AVTranscoder.h
897 字节
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
#pragma once
#include "AVDecoder.h"
class CAVTranscoder
{
public:
CAVTranscoder();
virtual ~CAVTranscoder();
int add(media_info & info);
int64_t transcode();
bool all_processed();
int close();
int open_output_file(const char *filename);
protected:
vector < CAVDecoder *> _decoders;
AVFormatContext *ofmt_ctx;
int64_t _start_time;
int64_t _cur_a_time;
int64_t _cur_v_time;
int _nOutputWidth;
int _nOutputHeight;
private:
int mix_and_output_vframe(vector<CAVDecoder *> & decoders_got_frame);
int mix_and_output_aframe(vector<CAVDecoder *> & decoders_got_frame);
bool _all_processed;
bool _one2one;
int mix_and_output_one2one_vframe(vector<CAVDecoder *> & decoders_got_frame);
int mix_and_output_one2many_vframe(vector<CAVDecoder *> & decoders_got_frame);
int fillDestFrame(AVFrame * pDstFrame, AVFrame * pSrcFrame, int x, int y);
};