summaryrefslogtreecommitdiff
path: root/ffmpeg_backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg_backend.h')
-rw-r--r--ffmpeg_backend.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/ffmpeg_backend.h b/ffmpeg_backend.h
new file mode 100644
index 0000000..d6a6a66
--- /dev/null
+++ b/ffmpeg_backend.h
@@ -0,0 +1,22 @@
+struct av_codec_info {
+ real32 AvgPTSPerFrame;
+
+ AVFormatContext *FileFormatContext;
+ AVCodecParameters *VideoCodecParameters;
+ const AVCodec* VideoCodec;
+ const AVCodecHWConfig* VideoHWConfig;
+ // AVPixelFormat HWPixFormat;
+ AVCodecContext *VideoCodecContext;
+ AVStream *VideoStream;
+};
+
+struct av_packet_info {
+ uint64 PreviousPTS = -1; // PTS value of the previous frame, used to check timings.
+
+ AVPacket *VideoPacket;
+ AVFrame *VideoFrame;
+ SwsContext *RGBContext;
+};
+
+static bool32 AV_TryFrame(av_codec_info *AV, av_packet_info *AVPacket, int32 *err); // Internal attempt to decode a frame. Typically run in a while loop until it returns true.
+