ViveSoftware / ViveMediaDecoder

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

I have some issues about "swap" function in DecoderFFMpeg.cpp, NativeCode #26

Open 0x3375 opened 5 years ago

0x3375 commented 5 years ago

Hello. I have some troubles to use Native code.

I made a project and include all of ffmpeg's lib, and ViveMediaDecoder's include directory.

When I build this project, I got 4 errors. This errors accured when "mAudioFrames.swap(decltype(mAudioFrames)())" and "mVideoFrames.swap(decltype(mAudioFrames)());" are called.

Error logs below

C2664 : 'void std::queue<AVFrame ,std::deque<_Ty,std::allocator<_Ty>>>::swap(std::queue<_Ty,std::deque<_Ty,std::allocator<_Ty>>> &) noexcept()' : cannot convert argument 1 from 'std::queue<AVFrame ,std::deque<_Ty,std::allocator<_Ty>>>' to 'std::queue<AVFrame *,std::deque<_Ty,std::allocator<_Ty>>> &'

I'm using Visual Studio 2017 and ffmpeg 3.4 now. Why these errors happen and how can I fix it?

thank you.


add) The swap function appears to exist to initialize all the queues inside. so, I make empty queue with same data type and swapped. Is this method appropriate?

mVideoFrames.swap(decltype(mVideoFrames)()); -> mVideoFrames.swap(EmptyQueue);

kyo8568131 commented 5 years ago

Hi leeseungho1,

Yes, you can create an empty queue and swap. The code is just to clear the queue.