summaryrefslogtreecommitdiff
path: root/tvapi/libtv/tv/CTvEv.h (plain)
blob: 9db348386676f99495d9d8b325368ec7a337e149
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
36 CTvEv(int type);
37 virtual ~CTvEv() {};
38 int getEvType() const
39 {
40 return mEvType;
41 };
42private:
43 int mEvType;
44};
45
46namespace TvEvent {
47 //events
48 class SignalInfoEvent: public CTvEv {
49 public:
50 SignalInfoEvent() : CTvEv ( CTvEv::TV_EVENT_SIGLE_DETECT )
51 {
52 }
53 ~SignalInfoEvent()
54 {
55 }
56 int mTrans_fmt;
57 int mFmt;
58 int mStatus;
59 int mReserved;
60 };
61
62 class VGAEvent: public CTvEv {
63 public:
64 VGAEvent() : CTvEv ( CTvEv::TV_EVENT_VGA )
65 {
66 }
67 ~VGAEvent()
68 {
69 }
70 int mState;
71 };
72
73 class ADCCalibrationEvent: public CTvEv {
74 public:
75 ADCCalibrationEvent() : CTvEv ( CTvEv::TV_EVENT_ADC_CALIBRATION )
76 {
77 }
78 ~ADCCalibrationEvent()
79 {
80 }
81 int mState;
82 };
83
84 class SerialCommunicationEvent: public CTvEv {
85 public:
86 SerialCommunicationEvent(): CTvEv(CTvEv::TV_EVENT_SERIAL_COMMUNICATION)
87 {
88 }
89 ~SerialCommunicationEvent()
90 {
91 }
92 public:
93 int mDevId;
94 int mDataCount;
95 unsigned char mDataBuf[CC_MAX_SERIAL_RD_BUF_LEN];
96 };
97
98 class SourceConnectEvent: public CTvEv {
99 public:
100 SourceConnectEvent() : CTvEv ( CTvEv::TV_EVENT_SOURCE_CONNECT )
101 {
102 }
103 ~SourceConnectEvent()
104 {
105 }
106 int mSourceInput;
107 int connectionState;
108 };
109
110 class HDMIRxCECEvent: public CTvEv {
111 public:
112 HDMIRxCECEvent() : CTvEv ( CTvEv::TV_EVENT_HDMIRX_CEC )
113 {
114 }
115 ~HDMIRxCECEvent()
116 {
117 }
118 int mDataCount;
119 int mDataBuf[32];
120 };
121
122 class AVPlaybackEvent: public CTvEv {
123 public:
124 AVPlaybackEvent() : CTvEv ( CTvEv::TV_EVENT_AV_PLAYBACK )
125 {
126 }
127 ~AVPlaybackEvent()
128 {
129 }
130 static const int EVENT_AV_PLAYBACK_NODATA = 1;
131 static const int EVENT_AV_PLAYBACK_RESUME = 2;
132 static const int EVENT_AV_SCAMBLED = 3;
133 static const int EVENT_AV_UNSUPPORT = 4;
134
135 public:
136 int mMsgType;
137 int mProgramId;
138 };
139 class BlockEvent: public CTvEv {
140 public:
141 BlockEvent() : CTvEv ( CTvEv::TV_EVENT_BLOCK )
142 {
143 }
144 ~BlockEvent()
145 {
146 }
147 public:
148 bool block_status;
149 int programBlockType;
150 String8 vchipDimension;
151 String8 vchipAbbrev;
152 String8 vchipAbbtext;
153 };
154
155 class UpgradeFBCEvent: public CTvEv {
156 public:
157 UpgradeFBCEvent() : CTvEv ( CTvEv::TV_EVENT_UPGRADE_FBC )
158 {
159 }
160 ~UpgradeFBCEvent()
161 {
162 }
163 int mState;
164 int param;
165 };
166
167 class HeadSetOf2d4GEvent: public CTvEv {
168 public:
169 HeadSetOf2d4GEvent(): CTvEv(CTvEv::TV_EVENT_2d4G_HEADSET)
170 {
171 }
172 ~HeadSetOf2d4GEvent()
173 {
174 }
175 public:
176 int state;
177 int para;
178 };
179};
180#endif
181