|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef DECODE_SIMPLE_H |
|
|
#define DECODE_SIMPLE_H |
|
|
|
|
|
#include "libavformat/avformat.h" |
|
|
|
|
|
#include "libavcodec/avcodec.h" |
|
|
#include "libavcodec/packet.h" |
|
|
|
|
|
#include "libavutil/dict.h" |
|
|
#include "libavutil/frame.h" |
|
|
|
|
|
|
|
|
typedef struct DecodeContext { |
|
|
AVFormatContext *demuxer; |
|
|
AVStream *stream; |
|
|
AVCodecContext *decoder; |
|
|
|
|
|
AVPacket *pkt; |
|
|
AVFrame *frame; |
|
|
|
|
|
int (*process_frame)(struct DecodeContext *dc, AVFrame *frame); |
|
|
void *opaque; |
|
|
|
|
|
AVDictionary *decoder_opts; |
|
|
int max_frames; |
|
|
} DecodeContext; |
|
|
|
|
|
int ds_open(DecodeContext *dc, const char *url, int stream_idx); |
|
|
void ds_free(DecodeContext *dc); |
|
|
|
|
|
int ds_run(DecodeContext *dc); |
|
|
|
|
|
#endif |
|
|
|