1、VideoState结构体
typedef struct VideoState {
//ori SDL_Thread *parse_tid;
//ori SDL_Thread *video_tid;
HANDLE parse_tid;
HANDLE video_tid;
AVInputFormat *iformat;
int no_background;
int abort_request;
int paused;
int last_paused;
int seek_req;
int seek_flags;
int64_t seek_pos;
int64_t seek_rel;
int read_pause_return;
AVFormatContext *ic;
int dtg_active_format;
int audio_stream;
int av_sync_type;
double external_clock; /* external clock base */
int64_t external_clock_time;
double audio_clock;
double audio_diff_cum; /* used for AV difference average computation */
double audio_diff_avg_coef;
double audio_diff_threshold;
int audio_diff_avg_count;
AVStream *audio_st;
PacketQueue audioq;
int audio_hw_buf_size;
/* samples output by the codec. we reserve more space for avsync
compensation */
DECLARE_ALIGNED(16,uint8_t,audio_buf1)[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
DECLARE_ALIGNED(16,uint8_t,audio_buf2)[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
uint8_t *audio_buf;
unsigned int audio_buf_size; /* in bytes */
int audio_buf_index; /* in bytes */
AVPacket audio_pkt_temp;
AVPacket audio_pkt;
enum SampleFormat audio_src_fmt;
AVAudioConvert *reformat_ctx;
int show_audio; /* if true, display audio samples */
int16_t sample_array[SAMPLE_ARRAY_SIZE];
int sample_array_index;
int last_i_start;
//ori RDFTContext rdft;
//ori int rdft_bits;
int xpos;
//ori SDL_Thread *subtitle_tid;
HANDLE subtitle_tid;
int subtitle_stream;
int subtitle_stream_changed;
AVStream *subtitle_st;
PacketQueue subtitleq;
SubPicture subpq[SUBPICTURE_QUEUE_SIZE];
int subpq_size, subpq_rindex, subpq_windex;
//ori SDL_mutex *subpq_mutex;
//ori SDL_cond *subpq_cond;
CRITICAL_SECTION subpq_mutex;
HANDLE subpq_cond;
double frame_timer;
double frame_last_pts;
double frame_last_delay;
double video_clock; ///<pts of last decoded frame / predicted pts of next decoded frame
int video_stream;
AVStream *video_st;
PacketQueue videoq;
double video_current_pts; ///<current displayed pts (different from video_clock if frame fifos are used)
double video_current_pts_drift; ///<video_current_pts - time (av_gettime) at which we updated video_current_pts - used to have running video pts
int64_t video_current_pos; ///<current displayed file pos
VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE];
int pictq_size, pictq_rindex, pictq_windex;
//ori SDL_mutex *pictq_mutex;
//ori SDL_cond *pictq_cond;
CRITICAL_SECTION pictq_mutex;
HANDLE pictq_cond;
struct SwsContext *img_convert_ctx;
// QETimer *video_timer;
char filename[1024];
int width, height, xleft, ytop;
HWND hWnd;
int64_t faulty_pts;
int64_t faulty_dts;
int64_t last_dts_for_fault_detection;
int64_t last_pts_for_fault_detection;
} VideoState;
2、VideoPicture结构体
typedef struct VideoPicture {
double pts; ///<presentation time stamp for this picture
int64_t pos; ///<byte position in file
//ori SDL_Overlay *bmp;
// HBITMAP bmp;
FrameRgb* pRgbFrame;
int width, height; /* source height & width */
int allocated;
//ori SDL_TimerID timer_id;
DWORD timer_id;
} VideoPicture;