AVDecoder.h
1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#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();
std::string get_cur_vfile();
std::string get_cur_afile();
double _cur_a_ts_ms;
double _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;
unsigned int _uid;
protected:
void free_cur_v_frame();
void free_cur_a_frame();
public:
int scale_frame(AVFrame * pFrame, AVFrame * pScaledFrame, int scaled_width, int scaled_height);
protected:
int _scaled_width;
int _scaled_height;
int _src_width;
int _src_height;
struct SwsContext * _sws_ctx;
};