blob: 7227efb1bea8effce1cab529ca8a171b872b96e4
1 | // amlogic 2014 |
2 | // |
3 | // @ Project : tv |
4 | // @ File Name : |
5 | // @ Date : 2014-02 |
6 | // @ Author : |
7 | #ifndef _CTVEV_H_ |
8 | #define _CTVEV_H_ |
9 | |
10 | #include <utils/String8.h> |
11 | #define CC_MAX_SERIAL_RD_BUF_LEN (1200) |
12 | |
13 | using namespace android; |
14 | |
15 | class CTvEv { |
16 | public: |
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 | static const int TV_EVENT_SUBTITLE = 19; |
37 | |
38 | CTvEv(int type); |
39 | virtual ~CTvEv() {}; |
40 | int getEvType() const { |
41 | return mEvType; |
42 | }; |
43 | private: |
44 | int mEvType; |
45 | }; |
46 | |
47 | namespace TvEvent { |
48 | //events |
49 | class SignalInfoEvent: public CTvEv { |
50 | public: |
51 | SignalInfoEvent() : CTvEv ( CTvEv::TV_EVENT_SIGLE_DETECT ) {} |
52 | ~SignalInfoEvent() {} |
53 | int mTrans_fmt; |
54 | int mFmt; |
55 | int mStatus; |
56 | int mReserved; |
57 | }; |
58 | |
59 | class VGAEvent: public CTvEv { |
60 | public: |
61 | VGAEvent() : CTvEv ( CTvEv::TV_EVENT_VGA ) {} |
62 | ~VGAEvent() {} |
63 | int mState; |
64 | }; |
65 | |
66 | class ADCCalibrationEvent: public CTvEv { |
67 | public: |
68 | ADCCalibrationEvent() : CTvEv ( CTvEv::TV_EVENT_ADC_CALIBRATION ) {} |
69 | ~ADCCalibrationEvent() {} |
70 | int mState; |
71 | }; |
72 | |
73 | class SerialCommunicationEvent: public CTvEv { |
74 | public: |
75 | SerialCommunicationEvent(): CTvEv(CTvEv::TV_EVENT_SERIAL_COMMUNICATION) {} |
76 | ~SerialCommunicationEvent() {} |
77 | |
78 | int mDevId; |
79 | int mDataCount; |
80 | unsigned char mDataBuf[CC_MAX_SERIAL_RD_BUF_LEN]; |
81 | }; |
82 | |
83 | class SourceConnectEvent: public CTvEv { |
84 | public: |
85 | SourceConnectEvent() : CTvEv ( CTvEv::TV_EVENT_SOURCE_CONNECT ) {} |
86 | ~SourceConnectEvent() {} |
87 | int mSourceInput; |
88 | int connectionState; |
89 | }; |
90 | |
91 | class HDMIRxCECEvent: public CTvEv { |
92 | public: |
93 | HDMIRxCECEvent() : CTvEv ( CTvEv::TV_EVENT_HDMIRX_CEC ) {} |
94 | ~HDMIRxCECEvent() {} |
95 | int mDataCount; |
96 | int mDataBuf[32]; |
97 | }; |
98 | |
99 | class AVPlaybackEvent: public CTvEv { |
100 | public: |
101 | AVPlaybackEvent() : CTvEv ( CTvEv::TV_EVENT_AV_PLAYBACK ) {} |
102 | ~AVPlaybackEvent() {} |
103 | static const int EVENT_AV_PLAYBACK_NODATA = 1; |
104 | static const int EVENT_AV_PLAYBACK_RESUME = 2; |
105 | static const int EVENT_AV_SCAMBLED = 3; |
106 | static const int EVENT_AV_UNSUPPORT = 4; |
107 | |
108 | int mMsgType; |
109 | int mProgramId; |
110 | }; |
111 | |
112 | class BlockEvent: public CTvEv { |
113 | public: |
114 | BlockEvent() : CTvEv ( CTvEv::TV_EVENT_BLOCK ) {} |
115 | ~BlockEvent() {} |
116 | |
117 | bool block_status; |
118 | int programBlockType; |
119 | String8 vchipDimension; |
120 | String8 vchipAbbrev; |
121 | String8 vchipAbbtext; |
122 | }; |
123 | |
124 | class UpgradeFBCEvent: public CTvEv { |
125 | public: |
126 | UpgradeFBCEvent() : CTvEv ( CTvEv::TV_EVENT_UPGRADE_FBC ) {} |
127 | ~UpgradeFBCEvent() {} |
128 | int mState; |
129 | int param; |
130 | }; |
131 | |
132 | class HeadSetOf2d4GEvent: public CTvEv { |
133 | public: |
134 | HeadSetOf2d4GEvent(): CTvEv(CTvEv::TV_EVENT_2d4G_HEADSET) {} |
135 | ~HeadSetOf2d4GEvent() {} |
136 | |
137 | int state; |
138 | int para; |
139 | }; |
140 | |
141 | class SubtitleEvent: public CTvEv { |
142 | public: |
143 | SubtitleEvent(): CTvEv(CTvEv::TV_EVENT_SUBTITLE) {} |
144 | ~SubtitleEvent() {} |
145 | int pic_width; |
146 | int pic_height; |
147 | }; |
148 | }; |
149 | #endif |
150 | |
151 |