summaryrefslogtreecommitdiff
path: root/src/include/ffmpeg_backend.h
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2022-12-16 20:16:43 -0500
committerFox Caminiti <fox@foxcam.net>2022-12-16 20:16:43 -0500
commitbedd6906eabdd513042d6a178d4dc56a3a41d1d3 (patch)
tree2bcbd3e46ae61e583707a2ccc5b3f5cfeacb61a8 /src/include/ffmpeg_backend.h
parentcdb9e1f7240cb0716b7d99df5e1fd7c3fc3407a8 (diff)
v3, file/build organization
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;
+};
+