summaryrefslogtreecommitdiff
path: root/src/include/ffmpeg_backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/ffmpeg_backend.h')
-rw-r--r--src/include/ffmpeg_backend.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/include/ffmpeg_backend.h b/src/include/ffmpeg_backend.h
new file mode 100644
index 0000000..717a33d
--- /dev/null
+++ b/src/include/ffmpeg_backend.h
@@ -0,0 +1,37 @@
+// NOTE(fox): Even though each layer has its own completely isolated AV
+// instance, it appears two layers with the same file still share something.
+// When the layers aren't at the same position in time, the playhead of one
+// layer gets misaligned every few frames and causes a manual seek back to the
+// position. Different files don't exhibit this behavior.
+
+struct av_stream_info {
+ uint32 Index;
+ AVCodecParameters *CodecParameters; // Used to supply info about the decoder.
+ const AVCodec* Codec;
+ AVStream *Stream; // Which stream, or channel, the video is in. Holds FPS info and is used to verify that the decoded packet belongs to this stream.
+ AVCodecContext *CodecContext;
+};
+
+
+struct av_info {
+ uint8 Occupied;
+
+ uint16 Block_Source_Index;
+
+ int LastFrameRendered; // Convenient to know this to only seek when we actually need to.
+ uint64 PreviousPTS; // PTS value of the previous frame, used to check timings in debug.
+
+ AVFormatContext *FileFormatContext; // Umbrella for everything else, seems to contain the playhead state
+
+ av_stream_info Video;
+ av_stream_info Audio;
+
+ AVPacket *Packet;
+ AVFrame *Frame;
+
+ uint32 FrameCount;
+ uint64 PTSDuration; // likely not always 100% accurate
+
+ SwsContext *RGBContext;
+};
+