{\r
agent::wait(this);\r
}\r
- \r
- std::shared_ptr<AVFrame> decode(AVPacket& packet)\r
- {\r
- std::shared_ptr<AVFrame> decoded_frame(avcodec_alloc_frame(), av_free);\r
-\r
- int frame_finished = 0;\r
- THROW_ON_ERROR2(avcodec_decode_video2(codec_context_.get(), decoded_frame.get(), &frame_finished, &packet), "[video_decocer]");\r
-\r
- // 1 packet <=> 1 frame.\r
- // If a decoder consumes less then the whole packet then something is wrong\r
- // that might be just harmless padding at the end, or a problem with the\r
- // AVParser or demuxer which puted more then one frame in a AVPacket.\r
-\r
- if(frame_finished == 0) \r
- return nullptr;\r
- \r
- if(decoded_frame->repeat_pict > 0)\r
- CASPAR_LOG(warning) << "[video_decoder]: Field repeat_pict not implemented.";\r
-\r
- return decoded_frame;\r
- }\r
\r
virtual void run()\r
{\r
\r
done();\r
}\r
+ \r
+ std::shared_ptr<AVFrame> decode(AVPacket& packet)\r
+ {\r
+ std::shared_ptr<AVFrame> decoded_frame(avcodec_alloc_frame(), av_free);\r
+\r
+ int frame_finished = 0;\r
+ THROW_ON_ERROR2(avcodec_decode_video2(codec_context_.get(), decoded_frame.get(), &frame_finished, &packet), "[video_decocer]");\r
+\r
+ // 1 packet <=> 1 frame.\r
+ // If a decoder consumes less then the whole packet then something is wrong\r
+ // that might be just harmless padding at the end, or a problem with the\r
+ // AVParser or demuxer which puted more then one frame in a AVPacket.\r
+\r
+ if(frame_finished == 0) \r
+ return nullptr;\r
+ \r
+ if(decoded_frame->repeat_pict > 0)\r
+ CASPAR_LOG(warning) << "[video_decoder]: Field repeat_pict not implemented.";\r
+\r
+ return decoded_frame;\r
+ }\r
+\r
\r
double fps() const\r
{\r