blob: 5dd4bf2ae92011306be70becc6e85c668c4401c4
1 | |
2 | // amlogic 2013 |
3 | // |
4 | // @ Project : tv |
5 | // @ File Name : CDtv.h |
6 | // @ Date : 2013-11 |
7 | // @ Author : |
8 | |
9 | #if !defined(_CDTV_H) |
10 | #define _CDTV_H |
11 | #include <stdint.h> |
12 | #include <sys/time.h> |
13 | #include <am_epg.h> |
14 | #include <am_mem.h> |
15 | #include <utils/threads.h> |
16 | #include "CTvProgram.h" |
17 | #include "CTvEpg.h" |
18 | #include "CTvScanner.h" |
19 | #include "CTvLog.h" |
20 | #include "CTvTime.h" |
21 | #include "CTvEvent.h" |
22 | #include "CTvEv.h" |
23 | #include "CTvBooking.h" |
24 | #include "CFrontEnd.h" |
25 | #include "../vpp/CVpp.h" |
26 | #include "../vpp/CPQdb.h" |
27 | #include "../tvin/CTvin.h" |
28 | #include "../tvutils/CMsgQueue.h" |
29 | #include "../tvutils/CSerialCommunication.h" |
30 | #include "../tvutils/serial_operate.h" |
31 | #include "CTvRecord.h" |
32 | #include "CTvSubtitle.h" |
33 | #include "CUpgradeFBC.h" |
34 | #include "CAv.h" |
35 | #include "CTvDmx.h" |
36 | #include "../audio/audio_api.h" |
37 | #include "AutoBackLight.h" |
38 | using namespace android; |
39 | |
40 | static const char *TV_CONFIG_FILE_PATH = "/param/tvconfig.conf"; |
41 | static const char *TV_DB_PATH = "/param/dtv.db"; |
42 | static const char *TV_CONFIG_FILE_SYSTEM_PATH = "/system/etc/tvconfig.conf"; |
43 | static const char *TV_CONFIG_FILE_PARAM_PATH = "/param/tvconfig.conf"; |
44 | static const char *TV_CHANNEL_LIST_SYSTEM_PATH = "/system/etc/tv_default.xml"; |
45 | static const char *TV_CHANNEL_LIST_PARAM_PATH = "/param/tv_default.xml"; |
46 | static const char *TV_SSM_DATA_SYSTEM_PATH = "/system/etc/ssm_data"; |
47 | static const char *TV_SSM_DATA_PARAM_PATH = "/param/ssm_data"; |
48 | |
49 | #define DEVICE_CLASS_TSYNC_AV_THRESHOLD_MIN "/sys/class/tsync/av_threshold_min" |
50 | #define AV_THRESHOLD_MIN_MS "540000" //6S = 6*90000 |
51 | |
52 | #define DEFAULT_COMPENSATION_VALUE 0 |
53 | |
54 | |
55 | typedef enum tv_fmt_ratio_e { |
56 | RATIO_43, |
57 | RATIO_169, |
58 | RATIO_MAX, |
59 | } tv_fmt_ratio_t; |
60 | |
61 | typedef enum tv_color_fmt_e { |
62 | COLOR_RGB444, |
63 | COLOR_YUV422, |
64 | COLOR_YUV444, |
65 | COLOR_MAX, |
66 | } tv_color_fmt_t; |
67 | |
68 | |
69 | |
70 | typedef enum tv_window_mode_e { |
71 | NORMAL_WONDOW, |
72 | PREVIEW_WONDOW, |
73 | } tv_window_mode_t; |
74 | |
75 | typedef enum tv_dtv_scan_running_status_e { |
76 | DTV_SCAN_RUNNING_NORMAL, |
77 | DTV_SCAN_RUNNING_ANALYZE_CHANNEL, |
78 | } tv_dtv_scan_running_status_t; |
79 | |
80 | typedef struct tv_config_s { |
81 | unsigned int overscan_3d; |
82 | unsigned int tv_out_counter; |
83 | bool kernelpet_disable; |
84 | unsigned int kernelpet_timeout; |
85 | bool userpet; |
86 | unsigned int userpet_timeout; |
87 | unsigned int userpet_reset; |
88 | unsigned int dtv_videopath_switch; |
89 | bool title_shake; |
90 | bool memory512m; |
91 | } tv_config_t; |
92 | |
93 | typedef enum TvRunStatus_s { |
94 | TV_INIT_ED = -1, |
95 | TV_OPEN_ED = 0, |
96 | TV_START_ED , |
97 | TV_RESUME_ED, |
98 | TV_PAUSE_ED, |
99 | TV_STOP_ED, |
100 | TV_CLOSE_ED, |
101 | } TvRunStatus_t; |
102 | |
103 | class CTv : public CTvin::CTvinSigDetect::ISigDetectObserver, public CTvin::CSourceConnectDetect::ISourceConnectObserver, public CTvin::CHDMIRxCEC::IHDMIRxCECObserver, public CUpgradeFBC::IUpgradeFBCObserver, public CSerialCommunication::ISerialCommunicationObserver { |
104 | public: |
105 | static const int TV_ACTION_NULL = 0x0000; |
106 | static const int TV_ACTION_STARTING = 0x0001; |
107 | static const int TV_ACTION_STOPING = 0x0002; |
108 | static const int TV_ACTION_SCANNING = 0x0004; |
109 | static const int TV_ACTION_PLAYING = 0x0008; |
110 | static const int TV_ACTION_RECORDING = 0x0010; |
111 | static const int TV_ACTION_SOURCE_SWITCHING = 0x0020; |
112 | public: |
113 | class TvIObserver { |
114 | public: |
115 | TvIObserver() {}; |
116 | virtual ~TvIObserver() {}; |
117 | virtual void onTvEvent ( const CTvEv &ev ) = 0; |
118 | }; |
119 | //main |
120 | CTv(); |
121 | virtual ~CTv(); |
122 | virtual int OpenTv ( void ); |
123 | virtual int CloseTv ( void ); |
124 | virtual int StartTvLock (); |
125 | virtual int StopTvLock ( void ); |
126 | virtual TvRunStatus_t GetTvStatus(); |
127 | virtual int ClearAnalogFrontEnd(); |
128 | virtual tv_source_input_t GetLastSourceInput (void); |
129 | virtual int SetSourceSwitchInput (tv_source_input_t source_input ); |
130 | virtual tv_source_input_t GetCurrentSourceInputLock ( void ); |
131 | virtual tvin_info_t GetCurrentSignalInfo ( void ); |
132 | virtual int SetPreviewWindow ( tvin_window_pos_t pos ); |
133 | virtual int dtvAutoScan(); |
134 | virtual int dtvManualScan (int beginFreq, int endFreq, int modulation = -1); |
135 | virtual int atvAutoScan(int videoStd, int audioStd, int searchType); |
136 | virtual int clearAllProgram(int arg0); |
137 | virtual int clearDbAllProgramInfoTable(); |
138 | virtual void setSourceSwitchAndPlay(); |
139 | virtual int GetDisplayResolutionConfig(); |
140 | virtual int GetDisplayResolutionInfo(); |
141 | virtual int atvMunualScan ( int startFreq, int endFreq, int videoStd, int audioStd, int store_Type = 0, int channel_num = 0 ); |
142 | virtual int stopScanLock(); |
143 | virtual int dtvAutoScanAtscLock(int attenna, int videoStd, int audioStd); |
144 | virtual void SetRecordFileName ( char *name ); |
145 | virtual void StartToRecord(); |
146 | virtual void StopRecording(); |
147 | virtual void SetRecCurTsOrCurProgram ( int sel ); |
148 | virtual int startCC(int country, int src, int channel, int service); |
149 | virtual int stopCC(); |
150 | virtual void printDebugInfo(); |
151 | virtual int playProgramLock ( int progId ); |
152 | virtual int playDvbcProgram ( int progId ); |
153 | virtual int playDtmbProgram ( int progId ); |
154 | virtual int playAtvProgram ( int, int, int, int); |
155 | virtual int playDtvProgram ( int, int, int, int, int, int, int, int, int); |
156 | virtual int stopPlayingLock(); |
157 | virtual int resetFrontEndPara ( frontend_para_set_t feParms ); |
158 | int SetCurProgramAudioVolumeCompensationVal ( int tmpVal ); |
159 | int GetAudioVolumeCompensationVal(int progDbId); |
160 | //dtv audio track info |
161 | int getAudioTrackNum ( int progId ); |
162 | int getAudioInfoByIndex ( int progId, int idx, int *pAFmt, String8 &lang ); |
163 | int switchAudioTrack ( int progId, int idx ); |
164 | int getVideoFormatInfo ( int *pWidth, int *pHeight, int *pFPS, int *pInterlace ); |
165 | int ResetAudioDecoderForPCMOutput(); |
166 | int setAudioChannel ( int channelIdx ); |
167 | int getAudioChannel(); |
168 | int setTvObserver (TvIObserver *ob); |
169 | int getAtscAttenna(); |
170 | long getTvTime() |
171 | { |
172 | return mTvTime.getTime(); |
173 | }; |
174 | void getFrontendStatus(); |
175 | int getFrontendSignalStrength(); |
176 | int getFrontendSNR(); |
177 | int getFrontendBER(); |
178 | int getChannelInfoBydbID ( int dbID, channel_info_t &chan_info ); |
179 | int setBlackoutEnable(int enable); |
180 | int getSaveBlackoutEnable(); |
181 | void startAutoBackLight(); |
182 | void stopAutoBackLight(); |
183 | int getAutoBackLight_on_off(); |
184 | int saveATVProgramID ( int dbID ); |
185 | int getATVProgramID ( void ); |
186 | int saveDTVProgramID ( int dbID ); |
187 | int getDTVProgramID ( void ); |
188 | int getCurPlayProgId(); |
189 | int getATVMinMaxFreq ( int *scanMinFreq, int *scanMaxFreq ); |
190 | |
191 | int Tv_SSMRestoreDefaultSetting(); |
192 | |
193 | // |
194 | int GetSourceConnectStatus(int source_input); |
195 | int IsDVISignal(); |
196 | int isVgaFmtInHdmi(); |
197 | // |
198 | int getHDMIFrameRate ( void ); |
199 | void RefreshAudioMasterVolume ( tv_source_input_t source_input ); |
200 | |
201 | int Tv_Set3DMode ( VIDEO_3D_MODE_T mode ); |
202 | VIDEO_3D_MODE_T Tv_Get3DMode ( void ); |
203 | int Tv_Set3DLRSwith ( int on_off); |
204 | int Tv_Get3DLRSwith ( void ); |
205 | int Tv_Set3DTo2DMode ( int mode); |
206 | int Tv_Get3DTo2DMode ( void ); |
207 | int Tv_Set3DDepth ( int value ); |
208 | int GetSave3DDepth ( void ); |
209 | is_3d_type_t Check2Dor3D ( VIDEO_3D_MODE_T mode3d, tvin_trans_fmt_t trans_fmt ); |
210 | int Tvin_SetPLLValues (); |
211 | int SetCVD2Values (); |
212 | unsigned int Vpp_GetDisplayResolutionInfo(tvin_window_pos_t *win_pos); |
213 | int get_hdmi_sampling_rate(); |
214 | //SSM |
215 | int Tv_SSMFacRestoreDefaultSetting(); |
216 | |
217 | CTvin::CTvinSigDetect mSigDetectThread; |
218 | CTvin::CSourceConnectDetect mSourceConnectDetectThread; |
219 | CTvin::CHDMIRxCEC mHDMIRxCEC; |
220 | CUpgradeFBC *mpUpgradeFBC; |
221 | CSerialCommunication mSerialA; |
222 | CSerialCommunication mSerialB; |
223 | CSerialCommunication mSerialC; |
224 | |
225 | int SendHDMIRxCECCustomMessage(unsigned char data_buf[]); |
226 | int SendHDMIRxCECCustomMessageAndWaitReply(unsigned char data_buf[], unsigned char reply_buf[], int WaitCmd, int timeout); |
227 | int SendHDMIRxCECBoradcastStandbyMessage(); |
228 | int SendHDMIRxCECGiveCECVersionMessage(tv_source_input_t source_input, unsigned char data_buf[]); |
229 | int SendHDMIRxCECGiveDeviceVendorIDMessage(tv_source_input_t source_input, unsigned char data_buf[]); |
230 | int SendHDMIRxCECGiveOSDNameMessage(tv_source_input_t source_input, unsigned char data_buf[]); |
231 | |
232 | int GetHdmiHdcpKeyKsvInfo(int data_buf[]); |
233 | int StartUpgradeFBC(char *file_name, int mode, int upgrade_blk_size); |
234 | int SetSerialSwitch(int dev_id, int switch_val); |
235 | int SendSerialData(int dev_id, int data_len, unsigned char data_buf[]); |
236 | int ChannelExport(const char *destPath); |
237 | int ChannelImport(const char *srcPath); |
238 | int Tv_GetProjectInfo(project_info_t *ptrInfo); |
239 | int Tv_GetPlatformType(); |
240 | int Tv_SetDDDRCMode(tv_source_input_t source_input); |
241 | int Tv_SetAudioSourceType (tv_source_input_t source_input); |
242 | |
243 | //PQ |
244 | int Tv_SetBrightness ( int brightness, tv_source_input_type_t source_type, int is_save ); |
245 | int Tv_GetBrightness ( tv_source_input_type_t source_type ); |
246 | int Tv_SetContrast ( int contrast, tv_source_input_type_t source_type, int is_save ); |
247 | int Tv_GetContrast ( tv_source_input_type_t source_type ); |
248 | int Tv_SetSaturation ( int satuation, tv_source_input_type_t source_type, tvin_sig_fmt_t sig_fmt, int is_save ); |
249 | int Tv_GetSaturation ( tv_source_input_type_t source_type ); |
250 | int Tv_SetHue ( int hue, tv_source_input_type_t source_type, tvin_sig_fmt_t sig_fmt, int is_save ); |
251 | int Tv_GetHue ( tv_source_input_type_t source_type ); |
252 | int Tv_SetPQMode ( vpp_picture_mode_t mode, tv_source_input_type_t source_type, int is_save ); |
253 | vpp_picture_mode_t Tv_GetPQMode ( tv_source_input_type_t source_type ); |
254 | int Tv_SetSharpness ( int value, tv_source_input_type_t source_type, int en, int is_save ); |
255 | int Tv_GetSharpness ( tv_source_input_type_t source_type ); |
256 | int Tv_SaveSharpness ( int value, tv_source_input_type_t source_type, int is_enable ); |
257 | int Tv_SetBacklight ( int value, tv_source_input_type_t source_type, int is_save ); |
258 | int Tv_GetBacklight ( tv_source_input_type_t source_type ); |
259 | int Tv_SetColorTemperature ( vpp_color_temperature_mode_t mode, tv_source_input_type_t source_type, int is_save ); |
260 | vpp_color_temperature_mode_t Tv_GetColorTemperature ( tv_source_input_type_t source_type ); |
261 | int Tv_SaveColorTemp ( vpp_color_temperature_mode_t mode, tv_source_input_type_t source_type ); |
262 | int Tv_SetDisplayMode ( vpp_display_mode_t mode, tv_source_input_type_t source_type, tvin_sig_fmt_t fmt, int is_save ); |
263 | vpp_display_mode_t Tv_GetDisplayMode ( tv_source_input_type_t source_type ); |
264 | int Tv_SaveDisplayMode ( vpp_display_mode_t mode, tv_source_input_type_t source_type ); |
265 | int Tv_SetNoiseReductionMode ( vpp_noise_reduction_mode_t mode, tv_source_input_type_t source_type, int is_save ); |
266 | vpp_noise_reduction_mode_t Tv_GetNoiseReductionMode ( tv_source_input_type_t source_type ); |
267 | int Tv_SaveNoiseReductionMode ( vpp_noise_reduction_mode_t mode, tv_source_input_type_t source_type ); |
268 | int Tv_SetRGBOGO_PostOffset(int type, int offset); |
269 | int Tv_SetRGBOGO_Gain(int type, int gain); |
270 | int Tv_GetRGBOGO_PostOffset ( int type ); |
271 | int Tv_GetRGBOGO_Gain ( int type ); |
272 | // |
273 | int Tv_FactorySetPQMode_Brightness ( int source_type, int pq_mode, int brightness ); |
274 | int Tv_FactoryGetPQMode_Brightness ( int source_type, int pq_mode ); |
275 | int Tv_FactorySetPQMode_Contrast ( int source_type, int pq_mode, int contrast ); |
276 | int Tv_FactoryGetPQMode_Contrast ( int source_type, int pq_mode ); |
277 | int Tv_FactorySetPQMode_Saturation ( int source_type, int pq_mode, int saturation ); |
278 | int Tv_FactoryGetPQMode_Saturation ( int source_type, int pq_mode ); |
279 | int Tv_FactorySetPQMode_Hue ( int source_type, int pq_mode, int hue ); |
280 | int Tv_FactoryGetPQMode_Hue ( int source_type, int pq_mode ); |
281 | int Tv_FactorySetPQMode_Sharpness ( int source_type, int pq_mode, int sharpness ); |
282 | int Tv_FactoryGetPQMode_Sharpness ( int source_type, int pq_mode ); |
283 | int Tv_FactorySetColorTemp_Rgain ( int source_type, int colortemp_mode, int rgain ); |
284 | int Tv_FactorySaveColorTemp_Rgain ( int source_type, int colortemp_mode, int rgain ); |
285 | int Tv_FactoryGetColorTemp_Rgain ( int source_type, int colortemp_mode ); |
286 | int Tv_FactorySetColorTemp_Ggain ( int source_type, int colortemp_mode, int ggain ); |
287 | int Tv_FactorySaveColorTemp_Ggain ( int source_type, int colortemp_mode, int ggain ); |
288 | int Tv_FactoryGetColorTemp_Ggain ( int source_type, int colortemp_mode ); |
289 | int Tv_FactorySetColorTemp_Bgain ( int source_type, int colortemp_mode, int bgain ); |
290 | int Tv_FactorySaveColorTemp_Bgain ( int source_type, int colortemp_mode, int bgain ); |
291 | int Tv_FactoryGetColorTemp_Bgain ( int source_type, int colortemp_mode ); |
292 | int Tv_FactorySetColorTemp_Roffset ( int source_type, int colortemp_mode, int roffset ); |
293 | int Tv_FactorySaveColorTemp_Roffset ( int source_type, int colortemp_mode, int roffset ); |
294 | int Tv_FactoryGetColorTemp_Roffset ( int source_type, int colortemp_mode ); |
295 | int Tv_FactorySetColorTemp_Goffset ( int source_type, int colortemp_mode, int goffset ); |
296 | int Tv_FactorySaveColorTemp_Goffset ( int source_type, int colortemp_mode, int goffset ); |
297 | int Tv_FactoryGetColorTemp_Goffset ( int source_type, int colortemp_mode ); |
298 | int Tv_FactorySetColorTemp_Boffset ( int source_type, int colortemp_mode, int boffset ); |
299 | int Tv_FactorySaveColorTemp_Boffset ( int source_type, int colortemp_mode, int boffset ); |
300 | int Tv_FactoryGetColorTemp_Boffset ( int source_type, int colortemp_mode ); |
301 | int GetColorTemperatureParams ( vpp_color_temperature_mode_t Tempmode, tcon_rgb_ogo_t *params ); |
302 | int Tv_FactorySetTestPattern ( int pattern ); |
303 | int Tv_FactoryGetTestPattern ( void ); |
304 | int Tv_FactoryResetPQMode ( void ); |
305 | int Tv_FactoryResetColorTemp ( void ); |
306 | int Tv_FactorySetParamsDefault ( void ); |
307 | int Tv_FactorySetDDRSSC ( int step ); |
308 | int Tv_FactoryGetDDRSSC ( void ); |
309 | int Tv_FactorySetLVDSSSC ( int step ); |
310 | int Tv_FactoryGetLVDSSSC ( void ); |
311 | int Tv_FactorySetNolineParams ( int noline_params_type, int source_type, noline_params_t noline_params ); |
312 | noline_params_t Tv_FactoryGetNolineParams ( int noline_params_type, int source_type ); |
313 | int Tv_FactorySetOverscan ( int source_type, int fmt, int status_3d, int trans_fmt, tvin_cutwin_t cutwin_t ); |
314 | tvin_cutwin_t Tv_FactoryGetOverscan ( int source_type, int fmt, int status_3d, int trans_fmt ); |
315 | //end PQ |
316 | |
317 | //TV TO FBC |
318 | int Tv_FactorySet_FBC_Brightness ( int value ); |
319 | int Tv_FactoryGet_FBC_Brightness ( void ); |
320 | int Tv_FactorySet_FBC_Contrast( int value ); |
321 | int Tv_FactoryGet_FBC_Contrast ( void ); |
322 | int Tv_FactorySet_FBC_Saturation( int value ); |
323 | int Tv_FactoryGet_FBC_Saturation ( void ); |
324 | int Tv_FactorySet_FBC_HueColorTint( int value ); |
325 | int Tv_FactoryGet_FBC_HueColorTint ( void ); |
326 | int Tv_FactorySet_FBC_Backlight ( int value ); |
327 | int Tv_FactoryGet_FBC_Backlight ( void ); |
328 | int Tv_FactorySet_FBC_Backlight_N360 ( int value ); |
329 | int Tv_FactoryGet_FBC_Backlight_N360 ( void ); |
330 | int Tv_FactorySet_FBC_ELEC_MODE( int value ); |
331 | int Tv_FactoryGet_FBC_ELEC_MODE( void ); |
332 | int Tv_FactorySet_FBC_Picture_Mode ( int mode ); |
333 | int Tv_FactoryGet_FBC_Picture_Mode ( void ); |
334 | int Tv_FactorySet_FBC_Set_Test_Pattern ( int mode ); |
335 | int Tv_FactoryGet_FBC_Get_Test_Pattern ( void ); |
336 | int Tv_FactorySet_FBC_Gain_Red( int value ); |
337 | int Tv_FactoryGet_FBC_Gain_Red ( void ); |
338 | int Tv_FactorySet_FBC_Gain_Green( int value ); |
339 | int Tv_FactoryGet_FBC_Gain_Green( void ); |
340 | int Tv_FactorySet_FBC_Gain_Blue( int value ); |
341 | int Tv_FactoryGet_FBC_Gain_Blue ( void ); |
342 | int Tv_FactorySet_FBC_Offset_Red( int value ); |
343 | int Tv_FactoryGet_FBC_Offset_Red ( void ); |
344 | int Tv_FactorySet_FBC_Offset_Green( int value ); |
345 | int Tv_FactoryGet_FBC_Offset_Green( void ); |
346 | int Tv_FactorySet_FBC_Offset_Blue( int value ); |
347 | int Tv_FactoryGet_FBC_Offset_Blue ( void ); |
348 | int Tv_FactoryGetWhiteBalanceRedGain(int source_type, int colortemp_mode); |
349 | int Tv_FactoryGetWhiteBalanceGreenGain(int source_type, int colortemp_mode); |
350 | int Tv_FactoryGetWhiteBalanceBlueGain(int source_type, int colortemp_mode); |
351 | int Tv_FactoryGetWhiteBalanceRedOffset(int source_type, int colortemp_mode); |
352 | int Tv_FactoryGetWhiteBalanceGreenOffset(int source_type, int colortemp_mode); |
353 | int Tv_FactoryGetWhiteBalanceBlueOffset(int source_type, int colortemp_mode); |
354 | int Tv_FactorySetWhiteBalanceRedGain(int source_type, int colortemp_mode, int value); |
355 | int Tv_FactorySetWhiteBalanceGreenGain(int source_type, int colortemp_mode, int value); |
356 | int Tv_FactorySetWhiteBalanceBlueGain(int source_type, int colortemp_mode, int value); |
357 | int Tv_FactorySetWhiteBalanceRedOffset(int source_type, int colortemp_mode, int value); |
358 | int Tv_FactorySetWhiteBalanceGreenOffset(int source_type, int colortemp_mode, int value); |
359 | int Tv_FactorySetWhiteBalanceBlueOffset(int source_type, int colortemp_mode, int value); |
360 | int Tv_FactorySetWhiteBalanceColorTempMode(int source_type, int colortemp_mode, int is_save); |
361 | int Tv_FactoryGetWhiteBalanceColorTempMode(int source_type ); |
362 | int Tv_FactoryWhiteBalanceFormatInputFbcGainParams(int value); |
363 | int Tv_FactoryWhiteBalanceFormatInputFbcOffsetParams(int value); |
364 | int Tv_FactoryWhiteBalanceFormatOutputFbcOffsetParams(int value); |
365 | int Tv_FactoryWhiteBalanceFormatOutputFbcGainParams(int value); |
366 | int Tv_FactorySaveWhiteBalancePramas(int source_type, int tempmode, int r_gain, int g_gain, int b_gain, int r_offset, int g_offset, int b_offset); |
367 | int Tv_FactoryCloseWhiteBalanceGrayPattern(); |
368 | int Tv_FactoryOpenWhiteBalanceGrayPattern(); |
369 | int Tv_FactorySetWhiteBalanceGrayPattern(int value); |
370 | int Tv_FactoryGetWhiteBalanceGrayPattern(); |
371 | int Tv_FactoryWhiteBalanceColorTempMappingG92Fbc(int Tempmode); |
372 | int Tv_FactoryWhiteBalanceColorTempMappingFbc2G9(int Tempmode); |
373 | int Tv_FactoryWhiteBalanceGetAllParams(int Tempmode, tcon_rgb_ogo_t *params); |
374 | int Tv_FactorySet_FBC_GrayPattern(int value); |
375 | int Tv_FactoryOpen_FBC_GrayPattern(); |
376 | int Tv_FactoryClose_FBC_GrayPattern(); |
377 | int Tv_FactorySet_FBC_ColorTemp_Mode( int mode ); |
378 | int Tv_FactoryGet_FBC_ColorTemp_Mode ( void ); |
379 | int Tv_FactorySet_FBC_ColorTemp_Mode_N360( int mode ); |
380 | int Tv_FactoryGet_FBC_ColorTemp_Mode_N360 ( void ); |
381 | int Tv_FactorySet_FBC_WB_Initial( int status ); |
382 | int Tv_FactoryGet_FBC_WB_Initial ( void ); |
383 | int Tv_FactorySet_FBC_ColorTemp_Batch(vpp_color_temperature_mode_t Tempmode, tcon_rgb_ogo_t params); |
384 | int Tv_FactoryGet_FBC_ColorTemp_Batch ( vpp_color_temperature_mode_t Tempmode, tcon_rgb_ogo_t *params ); |
385 | int Tv_FactorySet_WB_G9_To_FBC( vpp_color_temperature_mode_t Tempmode, tcon_rgb_ogo_t params ); |
386 | int Tv_FactoryGet_WB_G9_To_FBC ( vpp_color_temperature_mode_t Tempmode, tcon_rgb_ogo_t *params ); |
387 | int Tv_FactoryGetItemFromBatch(vpp_color_temperature_mode_t colortemp_mode, int item); |
388 | int Tv_FactorySet_FBC_CM_OnOff( unsigned char status ); |
389 | int Tv_FactoryGet_FBC_CM_OnOff (void); |
390 | int Tv_FactorySet_FBC_DNLP_OnOff( unsigned char status ); |
391 | int Tv_FactoryGet_FBC_DNLP_OnOff (void); |
392 | int Tv_FactorySet_FBC_Gamma_OnOff( unsigned char status ); |
393 | int Tv_FactoryGet_FBC_Gamma_OnOff (void); |
394 | int Tv_FactorySet_FBC_WhiteBalance_OnOff( unsigned char status ); |
395 | int Tv_FactoryGet_FBC_WhiteBalance_OnOff (void); |
396 | int Tv_FactorySet_FBC_Thermal_State( int value ); |
397 | int Tv_FactorySet_FBC_backlight_onoff(int value); |
398 | int Tv_FactoryGet_FBC_backlight_onoff ( void ); |
399 | int Tv_FactorySet_FBC_LVDS_SSG_Set( int value ); |
400 | int Tv_FactorySet_FBC_LightSensor_Status_N310 ( int value ); |
401 | int Tv_FactoryGet_FBC_LightSensor_Status_N310 ( void ); |
402 | int Tv_FactorySet_FBC_Dream_Panel_Status_N310 ( int value ); |
403 | int Tv_FactoryGet_FBC_Dream_Panel_Status_N310 ( void ); |
404 | int Tv_FactorySet_FBC_MULT_PQ_Status_N310 ( int value ); |
405 | int Tv_FactoryGet_FBC_MULT_PQ_Status_N310 ( void ); |
406 | int Tv_FactorySet_FBC_MEMC_Status_N310 ( int value ); |
407 | int Tv_FactoryGet_FBC_MEMC_Status_N310 ( void ); |
408 | //end TV TO FBC |
409 | |
410 | //audio |
411 | int SetAudioMuteForSystem(int muteOrUnmute); |
412 | int GetAudioMuteForSystem(); |
413 | int SetAudioAVOutMute(int muteStatus); |
414 | int GetAudioAVOutMute(); |
415 | int SetAudioSPDIFMute(int muteStatus); |
416 | int GetAudioSPDIFMute(); |
417 | int SetAudioMasterVolume(int tmp_vol); |
418 | int GetAudioMasterVolume(); |
419 | int SaveCurAudioMasterVolume(int tmp_vol); |
420 | int GetCurAudioMasterVolume(); |
421 | int SetAudioBalance(int tmp_val); |
422 | int GetAudioBalance(); |
423 | int SaveCurAudioBalance(int tmp_val); |
424 | int GetCurAudioBalance(); |
425 | int SetAudioSupperBassVolume(int tmp_vol); |
426 | int GetAudioSupperBassVolume(); |
427 | int SaveCurAudioSupperBassVolume(int tmp_vol); |
428 | int GetCurAudioSupperBassVolume(); |
429 | int SetAudioSupperBassSwitch(int tmp_val); |
430 | int GetAudioSupperBassSwitch(); |
431 | int SaveCurAudioSupperBassSwitch(int tmp_val); |
432 | int GetCurAudioSupperBassSwitch(); |
433 | int SetAudioSRSSurround(int tmp_val); |
434 | int GetAudioSRSSurround(); |
435 | int SaveCurAudioSrsSurround(int tmp_val); |
436 | int GetCurAudioSRSSurround(); |
437 | int SetAudioSrsDialogClarity(int tmp_val); |
438 | int GetAudioSrsDialogClarity(); |
439 | int SaveCurAudioSrsDialogClarity(int tmp_val); |
440 | int GetCurAudioSrsDialogClarity(); |
441 | int SetAudioSrsTruBass(int tmp_val); |
442 | int GetAudioSrsTruBass(); |
443 | int SaveCurAudioSrsTruBass(int tmp_val); |
444 | int GetCurAudioSrsTruBass(); |
445 | int SetAudioBassVolume(int tmp_vol); |
446 | int GetAudioBassVolume(); |
447 | int SaveCurAudioBassVolume(int tmp_vol); |
448 | int GetCurAudioBassVolume(); |
449 | int SetAudioTrebleVolume(int tmp_vol); |
450 | int GetAudioTrebleVolume(); |
451 | int SaveCurAudioTrebleVolume(int tmp_vol); |
452 | int GetCurAudioTrebleVolume(); |
453 | int SetAudioSoundMode(int tmp_val); |
454 | int GetAudioSoundMode(); |
455 | int SaveCurAudioSoundMode(int tmp_val); |
456 | int GetCurAudioSoundMode(); |
457 | int SetAudioWallEffect(int tmp_val); |
458 | int GetAudioWallEffect(); |
459 | int SaveCurAudioWallEffect(int tmp_val); |
460 | int GetCurAudioWallEffect(); |
461 | int SetAudioEQMode(int tmp_val); |
462 | int GetAudioEQMode(); |
463 | int SaveCurAudioEQMode(int tmp_val); |
464 | int GetCurAudioEQMode(); |
465 | int GetAudioEQRange(int range_buf[]); |
466 | int SetAudioEQGain(int gain_buf[]); |
467 | int GetAudioEQGain(int gain_buf[]); |
468 | int SaveCurAudioEQGain(int gain_buf[]); |
469 | int GetCurAudioEQGain(int gain_buf[]); |
470 | int GetAudioEQBandCount(); |
471 | int SetAudioEQSwitch(int switch_val); |
472 | int SetAudioSPDIFSwitch(int tmp_val); |
473 | int amAudioSetDoubleOutputSwitch(int en_val); |
474 | int UsbAudioOuputModuleSwitch(int sw); |
475 | int GetAmAudioSetDoubleOutputSwitch(); |
476 | int GetCurUsbAudioOuputModuleSwitch(); |
477 | int SaveCurAudioSPDIFSwitch(int tmp_val); |
478 | int GetCurAudioSPDIFSwitch(); |
479 | int SetAudioSPDIFMode(int tmp_val); |
480 | int SaveCurAudioSPDIFMode(int tmp_val); |
481 | int GetCurAudioSPDIFMode(); |
482 | int OpenAmAudio(unsigned int sr, int output_device); |
483 | int CloseAmAudio(void); |
484 | int SetAmAudioInputSr(unsigned int sr, int output_device); |
485 | int SetAmAudioOutputMode(int mode); |
486 | int SetAmAudioMusicGain(int gain); |
487 | int SetAmAudioLeftGain(int gain); |
488 | int SetAmAudioRightGain(int gain); |
489 | int AudioLineInSelectChannel(int audio_channel); |
490 | int SetKalaokIO(int level); |
491 | int AudioSetAudioInSource(int audio_src_in_type); |
492 | int AudioSetLineInCaptureVolume(int l_vol, int r_vol); |
493 | int AudioHandleHeadsetPlugIn(); |
494 | int AudioHandleHeadsetPullOut(); |
495 | //end audio |
496 | |
497 | protected: |
498 | class CTvMsgQueue: public CMsgQueueThread, public CAv::IObserver, public CTvScanner::IObserver , public CTvEpg::IObserver, public CFrontEnd::IObserver { |
499 | public: |
500 | static const int TV_MSG_COMMON = 0; |
501 | static const int TV_MSG_STOP_ANALYZE_TS = 1; |
502 | static const int TV_MSG_START_ANALYZE_TS = 2; |
503 | static const int TV_MSG_CHECK_FE_DELAY = 3; |
504 | static const int TV_MSG_AV_EVENT = 4; |
505 | static const int TV_MSG_FE_EVENT = 5; |
506 | static const int TV_MSG_SCAN_EVENT = 6; |
507 | static const int TV_MSG_EPG_EVENT = 7; |
508 | |
509 | CTvMsgQueue(CTv *tv); |
510 | ~CTvMsgQueue(); |
511 | //scan observer |
512 | void onEvent ( const CTvScanner::ScannerEvent &ev ); |
513 | //epg observer |
514 | void onEvent ( const CTvEpg::EpgEvent &ev ); |
515 | //FE observer |
516 | void onEvent ( const CFrontEnd::FEEvent &ev ); |
517 | //AV |
518 | void onEvent(const CAv::AVEvent &ev); |
519 | private: |
520 | virtual void handleMessage ( CMessage &msg ); |
521 | CTv *mpTv; |
522 | }; |
523 | |
524 | |
525 | int resetDmxAndAvSource(); |
526 | int stopScan(); |
527 | int stopPlaying(); |
528 | void sendTvEvent ( const CTvEv &ev ); |
529 | int startPlayTv ( int source, int vid, int aid, int vfat, int afat ); |
530 | //scan observer |
531 | void onEvent ( const CTvScanner::ScannerEvent &ev ); |
532 | //epg observer |
533 | void onEvent ( const CTvEpg::EpgEvent &ev ); |
534 | //FE observer |
535 | void onEvent ( const CFrontEnd::FEEvent &ev ); |
536 | //AV |
537 | void onEvent(const CAv::AVEvent &ev); |
538 | bool Tv_Start_Analyze_Ts ( int channelID ); |
539 | bool Tv_Stop_Analyze_Ts(); |
540 | int Tvin_Stop ( void ); |
541 | int SetBypassModulesFor3D ( VIDEO_3D_MODE_E ); |
542 | int Vpp_SetDisplayMode ( vpp_display_mode_t display_mode, tv_source_input_type_t source_type, tvin_sig_fmt_t sig_fmt ); |
543 | int Tvin_GetTvinConfig(); |
544 | int Tv_init_audio(); |
545 | int Tv_MiscSetBySource ( tv_source_input_t ); |
546 | void print_version_info ( void ); |
547 | int dtvCleanProgramByFreq ( int freq ); |
548 | /*********************** Audio start **********************/ |
549 | int SetAudioMainVolLutBufName(); |
550 | int SetAudioSupperBassVolLutBufName(); |
551 | int SetAudioVolDigitLUTBuf ( tv_source_input_t source_input ); |
552 | int Tv_SetAudioInSource (tv_source_input_t source_input); |
553 | void Tv_SetAudioOutputSwap_Type (tv_source_input_t source_input); |
554 | /*********************** Audio end **********************/ |
555 | |
556 | // |
557 | virtual void onSigToStable(); |
558 | virtual void onSigStableToUnstable(); |
559 | virtual void onSigStableToUnSupport(); |
560 | virtual void onSigStableToNoSig(); |
561 | virtual void onSigUnStableToUnSupport(); |
562 | virtual void onSigUnStableToNoSig(); |
563 | virtual void onSigNullToNoSig(); |
564 | virtual void onSigNoSigToUnstable(); |
565 | virtual void onSigStillStable(); |
566 | virtual void onSigStillUnstable(); |
567 | virtual void onSigStillNosig(); |
568 | virtual void onSigStillNoSupport(); |
569 | virtual void onSigStillNull(); |
570 | virtual void onStableSigFmtChange(); |
571 | virtual void onStableTransFmtChange(); |
572 | virtual void onSigDetectEnter(); |
573 | virtual void onLoop(); |
574 | |
575 | virtual void onSourceConnect(int source_type, int connect_status); |
576 | virtual void onHDMIRxCECMessage(int msg_len, unsigned char msg_buf[]); |
577 | virtual void onUpgradeStatus(int status, int progress); |
578 | virtual void onSerialCommunication(int dev_id, int rd_len, unsigned char data_buf[]); |
579 | virtual void onThermalDetect(int state); |
580 | |
581 | CTvEpg mTvEpg; |
582 | CTvScanner mTvScanner; |
583 | mutable Mutex mLock; |
584 | CTvTime mTvTime; |
585 | CVpp mVpp; |
586 | CTvin mTvin; |
587 | CTvRecord mTvRec; |
588 | CFrontEnd mFrontDev; |
589 | CTvDimension mTvVchip; |
590 | CTvSubtitle mTvSub; |
591 | CTvAudio mTvAudio; |
592 | CAv mAv; |
593 | CTvDmx mTvDmx; |
594 | CTvMsgQueue mTvMsgQueue; |
595 | AutoBackLight mAutoBackLight; |
596 | // |
597 | volatile int mTvAction; |
598 | volatile TvRunStatus_t mTvStatus; |
599 | volatile tv_source_input_t m_source_input; |
600 | volatile tv_source_input_t m_last_source_input; |
601 | /* for tvin window mode and pos*/ |
602 | tvin_window_pos_t m_win_pos; |
603 | tv_window_mode_t m_win_mode; |
604 | int m_blackout_enable;//1 enable 0 disable |
605 | int m_cur_playing_prog_id; |
606 | tvin_sig_fmt_t m_cur_set_info_fmt; |
607 | bool mIsFbc; |
608 | |
609 | |
610 | bool mlastlockstatus; |
611 | String8 mlastdm; |
612 | String8 mlastabbrev; |
613 | String8 mlastabbtext; |
614 | pthread_t vchipthread; |
615 | int mvchip_running; |
616 | friend class CTvMsgQueue; |
617 | int mCurAnalyzeTsChannelID; |
618 | int audio_sr; |
619 | TvIObserver *mpObserver; |
620 | tv_dtv_scan_running_status_t mDtvScanRunningStatus; |
621 | volatile tv_config_t gTvinConfig; |
622 | int dtv_auto_3d_flag; |
623 | bool m_autoset_displayfreq; |
624 | int m_sig_stable_nums; |
625 | bool m_is_set_hdmi_edid; |
626 | /** for L/R or B/T 3d mode overscan **/ |
627 | /** for 3D **/ |
628 | VIDEO_3D_MODE_T m_mode_3d; |
629 | /** for HDMI-in sampling detection. **/ |
630 | volatile bool m_is_hdmi_sr_detect_start; |
631 | int m_hdmi_sampling_rate; |
632 | }; |
633 | |
634 | #endif //_CDTV_H |
635 |