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