struct video_decoder::implementation : boost::noncopyable
{
int index_ = -1;
const spl::shared_ptr<AVCodecContext> codec_context_;
std::queue<spl::shared_ptr<AVPacket>> packets_;
struct video_decoder::implementation : boost::noncopyable
{
int index_ = -1;
const spl::shared_ptr<AVCodecContext> codec_context_;
std::queue<spl::shared_ptr<AVPacket>> packets_;
packets_.pop();
file_frame_number_ = static_cast<uint32_t>(packet->pos);
avcodec_flush_buffers(codec_context_.get());
return flush_video();
}
packets_.pop();
file_frame_number_ = static_cast<uint32_t>(packet->pos);
avcodec_flush_buffers(codec_context_.get());
return flush_video();
}
int frame_finished = 0;
THROW_ON_ERROR2(avcodec_decode_video2(codec_context_.get(), decoded_frame.get(), &frame_finished, pkt.get()), "[video_decoder]");
int frame_finished = 0;
THROW_ON_ERROR2(avcodec_decode_video2(codec_context_.get(), decoded_frame.get(), &frame_finished, pkt.get()), "[video_decoder]");
// If a decoder consumes less then the whole packet then something is wrong
// that might be just harmless padding at the end, or a problem with the
// AVParser or demuxer which puted more then one frame in a AVPacket.
// If a decoder consumes less then the whole packet then something is wrong
// that might be just harmless padding at the end, or a problem with the
// AVParser or demuxer which puted more then one frame in a AVPacket.
return nullptr;
is_progressive_ = !decoded_frame->interlaced_frame;
if(decoded_frame->repeat_pict > 0)
CASPAR_LOG(warning) << "[video_decoder] Field repeat_pict not implemented.";
return nullptr;
is_progressive_ = !decoded_frame->interlaced_frame;
if(decoded_frame->repeat_pict > 0)
CASPAR_LOG(warning) << "[video_decoder] Field repeat_pict not implemented.";