2017-12-12 22:12:07 +08:00
|
|
|
#ifndef DECODER_H
|
|
|
|
#define DECODER_H
|
|
|
|
|
2019-03-03 06:52:22 +08:00
|
|
|
#include <stdbool.h>
|
2019-03-02 23:43:43 +08:00
|
|
|
#include <libavformat/avformat.h>
|
2017-12-12 22:12:07 +08:00
|
|
|
|
2019-09-30 04:36:56 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2019-03-02 22:16:55 +08:00
|
|
|
struct video_buffer;
|
2017-12-12 22:12:07 +08:00
|
|
|
|
|
|
|
struct decoder {
|
2019-03-02 22:16:55 +08:00
|
|
|
struct video_buffer *video_buffer;
|
2019-03-02 23:43:43 +08:00
|
|
|
AVCodecContext *codec_ctx;
|
2017-12-12 22:12:07 +08:00
|
|
|
};
|
|
|
|
|
2019-03-03 03:09:56 +08:00
|
|
|
void
|
|
|
|
decoder_init(struct decoder *decoder, struct video_buffer *vb);
|
2019-03-02 23:43:43 +08:00
|
|
|
|
2019-03-03 06:52:22 +08:00
|
|
|
bool
|
2019-03-03 18:59:31 +08:00
|
|
|
decoder_open(struct decoder *decoder, const AVCodec *codec);
|
2019-03-02 23:43:43 +08:00
|
|
|
|
2019-03-03 03:09:56 +08:00
|
|
|
void
|
|
|
|
decoder_close(struct decoder *decoder);
|
|
|
|
|
2019-03-03 06:52:22 +08:00
|
|
|
bool
|
2019-03-03 18:59:31 +08:00
|
|
|
decoder_push(struct decoder *decoder, const AVPacket *packet);
|
2019-03-03 03:09:56 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
decoder_interrupt(struct decoder *decoder);
|
2017-12-12 22:12:07 +08:00
|
|
|
|
|
|
|
#endif
|