ViveSoftware / ViveMediaDecoder

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

Videoframe swapping in native script #25

Open spaul13 opened 5 years ago

spaul13 commented 5 years ago

mVideoFrames.swap(decltype(mVideoFrames)());

function showing me some error of initial value of reference to non-constant must be lvalue and function overload. I commented this function and generate dll and use it on Unity. Although it works, the decoding and displaying process are really slow (~100ms) and in the native script, I found the actual decoding function takes much less time. Can anyone (@kyo8568131 ) please tell me about the purpose of mVideoFrames.swap() and how it can impact the performance? and how to solve the aforementioned issue.

kyo8568131 commented 5 years ago

Hi spaul13,

mVideoFrames.swap(decltype(mVideoFrames)()); This code is just init an default container and swap into mVideoFrame. The original container, which is swap out, is expected to be released in local scope. This is called in init function and does not influence the decoding time.