ViveSoftware / ViveMediaDecoder

A high performance video decoding Unity plugin for Windows.
http://u3d.as/usf
Other
133 stars 36 forks source link

Reducing the time for displaying a frame on the screen #28

Open spaul13 opened 5 years ago

spaul13 commented 5 years ago

The total time for decoding the video (BUFFERING-->START) IS <=22 ms for my case but after that to display the frame on the screen takes additional 25-30 ms. Mainly these four APIs are being executed in order to display the frame on the screen

nativeSetVideoTime(decoderID, (float)setTime); GL.IssuePluginEvent(GetRenderEventFunc(), decoderID); getTextureFromNative(); setTextures(videoTexYch, videoTexUch, videoTexVch);

Is there any way to optimize this delay associated to display the frame on the screen. Any help is highly appreciated.

kyo8568131 commented 5 years ago

Hi spaul13, You could modify the timing of native create texture buffer to as early as possible to avoid runtime texture creation. And for the best optimization to show up the first texture, you could modify the flow to work as synchronization rather than asynchronization. Since asynchronization would follow the life cycle of Unity and may cause some delay to trigger your things. Thanks.