ViveMediaDecoder icon indicating copy to clipboard operation
ViveMediaDecoder copied to clipboard

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

Open 0x3375 opened this issue 5 years ago • 1 comments

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);

0x3375 avatar Mar 29 '19 07:03 0x3375

Hi leeseungho1,

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

kyo8568131 avatar Apr 01 '19 09:04 kyo8568131