summaryrefslogtreecommitdiff
path: root/tvapi/libtv/tv/CTvEv.h (plain)
blob: 54ec5fe48ea6cffc74421089ba5b01e52d42298a
1// amlogic 2014
2//
3// @ Project : tv
4// @ File Name :
5// @ Date : 2014-02
6// @ Author :
7//电视通知消息的基类
8#if !defined(_CTVEV_H)
9#define _CTVEV_H
10#include <utils/String8.h>
11#define CC_MAX_SERIAL_RD_BUF_LEN (1200)
12using namespace android;
13
14class CTvEv
15{
16public:
17 static const int TV_EVENT_COMMOM = 0;//通用消息
18 static const int TV_EVENT_SCANNER = 1;//搜索消息
19 static const int TV_EVENT_EPG = 2;//EPG状态消息
20 static const int TV_EVENT_SOURCE_SWITCH = 3;//信源切换
21 static const int TV_EVENT_SIGLE_DETECT = 4;//信号检测
22 static const int TV_EVENT_ADC_CALIBRATION = 5;//ADC校准
23 static const int TV_EVENT_VGA = 6;//VGA
24 static const int TV_EVENT_3D_STATE = 7;//3D
25 static const int TV_EVENT_AV_PLAYBACK = 8;//PLAYBACK EVENT MSG
26 static const int TV_EVENT_SERIAL_COMMUNICATION = 9;
27 static const int TV_EVENT_SOURCE_CONNECT = 10;
28 static const int TV_EVENT_HDMIRX_CEC = 11;
29 static const int TV_EVENT_BLOCK = 12;
30 static const int TV_EVENT_CC = 13; //close caption
31 static const int TV_EVENT_VCHIP = 14; //VCHIP
32 static const int TV_EVENT_HDMI_IN_CAP = 15;
33 static const int TV_EVENT_UPGRADE_FBC = 16;
34 static const int TV_EVENT_2d4G_HEADSET = 17;
35 static const int TV_EVENT_AV = 18;
36
37 CTvEv(int type);
38 virtual ~CTvEv() {};
39 int getEvType() const
40 {
41 return mEvType;
42 };
43private:
44 int mEvType;
45};
46
47namespace TvEvent
48{
49 //events
50 class SignalInfoEvent: public CTvEv
51 {
52 public:
53 SignalInfoEvent() : CTvEv ( CTvEv::TV_EVENT_SIGLE_DETECT )
54 {
55 }
56 ~SignalInfoEvent()
57 {
58 }
59 int mTrans_fmt;
60 int mFmt;
61 int mStatus;
62 int mReserved;
63 };
64
65 class VGAEvent: public CTvEv
66 {
67 public:
68 VGAEvent() : CTvEv ( CTvEv::TV_EVENT_VGA )
69 {
70 }
71 ~VGAEvent()
72 {
73 }
74 int mState;
75 };
76
77 class ADCCalibrationEvent: public CTvEv
78 {
79 public:
80 ADCCalibrationEvent() : CTvEv ( CTvEv::TV_EVENT_ADC_CALIBRATION )
81 {
82 }
83 ~ADCCalibrationEvent()
84 {
85 }
86 int mState;
87 };
88
89 class SerialCommunicationEvent: public CTvEv
90 {
91 public:
92 SerialCommunicationEvent(): CTvEv(CTvEv::TV_EVENT_SERIAL_COMMUNICATION)
93 {
94 }
95 ~SerialCommunicationEvent()
96 {
97 }
98 public:
99 int mDevId;
100 int mDataCount;
101 unsigned char mDataBuf[CC_MAX_SERIAL_RD_BUF_LEN];
102 };
103
104 class SourceConnectEvent: public CTvEv
105 {
106 public:
107 SourceConnectEvent() : CTvEv ( CTvEv::TV_EVENT_SOURCE_CONNECT )
108 {
109 }
110 ~SourceConnectEvent()
111 {
112 }
113 int mSourceInput;
114 int connectionState;
115 };
116
117 class HDMIRxCECEvent: public CTvEv
118 {
119 public:
120 HDMIRxCECEvent() : CTvEv ( CTvEv::TV_EVENT_HDMIRX_CEC )
121 {
122 }
123 ~HDMIRxCECEvent()
124 {
125 }
126 int mDataCount;
127 int mDataBuf[32];
128 };
129
130 class AVPlaybackEvent: public CTvEv
131 {
132 public:
133 AVPlaybackEvent() : CTvEv ( CTvEv::TV_EVENT_AV_PLAYBACK )
134 {
135 }
136 ~AVPlaybackEvent()
137 {
138 }
139 static const int EVENT_AV_PLAYBACK_NODATA = 1;
140 static const int EVENT_AV_PLAYBACK_RESUME = 2;
141 static const int EVENT_AV_SCAMBLED = 3;
142 static const int EVENT_AV_UNSUPPORT = 4;
143
144 public:
145 int mMsgType;
146 int mProgramId;
147 };
148 class BlockEvent: public CTvEv
149 {
150 public:
151 BlockEvent() : CTvEv ( CTvEv::TV_EVENT_BLOCK )
152 {
153 }
154 ~BlockEvent()
155 {
156 }
157 public:
158 bool block_status;
159 int programBlockType;
160 String8 vchipDimension;
161 String8 vchipAbbrev;
162 String8 vchipAbbtext;
163 };
164
165 class UpgradeFBCEvent: public CTvEv
166 {
167 public:
168 UpgradeFBCEvent() : CTvEv ( CTvEv::TV_EVENT_UPGRADE_FBC )
169 {
170 }
171 ~UpgradeFBCEvent()
172 {
173 }
174 int mState;
175 int param;
176 };
177
178 class HeadSetOf2d4GEvent: public CTvEv
179 {
180 public:
181 HeadSetOf2d4GEvent(): CTvEv(CTvEv::TV_EVENT_2d4G_HEADSET)
182 {
183 }
184 ~HeadSetOf2d4GEvent()
185 {
186 }
187 public:
188 int state;
189 int para;
190 };
191};
192#endif
193