15 #ifndef SHAKA_EMBEDDED_MEDIA_FFMPEG_FFMPEG_DECODER_H_ 16 #define SHAKA_EMBEDDED_MEDIA_FFMPEG_FFMPEG_DECODER_H_ 19 #include <libavcodec/avcodec.h> 20 #include <libavformat/avformat.h> 52 std::vector<std::shared_ptr<DecodedFrame>>*
frames,
53 std::string* extra_info)
override;
56 #ifdef ENABLE_HARDWARE_DECODE 57 static AVPixelFormat GetPixelFormat(AVCodecContext* ctx,
58 const AVPixelFormat* formats);
61 bool InitializeDecoder(std::shared_ptr<const StreamInfo> info,
63 std::string* extra_info);
64 bool ReadFromDecoder(std::shared_ptr<const StreamInfo> stream_info,
65 std::shared_ptr<EncodedFrame> input,
66 std::vector<std::shared_ptr<DecodedFrame>>* decoded,
67 std::string* extra_info);
70 const std::string codec_;
72 AVCodecContext* decoder_ctx_;
73 AVFrame* received_frame_;
74 #ifdef ENABLE_HARDWARE_DECODE 75 AVBufferRef* hw_device_ctx_;
76 AVPixelFormat hw_pix_fmt_;
78 double prev_timestamp_offset_;
80 std::shared_ptr<const StreamInfo> decoder_stream_info_;
87 #endif // SHAKA_EMBEDDED_MEDIA_FFMPEG_FFMPEG_DECODER_H_
std::list< std::shared_ptr< BaseFrame > > frames