forked from Jackarain/avplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
y4m_render.h
51 lines (38 loc) · 922 Bytes
/
y4m_render.h
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
//
// y4m_render.h
// ~~~~~~~~~~~~
//
// Copyright (c) 2011 Jack ([email protected])
//
#ifndef __Y4M_RENDER_H__
#define __Y4M_RENDER_H__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "video_render.h"
// 用于调试测试输出视频文件.
class y4m_render
: public video_render
{
public:
y4m_render(void);
~y4m_render(void);
public:
/* 初始render. */
virtual bool init_render(void* ctx, int w, int h, int pix_fmt);
virtual bool init_render(void* ctx, int w, int h, int pix_fmt, float fps);
/* 渲染一帧. */
virtual bool render_one_frame(AVFrame* data, int pix_fmt);
/* 调整大小. */
virtual void re_size(int width, int height);
/* 设置宽高比. */
virtual void aspect_ratio(int srcw, int srch, bool enable_aspect);
/* 撤销render. */
virtual void destory_render();
private:
FILE *m_yuv_out;
char *m_image;
int m_image_width;
int m_image_height;
};
#endif // __Y4M_RENDER_H__