cb9c42bdcb
A skipped frame is detected when the producer offers a frame while the current pending frame has not been consumed. However, the producer (in practice the decoder) is not interested in the fact that a frame has been skipped, only the consumer (the renderer) is. Therefore, notify frame skip via a consumer callback. This allows to manage the skipped and rendered frames count at the same place, and remove fps_counter from decoder.
32 lines
537 B
C
32 lines
537 B
C
#ifndef DECODER_H
|
|
#define DECODER_H
|
|
|
|
#include "common.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <libavformat/avformat.h>
|
|
|
|
struct video_buffer;
|
|
|
|
struct decoder {
|
|
struct video_buffer *video_buffer;
|
|
|
|
AVCodecContext *codec_ctx;
|
|
};
|
|
|
|
void
|
|
decoder_init(struct decoder *decoder, struct video_buffer *vb);
|
|
|
|
bool
|
|
decoder_open(struct decoder *decoder, const AVCodec *codec);
|
|
|
|
void
|
|
decoder_close(struct decoder *decoder);
|
|
|
|
bool
|
|
decoder_push(struct decoder *decoder, const AVPacket *packet);
|
|
|
|
void
|
|
decoder_interrupt(struct decoder *decoder);
|
|
|
|
#endif
|