From bedd6906eabdd513042d6a178d4dc56a3a41d1d3 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Fri, 16 Dec 2022 20:16:43 -0500 Subject: v3, file/build organization --- src/include/ffmpeg_backend.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/include/ffmpeg_backend.h (limited to 'src/include/ffmpeg_backend.h') 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; +}; + -- cgit v1.2.3