AVDecoder.h 796 字节
#pragma once
#include "AudioDecoder.h"
#include "VideoDecoder.h"

class CAVDecoder
{
public:
	CAVDecoder();
	virtual ~CAVDecoder();

	int add(media_info &info);

	unsigned int getuid();
	bool get_one_a_frame();
	bool get_one_v_frame();
	int64_t _cur_a_ts_ms;
	int64_t _cur_v_ts_ms;
	media_role _media_role;

	AVFrame * _cur_a_frame;
	AVFrame * _cur_v_frame;
protected:
	list<media_info> _video_info;
	list<media_info> _audio_info;
	CAudioDecoder _audio_decoder;
	CVideoDecoder _video_decoder;
	int64_t _a_start_time_ms;
	int64_t _a_end_time_ms;
	int64_t _v_start_time_ms;
	int64_t _v_end_time_ms;
	int64_t _end_time_ms;

private:
	AVFrame * get_blank_frame();
	AVFrame * get_silence_frame();
public:
	void free_cur_a_frame();
	void free_cur_v_frame();
};