diff options
author | Fox Caminiti <fox@foxcam.net> | 2022-08-03 16:57:07 -0400 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2022-08-03 16:57:07 -0400 |
commit | 8875d0226f0d38a1e5ef946e56cd15810627f5ac (patch) | |
tree | ef7a8fa7b19f41faade33bdf5eaa24902c3b9f37 /ffmpeg_backend.h | |
parent | b26f27d9e3fd44ec5775accdc3666a339684be4c (diff) |
caching introduced
Diffstat (limited to 'ffmpeg_backend.h')
-rw-r--r-- | ffmpeg_backend.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/ffmpeg_backend.h b/ffmpeg_backend.h index d6a6a66..de73ff4 100644 --- a/ffmpeg_backend.h +++ b/ffmpeg_backend.h @@ -1,22 +1,23 @@ -struct av_codec_info { - real32 AvgPTSPerFrame; +// 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. - AVFormatContext *FileFormatContext; - AVCodecParameters *VideoCodecParameters; +struct av_info { + uint64 PreviousPTS = -1; // PTS value of the previous frame, used to check timings. + + AVCodecParameters *VideoCodecParameters; // Used to supply info about the decoder. const AVCodec* VideoCodec; - const AVCodecHWConfig* VideoHWConfig; + // const AVCodecHWConfig* VideoHWConfig; // Haven't done enough research to know if HW decoding is already done by default or if we need these. // AVPixelFormat HWPixFormat; + AVStream *VideoStream; // Which stream, or channel, the video is in. Holds FPS info and is used to verify that the decoded packet belongs to this stream. + AVFormatContext *FileFormatContext; // Umbrella for everything else, seems to contain the playhead state 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. +static bool32 AV_TryFrame(av_info *AVPacket, int32 *err); // Internal attempt to decode a frame. Typically run in a while loop until it returns true. |