-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxbmcstubs.h
127 lines (107 loc) · 4.07 KB
/
xbmcstubs.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include "BitstreamConverter.h"
#define BYTE unsigned char
#define fast_memcpy memcpy
#define DVD_NOPTS_VALUE (-1LL<<52) // should be possible to represent in both double and int64_t
#define DVP_FLAG_TOP_FIELD_FIRST 0x00000001
#define DVP_FLAG_REPEAT_TOP_FIELD 0x00000002 //Set to indicate that the top field should be repeated
#define DVP_FLAG_ALLOCATED 0x00000004 //Set to indicate that this has allocated data
#define DVP_FLAG_INTERLACED 0x00000008 //Set to indicate that this frame is interlaced
#define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped
#define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data
#define DVD_CODEC_CTRL_SKIPDEINT 0x01000000 // indicate that this picture was requested to have been dropped in deint stage
#define DVD_CODEC_CTRL_NO_POSTPROC 0x02000000 // see GetCodecStats
#define DVD_CODEC_CTRL_DRAIN 0x04000000 // see GetCodecStats
#define VC_ERROR 0x00000001 // an error occured, no other messages will be returned
#define VC_BUFFER 0x00000002 // the decoder needs more data
#define VC_PICTURE 0x00000004 // the decoder got a picture, call Decode(NULL, 0) again to parse the rest of the data
#define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data
#define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again
#define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped
class CProcessInfo {
public:
CProcessInfo() {};
virtual ~CProcessInfo() {};
void SetVideoDecoderName(std::string name, bool isHw) {};
void SetVideoDeintMethod(std::string method) {};
void SetVideoPixelFormat(std::string pixFormat) {};
void SetVideoDimensions(int width, int height) {};
};
class CDVDCodecOptions {
};
enum ERenderFormat {
RENDER_FMT_NONE = 0,
RENDER_FMT_YUV420P,
RENDER_FMT_YUV420P10,
RENDER_FMT_YUV420P16,
RENDER_FMT_VDPAU,
RENDER_FMT_VDPAU_420,
RENDER_FMT_NV12,
RENDER_FMT_UYVY422,
RENDER_FMT_YUYV422,
RENDER_FMT_DXVA,
RENDER_FMT_VAAPI,
RENDER_FMT_VAAPINV12,
RENDER_FMT_OMXEGL,
RENDER_FMT_CVBREF,
RENDER_FMT_BYPASS,
RENDER_FMT_EGLIMG,
RENDER_FMT_MEDIACODEC,
RENDER_FMT_IMXMAP,
RENDER_FMT_MMAL,
};
struct DVDVideoPicture
{
double pts; // timestamp in seconds, used in the CDVDPlayer class to keep track of pts
double dts;
union
{
struct {
uint8_t* data[4]; // [4] = alpha channel, currently not used
int iLineSize[4]; // [4] = alpha channel, currently not used
};
};
unsigned int iFlags;
double iRepeatPicture;
double iDuration;
unsigned int iFrameType : 4; // see defines above // 1->I, 2->P, 3->B, 0->Undef
unsigned int color_matrix : 4;
unsigned int color_range : 1; // 1 indicate if we have a full range of color
unsigned int chroma_position;
unsigned int color_primaries;
unsigned int color_transfer;
unsigned int extended_format;
char stereo_mode[32];
int8_t* qp_table; // Quantization parameters, primarily used by filters
int qstride;
int qscale_type;
unsigned int iWidth;
unsigned int iHeight;
unsigned int iDisplayWidth; // width of the picture without black bars
unsigned int iDisplayHeight; // height of the picture without black bars
ERenderFormat format;
};
class CDVDStreamInfo {
public:
AVCodecID codec;
bool software; //force software decoding
void* extradata; // extra data for codec to use
unsigned int extrasize; // size of extra data
bool ptsinvalid; // pts cannot be trusted (avi's).
};
class CDVDVideoCodec {
public:
CDVDVideoCodec(CProcessInfo &processInfo) : m_processInfo(processInfo) {};
virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture)
{
memset(pDvdVideoPicture, 0, sizeof(DVDVideoPicture));
return true;
}
virtual bool GetCodecStats(double &pts, int &droppedFrames, int &skippedPics)
{
droppedFrames = -1;
skippedPics = -1;
return false;
}
protected:
CProcessInfo &m_processInfo;
};