-
Notifications
You must be signed in to change notification settings - Fork 0
/
pvr350device.h
115 lines (104 loc) · 2.96 KB
/
pvr350device.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
/*
* pvr350device.h:
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef __PVR350_DEVICE_H
#define __PVR350_DEVICE_H
#include <vdr/device.h>
#include <vdr/thread.h>
#include "pvr350osd.h"
#include "pvr350audio.h"
typedef enum {
undef,
video,
audio_only
} eStreamtype;
class cPvr350Device: public cDevice {
private:
int fd_out;
int fbfd;
int fh;
int storedglobalalpha;
ulong initglobalalpha;
int fb_bpp;
int fb_pixel_size;
int fb_line_len;
int fb_size;
int osdbufsize;
uint8_t *osdbuffer;
uint8_t *osdbuf_aligned;
int stride;
int output_mode;
bool Format16_9;
ePlayMode m_PlayMode;
cSpuDecoder *spuDecoder;
/* Current sizes of the mpeg video */
int aspectratio;
int horizontal_size;
int vertical_size;
/* Current sizes of the display */
int current_horiz;
int current_vertical;
int current_afd;
int sizechanged;
int current_wss_data;
int lx, ly;
int width, height;
int audiomode;
int framecount;
bool newStream;
eStreamtype streamtype;
uint8_t m_PCMBuffer[PCM_BUFFER_SIZE];
uint8_t m_MP2PESBuffer[MP2_PES_BUFFER_SIZE];
uint8_t *m_PESHeader;
uint8_t *m_PESPacketData;
cAC3toMP2 *m_AC3toMP2;
bool m_AC3toMP2Init;
AC3DecodeState_t m_AC3DecodeState;
AC3DecodeState_t *m_AC3DecodeStatePtr;
cMP2toMP2 *m_MP2toMP2;
bool m_MP2RecodeInit;
bool DecEncMP2Audio;
void SetVidInfo(const uchar *mbuf, __u32 count);
void OpenFramebuffer();
void ProcessAC3Audio(uint8_t *PESPacket, int PESHeader_len, int Length);
bool CheckMPEGAudio4JointStereo(const uchar *PESData, int Length);
bool ConvertMP2Audio(uint8_t *PESPacket, int PESHeader_len, int Length);
void ProcessMP2Audio(uint8_t *PESPacket, int PESHeader_len, int Length);
public:
cPvr350Device(void);
~cPvr350Device();
void MakePrimaryDevice(bool On);
virtual bool HasDecoder(void) const;
virtual bool CanReplay(void) const;
virtual bool SetPlayMode(ePlayMode PlayMode);
#if APIVERSNUM >= 20103
virtual void TrickSpeed(int, bool);
#else
virtual void TrickSpeed(int);
#endif
virtual void Clear(void);
virtual void Play(void);
virtual void Freeze(void);
virtual void Mute(void);
virtual int GetAudioChannelDevice(void);
virtual void SetAudioChannelDevice(int AudioChannel);
virtual void StillPicture(const uchar *Data, int Length);
virtual int PlayVideo(const uchar *Data, int Length);
virtual int PlayAudio(const uchar *Data, int Length, uchar Id);
virtual void SetVideoFormat(bool VideoFormat16_9);
virtual void SetVolumeDevice(int Volume);
virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect);
virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect);
virtual bool Poll(cPoller &Poller, int TimeoutMs = 0);
virtual cSpuDecoder *GetSpuDecoder(void);
virtual int64_t GetSTC(void);
void SetVideoSize(int x, int y, int w, int d);
void Set_wss_mode(int wss_data);
void DecoderStop(int blank);
void DecoderPlay(int speed);
void DecoderPaused(int paused);
};
#endif