blob: 13a90f639bbfaf7158eced0f807068c8daf0fec5
1 | #include <utils/Log.h> |
2 | #include <binder/IServiceManager.h> |
3 | #include <binder/IPCThreadState.h> |
4 | #include <utils/String16.h> |
5 | #include <utils/Errors.h> |
6 | #include <binder/MemoryBase.h> |
7 | #include <binder/MemoryHeapBase.h> |
8 | #include <include/ITvService.h> |
9 | #include <hardware/hardware.h> |
10 | #include "TvService.h" |
11 | #include <cutils/atomic.h> |
12 | #include <cutils/properties.h> |
13 | #include <stdint.h> |
14 | #include <tvconfig/tvconfig.h> |
15 | #include <tvsetting/CTvSetting.h> |
16 | #include <audio/audio_api.h> |
17 | #include <tvutils/tvutils.h> |
18 | #include <version/version.h> |
19 | #include "../include/tvcmd.h" |
20 | #include "tv/CTvLog.h" |
21 | #include <tvdb/CTvRegion.h> |
22 | extern "C" { |
23 | #include <stdio.h> |
24 | #include <sys/types.h> |
25 | #include <sys/stat.h> |
26 | #include <fcntl.h> |
27 | #include <pthread.h> |
28 | #include <signal.h> |
29 | #include "make_ext4fs.h" |
30 | #include "am_ver.h" |
31 | } |
32 | #define LOG_TAG "TvService" |
33 | |
34 | #define PICTURE_TIMEOUT seconds(5) |
35 | |
36 | static int getCallingPid() |
37 | { |
38 | return IPCThreadState::self()->getCallingPid(); |
39 | } |
40 | |
41 | void TvService::instantiate(CTv *pTv) |
42 | { |
43 | defaultServiceManager()->addService(String16("aml.tvserver"), new TvService( pTv)); |
44 | } |
45 | |
46 | TvService::TvService(CTv *pTv) : |
47 | BnTvService() |
48 | { |
49 | mpStartTvClient = NULL; |
50 | mpScannerClient = NULL; |
51 | mUsers = 0; |
52 | mpTv = pTv; |
53 | mpTv->setTvObserver(this); |
54 | mCapVidFrame.setObserver(this); |
55 | mpTv->OpenTv(); |
56 | } |
57 | |
58 | |
59 | TvService::~TvService() |
60 | { |
61 | mpStartTvClient = NULL; |
62 | mpScannerClient = NULL; |
63 | int client_size = m_v_Clients.size(); |
64 | wp<Client> client; |
65 | for(int i = 0; i < client_size; i++) { |
66 | client = m_v_Clients[i]; |
67 | if (client != 0) { |
68 | LOGW("some client still connect it!"); |
69 | } |
70 | } |
71 | if(mpTv != NULL) { |
72 | delete mpTv; |
73 | mpTv = NULL; |
74 | } |
75 | } |
76 | |
77 | void TvService::onTvEvent(const CTvEv &ev) |
78 | { |
79 | int type = ev.getEvType(); |
80 | LOGD("TvService::onTvEvent ev type = %d", type); |
81 | switch(type) { |
82 | case CTvEv::TV_EVENT_COMMOM: { |
83 | break; |
84 | } |
85 | case CTvEv::TV_EVENT_SCANNER: { |
86 | CTvScanner::ScannerEvent *pScannerEv = (CTvScanner::ScannerEvent *) (&ev); |
87 | if(mpScannerClient != NULL) { |
88 | sp<Client> ScannerClient = mpScannerClient.promote(); |
89 | if(ScannerClient != 0) { |
90 | Parcel p; |
91 | LOGD("scanner evt type:%d freq:%d vid:%d acnt:%d", |
92 | pScannerEv->mType, pScannerEv->mFrequency, pScannerEv->mVid, pScannerEv->mAcnt); |
93 | p.writeInt32(pScannerEv->mType); |
94 | p.writeInt32(pScannerEv->mPercent); |
95 | p.writeInt32(pScannerEv->mTotalChannelCount); |
96 | p.writeInt32(pScannerEv->mLockedStatus); |
97 | p.writeInt32(pScannerEv->mChannelNumber); |
98 | p.writeInt32(pScannerEv->mFrequency); |
99 | p.writeString16(String16(pScannerEv->mProgramName)); |
100 | p.writeInt32(pScannerEv->mprogramType); |
101 | p.writeString16(String16(pScannerEv->mMSG)); |
102 | p.writeInt32(pScannerEv->mStrength); |
103 | p.writeInt32(pScannerEv->mSnr); |
104 | //ATV |
105 | p.writeInt32(pScannerEv->mVideoStd); |
106 | p.writeInt32(pScannerEv->mAudioStd); |
107 | p.writeInt32(pScannerEv->mIsAutoStd); |
108 | //DTV |
109 | p.writeInt32(pScannerEv->mMode); |
110 | p.writeInt32(pScannerEv->mSymbolRate); |
111 | p.writeInt32(pScannerEv->mModulation); |
112 | p.writeInt32(pScannerEv->mBandwidth); |
113 | p.writeInt32(pScannerEv->mOfdm_mode); |
114 | p.writeInt32(pScannerEv->mTsId); |
115 | p.writeInt32(pScannerEv->mONetId); |
116 | p.writeInt32(pScannerEv->mServiceId); |
117 | p.writeInt32(pScannerEv->mVid); |
118 | p.writeInt32(pScannerEv->mVfmt); |
119 | p.writeInt32(pScannerEv->mAcnt); |
120 | for (int i = 0; i < pScannerEv->mAcnt; i++) |
121 | p.writeInt32(pScannerEv->mAid[i]); |
122 | for (int i = 0; i < pScannerEv->mAcnt; i++) |
123 | p.writeInt32(pScannerEv->mAfmt[i]); |
124 | for (int i = 0; i < pScannerEv->mAcnt; i++) |
125 | p.writeString16(String16(pScannerEv->mAlang[i])); |
126 | for (int i = 0; i < pScannerEv->mAcnt; i++) |
127 | p.writeInt32(pScannerEv->mAtype[i]); |
128 | p.writeInt32(pScannerEv->mPcr); |
129 | ScannerClient->notifyCallback(SCAN_EVENT_CALLBACK, p); |
130 | } |
131 | } |
132 | break; |
133 | } |
134 | case CTvEv::TV_EVENT_EPG: { |
135 | CTvEpg::EpgEvent *pEpgEvent = (CTvEpg::EpgEvent *) (&ev); |
136 | int client_size = m_v_Clients.size(); |
137 | wp<Client> client; |
138 | for(int i = 0; i < client_size; i++) { |
139 | client = m_v_Clients[i]; |
140 | if (client != 0) { |
141 | sp<Client> currentClient = client.promote(); |
142 | if (currentClient != 0) { |
143 | Parcel p; |
144 | p.writeInt32(pEpgEvent->type); |
145 | p.writeInt32(pEpgEvent->time); |
146 | p.writeInt32(pEpgEvent->programID); |
147 | p.writeInt32(pEpgEvent->channelID); |
148 | currentClient->getTvClient()->notifyCallback(EPG_EVENT_CALLBACK, p); |
149 | } |
150 | } |
151 | } |
152 | break; |
153 | } |
154 | case CTvEv::TV_EVENT_HDMI_IN_CAP: { |
155 | CTvScreenCapture::CapEvent *pCapEvt = (CTvScreenCapture::CapEvent *)(&ev); |
156 | int client_size = m_v_Clients.size(); |
157 | wp<Client> client; |
158 | for(int i = 0; i < client_size; i++) { |
159 | client = m_v_Clients[i]; |
160 | if (client != 0) { |
161 | sp<Client> currentClient = client.promote(); |
162 | if (currentClient != 0) { |
163 | Parcel p; |
164 | p.writeInt32(pCapEvt->mFrameNum); |
165 | p.writeInt32(pCapEvt->mFrameSize); |
166 | p.writeInt32(pCapEvt->mFrameWide); |
167 | p.writeInt32(pCapEvt->mFrameHeight); |
168 | currentClient->getTvClient()->notifyCallback(VFRAME_BMP_EVENT_CALLBACK, p); |
169 | } |
170 | } |
171 | } |
172 | break; |
173 | } |
174 | case CTvEv::TV_EVENT_AV_PLAYBACK: { |
175 | TvEvent::AVPlaybackEvent *pEv = (TvEvent::AVPlaybackEvent *)(&ev); |
176 | int client_size = m_v_Clients.size(); |
177 | wp<Client> client; |
178 | for(int i = 0; i < client_size; i++) { |
179 | client = m_v_Clients[i]; |
180 | if (client != 0) { |
181 | sp<Client> currentClient = client.promote(); |
182 | if (currentClient != 0) { |
183 | Parcel p; |
184 | p.writeInt32(pEv->mMsgType); |
185 | p.writeInt32(pEv->mProgramId); |
186 | currentClient->getTvClient()->notifyCallback(DTV_AV_PLAYBACK_CALLBACK, p); |
187 | } |
188 | } |
189 | } |
190 | break; |
191 | } |
192 | case CTvEv::TV_EVENT_SIGLE_DETECT: { |
193 | TvEvent::SignalInfoEvent *pEv = (TvEvent::SignalInfoEvent *)(&ev); |
194 | |
195 | int client_size = m_v_Clients.size(); |
196 | wp<Client> client; |
197 | for(int i = 0; i < client_size; i++) { |
198 | client = m_v_Clients[i]; |
199 | if (client != 0) { |
200 | sp<Client> currentClient = client.promote(); |
201 | if (currentClient != 0) { |
202 | Parcel p; |
203 | p.writeInt32(pEv->mTrans_fmt); |
204 | p.writeInt32(pEv->mFmt); |
205 | p.writeInt32(pEv->mStatus); |
206 | p.writeInt32(pEv->mReserved); |
207 | currentClient->getTvClient()->notifyCallback(SIGLE_DETECT_CALLBACK, p); |
208 | } |
209 | } |
210 | } |
211 | break; |
212 | } |
213 | case CTvEv::TV_EVENT_ADC_CALIBRATION: { |
214 | TvEvent::ADCCalibrationEvent *pEv = (TvEvent::ADCCalibrationEvent *)(&ev); |
215 | int client_size = m_v_Clients.size(); |
216 | wp<Client> client; |
217 | for(int i = 0; i < client_size; i++) { |
218 | client = m_v_Clients[i]; |
219 | if (client != 0) { |
220 | sp<Client> currentClient = client.promote(); |
221 | if (currentClient != 0) { |
222 | Parcel p; |
223 | p.writeInt32(pEv->mState); |
224 | currentClient->getTvClient()->notifyCallback(ADC_CALIBRATION_CALLBACK, p); |
225 | } |
226 | } |
227 | } |
228 | break; |
229 | } |
230 | case CTvEv::TV_EVENT_VGA: { //VGA |
231 | TvEvent::VGAEvent *pEv = (TvEvent::VGAEvent *)(&ev); |
232 | int client_size = m_v_Clients.size(); |
233 | wp<Client> client; |
234 | for(int i = 0; i < client_size; i++) { |
235 | client = m_v_Clients[i]; |
236 | if (client != 0) { |
237 | sp<Client> currentClient = client.promote(); |
238 | if (currentClient != 0) { |
239 | Parcel p; |
240 | p.writeInt32(pEv->mState); |
241 | currentClient->getTvClient()->notifyCallback(VGA_CALLBACK, p); |
242 | } |
243 | } |
244 | } |
245 | break; |
246 | } |
247 | case CTvEv::TV_EVENT_SOURCE_CONNECT: { |
248 | TvEvent::SourceConnectEvent *pEv = (TvEvent::SourceConnectEvent *)(&ev); |
249 | int client_size = m_v_Clients.size(); |
250 | wp<Client> client; |
251 | for(int i = 0; i < client_size; i++) { |
252 | client = m_v_Clients[i]; |
253 | if (client != 0) { |
254 | sp<Client> currentClient = client.promote(); |
255 | if (currentClient != 0) { |
256 | Parcel p; |
257 | p.writeInt32(pEv->mSourceInput); |
258 | p.writeInt32(pEv->connectionState); |
259 | currentClient->getTvClient()->notifyCallback(SOURCE_CONNECT_CALLBACK, p); |
260 | } |
261 | } |
262 | } |
263 | break; |
264 | } |
265 | case CTvEv::TV_EVENT_HDMIRX_CEC: { |
266 | TvEvent::HDMIRxCECEvent *pEv = (TvEvent::HDMIRxCECEvent *)(&ev); |
267 | int client_size = m_v_Clients.size(); |
268 | wp<Client> client; |
269 | for(int i = 0; i < client_size; i++) { |
270 | client = m_v_Clients[i]; |
271 | if (client != 0) { |
272 | sp<Client> currentClient = client.promote(); |
273 | if (currentClient != 0) { |
274 | Parcel p; |
275 | |
276 | p.writeInt32(pEv->mDataCount); |
277 | for(int j = 0; j < pEv->mDataCount; j++) { |
278 | p.writeInt32(pEv->mDataBuf[j]); |
279 | } |
280 | |
281 | currentClient->getTvClient()->notifyCallback(HDMIRX_CEC_CALLBACK, p); |
282 | } |
283 | } |
284 | } |
285 | break; |
286 | } |
287 | case CTvEv::TV_EVENT_UPGRADE_FBC: { |
288 | TvEvent::UpgradeFBCEvent *pEv = (TvEvent::UpgradeFBCEvent *)(&ev); |
289 | |
290 | int client_size = m_v_Clients.size(); |
291 | wp<Client> client; |
292 | for(int i = 0; i < client_size; i++) { |
293 | client = m_v_Clients[i]; |
294 | if (client != 0) { |
295 | sp<Client> currentClient = client.promote(); |
296 | if (currentClient != 0) { |
297 | Parcel p; |
298 | p.writeInt32(pEv->mState); |
299 | p.writeInt32(pEv->param); |
300 | currentClient->getTvClient()->notifyCallback(UPGRADE_FBC_CALLBACK, p); |
301 | } |
302 | } |
303 | } |
304 | break; |
305 | } |
306 | case CTvEv::TV_EVENT_SERIAL_COMMUNICATION: { |
307 | TvEvent::SerialCommunicationEvent *pEv = (TvEvent::SerialCommunicationEvent *)(&ev); |
308 | int client_size = m_v_Clients.size(); |
309 | wp<Client> client; |
310 | for(int i = 0; i < client_size; i++) { |
311 | client = m_v_Clients[i]; |
312 | if (client != 0) { |
313 | sp<Client> currentClient = client.promote(); |
314 | if (currentClient != 0) { |
315 | Parcel p; |
316 | |
317 | p.writeInt32(pEv->mDevId); |
318 | p.writeInt32(pEv->mDataCount); |
319 | for(int j = 0; j < pEv->mDataCount; j++) { |
320 | p.writeInt32(pEv->mDataBuf[j]); |
321 | } |
322 | |
323 | currentClient->getTvClient()->notifyCallback(SERIAL_COMMUNICATION_CALLBACK, p); |
324 | } |
325 | } |
326 | } |
327 | break; |
328 | } |
329 | |
330 | case CTvEv::TV_EVENT_2d4G_HEADSET: { |
331 | TvEvent::HeadSetOf2d4GEvent *pEv = (TvEvent::HeadSetOf2d4GEvent *)(&ev); |
332 | LOGD("SendDtvStats status: =%d para2: =%d", pEv->state, pEv->para); |
333 | int client_size = m_v_Clients.size(); |
334 | wp<Client> client; |
335 | for(int i = 0; i < client_size; i++) { |
336 | client = m_v_Clients[i]; |
337 | if (client != 0) { |
338 | sp<Client> currentClient = client.promote(); |
339 | if (currentClient != 0) { |
340 | Parcel p; |
341 | p.writeInt32(pEv->state); |
342 | p.writeInt32(pEv->para); |
343 | currentClient->getTvClient()->notifyCallback(HEADSET_STATUS_CALLBACK, p); |
344 | } |
345 | } |
346 | } |
347 | break; |
348 | } |
349 | |
350 | default: |
351 | break; |
352 | } |
353 | } |
354 | |
355 | sp<ITv> TvService::connect(const sp<ITvClient> &tvClient) |
356 | { |
357 | int callingPid = getCallingPid(); |
358 | LOGD("TvService::connect E (pid %d, client %p)", callingPid, tvClient->asBinder().get()); |
359 | |
360 | Mutex::Autolock lock(mServiceLock); |
361 | |
362 | int client_size = m_v_Clients.size(); |
363 | wp<Client> client; |
364 | for(int i = 0; i < client_size; i++) { |
365 | client = m_v_Clients[i]; |
366 | if (client != 0) { |
367 | sp<Client> currentClient = client.promote(); |
368 | if (currentClient != 0) { |
369 | sp<ITvClient> currentTvClient(currentClient->getTvClient()); |
370 | if (tvClient->asBinder() == currentTvClient->asBinder()) { |
371 | LOGD("TvService::connect X (pid %d, same client %p) is reconnecting...", callingPid, tvClient->asBinder().get()); |
372 | return currentClient; |
373 | } else { |
374 | //LOGD("TvService::connect X (pid %d, new client %p) rejected. " |
375 | // "(old pid %d, old client %p)", callingPid, tvClient->asBinder().get(), currentClient->mClientPid, currentTvClient->asBinder().get()); |
376 | // if (kill(currentClient->mClientPid, 0) == -1 && errno == ESRCH) { |
377 | // LOGE("The old client is dead!"); |
378 | // } |
379 | //return client; |
380 | //return currentClient; |
381 | continue; |
382 | } |
383 | } else { |
384 | LOGE("client (pid %d) have delete ------------not exist", callingPid); |
385 | client.clear(); |
386 | m_v_Clients.removeAt(i); |
387 | client_size--; |
388 | continue; |
389 | } |
390 | } |
391 | } |
392 | |
393 | if (mUsers > 0) { |
394 | LOGE("Still have client, rejected"); |
395 | //return client; |
396 | } |
397 | LOGD("TvService::connect X 3"); |
398 | // client = new Client(this, tvClient, callingPid); |
399 | //mClient = client; |
400 | |
401 | sp<Client> newclient = new Client(this, tvClient, callingPid, mpTv); |
402 | m_v_Clients.add(newclient); |
403 | |
404 | #if DEBUG_CLIENT_REFERENCES |
405 | //client->trackMe(true, true); |
406 | #endif |
407 | //mCurClient = client; |
408 | LOGD("TvService::connect X 4"); |
409 | return newclient; |
410 | } |
411 | |
412 | void TvService::removeClient(const sp<ITvClient> &tvClient) |
413 | { |
414 | int callingPid = getCallingPid(); |
415 | |
416 | Mutex::Autolock lock(mServiceLock); |
417 | |
418 | int client_size = m_v_Clients.size(); |
419 | wp<Client> client; |
420 | for(int i = 0; i < client_size; i++) { |
421 | client = m_v_Clients[i]; |
422 | if (client != 0) { |
423 | sp<Client> currentClient = client.promote(); |
424 | if (currentClient != 0) { |
425 | sp<ITvClient> currentTvClient(currentClient->getTvClient()); |
426 | if (tvClient->asBinder() == currentTvClient->asBinder()) { |
427 | LOGD("find client , and remove it pid = %d, client = %p i=%d", callingPid, tvClient->asBinder().get(), i); |
428 | client.clear(); |
429 | LOGD("find client , and remove it pid1 "); |
430 | m_v_Clients.removeAt(i); |
431 | LOGD("find client , and remove it pid2 "); |
432 | break; |
433 | } else { |
434 | LOGW("removeClient (pid %d): mClient doesn't match!", callingPid); |
435 | continue; |
436 | } |
437 | } else { |
438 | LOGW("removeclient currentClient == 0 (pid %d)", callingPid); |
439 | client.clear(); |
440 | m_v_Clients.removeAt(i); |
441 | client_size--; |
442 | continue; |
443 | } |
444 | } else { |
445 | LOGW("removeclient client == 0 (pid %d)", callingPid); |
446 | client.clear(); |
447 | m_v_Clients.removeAt(i); |
448 | client_size--; |
449 | continue; |
450 | } |
451 | } |
452 | |
453 | LOGD("removeClient (pid %d) done", callingPid); |
454 | } |
455 | |
456 | void TvService::incUsers() |
457 | { |
458 | android_atomic_inc(&mUsers); |
459 | } |
460 | |
461 | void TvService::decUsers() |
462 | { |
463 | android_atomic_dec(&mUsers); |
464 | } |
465 | |
466 | TvService::Client::Client(const sp<TvService> &tvService, const sp<ITvClient> &tvClient, pid_t clientPid, CTv *pTv) |
467 | { |
468 | int callingPid = getCallingPid(); |
469 | LOGD("Client::Client E (pid %d)", callingPid); |
470 | mTvService = tvService; |
471 | mTvClient = tvClient; |
472 | mClientPid = clientPid; |
473 | tvService->incUsers(); |
474 | mpTv = pTv; |
475 | mIsStartTv = false; |
476 | } |
477 | |
478 | status_t TvService::Client::checkPid() |
479 | { |
480 | int callingPid = getCallingPid(); |
481 | if (mClientPid == callingPid) |
482 | return NO_ERROR; |
483 | LOGD("Attempt to use locked tv (client %p) from different process " |
484 | " (old pid %d, new pid %d)", getTvClient()->asBinder().get(), mClientPid, callingPid); |
485 | return -EBUSY; |
486 | } |
487 | |
488 | status_t TvService::Client::lock() |
489 | { |
490 | int callingPid = getCallingPid(); |
491 | LOGD("lock from pid %d (mClientPid %d)", callingPid, mClientPid); |
492 | Mutex::Autolock _l(mLock); |
493 | // lock tv to this client if the the tv is unlocked |
494 | if (mClientPid == 0) { |
495 | mClientPid = callingPid; |
496 | return NO_ERROR; |
497 | } |
498 | // returns NO_ERROR if the client already owns the tv, -EBUSY otherwise |
499 | return checkPid(); |
500 | } |
501 | |
502 | status_t TvService::Client::unlock() |
503 | { |
504 | int callingPid = getCallingPid(); |
505 | LOGD("unlock from pid %d (mClientPid %d)", callingPid, mClientPid); |
506 | Mutex::Autolock _l(mLock); |
507 | // allow anyone to use tv |
508 | status_t result = checkPid(); |
509 | if (result == NO_ERROR) { |
510 | mClientPid = 0; |
511 | LOGD("clear mTvClient (pid %d)", callingPid); |
512 | // we need to remove the reference so that when app goes |
513 | // away, the reference count goes to 0. |
514 | mTvClient.clear(); |
515 | } |
516 | return result; |
517 | } |
518 | |
519 | status_t TvService::Client::connect(const sp<ITvClient> &client) |
520 | { |
521 | int callingPid = getCallingPid(); |
522 | LOGD("Client::connect E (pid %d, client %p)", callingPid, client->asBinder().get()); |
523 | { |
524 | sp<ITvClient> oldClient; |
525 | { |
526 | Mutex::Autolock _l(mLock); |
527 | if (mClientPid != 0 && checkPid() != NO_ERROR) { |
528 | LOGW("Tried to connect to locked tv (old pid %d, new pid %d)", mClientPid, callingPid); |
529 | return -EBUSY; |
530 | } |
531 | oldClient = mTvClient; |
532 | |
533 | // did the client actually change? |
534 | if ((mTvClient != NULL) && (client->asBinder() == mTvClient->asBinder())) { |
535 | LOGD("Connect to the same client"); |
536 | return NO_ERROR; |
537 | } |
538 | |
539 | mTvClient = client; |
540 | mClientPid = -1; |
541 | LOGD("Connect to the new client (pid %d, client %p)", callingPid, mTvClient->asBinder().get()); |
542 | } |
543 | |
544 | } |
545 | mClientPid = callingPid; |
546 | return NO_ERROR; |
547 | } |
548 | |
549 | TvService::Client::~Client() |
550 | { |
551 | if(mIsStartTv) mpTv->StopTvLock(); |
552 | |
553 | int callingPid = getCallingPid(); |
554 | // tear down client |
555 | LOGD("Client::~Client E (pid %d, client %p)", callingPid, getTvClient()->asBinder().get()); |
556 | // make sure we tear down the hardware |
557 | mClientPid = callingPid; |
558 | disconnect(); |
559 | LOGD("Client::~Client X (pid %d)", mClientPid); |
560 | } |
561 | |
562 | void TvService::Client::disconnect() |
563 | { |
564 | int callingPid = getCallingPid(); |
565 | |
566 | LOGD("Client::disconnect() E (pid %d client %p)", callingPid, getTvClient()->asBinder().get()); |
567 | |
568 | Mutex::Autolock lock(mLock); |
569 | if (mClientPid <= 0) { |
570 | LOGE("tv is unlocked (mClientPid = %d), don't tear down hardware", mClientPid); |
571 | return; |
572 | } |
573 | if (checkPid() != NO_ERROR) { |
574 | LOGE("Different client - don't disconnect"); |
575 | return; |
576 | } |
577 | |
578 | mTvService->removeClient(mTvClient); |
579 | mTvService->decUsers(); |
580 | |
581 | LOGD("Client::disconnect() X (pid %d)", callingPid); |
582 | } |
583 | |
584 | status_t TvService::Client::createVideoFrame(const sp<IMemory> &share_mem) |
585 | { |
586 | LOGD(" mem=%p size=%d", share_mem->pointer() == NULL, share_mem->size()); |
587 | int Len = 0; |
588 | Mutex::Autolock lock(mLock); |
589 | mTvService->mCapVidFrame.InitVCap(share_mem); |
590 | mTvService->mCapVidFrame.SetVideoParameter(1280, 720, 50); |
591 | |
592 | mTvService->mCapVidFrame.VideoStart(); |
593 | mTvService->mCapVidFrame.GetVideoData(&Len); |
594 | mTvService->mCapVidFrame.VideoStop(); |
595 | mTvService->mCapVidFrame.DeinitVideoCap(); |
596 | |
597 | return 0; |
598 | } |
599 | |
600 | status_t TvService::Client::createSubtitle(const sp<IMemory> &share_mem) |
601 | { |
602 | LOGD("TvService::Client::createSubtitle mem=%d size=%d", share_mem->pointer() == NULL, share_mem->size()); |
603 | //pSub = new CTvSubtitle(share_mem, this); |
604 | //pSub->run(); |
605 | return 0; |
606 | } |
607 | status_t TvService::Client::processCmd(const Parcel &p, Parcel *r) |
608 | { |
609 | int tmp_i_buf[128] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}; |
610 | unsigned char tmp_uc_buf[512] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}; |
611 | unsigned char tmp_uc_buf2[512] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}; |
612 | int8_t tmp_int8_buf[512] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}; |
613 | static int source_input = 0; |
614 | int *data_ptr = NULL; |
615 | |
616 | int cmd = p.readInt32(); |
617 | |
618 | LOGD("client=%d cmd=%d", getCallingPid(), cmd); |
619 | switch (cmd) { |
620 | // Tv function |
621 | case OPEN_TV: { |
622 | break; |
623 | } |
624 | case CLOSE_TV: { |
625 | int ret = mpTv->CloseTv(); |
626 | r->writeInt32(ret); |
627 | break; |
628 | } |
629 | case START_TV: { |
630 | int mode = p.readInt32(); |
631 | int ret = mpTv->StartTvLock(); |
632 | //mTvService->mpStartTvClient = this; |
633 | mIsStartTv = true; |
634 | r->writeInt32(ret); |
635 | break; |
636 | } |
637 | case STOP_TV: { |
638 | int ret = mpTv->StopTvLock(); |
639 | r->writeInt32(ret); |
640 | mIsStartTv = false; |
641 | break; |
642 | } |
643 | case GET_TV_STATUS: { |
644 | int ret = 0; |
645 | ret = (int)mpTv->GetTvStatus(); |
646 | r->writeInt32(ret); |
647 | break; |
648 | } |
649 | case GET_LAST_SOURCE_INPUT: { |
650 | int ret = (int)mpTv->GetLastSourceInput(); |
651 | r->writeInt32(ret); |
652 | break; |
653 | } |
654 | case GET_CURRENT_SOURCE_INPUT: { |
655 | int ret = (int)mpTv->GetCurrentSourceInputLock(); |
656 | r->writeInt32(ret); |
657 | break; |
658 | } |
659 | case GET_CURRENT_SOURCE_INPUT_TYPE: { |
660 | int ret = 0;//(int)mpTv->Tvin_GetSrcInputType(); |
661 | r->writeInt32(ret); |
662 | break; |
663 | } |
664 | case GET_CURRENT_SIGNAL_INFO: { |
665 | tvin_info_t siginfo = mpTv->GetCurrentSignalInfo(); |
666 | int frame_rate = mpTv->getHDMIFrameRate(); |
667 | LOGD("superman--frame_rate = %d", frame_rate); |
668 | r->writeInt32(siginfo.trans_fmt); |
669 | r->writeInt32(siginfo.fmt); |
670 | r->writeInt32(siginfo.status); |
671 | r->writeInt32(frame_rate); |
672 | break; |
673 | } |
674 | case IS_SOURCE_SWTICH_DONE: { |
675 | //int ret = mpTv->Tv_IsSourceSwtichDone(); |
676 | r->writeInt32(0); |
677 | break; |
678 | } |
679 | case SET_SOURCE_INPUT: { |
680 | int sourceinput = p.readInt32(); |
681 | tvin_window_pos_t win_pos; |
682 | LOGD(" SetSourceInput sourceId= %x", sourceinput); |
683 | source_input = sourceinput; |
684 | /*win_pos.x1 = p.readInt32(); |
685 | win_pos.y1 = p.readInt32(); |
686 | win_pos.x2 = p.readInt32(); |
687 | win_pos.y2 = p.readInt32();*/ |
688 | int ret = mpTv->SetSourceSwitchInput((tv_source_input_t)sourceinput); |
689 | r->writeInt32(ret); |
690 | break; |
691 | } |
692 | case RUN_ADC_AUTO_CALIBRATION: { |
693 | // int ret = mpTv->Tv_RunADCAutoCalibration(); |
694 | // r->writeInt32(ret); |
695 | break; |
696 | } |
697 | case IS_DVI_SIGNAL: { |
698 | int ret = mpTv->IsDVISignal(); |
699 | r->writeInt32(ret); |
700 | break; |
701 | } |
702 | case IS_VGA_TIMEING_IN_HDMI: { |
703 | int ret = mpTv->isVgaFmtInHdmi(); |
704 | r->writeInt32(ret); |
705 | break; |
706 | } |
707 | case GET_VIDEO_PATH_STATUS: { |
708 | int path_type = p.readInt32(); |
709 | int ret = 0;//(int)mpTv->Tvin_CheckPathActive((tv_path_type_t)path_type); |
710 | r->writeInt32(ret); |
711 | break; |
712 | } |
713 | case GET_VIDEO_STREAM_STATUS: { |
714 | // int ret = (int)mpTv->Tvin_CheckVideoStreamStatus(); |
715 | // r->writeInt32(ret); |
716 | break; |
717 | } |
718 | case GET_FIRST_START_SWITCH_TYPE: { |
719 | //int tmp_val = 0; |
720 | //int ret = (int)mpTv->Tv_GetFirstStartSwitchType(&tmp_val); |
721 | //r->writeInt32(ret); |
722 | r->writeInt32(1); |
723 | break; |
724 | } |
725 | case SET_PREVIEW_WINDOW: { |
726 | tvin_window_pos_t win_pos; |
727 | win_pos.x1 = p.readInt32(); |
728 | win_pos.y1 = p.readInt32(); |
729 | win_pos.x2 = p.readInt32(); |
730 | win_pos.y2 = p.readInt32(); |
731 | int ret = (int)mpTv->SetPreviewWindow(win_pos); |
732 | r->writeInt32(ret); |
733 | break; |
734 | } |
735 | |
736 | case SET_VIDEO_DISABLE: { |
737 | int value = p.readInt32(); |
738 | int ret = 0;//(int)mpTv->Tv_SetVideoDisable(value); |
739 | r->writeInt32(ret); |
740 | break; |
741 | } |
742 | |
743 | case GET_SOURCE_CONNECT_STATUS: { |
744 | int source_input = p.readInt32(); |
745 | int ret = mpTv->GetSourceConnectStatus(source_input); |
746 | r->writeInt32(ret); |
747 | break; |
748 | } |
749 | //Tv function END |
750 | |
751 | //VGA |
752 | case RUN_VGA_AUTO_ADJUST: { |
753 | //int ret = mpTv->Tv_RunVGAAutoAdjust(); |
754 | int ret = 0; |
755 | r->writeInt32(ret); |
756 | break; |
757 | } |
758 | case GET_VGA_AUTO_ADJUST_STATUS: { |
759 | // int fmt = p.readInt32(); |
760 | //int ret = (int) mpTv->Tv_GetVagAutoAdjustStatus(); |
761 | int ret = 0; |
762 | r->writeInt32(ret); |
763 | break; |
764 | } |
765 | case IS_VGA_AUTO_ADJUST_DONE: { |
766 | int fmt = p.readInt32(); |
767 | int ret = 0;//mpTv->Tv_IsVGAAutoAdjustDone((tvin_sig_fmt_t)fmt); |
768 | r->writeInt32(ret); |
769 | break; |
770 | } |
771 | case SET_VGA_HPOS: { |
772 | // int value = p.readInt32(); |
773 | // int fmt = p.readInt32(); |
774 | //int ret = mpTv->Tv_SetVGAHPos(value, (tvin_sig_fmt_t)fmt); |
775 | int ret = 0; |
776 | r->writeInt32(ret); |
777 | break; |
778 | } |
779 | case GET_VGA_HPOS: { |
780 | // int fmt = p.readInt32(); |
781 | // int ret = mpTv->Tv_GetVGAHPos((tvin_sig_fmt_t)fmt); |
782 | int ret = 0; |
783 | r->writeInt32(ret); |
784 | break; |
785 | } |
786 | |
787 | case SET_VGA_VPOS: { |
788 | // int value = p.readInt32(); |
789 | // int fmt = p.readInt32(); |
790 | // int ret = mpTv->Tv_SetVGAVPos(value, (tvin_sig_fmt_t)fmt); |
791 | int ret = 0; |
792 | r->writeInt32(ret); |
793 | break; |
794 | } |
795 | case GET_VGA_VPOS: { |
796 | // int fmt = p.readInt32(); |
797 | // int ret = mpTv->Tv_GetVGAVPos((tvin_sig_fmt_t)fmt); |
798 | int ret = 0; |
799 | r->writeInt32(ret); |
800 | break; |
801 | } |
802 | |
803 | case SET_VGA_CLOCK: { |
804 | // int value = p.readInt32(); |
805 | // int fmt = p.readInt32(); |
806 | // int ret = mpTv->Tv_SetVGAClock(value, (tvin_sig_fmt_t)fmt); |
807 | int ret = 0; |
808 | r->writeInt32(ret); |
809 | break; |
810 | } |
811 | case GET_VGA_CLOCK: { |
812 | // int fmt = p.readInt32(); |
813 | // int ret = mpTv->Tv_GetVGAClock((tvin_sig_fmt_t)fmt); |
814 | int ret = 0; |
815 | r->writeInt32(ret); |
816 | break; |
817 | } |
818 | |
819 | case SET_VGA_PHASE: { |
820 | // int value = p.readInt32(); |
821 | // int fmt = p.readInt32(); |
822 | // int ret = mpTv->Tv_SetVGAPhase(value, (tvin_sig_fmt_t)fmt); |
823 | int ret = 0; |
824 | r->writeInt32(ret); |
825 | break; |
826 | } |
827 | case GET_VGA_PHASE: { |
828 | // int fmt = p.readInt32(); |
829 | // int ret = mpTv->Tv_GetVGAPhase((tvin_sig_fmt_t)fmt); |
830 | int ret = 0; |
831 | r->writeInt32(ret); |
832 | break; |
833 | } |
834 | case SET_VGA_AJUST_PARA: { |
835 | tvafe_vga_parm_t adjparam; |
836 | adjparam.clk_step = p.readInt32(); |
837 | adjparam.phase = p.readInt32(); |
838 | adjparam.hpos_step = p.readInt32(); |
839 | adjparam.vpos_step = p.readInt32(); |
840 | adjparam.vga_in_clean = p.readInt32(); |
841 | int fmt = p.readInt32(); |
842 | int ret = 0/*SetVGAAjustPara(adjparam, (tvin_sig_fmt_t)fmt)*/; |
843 | r->writeInt32(ret); |
844 | break; |
845 | } |
846 | case GET_VGA_AJUST_PARA: { |
847 | tvafe_vga_parm_t adjparam; |
848 | int fmt = p.readInt32(); |
849 | int ret = 0/*GetVGAAjustPara(&adjparam, (tvin_sig_fmt_t)fmt)*/; |
850 | r->writeInt32(adjparam.clk_step); |
851 | r->writeInt32(adjparam.phase); |
852 | r->writeInt32(adjparam.hpos_step); |
853 | r->writeInt32(adjparam.vpos_step); |
854 | r->writeInt32(adjparam.vga_in_clean); |
855 | r->writeInt32(ret); |
856 | break; |
857 | } |
858 | case SET_VGAPARAM_DEFAULT: { |
859 | // int ret = (int)mpTv->TvinResetVgaAjustParam(); |
860 | // r->writeInt32(ret); |
861 | break; |
862 | } |
863 | // VGA END |
864 | |
865 | // 3D |
866 | |
867 | case SET_3D_MODE: { |
868 | int mode = p.readInt32(); |
869 | int ret = mpTv->Tv_Set3DMode((VIDEO_3D_MODE_T)mode); |
870 | r->writeInt32(ret); |
871 | break; |
872 | } |
873 | case GET_3D_MODE: { |
874 | int ret = (int)mpTv->Tv_Get3DMode(); |
875 | r->writeInt32(ret); |
876 | break; |
877 | } |
878 | case SET_3D_LR_SWITH: { |
879 | int on_off = p.readInt32(); |
880 | //int status = p.readInt32(); |
881 | int ret = mpTv->Tv_Set3DLRSwith(on_off); |
882 | r->writeInt32(ret); |
883 | break; |
884 | } |
885 | case GET_3D_LR_SWITH: { |
886 | int ret = mpTv->Tv_Get3DLRSwith(); |
887 | r->writeInt32(ret); |
888 | break; |
889 | } |
890 | case SET_3D_TO_2D_MODE: { |
891 | int mode = p.readInt32(); |
892 | //int status = p.readInt32(); |
893 | int ret = mpTv->Tv_Set3DTo2DMode(mode); |
894 | r->writeInt32(ret); |
895 | break; |
896 | } |
897 | case GET_3D_TO_2D_MODE: { |
898 | int ret = mpTv->Tv_Get3DTo2DMode(); |
899 | r->writeInt32(ret); |
900 | break; |
901 | } |
902 | case SET_3D_DEPTH: { |
903 | int value = p.readInt32(); |
904 | int ret = mpTv->Tv_Set3DDepth(value); |
905 | r->writeInt32(ret); |
906 | break; |
907 | } |
908 | case GET_3D_DEPTH: { |
909 | int ret = mpTv->GetSave3DDepth(); |
910 | r->writeInt32(ret); |
911 | break; |
912 | } |
913 | // 3D END |
914 | |
915 | // PQ |
916 | case SET_BRIGHTNESS: { |
917 | int brightness = p.readInt32(); |
918 | int source_type = p.readInt32(); |
919 | int is_save = p.readInt32(); |
920 | int ret = mpTv->Tv_SetBrightness(brightness, (tv_source_input_type_t)source_type, is_save); |
921 | r->writeInt32(ret); |
922 | break; |
923 | } |
924 | case GET_BRIGHTNESS: { |
925 | int source_type = p.readInt32(); |
926 | LOGD("GET_BRIGHTNESS------------=%d", source_type); |
927 | int ret = mpTv->Tv_GetBrightness((tv_source_input_type_t)source_type); |
928 | r->writeInt32(ret); |
929 | break; |
930 | } |
931 | |
932 | case SET_CONTRAST: { |
933 | int contrast = p.readInt32(); |
934 | int source_type = p.readInt32(); |
935 | int is_save = p.readInt32(); |
936 | int ret = mpTv->Tv_SetContrast(contrast, (tv_source_input_type_t)source_type, is_save); |
937 | r->writeInt32(ret); |
938 | break; |
939 | } |
940 | case GET_CONTRAST: { |
941 | int source_type = p.readInt32(); |
942 | int ret = mpTv->Tv_GetContrast((tv_source_input_type_t)source_type); |
943 | r->writeInt32(ret); |
944 | break; |
945 | } |
946 | case SET_SATUATION: { |
947 | int satuation = p.readInt32(); |
948 | int source_type = p.readInt32(); |
949 | int fmt = p.readInt32(); |
950 | int is_save = p.readInt32(); |
951 | int ret = mpTv->Tv_SetSaturation(satuation, (tv_source_input_type_t)source_type, (tvin_sig_fmt_t)fmt, is_save); |
952 | r->writeInt32(ret); |
953 | break; |
954 | } |
955 | case GET_SATUATION: { |
956 | int source_type = p.readInt32(); |
957 | int ret = mpTv->Tv_GetSaturation((tv_source_input_type_t)source_type); |
958 | r->writeInt32(ret); |
959 | break; |
960 | } |
961 | case SET_HUE: { |
962 | int hue = p.readInt32(); |
963 | int source_type = p.readInt32(); |
964 | int fmt = p.readInt32(); |
965 | int is_save = p.readInt32(); |
966 | int ret = mpTv->Tv_SetHue(hue, (tv_source_input_type_t)source_type, (tvin_sig_fmt_t)fmt, is_save); |
967 | r->writeInt32(ret); |
968 | break; |
969 | } |
970 | case GET_HUE: { |
971 | int source_type = p.readInt32(); |
972 | int ret = mpTv->Tv_GetHue((tv_source_input_type_t)source_type); |
973 | r->writeInt32(ret); |
974 | break; |
975 | } |
976 | case SET_SCENEMODE: { |
977 | int mode = p.readInt32(); |
978 | int is_save = p.readInt32(); |
979 | int ret = 0;//mpTv->Tv_SetSceneMode((vpp_scene_mode_t)mode,is_save); |
980 | r->writeInt32(ret); |
981 | break; |
982 | } |
983 | case GET_SCENEMODE: { |
984 | int ret = 0;//(int)mpTv->Tv_GetSceneMode(); |
985 | r->writeInt32(ret); |
986 | break; |
987 | } |
988 | case SET_PQMODE: { |
989 | int mode = p.readInt32(); |
990 | int source_type = p.readInt32(); |
991 | int is_save = p.readInt32(); |
992 | int ret = mpTv->Tv_SetPQMode((vpp_picture_mode_t)mode, (tv_source_input_type_t)source_type, is_save); |
993 | r->writeInt32(ret); |
994 | break; |
995 | } |
996 | case GET_PQMODE: { |
997 | int source_type = p.readInt32(); |
998 | int ret = (int)mpTv->Tv_GetPQMode((tv_source_input_type_t)source_type); |
999 | r->writeInt32(ret); |
1000 | break; |
1001 | } |
1002 | case SET_SHARPNESS: { |
1003 | int value = p.readInt32(); |
1004 | int source_type = p.readInt32(); |
1005 | int en = p.readInt32(); |
1006 | int status_3d = p.readInt32(); |
1007 | int is_save = p.readInt32(); |
1008 | int ret = mpTv->Tv_SetSharpness(value, (tv_source_input_type_t)source_type, en, is_save); |
1009 | r->writeInt32(ret); |
1010 | break; |
1011 | } |
1012 | case GET_SHARPNESS: { |
1013 | int source_type = p.readInt32(); |
1014 | int ret = mpTv->Tv_GetSharpness((tv_source_input_type_t)source_type); |
1015 | r->writeInt32(ret); |
1016 | break; |
1017 | } |
1018 | case SAVE_SHARPNESS: { |
1019 | int value = p.readInt32(); |
1020 | int source_type = p.readInt32(); |
1021 | int en = p.readInt32(); |
1022 | int ret = mpTv->Tv_SaveSharpness(value, (tv_source_input_type_t)source_type, en); |
1023 | r->writeInt32(ret); |
1024 | break; |
1025 | } |
1026 | case SET_BACKLIGHT: { |
1027 | int value = p.readInt32(); |
1028 | int source_type = p.readInt32(); |
1029 | int is_save = p.readInt32(); |
1030 | int ret = -1; |
1031 | if (GetPlatformHaveFBCFlag() == 0) { |
1032 | ret = mpTv->Tv_SetBacklight(value, (tv_source_input_type_t)source_type, is_save); |
1033 | } else { |
1034 | ret = mpTv->Tv_FactorySet_FBC_Backlight(value); |
1035 | } |
1036 | r->writeInt32(ret); |
1037 | break; |
1038 | } |
1039 | case GET_BACKLIGHT: { |
1040 | int source_type = p.readInt32(); |
1041 | int ret = 0; |
1042 | if (GetPlatformHaveFBCFlag() == 0) { |
1043 | ret = mpTv->Tv_GetBacklight((tv_source_input_type_t)source_type); |
1044 | } else { |
1045 | ret = mpTv->Tv_FactoryGet_FBC_Backlight(); |
1046 | } |
1047 | r->writeInt32(ret); |
1048 | break; |
1049 | } |
1050 | case SET_COLOR_TEMPERATURE: { |
1051 | int mode = p.readInt32(); |
1052 | int source_type = p.readInt32(); |
1053 | int is_save = p.readInt32(); |
1054 | int ret = -1; |
1055 | if (GetPlatformHaveFBCFlag() == 0) { |
1056 | ret = mpTv->Tv_SetColorTemperature((vpp_color_temperature_mode_t)mode, (tv_source_input_type_t)source_type, is_save); |
1057 | } else { |
1058 | mode = mpTv->Tv_FactoryWhiteBalanceColorTempMappingG92Fbc(mode); |
1059 | ret = mpTv->Tv_FactorySet_FBC_ColorTemp_Mode(mode); |
1060 | } |
1061 | r->writeInt32(ret); |
1062 | break; |
1063 | } |
1064 | case GET_COLOR_TEMPERATURE: { |
1065 | int source_type = p.readInt32(); |
1066 | int ret = 0; |
1067 | if (GetPlatformHaveFBCFlag() == 0) { |
1068 | ret = mpTv->Tv_GetColorTemperature((tv_source_input_type_t)source_type); |
1069 | } else { |
1070 | ret = mpTv->Tv_FactoryGet_FBC_ColorTemp_Mode(); |
1071 | ret = mpTv->Tv_FactoryWhiteBalanceColorTempMappingFbc2G9(ret); |
1072 | } |
1073 | r->writeInt32(ret); |
1074 | break; |
1075 | } |
1076 | case SAVE_COLOR_TEMPERATURE: { |
1077 | int mode = p.readInt32(); |
1078 | int source_type = p.readInt32(); |
1079 | int ret = mpTv->Tv_SaveColorTemp((vpp_color_temperature_mode_t)mode, (tv_source_input_type_t)source_type); |
1080 | r->writeInt32(ret); |
1081 | break; |
1082 | } |
1083 | case SET_DISPLAY_MODE: { |
1084 | int mode = p.readInt32(); |
1085 | int source_type = p.readInt32(); |
1086 | int fmt = p.readInt32(); |
1087 | int is_save = p.readInt32(); |
1088 | int ret = mpTv->Tv_SetDisplayMode((vpp_display_mode_t)mode, (tv_source_input_type_t)source_type, (tvin_sig_fmt_t)fmt, is_save); |
1089 | r->writeInt32(ret); |
1090 | break; |
1091 | } |
1092 | case GET_DISPLAY_MODE: { |
1093 | int source_type = p.readInt32(); |
1094 | int ret = (int)mpTv->Tv_GetDisplayMode((tv_source_input_type_t)source_type); |
1095 | r->writeInt32(ret); |
1096 | break; |
1097 | } |
1098 | case SAVE_DISPLAY_MODE: { |
1099 | int mode = p.readInt32(); |
1100 | int source_type = p.readInt32(); |
1101 | int ret = mpTv->Tv_SaveDisplayMode((vpp_display_mode_t)mode, (tv_source_input_type_t)source_type); |
1102 | r->writeInt32(ret); |
1103 | break; |
1104 | } |
1105 | case SET_NOISE_REDUCTION_MODE: { |
1106 | int mode = p.readInt32(); |
1107 | int source_type = p.readInt32(); |
1108 | int is_save = p.readInt32(); |
1109 | int ret = mpTv->Tv_SetNoiseReductionMode((vpp_noise_reduction_mode_t)mode, (tv_source_input_type_t)source_type, is_save); |
1110 | r->writeInt32(ret); |
1111 | break; |
1112 | } |
1113 | case GET_NOISE_REDUCTION_MODE: { |
1114 | int source_type = p.readInt32(); |
1115 | int ret = mpTv->Tv_GetNoiseReductionMode((tv_source_input_type_t)source_type); |
1116 | r->writeInt32(ret); |
1117 | break; |
1118 | } |
1119 | case SAVE_NOISE_REDUCTION_MODE: { |
1120 | int mode = p.readInt32(); |
1121 | int source_type = p.readInt32(); |
1122 | int ret = mpTv->Tv_SaveNoiseReductionMode((vpp_noise_reduction_mode_t)mode, (tv_source_input_type_t)source_type); |
1123 | r->writeInt32(ret); |
1124 | break; |
1125 | } |
1126 | case SETRGBOGO_POSTOFFSET: { |
1127 | int type = p.readInt32(); |
1128 | int offset = p.readInt32(); |
1129 | int ret = 0; |
1130 | ret = mpTv->Tv_SetRGBOGO_PostOffset(type, offset); |
1131 | r->writeInt32(ret); |
1132 | break; |
1133 | } |
1134 | case SETRGBOGO_GAIN: { |
1135 | int type = p.readInt32(); |
1136 | int mode = p.readInt32(); |
1137 | int ret = 0; |
1138 | ret = mpTv->Tv_SetRGBOGO_Gain(type, mode); |
1139 | r->writeInt32(ret); |
1140 | break; |
1141 | } |
1142 | case GETRGBOGO_POSTOFFSET: { |
1143 | int ret = 0; |
1144 | int type = p.readInt32(); |
1145 | ret = mpTv->Tv_GetRGBOGO_PostOffset(type); |
1146 | r->writeInt32(ret); |
1147 | break; |
1148 | } |
1149 | case GETRGBOGO_GAIN: { |
1150 | int type = p.readInt32(); |
1151 | int ret = 0; |
1152 | ret = mpTv->Tv_GetRGBOGO_Gain(type); |
1153 | r->writeInt32(ret); |
1154 | break; |
1155 | } |
1156 | // PQ END |
1157 | |
1158 | // FACTORY |
1159 | case FACTORY_SETPQMODE_BRIGHTNESS: { |
1160 | int source_type = p.readInt32(); |
1161 | int pq_mode = p.readInt32(); |
1162 | int brightness = p.readInt32(); |
1163 | int ret = mpTv->Tv_FactorySetPQMode_Brightness(source_type, pq_mode, brightness); |
1164 | r->writeInt32(ret); |
1165 | break; |
1166 | } |
1167 | case FACTORY_GETPQMODE_BRIGHTNESS: { |
1168 | int source_type = p.readInt32(); |
1169 | int pq_mode = p.readInt32(); |
1170 | int ret = mpTv->Tv_FactoryGetPQMode_Brightness(source_type, pq_mode); |
1171 | r->writeInt32(ret); |
1172 | break; |
1173 | } |
1174 | case FACTORY_SETPQMODE_CONTRAST: { |
1175 | int source_type = p.readInt32(); |
1176 | int pq_mode = p.readInt32(); |
1177 | int contrast = p.readInt32(); |
1178 | int ret = mpTv->Tv_FactorySetPQMode_Contrast(source_type, pq_mode, contrast); |
1179 | r->writeInt32(ret); |
1180 | break; |
1181 | } |
1182 | case FACTORY_GETPQMODE_CONTRAST: { |
1183 | int source_type = p.readInt32(); |
1184 | int pq_mode = p.readInt32(); |
1185 | int ret = mpTv->Tv_FactoryGetPQMode_Contrast(source_type, pq_mode); |
1186 | r->writeInt32(ret); |
1187 | break; |
1188 | } |
1189 | case FACTORY_SETPQMODE_SATURATION: { |
1190 | int source_type = p.readInt32(); |
1191 | int pq_mode = p.readInt32(); |
1192 | int saturation = p.readInt32(); |
1193 | int ret = mpTv->Tv_FactorySetPQMode_Saturation(source_type, pq_mode, saturation); |
1194 | r->writeInt32(ret); |
1195 | break; |
1196 | } |
1197 | case FACTORY_GETPQMODE_SATURATION: { |
1198 | int source_type = p.readInt32(); |
1199 | int pq_mode = p.readInt32(); |
1200 | int ret = mpTv->Tv_FactoryGetPQMode_Saturation(source_type, pq_mode); |
1201 | r->writeInt32(ret); |
1202 | break; |
1203 | } |
1204 | case FACTORY_SETPQMODE_HUE: { |
1205 | int source_type = p.readInt32(); |
1206 | int pq_mode = p.readInt32(); |
1207 | int hue = p.readInt32(); |
1208 | int ret = mpTv->Tv_FactorySetPQMode_Hue(source_type, pq_mode, hue); |
1209 | r->writeInt32(ret); |
1210 | break; |
1211 | } |
1212 | case FACTORY_GETPQMODE_HUE: { |
1213 | int source_type = p.readInt32(); |
1214 | int pq_mode = p.readInt32(); |
1215 | int ret = mpTv->Tv_FactoryGetPQMode_Hue(source_type, pq_mode); |
1216 | r->writeInt32(ret); |
1217 | break; |
1218 | } |
1219 | case FACTORY_SETPQMODE_SHARPNESS: { |
1220 | int source_type = p.readInt32(); |
1221 | int pq_mode = p.readInt32(); |
1222 | int sharpness = p.readInt32(); |
1223 | int ret = mpTv->Tv_FactorySetPQMode_Sharpness(source_type, pq_mode, sharpness); |
1224 | r->writeInt32(ret); |
1225 | break; |
1226 | } |
1227 | case FACTORY_GETPQMODE_SHARPNESS: { |
1228 | int source_type = p.readInt32(); |
1229 | int pq_mode = p.readInt32(); |
1230 | int ret = mpTv->Tv_FactoryGetPQMode_Sharpness(source_type, pq_mode); |
1231 | r->writeInt32(ret); |
1232 | break; |
1233 | } |
1234 | case FACTORY_SETCOLORTEMP_RGAIN: { |
1235 | int source_type = p.readInt32(); |
1236 | int colortemp_mode = p.readInt32(); |
1237 | int rgain = p.readInt32(); |
1238 | int ret = mpTv->Tv_FactorySetColorTemp_Rgain(source_type, colortemp_mode, rgain); |
1239 | r->writeInt32(ret); |
1240 | break; |
1241 | } |
1242 | case FACTORY_SAVECOLORTEMP_RGAIN: { |
1243 | int source_type = p.readInt32(); |
1244 | int colortemp_mode = p.readInt32(); |
1245 | int rgain = p.readInt32(); |
1246 | int ret = mpTv->Tv_FactorySaveColorTemp_Rgain(source_type, colortemp_mode, rgain); |
1247 | r->writeInt32(ret); |
1248 | break; |
1249 | } |
1250 | case FACTORY_GETCOLORTEMP_RGAIN: { |
1251 | int source_type = p.readInt32(); |
1252 | int colortemp_mode = p.readInt32(); |
1253 | int ret = mpTv->Tv_FactoryGetColorTemp_Rgain(source_type, colortemp_mode); |
1254 | r->writeInt32(ret); |
1255 | break; |
1256 | } |
1257 | case FACTORY_SETCOLORTEMP_GGAIN: { |
1258 | int source_type = p.readInt32(); |
1259 | int colortemp_mode = p.readInt32(); |
1260 | int ggain = p.readInt32(); |
1261 | int ret = mpTv->Tv_FactorySetColorTemp_Ggain(source_type, colortemp_mode, ggain); |
1262 | r->writeInt32(ret); |
1263 | break; |
1264 | } |
1265 | case FACTORY_SAVECOLORTEMP_GGAIN: { |
1266 | int source_type = p.readInt32(); |
1267 | int colortemp_mode = p.readInt32(); |
1268 | int ggain = p.readInt32(); |
1269 | int ret = mpTv->Tv_FactorySaveColorTemp_Ggain(source_type, colortemp_mode, ggain); |
1270 | r->writeInt32(ret); |
1271 | break; |
1272 | } |
1273 | case FACTORY_GETCOLORTEMP_GGAIN: { |
1274 | int source_type = p.readInt32(); |
1275 | int colortemp_mode = p.readInt32(); |
1276 | int ret = mpTv->Tv_FactoryGetColorTemp_Ggain(source_type, colortemp_mode); |
1277 | r->writeInt32(ret); |
1278 | break; |
1279 | } |
1280 | case FACTORY_SETCOLORTEMP_BGAIN: { |
1281 | int source_type = p.readInt32(); |
1282 | int colortemp_mode = p.readInt32(); |
1283 | int bgain = p.readInt32(); |
1284 | int ret = mpTv->Tv_FactorySetColorTemp_Bgain(source_type, colortemp_mode, bgain); |
1285 | r->writeInt32(ret); |
1286 | break; |
1287 | } |
1288 | case FACTORY_SAVECOLORTEMP_BGAIN: { |
1289 | int source_type = p.readInt32(); |
1290 | int colortemp_mode = p.readInt32(); |
1291 | int bgain = p.readInt32(); |
1292 | int ret = mpTv->Tv_FactorySaveColorTemp_Bgain(source_type, colortemp_mode, bgain); |
1293 | r->writeInt32(ret); |
1294 | break; |
1295 | } |
1296 | case FACTORY_GETCOLORTEMP_BGAIN: { |
1297 | int source_type = p.readInt32(); |
1298 | int colortemp_mode = p.readInt32(); |
1299 | int ret = mpTv->Tv_FactoryGetColorTemp_Bgain(source_type, colortemp_mode); |
1300 | r->writeInt32(ret); |
1301 | break; |
1302 | } |
1303 | case FACTORY_SETCOLORTEMP_ROFFSET: { |
1304 | int source_type = p.readInt32(); |
1305 | int colortemp_mode = p.readInt32(); |
1306 | int roffset = p.readInt32(); |
1307 | int ret = mpTv->Tv_FactorySetColorTemp_Roffset(source_type, colortemp_mode, roffset); |
1308 | r->writeInt32(ret); |
1309 | break; |
1310 | } |
1311 | case FACTORY_SAVECOLORTEMP_ROFFSET: { |
1312 | int source_type = p.readInt32(); |
1313 | int colortemp_mode = p.readInt32(); |
1314 | int roffset = p.readInt32(); |
1315 | int ret = mpTv->Tv_FactorySaveColorTemp_Roffset(source_type, colortemp_mode, roffset); |
1316 | r->writeInt32(ret); |
1317 | break; |
1318 | } |
1319 | case FACTORY_GETCOLORTEMP_ROFFSET: { |
1320 | int source_type = p.readInt32(); |
1321 | int colortemp_mode = p.readInt32(); |
1322 | int ret = mpTv->Tv_FactoryGetColorTemp_Roffset(source_type, colortemp_mode); |
1323 | r->writeInt32(ret); |
1324 | break; |
1325 | } |
1326 | case FACTORY_SETCOLORTEMP_GOFFSET: { |
1327 | int source_type = p.readInt32(); |
1328 | int colortemp_mode = p.readInt32(); |
1329 | int goffset = p.readInt32(); |
1330 | int ret = mpTv->Tv_FactorySetColorTemp_Goffset(source_type, colortemp_mode, goffset); |
1331 | r->writeInt32(ret); |
1332 | break; |
1333 | } |
1334 | case FACTORY_SAVECOLORTEMP_GOFFSET: { |
1335 | int source_type = p.readInt32(); |
1336 | int colortemp_mode = p.readInt32(); |
1337 | int goffset = p.readInt32(); |
1338 | int ret = mpTv->Tv_FactorySaveColorTemp_Goffset(source_type, colortemp_mode, goffset); |
1339 | r->writeInt32(ret); |
1340 | break; |
1341 | } |
1342 | case FACTORY_GETCOLORTEMP_GOFFSET: { |
1343 | int source_type = p.readInt32(); |
1344 | int colortemp_mode = p.readInt32(); |
1345 | int ret = mpTv->Tv_FactoryGetColorTemp_Goffset(source_type, colortemp_mode); |
1346 | r->writeInt32(ret); |
1347 | break; |
1348 | } |
1349 | case FACTORY_SETCOLORTEMP_BOFFSET: { |
1350 | int source_type = p.readInt32(); |
1351 | int colortemp_mode = p.readInt32(); |
1352 | int boffset = p.readInt32(); |
1353 | int ret = mpTv->Tv_FactorySetColorTemp_Boffset(source_type, colortemp_mode, boffset); |
1354 | r->writeInt32(ret); |
1355 | break; |
1356 | } |
1357 | case FACTORY_SAVECOLORTEMP_BOFFSET: { |
1358 | int source_type = p.readInt32(); |
1359 | int colortemp_mode = p.readInt32(); |
1360 | int boffset = p.readInt32(); |
1361 | int ret = mpTv->Tv_FactorySaveColorTemp_Boffset(source_type, colortemp_mode, boffset); |
1362 | r->writeInt32(ret); |
1363 | break; |
1364 | } |
1365 | case FACTORY_GETCOLORTEMP_BOFFSET: { |
1366 | int source_type = p.readInt32(); |
1367 | int colortemp_mode = p.readInt32(); |
1368 | int ret = mpTv->Tv_FactoryGetColorTemp_Boffset(source_type, colortemp_mode); |
1369 | r->writeInt32(ret); |
1370 | break; |
1371 | } |
1372 | case FACTORY_SETTESTPATTERN: { |
1373 | int pattern = p.readInt32(); |
1374 | int ret = mpTv->Tv_FactorySetTestPattern(pattern); |
1375 | r->writeInt32(ret); |
1376 | break; |
1377 | } |
1378 | case FACTORY_GETTESTPATTERN: { |
1379 | int ret = mpTv->Tv_FactoryGetTestPattern(); |
1380 | r->writeInt32(ret); |
1381 | break; |
1382 | } |
1383 | case FACTORY_RESETPQMODE: { |
1384 | int ret = mpTv->Tv_FactoryResetPQMode(); |
1385 | r->writeInt32(ret); |
1386 | break; |
1387 | } |
1388 | case FACTORY_RESETCOLORTEMP: { |
1389 | int ret = mpTv->Tv_FactoryResetColorTemp(); |
1390 | r->writeInt32(ret); |
1391 | break; |
1392 | } |
1393 | case FACTORY_RESETPAMAMSDEFAULT: { |
1394 | int ret = mpTv->Tv_FactorySetParamsDefault(); |
1395 | r->writeInt32(ret); |
1396 | break; |
1397 | } |
1398 | case FACTORY_SETDDRSSC: { |
1399 | int setp = p.readInt32(); |
1400 | int ret = mpTv->Tv_FactorySetDDRSSC(setp); |
1401 | r->writeInt32(ret); |
1402 | break; |
1403 | } |
1404 | case FACTORY_GETDDRSSC: { |
1405 | int ret = mpTv->Tv_FactoryGetDDRSSC(); |
1406 | r->writeInt32(ret); |
1407 | break; |
1408 | } |
1409 | case FACTORY_SETLVDSSSC: { |
1410 | int setp = p.readInt32(); |
1411 | int ret = mpTv->Tv_FactorySetLVDSSSC(setp); |
1412 | r->writeInt32(ret); |
1413 | break; |
1414 | } |
1415 | case FACTORY_GETLVDSSSC: { |
1416 | int ret = mpTv->Tv_FactoryGetLVDSSSC(); |
1417 | r->writeInt32(ret); |
1418 | break; |
1419 | } |
1420 | case FACTORY_SETNOLINEPARAMS: { |
1421 | noline_params_t params; |
1422 | int noline_params_type = p.readInt32(); |
1423 | int source_type = p.readInt32(); |
1424 | params.osd0 = p.readInt32(); |
1425 | params.osd25 = p.readInt32(); |
1426 | params.osd50 = p.readInt32(); |
1427 | params.osd75 = p.readInt32(); |
1428 | params.osd100 = p.readInt32(); |
1429 | int ret = mpTv->Tv_FactorySetNolineParams(noline_params_type, source_type, params); |
1430 | r->writeInt32(ret); |
1431 | break; |
1432 | } |
1433 | case FACTORY_GETNOLINEPARAMS: { |
1434 | int noline_params_type = p.readInt32(); |
1435 | int source_type = p.readInt32(); |
1436 | noline_params_t params = mpTv->Tv_FactoryGetNolineParams(noline_params_type, source_type); |
1437 | r->writeInt32(params.osd0); |
1438 | r->writeInt32(params.osd25); |
1439 | r->writeInt32(params.osd50); |
1440 | r->writeInt32(params.osd75); |
1441 | r->writeInt32(params.osd100); |
1442 | break; |
1443 | } |
1444 | case FACTORY_SETOVERSCAN: { |
1445 | tvin_cutwin_t cutwin_t; |
1446 | int source_type = p.readInt32(); |
1447 | int fmt = p.readInt32(); |
1448 | int status_3d = p.readInt32(); |
1449 | int trans_fmt = p.readInt32(); |
1450 | cutwin_t.hs = p.readInt32(); |
1451 | cutwin_t.he = p.readInt32(); |
1452 | cutwin_t.vs = p.readInt32(); |
1453 | cutwin_t.ve = p.readInt32(); |
1454 | int ret = mpTv->Tv_FactorySetOverscan(source_type, fmt, status_3d, trans_fmt, cutwin_t); |
1455 | r->writeInt32(ret); |
1456 | break; |
1457 | } |
1458 | case FACTORY_GETOVERSCAN: { |
1459 | int source_type = p.readInt32(); |
1460 | int fmt = p.readInt32(); |
1461 | int status_3d = p.readInt32(); |
1462 | int trans_fmt = p.readInt32(); |
1463 | tvin_cutwin_t cutwin_t = mpTv->Tv_FactoryGetOverscan(source_type, fmt, status_3d, trans_fmt); |
1464 | r->writeInt32(cutwin_t.hs); |
1465 | r->writeInt32(cutwin_t.he); |
1466 | r->writeInt32(cutwin_t.vs); |
1467 | r->writeInt32(cutwin_t.ve); |
1468 | break; |
1469 | } |
1470 | case FACTORY_SET_OUT_DEFAULT: { |
1471 | int ret = 0; |
1472 | ret = mpTv->Tv_SSMFacRestoreDefaultSetting(); |
1473 | r->writeInt32(ret); |
1474 | break; |
1475 | } |
1476 | case FACTORY_GETGLOBALOGO_RGAIN: { |
1477 | int ret = 0; |
1478 | r->writeInt32(ret); |
1479 | break; |
1480 | } |
1481 | case FACTORY_GETGLOBALOGO_GGAIN: { |
1482 | int ret = 0; |
1483 | r->writeInt32(ret); |
1484 | break; |
1485 | } |
1486 | case FACTORY_GETGLOBALOGO_BGAIN: { |
1487 | int ret = 0; |
1488 | r->writeInt32(ret); |
1489 | break; |
1490 | } |
1491 | case FACTORY_GETGLOBALOGO_ROFFSET: { |
1492 | int ret = 0; |
1493 | r->writeInt32(ret); |
1494 | break; |
1495 | } |
1496 | case FACTORY_GETGLOBALOGO_GOFFSET: { |
1497 | int ret = 0; |
1498 | r->writeInt32(ret); |
1499 | break; |
1500 | } |
1501 | case FACTORY_GETGLOBALOGO_BOFFSET: { |
1502 | int ret = 0; |
1503 | r->writeInt32(ret); |
1504 | break; |
1505 | } |
1506 | case FACTORY_SETGLOBALOGO_RGAIN: { |
1507 | int ret = 0; |
1508 | r->writeInt32(ret); |
1509 | break; |
1510 | } |
1511 | case FACTORY_SETGLOBALOGO_GGAIN: { |
1512 | int p1 = p.readInt32(); |
1513 | int ret = 0; |
1514 | r->writeInt32(ret); |
1515 | break; |
1516 | } |
1517 | case FACTORY_SETGLOBALOGO_BGAIN: { |
1518 | int p1 = p.readInt32(); |
1519 | int ret = 0; |
1520 | r->writeInt32(ret); |
1521 | break; |
1522 | } |
1523 | case FACTORY_SETGLOBALOGO_ROFFSET: { |
1524 | int p1 = p.readInt32(); |
1525 | int ret = 0; |
1526 | r->writeInt32(ret); |
1527 | break; |
1528 | } |
1529 | case FACTORY_SETGLOBALOGO_GOFFSET: { |
1530 | int p1 = p.readInt32(); |
1531 | int ret = 0; |
1532 | r->writeInt32(ret); |
1533 | break; |
1534 | } |
1535 | case FACTORY_SETGLOBALOGO_BOFFSET: { |
1536 | int p1 = p.readInt32(); |
1537 | int ret = 0; |
1538 | r->writeInt32(ret); |
1539 | break; |
1540 | } |
1541 | case FACTORY_CLEAN_ALL_TABLE_FOR_PROGRAM: { |
1542 | int ret = mpTv->ClearAnalogFrontEnd(); |
1543 | mpTv->clearDbAllProgramInfoTable(); |
1544 | r->writeInt32(ret); |
1545 | break; |
1546 | } |
1547 | case FACTORY_SETBACKLIGHT_PWM_FREQUENCY: { |
1548 | int value = p.readInt32(); |
1549 | int ret = 0;//mpTv->GetVpp().Tv_FactorySetBacklightPWM_Frequency(value); |
1550 | r->writeInt32(ret); |
1551 | break; |
1552 | } |
1553 | case FACTORY_GETBACKLIGHT_PWM_FREQUENCY: { |
1554 | int ret = 0;//mpTv->GetVpp().Tv_FactoryGetBacklightPWM_Frequency(); |
1555 | r->writeInt32(ret); |
1556 | break; |
1557 | } |
1558 | case FACTORY_SETBACKLIGHT_SWITCH_STATUS: { |
1559 | int value = p.readInt32(); |
1560 | int ret = 0;//mpTv->GetVpp().Tv_FactorySetBacklight_Switch_status(value); |
1561 | r->writeInt32(ret); |
1562 | break; |
1563 | } |
1564 | case FACTORY_GETBACKLIGHT_SWITCH_STATUS: { |
1565 | int ret = 0;//mpTv->GetVpp().Tv_FactoryGetBacklight_Switch_status(); |
1566 | r->writeInt32(ret); |
1567 | break; |
1568 | } |
1569 | case FACTORY_SETBACKLIGHT_PWM_DUTY: { |
1570 | int value = p.readInt32(); |
1571 | int ret = 0;//mpTv->GetVpp().Tv_FactorySetBacklightPWM_Duty(value); |
1572 | r->writeInt32(ret); |
1573 | break; |
1574 | } |
1575 | case FACTORY_GETBACKLIGHT_PWM_DUTY: { |
1576 | int ret = 0;//mpTv->GetVpp().Tv_FactoryGetBacklightPWM_Duty(); |
1577 | r->writeInt32(ret); |
1578 | break; |
1579 | } |
1580 | |
1581 | case FACTORY_SETLVDS_COLOR_DEPTH: { |
1582 | int value = p.readInt32(); |
1583 | int ret = 0;//mpTv->GetVpp().Tv_FactorySetLVDS_ColorDepth(value); |
1584 | r->writeInt32(ret); |
1585 | break; |
1586 | } |
1587 | case FACTORY_GETLVDS_COLOR_DEPTH: { |
1588 | int ret = 0;//mpTv->GetVpp().Tv_FactoryGetLVDS_ColorDepth(); |
1589 | r->writeInt32(ret); |
1590 | break; |
1591 | } |
1592 | case FACTORY_SETLVDS_DITHER_STATUS: { |
1593 | int value = p.readInt32(); |
1594 | int ret = 0;//mpTv->GetVpp().Tv_FactorySetLVDS_ColorDither_status(value); |
1595 | r->writeInt32(ret); |
1596 | break; |
1597 | } |
1598 | case FACTORY_GETLVDS_DITHER_STATUS: { |
1599 | int ret = 0;//mpTv->GetVpp().Tv_FactoryGetLVDS_ColorDither_status(); |
1600 | r->writeInt32(ret); |
1601 | break; |
1602 | } |
1603 | case FACTORY_SETLVDS_MAPPING_STATUS: { |
1604 | int value = p.readInt32(); |
1605 | int ret = 0;//mpTv->GetVpp().Tv_FactorySetLVDS_Mapping_status(value); |
1606 | r->writeInt32(ret); |
1607 | break; |
1608 | } |
1609 | case FACTORY_GETLVDS_MAPPING_STATUS: { |
1610 | int ret = 0;//mpTv->GetVpp().Tv_FactoryGetLVDS_Mapping_status(); |
1611 | r->writeInt32(ret); |
1612 | break; |
1613 | } |
1614 | case FACTORY_SETLVDS_PORT_SWAP_STATUS: { |
1615 | int value = p.readInt32(); |
1616 | int ret = 0;//mpTv->GetVpp().Tv_FactorySetLVDS_PortSwap_status(value); |
1617 | r->writeInt32(ret); |
1618 | break; |
1619 | } |
1620 | case FACTORY_GETLVDS_PORT_SWAP_STATUS: { |
1621 | int ret = 0;//mpTv->GetVpp().Tv_FactoryGetLVDS_PortSwap_status(); |
1622 | r->writeInt32(ret); |
1623 | break; |
1624 | } |
1625 | // FACTORY END |
1626 | |
1627 | // AUDIO |
1628 | // AUDIO MUTE |
1629 | case SET_AUDIO_MUTEKEY_STATUS: { |
1630 | int status = p.readInt32(); |
1631 | int ret = mpTv->SetAudioMuteForSystem(status); |
1632 | r->writeInt32(ret); |
1633 | break; |
1634 | } |
1635 | case GET_AUDIO_MUTEKEY_STATUS: { |
1636 | int ret = mpTv->GetAudioMuteForSystem(); |
1637 | r->writeInt32(ret); |
1638 | break; |
1639 | } |
1640 | case SET_AUDIO_FORCE_MUTE_STATUS: { |
1641 | int status = p.readInt32(); |
1642 | int ret = 0;//pTv->getTvAudio().AudioSetForceMuteStatus(status); |
1643 | r->writeInt32(ret); |
1644 | break; |
1645 | } |
1646 | case GET_AUDIO_FORCE_MUTE_STATUS: { |
1647 | int ret = 0;//mpTv->AudioGetForceMuteStatus(); |
1648 | r->writeInt32(ret); |
1649 | break; |
1650 | } |
1651 | case SET_AUDIO_AVOUT_MUTE_STATUS: { |
1652 | int status = p.readInt32(); |
1653 | int ret = mpTv->SetAudioAVOutMute(status); |
1654 | r->writeInt32(ret); |
1655 | break; |
1656 | } |
1657 | case GET_AUDIO_AVOUT_MUTE_STATUS: { |
1658 | int ret = mpTv->GetAudioAVOutMute(); |
1659 | r->writeInt32(ret); |
1660 | break; |
1661 | } |
1662 | case SET_AUDIO_SPDIF_MUTE_STATUS: { |
1663 | int status = p.readInt32(); |
1664 | int ret = mpTv->SetAudioSPDIFMute(status); |
1665 | r->writeInt32(ret); |
1666 | break; |
1667 | } |
1668 | case GET_AUDIO_SPDIF_MUTE_STATUS: { |
1669 | int ret = mpTv->GetAudioSPDIFMute(); |
1670 | r->writeInt32(ret); |
1671 | break; |
1672 | } |
1673 | // AUDIO MASTER VOLUME |
1674 | case SET_AUDIO_MASTER_VOLUME: { |
1675 | int vol = p.readInt32(); |
1676 | int ret = mpTv->SetAudioMasterVolume(vol); |
1677 | r->writeInt32(ret); |
1678 | break; |
1679 | } |
1680 | case GET_AUDIO_MASTER_VOLUME: { |
1681 | int ret = mpTv->GetAudioMasterVolume(); |
1682 | r->writeInt32(ret); |
1683 | break; |
1684 | } |
1685 | case SAVE_CUR_AUDIO_MASTER_VOLUME: { |
1686 | int vol = p.readInt32(); |
1687 | int ret = mpTv->SaveCurAudioMasterVolume(vol); |
1688 | r->writeInt32(ret); |
1689 | break; |
1690 | } |
1691 | case GET_CUR_AUDIO_MASTER_VOLUME: { |
1692 | int ret = mpTv->GetCurAudioMasterVolume(); |
1693 | r->writeInt32(ret); |
1694 | break; |
1695 | } |
1696 | //AUDIO BALANCE |
1697 | case SET_AUDIO_BALANCE: { |
1698 | int vol = p.readInt32(); |
1699 | int ret = mpTv->SetAudioBalance(vol); |
1700 | r->writeInt32(ret); |
1701 | break; |
1702 | } |
1703 | case GET_AUDIO_BALANCE: { |
1704 | int ret = mpTv->GetAudioBalance(); |
1705 | r->writeInt32(ret); |
1706 | break; |
1707 | } |
1708 | case SAVE_CUR_AUDIO_BALANCE: { |
1709 | int vol = p.readInt32(); |
1710 | int ret = mpTv->SaveCurAudioBalance(vol); |
1711 | r->writeInt32(ret); |
1712 | break; |
1713 | } |
1714 | case GET_CUR_AUDIO_BALANCE: { |
1715 | int ret = mpTv->GetCurAudioBalance(); |
1716 | r->writeInt32(ret); |
1717 | break; |
1718 | } |
1719 | //AUDIO SUPPERBASS VOLUME |
1720 | case SET_AUDIO_SUPPER_BASS_VOLUME: { |
1721 | int vol = p.readInt32(); |
1722 | int ret = mpTv->SetAudioSupperBassVolume(vol); |
1723 | r->writeInt32(ret); |
1724 | break; |
1725 | } |
1726 | case GET_AUDIO_SUPPER_BASS_VOLUME: { |
1727 | int ret = mpTv->GetAudioSupperBassVolume(); |
1728 | r->writeInt32(ret); |
1729 | break; |
1730 | } |
1731 | case SAVE_CUR_AUDIO_SUPPER_BASS_VOLUME: { |
1732 | int vol = p.readInt32(); |
1733 | int ret = mpTv->SaveCurAudioSupperBassVolume(vol); |
1734 | r->writeInt32(ret); |
1735 | break; |
1736 | } |
1737 | case GET_CUR_AUDIO_SUPPER_BASS_VOLUME: { |
1738 | int ret = mpTv->GetCurAudioSupperBassVolume(); |
1739 | r->writeInt32(ret); |
1740 | break; |
1741 | } |
1742 | //AUDIO SUPPERBASS SWITCH |
1743 | case SET_AUDIO_SUPPER_BASS_SWITCH: { |
1744 | int vol = p.readInt32(); |
1745 | int ret = mpTv->SetAudioSupperBassSwitch(vol); |
1746 | r->writeInt32(ret); |
1747 | break; |
1748 | } |
1749 | case GET_AUDIO_SUPPER_BASS_SWITCH: { |
1750 | int ret = mpTv->GetAudioSupperBassSwitch(); |
1751 | r->writeInt32(ret); |
1752 | break; |
1753 | } |
1754 | case SAVE_CUR_AUDIO_SUPPER_BASS_SWITCH: { |
1755 | int vol = p.readInt32(); |
1756 | int ret = mpTv->SaveCurAudioSupperBassSwitch(vol); |
1757 | r->writeInt32(ret); |
1758 | break; |
1759 | } |
1760 | case GET_CUR_AUDIO_SUPPER_BASS_SWITCH: { |
1761 | int ret = mpTv->GetCurAudioSupperBassSwitch(); |
1762 | r->writeInt32(ret); |
1763 | break; |
1764 | } |
1765 | //AUDIO SRS SURROUND SWITCH |
1766 | case SET_AUDIO_SRS_SURROUND: { |
1767 | int vol = p.readInt32(); |
1768 | int ret = mpTv->SetAudioSRSSurround(vol); |
1769 | mpTv->RefreshAudioMasterVolume(SOURCE_MAX); |
1770 | r->writeInt32(ret); |
1771 | break; |
1772 | } |
1773 | case GET_AUDIO_SRS_SURROUND: { |
1774 | int ret = mpTv->GetAudioSRSSurround(); |
1775 | r->writeInt32(ret); |
1776 | break; |
1777 | } |
1778 | case SAVE_CUR_AUDIO_SRS_SURROUND: { |
1779 | int vol = p.readInt32(); |
1780 | int ret = mpTv->SaveCurAudioSrsSurround(vol); |
1781 | r->writeInt32(ret); |
1782 | break; |
1783 | } |
1784 | case GET_CUR_AUDIO_SRS_SURROUND: { |
1785 | int ret = mpTv->GetCurAudioSRSSurround(); |
1786 | r->writeInt32(ret); |
1787 | break; |
1788 | } |
1789 | //AUDIO SRS DIALOG CLARITY |
1790 | case SET_AUDIO_SRS_DIALOG_CLARITY: { |
1791 | int vol = p.readInt32(); |
1792 | int ret = mpTv->SetAudioSrsDialogClarity(vol); |
1793 | mpTv->RefreshAudioMasterVolume(SOURCE_MAX); |
1794 | r->writeInt32(ret); |
1795 | break; |
1796 | } |
1797 | case GET_AUDIO_SRS_DIALOG_CLARITY: { |
1798 | int ret = mpTv->GetAudioSrsDialogClarity(); |
1799 | r->writeInt32(ret); |
1800 | break; |
1801 | } |
1802 | case SAVE_CUR_AUDIO_SRS_DIALOG_CLARITY: { |
1803 | int vol = p.readInt32(); |
1804 | int ret = mpTv->SaveCurAudioSrsDialogClarity(vol); |
1805 | r->writeInt32(ret); |
1806 | break; |
1807 | } |
1808 | case GET_CUR_AUDIO_SRS_DIALOG_CLARITY: { |
1809 | int ret = mpTv->GetCurAudioSrsDialogClarity(); |
1810 | r->writeInt32(ret); |
1811 | break; |
1812 | } |
1813 | //AUDIO SRS TRUBASS |
1814 | case SET_AUDIO_SRS_TRU_BASS: { |
1815 | int vol = p.readInt32(); |
1816 | int ret = mpTv->SetAudioSrsTruBass(vol); |
1817 | mpTv->RefreshAudioMasterVolume(SOURCE_MAX); |
1818 | r->writeInt32(ret); |
1819 | break; |
1820 | } |
1821 | case GET_AUDIO_SRS_TRU_BASS: { |
1822 | int ret = mpTv->GetAudioSrsTruBass(); |
1823 | r->writeInt32(ret); |
1824 | break; |
1825 | } |
1826 | case SAVE_CUR_AUDIO_SRS_TRU_BASS: { |
1827 | int vol = p.readInt32(); |
1828 | int ret = mpTv->SaveCurAudioSrsTruBass(vol); |
1829 | r->writeInt32(ret); |
1830 | break; |
1831 | } |
1832 | case GET_CUR_AUDIO_SRS_TRU_BASS: { |
1833 | int ret = mpTv->GetCurAudioSrsTruBass(); |
1834 | r->writeInt32(ret); |
1835 | break; |
1836 | } |
1837 | //AUDIO BASS |
1838 | case SET_AUDIO_BASS_VOLUME: { |
1839 | int vol = p.readInt32(); |
1840 | int ret = mpTv->SetAudioBassVolume(vol); |
1841 | r->writeInt32(ret); |
1842 | break; |
1843 | } |
1844 | case GET_AUDIO_BASS_VOLUME: { |
1845 | int ret = mpTv->GetAudioBassVolume(); |
1846 | r->writeInt32(ret); |
1847 | break; |
1848 | } |
1849 | case SAVE_CUR_AUDIO_BASS_VOLUME: { |
1850 | int vol = p.readInt32(); |
1851 | int ret = mpTv->SaveCurAudioBassVolume(vol); |
1852 | r->writeInt32(ret); |
1853 | break; |
1854 | } |
1855 | case GET_CUR_AUDIO_BASS_VOLUME: { |
1856 | int ret = mpTv->GetCurAudioBassVolume(); |
1857 | r->writeInt32(ret); |
1858 | break; |
1859 | } |
1860 | //AUDIO TREBLE |
1861 | case SET_AUDIO_TREBLE_VOLUME: { |
1862 | int vol = p.readInt32(); |
1863 | int ret = mpTv->SetAudioTrebleVolume(vol); |
1864 | r->writeInt32(ret); |
1865 | break; |
1866 | } |
1867 | case GET_AUDIO_TREBLE_VOLUME: { |
1868 | int ret = mpTv->GetAudioTrebleVolume(); |
1869 | r->writeInt32(ret); |
1870 | break; |
1871 | } |
1872 | case SAVE_CUR_AUDIO_TREBLE_VOLUME: { |
1873 | int vol = p.readInt32(); |
1874 | int ret = mpTv->SaveCurAudioTrebleVolume(vol); |
1875 | r->writeInt32(ret); |
1876 | break; |
1877 | } |
1878 | case GET_CUR_AUDIO_TREBLE_VOLUME: { |
1879 | int ret = mpTv->GetCurAudioTrebleVolume(); |
1880 | r->writeInt32(ret); |
1881 | break; |
1882 | } |
1883 | //AUDIO SOUND MODE |
1884 | case SET_AUDIO_SOUND_MODE: { |
1885 | int vol = p.readInt32(); |
1886 | int ret = mpTv->SetAudioSoundMode(vol); |
1887 | r->writeInt32(ret); |
1888 | break; |
1889 | } |
1890 | case GET_AUDIO_SOUND_MODE: { |
1891 | int ret = mpTv->GetAudioSoundMode(); |
1892 | r->writeInt32(ret); |
1893 | break; |
1894 | } |
1895 | case SAVE_CUR_AUDIO_SOUND_MODE: { |
1896 | int vol = p.readInt32(); |
1897 | int ret = mpTv->SaveCurAudioSoundMode(vol); |
1898 | r->writeInt32(ret); |
1899 | break; |
1900 | } |
1901 | case GET_CUR_AUDIO_SOUND_MODE: { |
1902 | int ret = mpTv->GetCurAudioSoundMode(); |
1903 | r->writeInt32(ret); |
1904 | break; |
1905 | } |
1906 | //AUDIO WALL EFFECT |
1907 | case SET_AUDIO_WALL_EFFECT: { |
1908 | int vol = p.readInt32(); |
1909 | int ret = mpTv->SetAudioWallEffect(vol); |
1910 | r->writeInt32(ret); |
1911 | break; |
1912 | } |
1913 | case GET_AUDIO_WALL_EFFECT: { |
1914 | int ret = mpTv->GetAudioWallEffect(); |
1915 | r->writeInt32(ret); |
1916 | break; |
1917 | } |
1918 | case SAVE_CUR_AUDIO_WALL_EFFECT: { |
1919 | int vol = p.readInt32(); |
1920 | int ret = mpTv->SaveCurAudioWallEffect(vol); |
1921 | r->writeInt32(ret); |
1922 | break; |
1923 | } |
1924 | case GET_CUR_AUDIO_WALL_EFFECT: { |
1925 | int ret = mpTv->GetCurAudioWallEffect(); |
1926 | r->writeInt32(ret); |
1927 | break; |
1928 | } |
1929 | //AUDIO EQ MODE |
1930 | case SET_AUDIO_EQ_MODE: { |
1931 | int vol = p.readInt32(); |
1932 | int ret = mpTv->SetAudioEQMode(vol); |
1933 | r->writeInt32(ret); |
1934 | break; |
1935 | } |
1936 | case GET_AUDIO_EQ_MODE: { |
1937 | int ret = mpTv->GetAudioEQMode(); |
1938 | r->writeInt32(ret); |
1939 | break; |
1940 | } |
1941 | case SAVE_CUR_AUDIO_EQ_MODE: { |
1942 | int vol = p.readInt32(); |
1943 | int ret = mpTv->SaveCurAudioEQMode(vol); |
1944 | r->writeInt32(ret); |
1945 | break; |
1946 | } |
1947 | case GET_CUR_AUDIO_EQ_MODE: { |
1948 | int ret = mpTv->GetCurAudioEQMode(); |
1949 | r->writeInt32(ret); |
1950 | break; |
1951 | } |
1952 | //AUDIO EQ GAIN |
1953 | case GET_AUDIO_EQ_RANGE: { |
1954 | int buf[2]; |
1955 | int ret = mpTv->GetAudioEQRange(buf); |
1956 | r->writeInt32(2); |
1957 | r->writeInt32(buf[0]); |
1958 | r->writeInt32(buf[1]); |
1959 | r->writeInt32(ret); |
1960 | break; |
1961 | } |
1962 | case GET_AUDIO_EQ_BAND_COUNT: { |
1963 | int ret = mpTv->GetAudioEQBandCount(); |
1964 | r->writeInt32(ret); |
1965 | break; |
1966 | } |
1967 | case SET_AUDIO_EQ_GAIN: { |
1968 | int i = 0, tmp_buf_size = 0, ret = 0; |
1969 | tmp_buf_size = p.readInt32(); |
1970 | for (i = 0; i < tmp_buf_size; i++) { |
1971 | tmp_i_buf[i] = p.readInt32(); |
1972 | } |
1973 | ret = mpTv->SetAudioEQGain(tmp_i_buf); |
1974 | r->writeInt32(ret); |
1975 | break; |
1976 | } |
1977 | case GET_AUDIO_EQ_GAIN: { |
1978 | int i = 0, tmp_buf_size = 0, ret = 0; |
1979 | ret = mpTv->GetAudioEQGain(tmp_i_buf); |
1980 | tmp_buf_size = mpTv->GetAudioEQBandCount(); |
1981 | r->writeInt32(tmp_buf_size); |
1982 | for (i = 0; i < tmp_buf_size; i++) { |
1983 | r->writeInt32(tmp_i_buf[i]); |
1984 | } |
1985 | r->writeInt32(ret); |
1986 | break; |
1987 | } |
1988 | case SAVE_CUR_AUDIO_EQ_GAIN: { |
1989 | int i = 0, tmp_buf_size = 0, ret = 0; |
1990 | tmp_buf_size = p.readInt32(); |
1991 | for (i = 0; i < tmp_buf_size; i++) { |
1992 | tmp_i_buf[i] = p.readInt32(); |
1993 | } |
1994 | ret = mpTv->SaveCurAudioEQGain(tmp_i_buf); |
1995 | r->writeInt32(ret); |
1996 | break; |
1997 | } |
1998 | case GET_CUR_EQ_GAIN: { |
1999 | int i = 0, tmp_buf_size = 0, ret = 0; |
2000 | ret = mpTv->GetCurAudioEQGain(tmp_i_buf); |
2001 | tmp_buf_size = mpTv->GetAudioEQBandCount(); |
2002 | r->writeInt32(tmp_buf_size); |
2003 | for (i = 0; i < tmp_buf_size; i++) { |
2004 | r->writeInt32(tmp_i_buf[i]); |
2005 | } |
2006 | r->writeInt32(ret); |
2007 | break; |
2008 | } |
2009 | case SET_AUDIO_EQ_SWITCH: { |
2010 | int tmpVal = p.readInt32(); |
2011 | int ret = mpTv->SetAudioEQSwitch(tmpVal); |
2012 | r->writeInt32(ret); |
2013 | break; |
2014 | } |
2015 | // AUDIO SPDIF SWITCH |
2016 | case SET_AUDIO_SPDIF_SWITCH: { |
2017 | int tmp_val = p.readInt32(); |
2018 | int ret = mpTv->SetAudioSPDIFSwitch(tmp_val); |
2019 | r->writeInt32(ret); |
2020 | break; |
2021 | } |
2022 | case GET_AUDIO_SPDIF_SWITCH: { |
2023 | int ret = 0;//mpTv->GetAudioSPDIFSwitch(); |
2024 | r->writeInt32(ret); |
2025 | break; |
2026 | } |
2027 | case AUDIO_SET_DOUBLE_OUTPUT_ENABLE: { |
2028 | int tmp_val = p.readInt32(); |
2029 | int ret = mpTv->amAudioSetDoubleOutputSwitch(tmp_val); |
2030 | r->writeInt32(ret); |
2031 | break; |
2032 | } |
2033 | case USB_AUDIO_OUPUT_MODULE_ENABLE: { |
2034 | int tmp_val = p.readInt32(); |
2035 | int ret = mpTv->UsbAudioOuputModuleSwitch(tmp_val); |
2036 | r->writeInt32(ret); |
2037 | break; |
2038 | } |
2039 | |
2040 | case GET_USB_AUDIO_DOUBLE_OUPUT_MODULE_ENABLE: { |
2041 | int ret = mpTv->GetAmAudioSetDoubleOutputSwitch(); |
2042 | r->writeInt32(ret); |
2043 | break; |
2044 | } |
2045 | |
2046 | case GET_USB_AUDIO_OUPUT_MODULE_ENABLE: { |
2047 | int ret = mpTv->GetCurUsbAudioOuputModuleSwitch(); |
2048 | r->writeInt32(ret); |
2049 | break; |
2050 | } |
2051 | |
2052 | case SAVE_CUR_AUDIO_SPDIF_SWITCH: { |
2053 | int tmp_val = p.readInt32(); |
2054 | int ret = mpTv->SaveCurAudioSPDIFSwitch(tmp_val); |
2055 | r->writeInt32(ret); |
2056 | break; |
2057 | } |
2058 | case GET_CUR_AUDIO_SPDIF_SWITCH: { |
2059 | int ret = mpTv->GetCurAudioSPDIFSwitch(); |
2060 | r->writeInt32(ret); |
2061 | break; |
2062 | } |
2063 | //AUDIO SPDIF MODE |
2064 | case SET_AUDIO_SPDIF_MODE: { |
2065 | int vol = p.readInt32(); |
2066 | int progId = p.readInt32(); |
2067 | int audioTrackId = p.readInt32(); |
2068 | int ret = mpTv->SetAudioSPDIFMode(vol); |
2069 | mpTv->ResetAudioDecoderForPCMOutput(); |
2070 | r->writeInt32(ret); |
2071 | break; |
2072 | } |
2073 | case GET_AUDIO_SPDIF_MODE: { |
2074 | int ret = 0;//mpTv->GetAudioSPDIFMode(); |
2075 | r->writeInt32(ret); |
2076 | break; |
2077 | } |
2078 | case SAVE_CUR_AUDIO_SPDIF_MODE: { |
2079 | int vol = p.readInt32(); |
2080 | int ret = mpTv->SaveCurAudioSPDIFMode(vol); |
2081 | r->writeInt32(ret); |
2082 | break; |
2083 | } |
2084 | case GET_CUR_AUDIO_SPDIF_MODE: { |
2085 | int ret = mpTv->GetCurAudioSPDIFMode(); |
2086 | r->writeInt32(ret); |
2087 | break; |
2088 | } |
2089 | case OPEN_AMAUDIO: { |
2090 | int sr = p.readInt32(); |
2091 | int output_dev = p.readInt32(); |
2092 | int ret = mpTv->OpenAmAudio(sr, output_dev); |
2093 | r->writeInt32(ret); |
2094 | break; |
2095 | } |
2096 | case CLOSE_AMAUDIO: { |
2097 | int ret = mpTv->CloseAmAudio(); |
2098 | r->writeInt32(ret); |
2099 | break; |
2100 | } |
2101 | case SET_AMAUDIO_INPUT_SR: { |
2102 | int sr = p.readInt32(); |
2103 | int output_dev = p.readInt32(); |
2104 | int ret = mpTv->SetAmAudioInputSr(sr, output_dev); |
2105 | r->writeInt32(ret); |
2106 | break; |
2107 | } |
2108 | case SET_AMAUDIO_OUTPUT_MODE: { |
2109 | int tmp_val = p.readInt32(); |
2110 | int ret = mpTv->SetAmAudioOutputMode(tmp_val); |
2111 | r->writeInt32(ret); |
2112 | break; |
2113 | } |
2114 | case SET_AMAUDIO_MUSIC_GAIN: { |
2115 | int tmp_val = p.readInt32(); |
2116 | int ret = mpTv->SetAmAudioMusicGain(tmp_val); |
2117 | r->writeInt32(ret); |
2118 | break; |
2119 | } |
2120 | case SET_AMAUDIO_LEFT_GAIN: { |
2121 | int tmp_val = p.readInt32(); |
2122 | int ret = mpTv->SetAmAudioLeftGain(tmp_val); |
2123 | r->writeInt32(ret); |
2124 | break; |
2125 | } |
2126 | case SET_AMAUDIO_RIGHT_GAIN: { |
2127 | int tmp_val = p.readInt32(); |
2128 | int ret = mpTv->SetAmAudioRightGain(tmp_val); |
2129 | r->writeInt32(ret); |
2130 | break; |
2131 | } |
2132 | case SELECT_LINE_IN_CHANNEL: { |
2133 | int channel = p.readInt32(); |
2134 | int ret = mpTv->AudioLineInSelectChannel(channel); |
2135 | r->writeInt32(ret); |
2136 | LOGD("SELECT_LINE_IN_CHANNEL: channel = %d; ret = %d.\n", channel, ret); |
2137 | break; |
2138 | } |
2139 | case SET_KALAOK_IO_LEVEL: { |
2140 | int level = p.readInt32(); |
2141 | int ret = mpTv->SetKalaokIO(level); |
2142 | r->writeInt32(ret); |
2143 | mpTv->AudioSetAudioInSource(CC_AUDIO_IN_SOURCE_LINEIN); |
2144 | LOGD("SET KALAOK H LEVEL: level = %d; ret = %d.\n", level, ret); |
2145 | break; |
2146 | } |
2147 | |
2148 | case SET_LINE_IN_CAPTURE_VOL: { |
2149 | int l_vol = p.readInt32(); |
2150 | int r_vol = p.readInt32(); |
2151 | int ret = mpTv->AudioSetLineInCaptureVolume(l_vol, r_vol); |
2152 | r->writeInt32(ret); |
2153 | break; |
2154 | } |
2155 | case HANDLE_AUDIO_HEADSET_PLUG_IN: { |
2156 | int ret = mpTv->AudioHandleHeadsetPlugIn(); |
2157 | r->writeInt32(ret); |
2158 | break; |
2159 | } |
2160 | case HANDLE_AUDIO_HEADSET_PULL_OUT: { |
2161 | int ret = mpTv->AudioHandleHeadsetPullOut(); |
2162 | r->writeInt32(ret); |
2163 | break; |
2164 | } |
2165 | case SET_AUDIO_VOL_COMP: { |
2166 | int tmpVal = p.readInt32(); |
2167 | int ret = mpTv->SetCurProgramAudioVolumeCompensationVal(tmpVal); |
2168 | r->writeInt32(ret); |
2169 | break; |
2170 | } |
2171 | case GET_AUDIO_VOL_COMP: { |
2172 | int ret = mpTv->GetAudioVolumeCompensationVal(-1); |
2173 | r->writeInt32(ret); |
2174 | break; |
2175 | } |
2176 | case SAVE_AUDIO_VOL_COMP: { |
2177 | int tmpVal = p.readInt32(); |
2178 | int ret = -1;//mpTv->atvSaveAudioVolumeCompensationVal(tmpVal); |
2179 | LOGD("this cmd is empty!!!!!!!!!!!!!!!!!!!"); |
2180 | r->writeInt32(ret); |
2181 | break; |
2182 | } |
2183 | case SET_NOISE_GATE_THRESHOLD: { |
2184 | int ret = 0; |
2185 | r->writeInt32(ret); |
2186 | break; |
2187 | } |
2188 | case SET_AUDIO_SOURCE_FOR_KARAOKE: { |
2189 | int sourceinput = p.readInt32(); |
2190 | int ret = mpTv->Tv_SetAudioSourceType((tv_source_input_t)sourceinput); |
2191 | r->writeInt32(ret); |
2192 | break; |
2193 | } |
2194 | // AUDIO END |
2195 | |
2196 | // SSM |
2197 | case SSM_INIT_DEVICE: { |
2198 | int tmpRet = 0; |
2199 | tmpRet = mpTv->Tv_SSMRestoreDefaultSetting();//mpTv->Tv_SSMInitDevice(); |
2200 | r->writeInt32(tmpRet); |
2201 | break; |
2202 | } |
2203 | /*case SSM_SAVE_ONE_BYTE: { |
2204 | int tmpOffset = p.readInt32(); |
2205 | int tmpVal = p.readInt32(); |
2206 | int tmpRet; |
2207 | tmpRet = SSMWriteOneByte(tmpOffset, tmpVal); |
2208 | r->writeInt32(tmpRet); |
2209 | break; |
2210 | } |
2211 | case SSM_READ_ONE_BYTE: { |
2212 | int tmpOffset = p.readInt32(); |
2213 | int tmpRet = 0; |
2214 | SSMReadOneByte(tmpOffset, &tmpRet); |
2215 | r->writeInt32(tmpRet); |
2216 | break; |
2217 | } |
2218 | case SSM_SAVE_N_BYTES: { |
2219 | int i = 0, tmp_offset = 0, tmp_data_len = 0, ret = -1; |
2220 | |
2221 | tmp_offset = p.readInt32(); |
2222 | tmp_data_len = p.readInt32(); |
2223 | |
2224 | if (tmp_data_len > 0) { |
2225 | data_ptr = new int[tmp_data_len]; |
2226 | |
2227 | if (data_ptr != NULL) { |
2228 | for (i = 0; i < tmp_data_len; i++) { |
2229 | data_ptr[i] = p.readInt32(); |
2230 | } |
2231 | |
2232 | ret = SSMWriteNTypes(tmp_offset, tmp_data_len, data_ptr); |
2233 | |
2234 | delete data_ptr; |
2235 | data_ptr = NULL; |
2236 | } |
2237 | } |
2238 | |
2239 | r->writeInt32(ret); |
2240 | break; |
2241 | } |
2242 | case SSM_READ_N_BYTES: { |
2243 | int i = 0, tmp_offset = 0, tmp_data_len = 0, ret = -1; |
2244 | tmp_offset = p.readInt32(); |
2245 | tmp_data_len = p.readInt32(); |
2246 | |
2247 | if (tmp_data_len > 0) { |
2248 | data_ptr = new int[tmp_data_len]; |
2249 | if (data_ptr != NULL) { |
2250 | ret = SSMReadNTypes(tmp_offset, tmp_data_len, data_ptr); |
2251 | if (ret < 0) { |
2252 | tmp_data_len = 0; |
2253 | } |
2254 | r->writeInt32(tmp_data_len); |
2255 | for (i = 0; i < tmp_data_len; i++) { |
2256 | r->writeInt32(data_ptr[i]); |
2257 | } |
2258 | delete data_ptr; |
2259 | data_ptr = NULL; |
2260 | } |
2261 | } |
2262 | r->writeInt32(ret); |
2263 | break; |
2264 | }*/ |
2265 | case SSM_SAVE_POWER_ON_OFF_CHANNEL: { |
2266 | int tmpPowerChanNum = p.readInt32(); |
2267 | int tmpRet; |
2268 | tmpRet = SSMSavePowerOnOffChannel(tmpPowerChanNum); |
2269 | r->writeInt32(tmpRet); |
2270 | break; |
2271 | } |
2272 | case SSM_READ_POWER_ON_OFF_CHANNEL: { |
2273 | int tmpRet = 0; |
2274 | tmpRet = SSMReadPowerOnOffChannel(); |
2275 | r->writeInt32(tmpRet); |
2276 | break; |
2277 | } |
2278 | case SSM_SAVE_SOURCE_INPUT: { |
2279 | int tmpSouceInput = p.readInt32(); |
2280 | int tmpRet; |
2281 | tmpRet = SSMSaveSourceInput(tmpSouceInput); |
2282 | r->writeInt32(tmpRet); |
2283 | break; |
2284 | } |
2285 | case SSM_READ_SOURCE_INPUT: { |
2286 | int tmpRet = 0; |
2287 | tmpRet = SSMReadSourceInput(); |
2288 | r->writeInt32(tmpRet); |
2289 | break; |
2290 | } |
2291 | case SSM_SAVE_LAST_SOURCE_INPUT: { |
2292 | int tmpLastSouceInput = p.readInt32(); |
2293 | int tmpRet; |
2294 | tmpRet = SSMSaveLastSelectSourceInput(tmpLastSouceInput); |
2295 | r->writeInt32(tmpRet); |
2296 | break; |
2297 | } |
2298 | case SSM_READ_LAST_SOURCE_INPUT: { |
2299 | int tmpRet = 0; |
2300 | tmpRet = SSMReadLastSelectSourceInput(); |
2301 | r->writeInt32(tmpRet); |
2302 | break; |
2303 | } |
2304 | case SSM_SAVE_SYS_LANGUAGE: { |
2305 | int tmpVal = p.readInt32(); |
2306 | int tmpRet; |
2307 | tmpRet = SSMSaveSystemLanguage(tmpVal); |
2308 | r->writeInt32(tmpRet); |
2309 | break; |
2310 | } |
2311 | case SSM_READ_SYS_LANGUAGE: { |
2312 | int tmpRet = 0; |
2313 | tmpRet = SSMReadSystemLanguage(); |
2314 | r->writeInt32(tmpRet); |
2315 | break; |
2316 | } |
2317 | case SSM_SAVE_AGING_MODE: { |
2318 | int tmpVal = p.readInt32(); |
2319 | int tmpRet; |
2320 | tmpRet = SSMSaveAgingMode(tmpVal); |
2321 | r->writeInt32(tmpRet); |
2322 | break; |
2323 | } |
2324 | case SSM_READ_AGING_MODE: { |
2325 | int tmpRet = 0; |
2326 | tmpRet = SSMReadAgingMode(); |
2327 | r->writeInt32(tmpRet); |
2328 | break; |
2329 | } |
2330 | case SSM_SAVE_PANEL_TYPE: { |
2331 | int tmpVal = p.readInt32(); |
2332 | int tmpRet; |
2333 | tmpRet = SSMSavePanelType(tmpVal); |
2334 | r->writeInt32(tmpRet); |
2335 | break; |
2336 | } |
2337 | case SSM_READ_PANEL_TYPE: { |
2338 | int tmpRet = 0; |
2339 | tmpRet = SSMReadPanelType(); |
2340 | r->writeInt32(tmpRet); |
2341 | break; |
2342 | } |
2343 | case SSM_SAVE_MAC_ADDR: { |
2344 | int i = 0, tmp_buf_size = 0, ret = 0; |
2345 | tmp_buf_size = p.readInt32(); |
2346 | for (i = 0; i < tmp_buf_size; i++) { |
2347 | tmp_uc_buf[i] = p.readInt32(); |
2348 | } |
2349 | ret = KeyData_SaveMacAddress(tmp_uc_buf); |
2350 | r->writeInt32(ret); |
2351 | break; |
2352 | } |
2353 | case SSM_READ_MAC_ADDR: { |
2354 | int i = 0, tmp_buf_size = 0, ret = 0; |
2355 | ret = KeyData_ReadMacAddress(tmp_uc_buf); |
2356 | tmp_buf_size = KeyData_GetMacAddressDataLen(); |
2357 | r->writeInt32(tmp_buf_size); |
2358 | for (i = 0; i < tmp_buf_size; i++) { |
2359 | r->writeInt32(tmp_uc_buf[i]); |
2360 | } |
2361 | r->writeInt32(ret); |
2362 | break; |
2363 | } |
2364 | case SSM_SAVE_BAR_CODE: { |
2365 | int i = 0, tmp_buf_size = 0, ret = 0; |
2366 | tmp_buf_size = p.readInt32(); |
2367 | for (i = 0; i < tmp_buf_size; i++) { |
2368 | tmp_uc_buf[i] = p.readInt32(); |
2369 | } |
2370 | ret = KeyData_SaveBarCode(tmp_uc_buf); |
2371 | r->writeInt32(ret); |
2372 | break; |
2373 | } |
2374 | case SSM_READ_BAR_CODE: { |
2375 | int i = 0, tmp_buf_size = 0, ret = 0; |
2376 | ret = KeyData_ReadBarCode(tmp_uc_buf); |
2377 | tmp_buf_size = KeyData_GetBarCodeDataLen(); |
2378 | r->writeInt32(tmp_buf_size); |
2379 | for (i = 0; i < tmp_buf_size; i++) { |
2380 | r->writeInt32(tmp_uc_buf[i]); |
2381 | } |
2382 | r->writeInt32(ret); |
2383 | break; |
2384 | } |
2385 | case SSM_SAVE_PROJECT_ID: { |
2386 | int tmpVal = p.readInt32(); |
2387 | int tmpRet; |
2388 | tmpRet = KeyData_SaveProjectID(tmpVal); |
2389 | r->writeInt32(tmpRet); |
2390 | break; |
2391 | } |
2392 | case SSM_READ_PROJECT_ID: { |
2393 | int tmpRet = 0; |
2394 | tmpRet = KeyData_ReadProjectID(); |
2395 | r->writeInt32(tmpRet); |
2396 | break; |
2397 | } |
2398 | case SSM_SAVE_HDCPKEY: { |
2399 | int i = 0, tmp_buf_size = 0, ret = 0; |
2400 | tmp_buf_size = p.readInt32(); |
2401 | for (i = 0; i < tmp_buf_size; i++) { |
2402 | tmp_uc_buf[i] = p.readInt32(); |
2403 | } |
2404 | ret = SSMSaveHDCPKey(tmp_uc_buf); |
2405 | r->writeInt32(ret); |
2406 | break; |
2407 | } |
2408 | case SSM_READ_HDCPKEY: { |
2409 | int i = 0, tmp_buf_size = 0, ret = 0; |
2410 | ret = SSMReadHDCPKey(tmp_uc_buf); |
2411 | tmp_buf_size = SSMGetHDCPKeyDataLen(); |
2412 | r->writeInt32(tmp_buf_size); |
2413 | for (i = 0; i < tmp_buf_size; i++) { |
2414 | r->writeInt32(tmp_uc_buf[i]); |
2415 | } |
2416 | r->writeInt32(ret); |
2417 | break; |
2418 | } |
2419 | case SSM_SAVE_POWER_ON_MUSIC_SWITCH: { |
2420 | int tmpVal = p.readInt32(); |
2421 | int tmpRet; |
2422 | tmpRet = SSMSavePowerOnMusicSwitch(tmpVal); |
2423 | r->writeInt32(tmpRet); |
2424 | break; |
2425 | } |
2426 | case SSM_READ_POWER_ON_MUSIC_SWITCH: { |
2427 | int tmpRet = 0; |
2428 | tmpRet = SSMReadPowerOnMusicSwitch(); |
2429 | r->writeInt32(tmpRet); |
2430 | break; |
2431 | } |
2432 | case SSM_SAVE_POWER_ON_MUSIC_VOL: { |
2433 | int tmpVal = p.readInt32(); |
2434 | int tmpRet; |
2435 | tmpRet = SSMSavePowerOnMusicVolume(tmpVal); |
2436 | r->writeInt32(tmpRet); |
2437 | break; |
2438 | } |
2439 | case SSM_READ_POWER_ON_MUSIC_VOL: { |
2440 | int tmpRet = 0; |
2441 | tmpRet = SSMReadPowerOnMusicVolume(); |
2442 | r->writeInt32(tmpRet); |
2443 | break; |
2444 | } |
2445 | case SSM_SAVE_SYS_SLEEP_TIMER: { |
2446 | int tmpVal = p.readInt32(); |
2447 | int tmpRet; |
2448 | tmpRet = SSMSaveSystemSleepTimer(tmpVal); |
2449 | r->writeInt32(tmpRet); |
2450 | break; |
2451 | } |
2452 | case SSM_READ_SYS_SLEEP_TIMER: { |
2453 | int tmpRet = 0; |
2454 | tmpRet = SSMReadSystemSleepTimer(); |
2455 | r->writeInt32(tmpRet); |
2456 | break; |
2457 | } |
2458 | case SSM_SET_BUS_STATUS: { |
2459 | int tmpVal = p.readInt32(); |
2460 | int tmpRet = 0; |
2461 | //showboz |
2462 | //tmpRet = SSMSetBusStatus(tmpVal); |
2463 | r->writeInt32(tmpRet); |
2464 | break; |
2465 | } |
2466 | case SSM_GET_BUS_STATUS: { |
2467 | int tmpRet = 0; |
2468 | //showboz |
2469 | //tmpRet = SSMGetBusStatus(); |
2470 | r->writeInt32(tmpRet); |
2471 | break; |
2472 | } |
2473 | case SSM_SAVE_INPUT_SRC_PARENTAL_CTL: { |
2474 | int tmpSourceIndex = p.readInt32(); |
2475 | int tmpCtlFlag = p.readInt32(); |
2476 | int tmpRet; |
2477 | tmpRet = SSMSaveInputSourceParentalControl(tmpSourceIndex, tmpCtlFlag); |
2478 | r->writeInt32(tmpRet); |
2479 | break; |
2480 | } |
2481 | case SSM_READ_INPUT_SRC_PARENTAL_CTL: { |
2482 | int tmpSourceIndex = p.readInt32(); |
2483 | int tmpRet = 0; |
2484 | tmpRet = SSMReadInputSourceParentalControl(tmpSourceIndex); |
2485 | r->writeInt32(tmpRet); |
2486 | break; |
2487 | } |
2488 | case SSM_SAVE_PARENTAL_CTL_SWITCH: { |
2489 | int tmpSwitchFlag = p.readInt32(); |
2490 | int tmpRet; |
2491 | tmpRet = SSMSaveParentalControlSwitch(tmpSwitchFlag); |
2492 | r->writeInt32(tmpRet); |
2493 | break; |
2494 | } |
2495 | case SSM_READ_PARENTAL_CTL_SWITCH: { |
2496 | int tmpRet = 0; |
2497 | tmpRet = SSMReadParentalControlSwitch(); |
2498 | r->writeInt32(tmpRet); |
2499 | break; |
2500 | } |
2501 | case SSM_SAVE_PARENTAL_CTL_PASS_WORD: { |
2502 | String16 pass_wd_str = p.readString16(); |
2503 | int tmpRet; |
2504 | tmpRet = SSMSaveParentalControlPassWord((unsigned char *)pass_wd_str.string(), pass_wd_str.size() * sizeof(unsigned short)); |
2505 | r->writeInt32(tmpRet); |
2506 | break; |
2507 | } |
2508 | case SSM_READ_PARENTAL_CTL_PASS_WORD: { |
2509 | int tmpChanID = p.readInt32(); |
2510 | unsigned short tmp_buf [SSM_RW_PARENTAL_CTL_PASSWORD_LEN + 1]; |
2511 | String16 pass_wd_str; |
2512 | SSMReadParentalControlPassWord(tmp_buf); |
2513 | tmp_buf[SSM_RW_PARENTAL_CTL_PASSWORD_LEN / sizeof(unsigned short)] = 0; |
2514 | pass_wd_str.setTo((const unsigned short *) tmp_buf); |
2515 | r->writeString16(pass_wd_str); |
2516 | break; |
2517 | } |
2518 | case SSM_SAVE_USING_DEF_HDCP_KEY_FLAG: { |
2519 | break; |
2520 | } |
2521 | case SSM_READ_USING_DEF_HDCP_KEY_FLAG: { |
2522 | break; |
2523 | } |
2524 | case SSM_GET_CUSTOMER_DATA_START: { |
2525 | int tmpRet = 0; |
2526 | tmpRet = SSMGetCustomerDataStart(); |
2527 | r->writeInt32(tmpRet); |
2528 | break; |
2529 | } |
2530 | case SSM_GET_CUSTOMER_DATA_LEN: { |
2531 | int tmpRet = 0; |
2532 | tmpRet = SSMGetCustomerDataLen(); |
2533 | r->writeInt32(tmpRet); |
2534 | break; |
2535 | } |
2536 | case SSM_SAVE_STANDBY_MODE: { |
2537 | int tmp_val = p.readInt32(); |
2538 | int tmpRet; |
2539 | tmpRet = SSMSaveStandbyMode(tmp_val); |
2540 | r->writeInt32(tmpRet); |
2541 | break; |
2542 | } |
2543 | case SSM_READ_STANDBY_MODE: { |
2544 | int tmpRet = 0; |
2545 | tmpRet = SSMReadStandbyMode(); |
2546 | r->writeInt32(tmpRet); |
2547 | break; |
2548 | } |
2549 | case SSM_SAVE_LOGO_ON_OFF_FLAG: { |
2550 | int tmpSwitchFlag = p.readInt32(); |
2551 | int tmpRet; |
2552 | tmpRet = SSMSaveLogoOnOffFlag(tmpSwitchFlag); |
2553 | r->writeInt32(tmpRet); |
2554 | break; |
2555 | } |
2556 | case SSM_READ_LOGO_ON_OFF_FLAG: { |
2557 | int tmpRet = 0; |
2558 | tmpRet = SSMReadLogoOnOffFlag(); |
2559 | r->writeInt32(tmpRet); |
2560 | break; |
2561 | } |
2562 | case SSM_SAVE_HDMIEQ_MODE: { |
2563 | int tmpSwitchFlag = p.readInt32(); |
2564 | int tmpRet; |
2565 | tmpRet = SSMSaveHDMIEQMode(tmpSwitchFlag); |
2566 | r->writeInt32(tmpRet); |
2567 | break; |
2568 | } |
2569 | case SSM_READ_HDMIEQ_MODE: { |
2570 | int tmpRet = 0; |
2571 | tmpRet = SSMReadHDMIEQMode(); |
2572 | r->writeInt32(tmpRet); |
2573 | break; |
2574 | } |
2575 | case SSM_SAVE_HDMIINTERNAL_MODE: { |
2576 | int tmp_val = p.readInt32(); |
2577 | int tmpRet; |
2578 | tmpRet = SSMSaveHDMIInternalMode(tmp_val); |
2579 | r->writeInt32(tmpRet); |
2580 | break; |
2581 | } |
2582 | case SSM_READ_HDMIINTERNAL_MODE: { |
2583 | int tmpRet = 0; |
2584 | tmpRet = SSMReadHDMIInternalMode(); |
2585 | r->writeInt32(tmpRet); |
2586 | break; |
2587 | } |
2588 | case SSM_SAVE_DISABLE_3D: { |
2589 | int tmp_val = p.readInt32(); |
2590 | int tmpRet; |
2591 | tmpRet = SSMSaveDisable3D(tmp_val); |
2592 | r->writeInt32(tmpRet); |
2593 | break; |
2594 | } |
2595 | case SSM_READ_DISABLE_3D: { |
2596 | int tmpRet = 0; |
2597 | tmpRet = SSMReadDisable3D(); |
2598 | r->writeInt32(tmpRet); |
2599 | break; |
2600 | } |
2601 | case SSM_SAVE_GLOBAL_OGOENABLE: { |
2602 | int tmp_val = p.readInt32(); |
2603 | int tmpRet; |
2604 | tmpRet = SSMSaveGlobalOgoEnable(tmp_val); |
2605 | r->writeInt32(tmpRet); |
2606 | break; |
2607 | } |
2608 | case SSM_READ_GLOBAL_OGOENABLE: { |
2609 | int tmpRet = 0; |
2610 | tmpRet = SSMReadGlobalOgoEnable(); |
2611 | r->writeInt32(tmpRet); |
2612 | break; |
2613 | } |
2614 | case SSM_SAVE_NON_STANDARD_STATUS: { |
2615 | int tmp_val = p.readInt32(); |
2616 | int tmpRet; |
2617 | tmpRet = SSMSaveNonStandardValue(tmp_val); |
2618 | r->writeInt32(tmpRet); |
2619 | break; |
2620 | } |
2621 | case SSM_READ_NON_STANDARD_STATUS: { |
2622 | int tmpRet = 0; |
2623 | tmpRet = SSMReadNonStandardValue(); |
2624 | r->writeInt32(tmpRet); |
2625 | break; |
2626 | } |
2627 | case SSM_SAVE_ADB_SWITCH_STATUS: { |
2628 | int tmp_val = p.readInt32(); |
2629 | int tmpRet; |
2630 | tmpRet = SSMSaveAdbSwitchValue(tmp_val); |
2631 | r->writeInt32(tmpRet); |
2632 | break; |
2633 | } |
2634 | case SSM_READ_ADB_SWITCH_STATUS: { |
2635 | int tmpRet = 0; |
2636 | tmpRet = SSMReadAdbSwitchValue(); |
2637 | r->writeInt32(tmpRet); |
2638 | break; |
2639 | } |
2640 | case SSM_SAVE_SERIAL_CMD_SWITCH_STATUS: { |
2641 | int tmp_val = p.readInt32(); |
2642 | int tmpRet; |
2643 | tmpRet = SSMSaveSerialCMDSwitchValue(tmp_val); |
2644 | tmpRet |= mpTv->SetSerialSwitch(SERIAL_A, tmp_val); |
2645 | r->writeInt32(tmpRet); |
2646 | break; |
2647 | } |
2648 | case SSM_READ_SERIAL_CMD_SWITCH_STATUS: { |
2649 | int tmpRet = 0; |
2650 | tmpRet = SSMReadSerialCMDSwitchValue(); |
2651 | r->writeInt32(tmpRet); |
2652 | break; |
2653 | } |
2654 | case SSM_SET_HDCP_KEY: { |
2655 | int tmpRet = 0; |
2656 | tmpRet = SSMSetHDCPKey(); |
2657 | r->writeInt32(tmpRet); |
2658 | break; |
2659 | } |
2660 | case SSM_REFRESH_HDCPKEY: { |
2661 | int tmpRet = 0; |
2662 | tmpRet = SSMRefreshHDCPKey(); |
2663 | r->writeInt32(tmpRet); |
2664 | break; |
2665 | } |
2666 | case SSM_SAVE_CHROMA_STATUS: { |
2667 | int tmp_val = p.readInt32(); |
2668 | int tmpRet; |
2669 | tmpRet = SSMSaveChromaStatus(tmp_val); |
2670 | r->writeInt32(tmpRet); |
2671 | break; |
2672 | } |
2673 | case SSM_SAVE_CA_BUFFER_SIZE: { |
2674 | int tmp_val = p.readInt32(); |
2675 | int tmpRet; |
2676 | tmpRet = SSMSaveCABufferSizeValue(tmp_val); |
2677 | r->writeInt32(tmpRet); |
2678 | break; |
2679 | } |
2680 | case SSM_READ_CA_BUFFER_SIZE: { |
2681 | int tmpRet = 0; |
2682 | tmpRet = SSMReadCABufferSizeValue(); |
2683 | r->writeInt32(tmpRet); |
2684 | break; |
2685 | } |
2686 | case SSM_GET_ATV_DATA_START: { |
2687 | int tmpRet = 0; |
2688 | tmpRet = SSMGetATVDataStart(); |
2689 | r->writeInt32(tmpRet); |
2690 | break; |
2691 | } |
2692 | case SSM_GET_ATV_DATA_LEN: { |
2693 | int tmpRet = 0; |
2694 | tmpRet = SSMGetATVDataLen(); |
2695 | r->writeInt32(tmpRet); |
2696 | break; |
2697 | } |
2698 | case SSM_GET_VPP_DATA_START: { |
2699 | int tmpRet = 0; |
2700 | tmpRet = SSMGetVPPDataStart(); |
2701 | r->writeInt32(tmpRet); |
2702 | break; |
2703 | } |
2704 | case SSM_GET_VPP_DATA_LEN: { |
2705 | int tmpRet = 0; |
2706 | tmpRet = SSMGetVPPDataLen(); |
2707 | r->writeInt32(tmpRet); |
2708 | break; |
2709 | } |
2710 | case SSM_SAVE_NOISE_GATE_THRESHOLD_STATUS: { |
2711 | int tmp_val = p.readInt32(); |
2712 | int tmpRet; |
2713 | tmpRet = SSMSaveNoiseGateThresholdValue(tmp_val); |
2714 | r->writeInt32(tmpRet); |
2715 | break; |
2716 | } |
2717 | case SSM_READ_NOISE_GATE_THRESHOLD_STATUS: { |
2718 | int tmpRet = 0; |
2719 | tmpRet = SSMReadNoiseGateThresholdValue(); |
2720 | r->writeInt32(tmpRet); |
2721 | break; |
2722 | } |
2723 | case SSM_EEPROM_SAVE_ONE_BYTE_N310_N311: { |
2724 | int tmpOffset = p.readInt32(); |
2725 | int tmpVal = p.readInt32(); |
2726 | int tmpRet; |
2727 | tmpRet = SSMSaveEEP_One_N310_N311(tmpOffset, tmpVal); |
2728 | r->writeInt32(tmpRet); |
2729 | break; |
2730 | } |
2731 | case SSM_EEPROM_READ_ONE_BYTE_N310_N311: { |
2732 | int tmpOffset = p.readInt32(); |
2733 | int tmpRet = 0; |
2734 | tmpRet = SSMReadEEP_One_N310_N311(tmpOffset); |
2735 | r->writeInt32(tmpRet); |
2736 | break; |
2737 | } |
2738 | case SSM_EEPROM_SAVE_N_BYTES_N310_N311: { |
2739 | int i = 0, tmp_offset = 0, tmp_data_len = 0, ret = -1; |
2740 | |
2741 | tmp_offset = p.readInt32(); |
2742 | tmp_data_len = p.readInt32(); |
2743 | |
2744 | if (tmp_data_len > 0) { |
2745 | data_ptr = new int[tmp_data_len]; |
2746 | |
2747 | if (data_ptr != NULL) { |
2748 | for (i = 0; i < tmp_data_len; i++) { |
2749 | data_ptr[i] = p.readInt32(); |
2750 | } |
2751 | |
2752 | ret = SSMSaveEEP_N_N310_N311(tmp_offset, tmp_data_len, data_ptr); |
2753 | |
2754 | delete data_ptr; |
2755 | data_ptr = NULL; |
2756 | } |
2757 | } |
2758 | |
2759 | r->writeInt32(ret); |
2760 | break; |
2761 | } |
2762 | case SSM_EEPROM_READ_N_BYTES_N310_N311: { |
2763 | int i = 0, tmp_offset = 0, tmp_data_len = 0, ret = -1; |
2764 | tmp_offset = p.readInt32(); |
2765 | tmp_data_len = p.readInt32(); |
2766 | |
2767 | if (tmp_data_len > 0) { |
2768 | data_ptr = new int[tmp_data_len]; |
2769 | if (data_ptr != NULL) { |
2770 | ret = SSMReadEEP_N_N310_N311(tmp_offset, tmp_data_len, data_ptr); |
2771 | if (ret < 0) { |
2772 | tmp_data_len = 0; |
2773 | } |
2774 | r->writeInt32(tmp_data_len); |
2775 | for (i = 0; i < tmp_data_len; i++) { |
2776 | r->writeInt32(data_ptr[i]); |
2777 | } |
2778 | delete data_ptr; |
2779 | data_ptr = NULL; |
2780 | } |
2781 | } |
2782 | r->writeInt32(ret); |
2783 | break; |
2784 | } |
2785 | case SSM_FLASH_SAVE_ONE_BYTE_N310_N311: { |
2786 | int tmpOffset = p.readInt32(); |
2787 | int tmpVal = p.readInt32(); |
2788 | int tmpRet; |
2789 | tmpRet = SSMSaveFlash_One_N310_N311(tmpOffset, tmpVal); |
2790 | r->writeInt32(tmpRet); |
2791 | break; |
2792 | } |
2793 | case SSM_FLASH_READ_ONE_BYTE_N310_N311: { |
2794 | int tmpOffset = p.readInt32(); |
2795 | int tmpRet = 0; |
2796 | tmpRet = SSMReadFlash_One_N310_N311(tmpOffset); |
2797 | r->writeInt32(tmpRet); |
2798 | break; |
2799 | } |
2800 | case SSM_FLASH_SAVE_N_BYTES_N310_N311: { |
2801 | int i = 0, tmp_offset = 0, tmp_data_len = 0, ret = -1; |
2802 | |
2803 | tmp_offset = p.readInt32(); |
2804 | tmp_data_len = p.readInt32(); |
2805 | |
2806 | if (tmp_data_len > 0) { |
2807 | data_ptr = new int[tmp_data_len]; |
2808 | |
2809 | if (data_ptr != NULL) { |
2810 | for (i = 0; i < tmp_data_len; i++) { |
2811 | data_ptr[i] = p.readInt32(); |
2812 | } |
2813 | |
2814 | ret = SSMSaveFlash_N_N310_N311(tmp_offset, tmp_data_len, data_ptr); |
2815 | |
2816 | delete data_ptr; |
2817 | data_ptr = NULL; |
2818 | } |
2819 | } |
2820 | |
2821 | r->writeInt32(ret); |
2822 | break; |
2823 | } |
2824 | case SSM_FLASH_READ_N_BYTES_N310_N311: { |
2825 | int i = 0, tmp_offset = 0, tmp_data_len = 0, ret = -1; |
2826 | tmp_offset = p.readInt32(); |
2827 | tmp_data_len = p.readInt32(); |
2828 | |
2829 | if (tmp_data_len > 0) { |
2830 | data_ptr = new int[tmp_data_len]; |
2831 | if (data_ptr != NULL) { |
2832 | ret = SSMReadFlash_N_N310_N311(tmp_offset, tmp_data_len, data_ptr); |
2833 | if (ret < 0) { |
2834 | tmp_data_len = 0; |
2835 | } |
2836 | r->writeInt32(tmp_data_len); |
2837 | for (i = 0; i < tmp_data_len; i++) { |
2838 | r->writeInt32(data_ptr[i]); |
2839 | } |
2840 | delete data_ptr; |
2841 | data_ptr = NULL; |
2842 | } |
2843 | } |
2844 | r->writeInt32(ret); |
2845 | break; |
2846 | } |
2847 | // SSM END |
2848 | |
2849 | //MISC |
2850 | case MISC_PROP_SET: { |
2851 | int tmpRet; |
2852 | String16 tmp_str16; |
2853 | String8 key_str, value_str; |
2854 | |
2855 | tmp_str16 = p.readString16(); |
2856 | key_str = String8(tmp_str16); |
2857 | tmp_str16 = p.readString16(); |
2858 | value_str = String8(tmp_str16); |
2859 | |
2860 | tmpRet = property_set(key_str.string(), value_str.string()); |
2861 | r->writeInt32(tmpRet); |
2862 | break; |
2863 | } |
2864 | case MISC_PROP_GET: { |
2865 | char prop_value[PROPERTY_VALUE_MAX]; |
2866 | String16 tmp_str16; |
2867 | String8 key_str, def_str; |
2868 | |
2869 | tmp_str16 = p.readString16(); |
2870 | key_str = String8(tmp_str16); |
2871 | tmp_str16 = p.readString16(); |
2872 | def_str = String8(tmp_str16); |
2873 | |
2874 | memset(prop_value, '\0', PROPERTY_VALUE_MAX); |
2875 | property_get(key_str.string(), prop_value, def_str.string()); |
2876 | tmp_str16 = String16(prop_value); |
2877 | |
2878 | r->writeString16(tmp_str16); |
2879 | break; |
2880 | } |
2881 | case MISC_CFG_SET: { |
2882 | int tmpRet; |
2883 | String16 tmp_str16; |
2884 | String8 key_str, value_str; |
2885 | |
2886 | tmp_str16 = p.readString16(); |
2887 | key_str = String8(tmp_str16); |
2888 | tmp_str16 = p.readString16(); |
2889 | value_str = String8(tmp_str16); |
2890 | |
2891 | tmpRet = config_set_str("TV", key_str.string(), value_str.string()); |
2892 | r->writeInt32(tmpRet); |
2893 | break; |
2894 | } |
2895 | case MISC_CFG_GET: { |
2896 | const char *prop_value; |
2897 | String16 tmp_str16; |
2898 | String8 key_str, def_str; |
2899 | |
2900 | tmp_str16 = p.readString16(); |
2901 | key_str = String8(tmp_str16); |
2902 | tmp_str16 = p.readString16(); |
2903 | def_str = String8(tmp_str16); |
2904 | |
2905 | prop_value = config_get_str("TV", key_str.string(), def_str.string()); |
2906 | tmp_str16 = String16(prop_value); |
2907 | |
2908 | r->writeString16(tmp_str16); |
2909 | break; |
2910 | } |
2911 | case MISC_READ_ADC_VAL: { |
2912 | int tmpChanNum = p.readInt32(); |
2913 | int tmpRet = 0; |
2914 | tmpRet = ReadADCSpecialChannelValue(tmpChanNum); |
2915 | r->writeInt32(tmpRet); |
2916 | break; |
2917 | } |
2918 | case MISC_SET_WDT_USER_PET: { |
2919 | int counter = p.readInt32(); |
2920 | int ret = TvMisc_SetUserCounter(counter); |
2921 | r->writeInt32(ret); |
2922 | break; |
2923 | } |
2924 | case MISC_SET_WDT_USER_COUNTER: { |
2925 | int counter_time_out = p.readInt32(); |
2926 | int ret = TvMisc_SetUserCounterTimeOut(counter_time_out); |
2927 | r->writeInt32(ret); |
2928 | break; |
2929 | } |
2930 | case MISC_SET_WDT_USER_PET_RESET_ENABLE: { |
2931 | int enable = p.readInt32(); |
2932 | int ret = TvMisc_SetUserPetResetEnable(enable); |
2933 | r->writeInt32(ret); |
2934 | break; |
2935 | } |
2936 | case MISC_GET_TV_API_VERSION: { |
2937 | const char *tmp_str8; |
2938 | String16 tmp_str16; |
2939 | |
2940 | // write tvapi version info |
2941 | tmp_str8 = tvservice_get_git_branch_info(); |
2942 | tmp_str16 = String16(tmp_str8); |
2943 | r->writeString16(tmp_str16); |
2944 | |
2945 | tmp_str8 = tvservice_get_git_version_info(); |
2946 | tmp_str16 = String16(tmp_str8); |
2947 | r->writeString16(tmp_str16); |
2948 | |
2949 | tmp_str8 = tvservice_get_last_chaned_time_info(); |
2950 | tmp_str16 = String16(tmp_str8); |
2951 | r->writeString16(tmp_str16); |
2952 | |
2953 | tmp_str8 = tvservice_get_build_time_info(); |
2954 | tmp_str16 = String16(tmp_str8); |
2955 | r->writeString16(tmp_str16); |
2956 | |
2957 | tmp_str8 = tvservice_get_build_name_info(); |
2958 | tmp_str16 = String16(tmp_str8); |
2959 | r->writeString16(tmp_str16); |
2960 | break; |
2961 | } |
2962 | case MISC_GET_DVB_API_VERSION: { |
2963 | const char *tmp_str8; |
2964 | String16 tmp_str16; |
2965 | |
2966 | // write dvb version info |
2967 | tmp_str8 = dvb_get_git_branch_info(); |
2968 | tmp_str16 = String16(tmp_str8); |
2969 | r->writeString16(tmp_str16); |
2970 | |
2971 | tmp_str8 = dvb_get_git_version_info(); |
2972 | tmp_str16 = String16(tmp_str8); |
2973 | r->writeString16(tmp_str16); |
2974 | |
2975 | tmp_str8 = dvb_get_last_chaned_time_info(); |
2976 | tmp_str16 = String16(tmp_str8); |
2977 | r->writeString16(tmp_str16); |
2978 | |
2979 | tmp_str8 = dvb_get_build_time_info(); |
2980 | tmp_str16 = String16(tmp_str8); |
2981 | r->writeString16(tmp_str16); |
2982 | |
2983 | tmp_str8 = dvb_get_build_name_info(); |
2984 | tmp_str16 = String16(tmp_str8); |
2985 | r->writeString16(tmp_str16); |
2986 | |
2987 | break; |
2988 | } |
2989 | case MISC_SERIAL_SWITCH: { |
2990 | int dev_id = p.readInt32(); |
2991 | int switch_val = p.readInt32(); |
2992 | int ret = mpTv->SetSerialSwitch(dev_id, switch_val); |
2993 | r->writeInt32(ret); |
2994 | break; |
2995 | } |
2996 | case MISC_SERIAL_SEND_DATA: { |
2997 | int i = 0, tmp_buf_size = 0, ret = 0; |
2998 | |
2999 | int dev_id = p.readInt32(); |
3000 | |
3001 | tmp_buf_size = p.readInt32(); |
3002 | if (tmp_buf_size > sizeof(tmp_uc_buf)) { |
3003 | tmp_buf_size = sizeof(tmp_uc_buf); |
3004 | } |
3005 | |
3006 | for (i = 0; i < tmp_buf_size; i++) { |
3007 | tmp_uc_buf[i] = p.readInt32() & 0xFF; |
3008 | } |
3009 | |
3010 | ret = mpTv->SendSerialData(dev_id, tmp_buf_size, tmp_uc_buf); |
3011 | r->writeInt32(ret); |
3012 | break; |
3013 | } |
3014 | case MISC_CHANNEL_EXPORT: { |
3015 | LOGD("MISC_CHANNEL_EXPORT"); |
3016 | int ret = 0; |
3017 | String16 tmp_str16; |
3018 | String8 tmp_str; |
3019 | |
3020 | tmp_str16 = p.readString16(); |
3021 | tmp_str = String8(tmp_str16); |
3022 | |
3023 | ret = mpTv->ChannelExport(tmp_str.string()); |
3024 | r->writeInt32(ret); |
3025 | break; |
3026 | } |
3027 | case MISC_CHANNEL_IMPORT: { |
3028 | LOGD("MISC_CHANNEL_IMPORT"); |
3029 | String16 tmp_str16; |
3030 | String8 tmp_str; |
3031 | |
3032 | tmp_str16 = p.readString16(); |
3033 | tmp_str = String8(tmp_str16); |
3034 | int ret = 0; |
3035 | ret = mpTv->ChannelImport(tmp_str.string()); |
3036 | r->writeInt32(ret); |
3037 | break; |
3038 | } |
3039 | case MISC_GET_PROJECT_INFO: { |
3040 | String16 tmp_str16; |
3041 | project_info_t tmpInfo; |
3042 | |
3043 | if (mpTv->Tv_GetProjectInfo(&tmpInfo) < 0) { |
3044 | strcpy(tmpInfo.version, "UNKOWN"); |
3045 | strcpy(tmpInfo.panel_type, "UNKOWN"); |
3046 | strcpy(tmpInfo.panel_outputmode, "UNKOWN"); |
3047 | strcpy(tmpInfo.panel_rev, "UNKOWN"); |
3048 | strcpy(tmpInfo.panel_name, "UNKOWN"); |
3049 | strcpy(tmpInfo.amp_curve_name, "UNKOWN"); |
3050 | } |
3051 | |
3052 | r->writeString16(String16(tmpInfo.version)); |
3053 | r->writeString16(String16(tmpInfo.panel_type)); |
3054 | r->writeString16(String16(tmpInfo.panel_outputmode)); |
3055 | r->writeString16(String16(tmpInfo.panel_rev)); |
3056 | r->writeString16(String16(tmpInfo.panel_name)); |
3057 | r->writeString16(String16(tmpInfo.amp_curve_name)); |
3058 | break; |
3059 | } |
3060 | case MISC_GET_PLATFORM_TYPE: { |
3061 | int ret = mpTv->Tv_GetPlatformType(); |
3062 | r->writeInt32(ret); |
3063 | break; |
3064 | } |
3065 | //MISC END |
3066 | |
3067 | // EXTAR |
3068 | case DELETE_DIR_FILES: { |
3069 | String16 strPath = p.readString16(); |
3070 | if(strPath.size() <= 0) { |
3071 | r->writeInt32(-1); |
3072 | break; |
3073 | } |
3074 | String8 strP8 = String8(strPath); |
3075 | int tmp_flag = p.readInt32(); |
3076 | int ret = TvMisc_DeleteDirFiles(strP8.string(), tmp_flag); |
3077 | r->writeInt32(ret); |
3078 | break; |
3079 | } |
3080 | case ATV_GET_CURRENT_PROGRAM_ID: { |
3081 | int atvLastProgramId = mpTv->getATVProgramID(); |
3082 | r->writeInt32(atvLastProgramId); |
3083 | break; |
3084 | } |
3085 | case DTV_GET_CURRENT_PROGRAM_ID: { |
3086 | int dtvLastProgramId = mpTv->getDTVProgramID(); |
3087 | r->writeInt32(dtvLastProgramId); |
3088 | break; |
3089 | } |
3090 | case ATV_SAVE_PROGRAM_ID: { |
3091 | int progID = p.readInt32(); |
3092 | int retCnt = 0; |
3093 | mpTv->saveATVProgramID(progID); |
3094 | r->writeInt32(retCnt); |
3095 | break; |
3096 | } |
3097 | case ATV_GET_MIN_MAX_FREQ: { |
3098 | int min, max; |
3099 | int tmpRet = mpTv->getATVMinMaxFreq(&min, &max); |
3100 | r->writeInt32(min); |
3101 | r->writeInt32(max); |
3102 | r->writeInt32(tmpRet); |
3103 | break; |
3104 | } |
3105 | case DTV_GET_SCAN_FREQUENCY_LIST: { |
3106 | Vector<sp<CTvChannel> > out; |
3107 | int tmpRet = CTvRegion::getChannelListByName("CHINA,Default DTMB ALL", out); |
3108 | r->writeInt32(out.size()); |
3109 | for(int i = 0; i < out.size(); i++) { |
3110 | r->writeInt32(out[i]->getID()); |
3111 | r->writeInt32(out[i]->getFrequency()); |
3112 | } |
3113 | r->writeInt32(tmpRet); |
3114 | break; |
3115 | } |
3116 | case DTV_GET_CHANNEL_INFO: { |
3117 | int dbID = p.readInt32(); |
3118 | channel_info_t chan_info; |
3119 | int ret = mpTv->getChannelInfoBydbID(dbID, chan_info); |
3120 | r->writeInt32(chan_info.freq); |
3121 | r->writeInt32(chan_info.uInfo.dtvChanInfo.strength); |
3122 | r->writeInt32(chan_info.uInfo.dtvChanInfo.quality); |
3123 | r->writeInt32(chan_info.uInfo.dtvChanInfo.ber); |
3124 | r->writeInt32(ret); |
3125 | break; |
3126 | } |
3127 | case ATV_GET_CHANNEL_INFO: { |
3128 | int dbID = p.readInt32(); |
3129 | channel_info_t chan_info; |
3130 | int ret = mpTv->getChannelInfoBydbID(dbID, chan_info); |
3131 | r->writeInt32(chan_info.freq); |
3132 | r->writeInt32(chan_info.uInfo.atvChanInfo.finefreq); |
3133 | r->writeInt32(chan_info.uInfo.atvChanInfo.videoStd); |
3134 | r->writeInt32(chan_info.uInfo.atvChanInfo.audioStd); |
3135 | r->writeInt32(chan_info.uInfo.atvChanInfo.isAutoStd); |
3136 | r->writeInt32(ret); |
3137 | break; |
3138 | } |
3139 | case ATV_SCAN_MANUAL: { |
3140 | int tmpRet = 0; |
3141 | int startFreq = p.readInt32(); |
3142 | int endFreq = p.readInt32(); |
3143 | int videoStd = p.readInt32(); |
3144 | int audioStd = p.readInt32(); |
3145 | tmpRet = mpTv->atvMunualScan(startFreq, endFreq, videoStd, audioStd); |
3146 | mTvService->mpScannerClient = this; |
3147 | r->writeInt32(tmpRet); |
3148 | break; |
3149 | } |
3150 | case ATV_SCAN_MANUAL_BY_NUMBER: { |
3151 | int tmpRet = 0; |
3152 | int startFreq = p.readInt32(); |
3153 | int endFreq = p.readInt32(); |
3154 | int videoStd = p.readInt32(); |
3155 | int audioStd = p.readInt32(); |
3156 | int storeType = p.readInt32(); |
3157 | int currentNum = p.readInt32(); |
3158 | tmpRet = mpTv->atvMunualScan(startFreq, endFreq, videoStd, audioStd, storeType, currentNum); |
3159 | mTvService->mpScannerClient = this; |
3160 | r->writeInt32(tmpRet); |
3161 | break; |
3162 | } |
3163 | |
3164 | case ATV_SCAN_AUTO: { |
3165 | int tmpRet = 0; |
3166 | LOGD("%s, atv auto scan!!!\n", "TV"); |
3167 | int videoStd = p.readInt32(); |
3168 | int audioStd = p.readInt32(); |
3169 | int searchType = p.readInt32(); |
3170 | tmpRet = mpTv->atvAutoScan(videoStd, audioStd, searchType); |
3171 | mTvService->mpScannerClient = this; |
3172 | r->writeInt32(tmpRet); |
3173 | break; |
3174 | } |
3175 | case DTV_SCAN_MANUAL: { |
3176 | int tmpRet = 0; |
3177 | int freq = p.readInt32(); |
3178 | tmpRet = mpTv->dtvManualScan(freq, freq); |
3179 | mTvService->mpScannerClient = this; |
3180 | r->writeInt32(tmpRet); |
3181 | break; |
3182 | } |
3183 | case DTV_SCAN_MANUAL_BETWEEN_FREQ: { |
3184 | int tmpRet = 0; |
3185 | int beginFreq = p.readInt32(); |
3186 | int endFreq = p.readInt32(); |
3187 | int modulation = p.readInt32(); |
3188 | tmpRet = mpTv->dtvManualScan(beginFreq, endFreq, modulation); |
3189 | mTvService->mpScannerClient = this; |
3190 | r->writeInt32(tmpRet); |
3191 | break; |
3192 | } |
3193 | case DTV_SCAN_AUTO: { |
3194 | int tmpRet = 0; |
3195 | tmpRet = mpTv->dtvAutoScan(); |
3196 | mTvService->mpScannerClient = this; |
3197 | r->writeInt32(tmpRet); |
3198 | break; |
3199 | } |
3200 | case DTV_SCAN_AUTO_ATSC: { |
3201 | int tmpRet = 0; |
3202 | int attenna = p.readInt32(); |
3203 | int vstd = p.readInt32(); |
3204 | int astd = p.readInt32(); |
3205 | tmpRet = mpTv->dtvAutoScanAtscLock(attenna, vstd, astd); |
3206 | mTvService->mpScannerClient = this; |
3207 | r->writeInt32(tmpRet); |
3208 | break; |
3209 | } |
3210 | case TV_SUBTITLE_DRAW_END: { |
3211 | int tmpRet = 0; |
3212 | //if(pSub)pSub->lock.unlock(); |
3213 | r->writeInt32(tmpRet); |
3214 | break; |
3215 | } |
3216 | case STOP_PROGRAM_PLAY: { |
3217 | int tmpRet = -1; |
3218 | tmpRet = mpTv->stopPlayingLock(); |
3219 | r->writeInt32(tmpRet); |
3220 | break; |
3221 | } |
3222 | case DTV_TEST_1: { |
3223 | // int progid = p.readInt32(); |
3224 | //CTvProgram prog; |
3225 | // int ret = CTvProgram::selectByID(progid, prog); |
3226 | //CTvEvent ev; |
3227 | //ret = ev.getProgPresentEvent(prog.getSrc(), prog.getID(), mpTv->getTvTime(), ev); |
3228 | //r->writeString16(String16(ev.getName())); |
3229 | break; |
3230 | } |
3231 | case DTV_TEST_2: { |
3232 | //int cmd = p.readInt32(); |
3233 | //CTvDatabase::GetTvDb()->importXmlToDB("/etc/tv_default.xml"); |
3234 | //r->writeString16(String16("xml")); |
3235 | break; |
3236 | } |
3237 | |
3238 | case TV_CLEAR_ALL_PROGRAM: { |
3239 | int tmpRet = 0; |
3240 | int arg0 = p.readInt32(); |
3241 | |
3242 | tmpRet = mpTv->clearAllProgram(arg0); |
3243 | mTvService->mpScannerClient = this; |
3244 | r->writeInt32(tmpRet); |
3245 | break; |
3246 | } |
3247 | |
3248 | case GET_DISPLAY_RESOLUTION_CONFIG: { |
3249 | int tmpRet = 0; |
3250 | tmpRet = mpTv->GetDisplayResolutionConfig(); |
3251 | r->writeInt32(tmpRet); |
3252 | break; |
3253 | } |
3254 | |
3255 | case GET_DISPLAY_RESOLUTION_INFO: { |
3256 | int tmpRet = 0; |
3257 | tmpRet = mpTv->GetDisplayResolutionInfo(); |
3258 | r->writeInt32(tmpRet); |
3259 | break; |
3260 | } |
3261 | |
3262 | case HDMIRX_CEC_SEND_CUSTOM_MESSAGE: { |
3263 | int i = 0, tmp_buf_size = 0, ret = 0; |
3264 | tmp_buf_size = p.readInt32(); |
3265 | for (i = 0; i < tmp_buf_size; i++) { |
3266 | tmp_uc_buf[i] = p.readInt32(); |
3267 | } |
3268 | |
3269 | int tmpRet = 0; |
3270 | tmpRet = mpTv->SendHDMIRxCECCustomMessage(tmp_uc_buf); |
3271 | r->writeInt32(tmpRet); |
3272 | break; |
3273 | } |
3274 | |
3275 | case HDMIRX_CEC_SEND_CUSTOM_WAIT_REPLY_MESSAGE: { |
3276 | int i = 0, tmp_buf_size = 0, ret = 0; |
3277 | int WaitCmd = 0, timeout = 0; |
3278 | tmp_buf_size = p.readInt32(); |
3279 | for (i = 0; i < tmp_buf_size; i++) { |
3280 | tmp_uc_buf[i] = p.readInt32(); |
3281 | } |
3282 | |
3283 | WaitCmd = p.readInt32(); |
3284 | timeout = p.readInt32(); |
3285 | |
3286 | int tmpRet = 0; |
3287 | tmpRet = mpTv->SendHDMIRxCECCustomMessageAndWaitReply(tmp_uc_buf, tmp_uc_buf2, WaitCmd, timeout); |
3288 | |
3289 | r->writeInt32(tmpRet); |
3290 | if(tmpRet > 0) { |
3291 | for (i = 0; i < tmpRet; i++) { |
3292 | r->writeInt32(tmp_uc_buf2[i]); |
3293 | } |
3294 | } |
3295 | |
3296 | r->writeInt32(tmpRet); |
3297 | break; |
3298 | } |
3299 | |
3300 | case HDMIRX_CEC_SEND_BROADCAST_STANDBY_MESSAGE: { |
3301 | int tmpRet = 0; |
3302 | tmpRet = mpTv->SendHDMIRxCECBoradcastStandbyMessage(); |
3303 | r->writeInt32(tmpRet); |
3304 | break; |
3305 | } |
3306 | |
3307 | case HDMIRX_CEC_SEND_GIVE_CEC_VERSION_MESSAGE: { |
3308 | int i = 0, tmp_buf_size = 0, ret = 0; |
3309 | int sourceinput = p.readInt32(); |
3310 | LOGD("HDMIRX_CEC_SEND_GIVE_CEC_VERSION_MESSAGE: sourceinput = %x", sourceinput); |
3311 | tmp_buf_size = mpTv->SendHDMIRxCECGiveCECVersionMessage((tv_source_input_t)sourceinput, tmp_uc_buf); |
3312 | r->writeInt32(tmp_buf_size); |
3313 | for (i = 0; i < tmp_buf_size; i++) { |
3314 | r->writeInt32(tmp_uc_buf[i]); |
3315 | } |
3316 | r->writeInt32(tmp_buf_size); |
3317 | break; |
3318 | } |
3319 | |
3320 | case HDMIRX_CEC_SEND_GIVE_DEV_VENDOR_ID_MESSAGE: { |
3321 | int i = 0, tmp_buf_size = 0, ret = 0; |
3322 | int sourceinput = p.readInt32(); |
3323 | LOGD("HDMIRX_CEC_SEND_GIVE_DEV_VENDOR_ID_MESSAGE: sourceinput = %x", sourceinput); |
3324 | tmp_buf_size = mpTv->SendHDMIRxCECGiveDeviceVendorIDMessage((tv_source_input_t)sourceinput, tmp_uc_buf); |
3325 | r->writeInt32(tmp_buf_size); |
3326 | for (i = 0; i < tmp_buf_size; i++) { |
3327 | r->writeInt32(tmp_uc_buf[i]); |
3328 | } |
3329 | r->writeInt32(tmp_buf_size); |
3330 | break; |
3331 | } |
3332 | |
3333 | case HDMIRX_CEC_SEND_GIVE_OSD_NAME_MESSAGE: { |
3334 | int i = 0, tmp_buf_size = 0, ret = 0; |
3335 | int sourceinput = p.readInt32(); |
3336 | LOGD("HDMIRX_CEC_SEND_GIVE_OSD_NAME_MESSAGE: sourceinput = %x", sourceinput); |
3337 | tmp_buf_size = mpTv->SendHDMIRxCECGiveOSDNameMessage((tv_source_input_t)sourceinput, tmp_uc_buf); |
3338 | r->writeInt32(tmp_buf_size); |
3339 | for (i = 0; i < tmp_buf_size; i++) { |
3340 | r->writeInt32(tmp_uc_buf[i]); |
3341 | } |
3342 | r->writeInt32(tmp_buf_size); |
3343 | break; |
3344 | } |
3345 | |
3346 | case GET_HDMI_KSV_INFO: { |
3347 | int tmpRet = 0; |
3348 | int ksv_data[2] = {0, 0}; |
3349 | tmpRet = mpTv->GetHdmiHdcpKeyKsvInfo(ksv_data); |
3350 | r->writeInt32(tmpRet); |
3351 | r->writeInt32(ksv_data[0]); |
3352 | r->writeInt32(ksv_data[1]); |
3353 | break; |
3354 | } |
3355 | |
3356 | case FACTORY_FBC_UPGRADE: { |
3357 | String16 tmpName = p.readString16(); |
3358 | String8 strName = String8(tmpName); |
3359 | sprintf((char *)tmp_uc_buf, "%s", strName.string()); |
3360 | int mode = p.readInt32(); |
3361 | int upgrade_blk_size = p.readInt32(); |
3362 | int ret = mpTv->StartUpgradeFBC((char *)tmp_uc_buf, mode, upgrade_blk_size); |
3363 | r->writeInt32(ret); |
3364 | break; |
3365 | } |
3366 | |
3367 | case FACTORY_FBC_SET_BRIGHTNESS: { |
3368 | int value = p.readInt32(); |
3369 | int ret = mpTv->Tv_FactorySet_FBC_Brightness(value); |
3370 | r->writeInt32(ret); |
3371 | break; |
3372 | } |
3373 | |
3374 | case FACTORY_FBC_GET_BRIGHTNESS: { |
3375 | int ret = mpTv->Tv_FactoryGet_FBC_Brightness(); |
3376 | r->writeInt32(ret); |
3377 | break; |
3378 | } |
3379 | |
3380 | case FACTORY_FBC_SET_CONTRAST: { |
3381 | int value = p.readInt32(); |
3382 | int ret = mpTv->Tv_FactorySet_FBC_Contrast(value); |
3383 | r->writeInt32(ret); |
3384 | break; |
3385 | } |
3386 | |
3387 | case FACTORY_FBC_GET_CONTRAST: { |
3388 | int ret = mpTv->Tv_FactoryGet_FBC_Contrast(); |
3389 | r->writeInt32(ret); |
3390 | break; |
3391 | } |
3392 | |
3393 | case FACTORY_FBC_SET_SATURATION: { |
3394 | int value = p.readInt32(); |
3395 | int ret = mpTv->Tv_FactorySet_FBC_Saturation(value); |
3396 | r->writeInt32(ret); |
3397 | break; |
3398 | } |
3399 | |
3400 | case FACTORY_FBC_GET_SATURATION: { |
3401 | int ret = mpTv->Tv_FactoryGet_FBC_Saturation(); |
3402 | r->writeInt32(ret); |
3403 | break; |
3404 | } |
3405 | |
3406 | case FACTORY_FBC_SET_HUE: { |
3407 | int value = p.readInt32(); |
3408 | int ret = mpTv->Tv_FactorySet_FBC_HueColorTint(value); |
3409 | r->writeInt32(ret); |
3410 | break; |
3411 | } |
3412 | |
3413 | case FACTORY_FBC_GET_HUE: { |
3414 | int ret = mpTv->Tv_FactoryGet_FBC_HueColorTint(); |
3415 | r->writeInt32(ret); |
3416 | break; |
3417 | } |
3418 | |
3419 | case FACTORY_FBC_SET_BACKLIGHT: { |
3420 | int value = p.readInt32(); |
3421 | int ret = mpTv->Tv_FactorySet_FBC_Backlight(value); |
3422 | r->writeInt32(ret); |
3423 | break; |
3424 | } |
3425 | |
3426 | case FACTORY_FBC_GET_BACKLIGHT: { |
3427 | int ret = mpTv->Tv_FactoryGet_FBC_Backlight(); |
3428 | r->writeInt32(ret); |
3429 | break; |
3430 | } |
3431 | case FACTORY_FBC_SET_BACKLIGHT_N360: { |
3432 | int value = p.readInt32(); |
3433 | int ret = mpTv->Tv_FactorySet_FBC_Backlight_N360(value); |
3434 | r->writeInt32(ret); |
3435 | break; |
3436 | } |
3437 | |
3438 | case FACTORY_FBC_GET_BACKLIGHT_N360: { |
3439 | int ret = mpTv->Tv_FactoryGet_FBC_Backlight_N360(); |
3440 | r->writeInt32(ret); |
3441 | break; |
3442 | } |
3443 | case FACTROY_FBC_SET_LIGHT_SENSOR_STATUS_N310: { |
3444 | int value = p.readInt32(); |
3445 | int ret = mpTv->Tv_FactorySet_FBC_LightSensor_Status_N310(value); |
3446 | r->writeInt32(ret); |
3447 | break; |
3448 | } |
3449 | |
3450 | case FACTROY_FBC_GET_LIGHT_SENSOR_STATUS_N310: { |
3451 | int ret = mpTv->Tv_FactoryGet_FBC_LightSensor_Status_N310(); |
3452 | r->writeInt32(ret); |
3453 | break; |
3454 | } |
3455 | case FACTROY_FBC_SET_DREAM_PANEL_STATUS_N310: { |
3456 | int value = p.readInt32(); |
3457 | int ret = mpTv->Tv_FactorySet_FBC_Dream_Panel_Status_N310(value); |
3458 | r->writeInt32(ret); |
3459 | break; |
3460 | } |
3461 | |
3462 | case FACTROY_FBC_GET_DREAM_PANEL_STATUS_N310: { |
3463 | int ret = mpTv->Tv_FactoryGet_FBC_Dream_Panel_Status_N310(); |
3464 | r->writeInt32(ret); |
3465 | break; |
3466 | } |
3467 | case FACTROY_FBC_SET_MULT_PQ_STATUS_N310: { |
3468 | int value = p.readInt32(); |
3469 | int ret = mpTv->Tv_FactorySet_FBC_MULT_PQ_Status_N310(value); |
3470 | r->writeInt32(ret); |
3471 | break; |
3472 | } |
3473 | |
3474 | case FACTROY_FBC_GET_MULT_PQ_STATUS_N310: { |
3475 | int ret = mpTv->Tv_FactoryGet_FBC_MULT_PQ_Status_N310(); |
3476 | r->writeInt32(ret); |
3477 | break; |
3478 | } |
3479 | case FACTROY_FBC_SET_MEMC_STATUS_N310: { |
3480 | int value = p.readInt32(); |
3481 | int ret = mpTv->Tv_FactorySet_FBC_MEMC_Status_N310(value); |
3482 | r->writeInt32(ret); |
3483 | break; |
3484 | } |
3485 | |
3486 | case FACTROY_FBC_GET_MEMC_STATUS_N310: { |
3487 | int ret = mpTv->Tv_FactoryGet_FBC_MEMC_Status_N310(); |
3488 | r->writeInt32(ret); |
3489 | break; |
3490 | } |
3491 | |
3492 | |
3493 | case FACTORY_FBC_SET_BACKLIGHT_EN : { |
3494 | int value = p.readInt32(); |
3495 | int ret = mpTv->Tv_FactorySet_FBC_backlight_onoff(value); |
3496 | r->writeInt32(ret); |
3497 | break; |
3498 | } |
3499 | |
3500 | case FACTORY_FBC_GET_BACKLIGHT_EN: { |
3501 | int ret = mpTv->Tv_FactoryGet_FBC_backlight_onoff(); |
3502 | r->writeInt32(ret); |
3503 | break; |
3504 | } |
3505 | |
3506 | case FACTORY_FBC_SET_LVDS_SSG: { |
3507 | int value = p.readInt32(); |
3508 | int ret = mpTv->Tv_FactorySet_FBC_LVDS_SSG_Set(value); |
3509 | r->writeInt32(ret); |
3510 | break; |
3511 | } |
3512 | |
3513 | case FACTORY_FBC_SET_ELEC_MODE: { |
3514 | int value = p.readInt32(); |
3515 | int ret = mpTv->Tv_FactorySet_FBC_ELEC_MODE(value); |
3516 | r->writeInt32(ret); |
3517 | break; |
3518 | } |
3519 | |
3520 | case FACTORY_FBC_GET_ELEC_MODE: { |
3521 | int ret = mpTv->Tv_FactoryGet_FBC_ELEC_MODE(); |
3522 | r->writeInt32(ret); |
3523 | break; |
3524 | } |
3525 | |
3526 | case FACTORY_FBC_SET_PIC_MODE: { |
3527 | int value = p.readInt32(); |
3528 | int ret = mpTv->Tv_FactorySet_FBC_Picture_Mode(value); |
3529 | r->writeInt32(ret); |
3530 | break; |
3531 | } |
3532 | |
3533 | case FACTORY_FBC_GET_PIC_MODE: { |
3534 | int ret = mpTv->Tv_FactoryGet_FBC_Picture_Mode(); |
3535 | r->writeInt32(ret); |
3536 | break; |
3537 | } |
3538 | |
3539 | case FACTORY_FBC_SET_TEST_PATTERN: { |
3540 | int value = p.readInt32(); |
3541 | int ret = mpTv->Tv_FactorySet_FBC_Set_Test_Pattern(value); |
3542 | r->writeInt32(ret); |
3543 | break; |
3544 | } |
3545 | |
3546 | case FACTORY_FBC_GET_TEST_PATTERN: { |
3547 | int ret = mpTv->Tv_FactoryGet_FBC_Get_Test_Pattern(); |
3548 | r->writeInt32(ret); |
3549 | break; |
3550 | } |
3551 | |
3552 | case FACTORY_FBC_SET_GAIN_RED: { |
3553 | int value = p.readInt32(); |
3554 | int ret = mpTv->Tv_FactorySet_FBC_Gain_Red(value); |
3555 | r->writeInt32(ret); |
3556 | break; |
3557 | } |
3558 | |
3559 | case FACTORY_FBC_GET_GAIN_RED: { |
3560 | int ret = mpTv->Tv_FactoryGet_FBC_Gain_Red(); |
3561 | r->writeInt32(ret); |
3562 | break; |
3563 | } |
3564 | |
3565 | case FACTORY_FBC_SET_GAIN_GREEN: { |
3566 | int value = p.readInt32(); |
3567 | int ret = mpTv->Tv_FactorySet_FBC_Gain_Green(value); |
3568 | r->writeInt32(ret); |
3569 | break; |
3570 | } |
3571 | |
3572 | case FACTORY_FBC_GET_GAIN_GREEN: { |
3573 | int ret = mpTv->Tv_FactoryGet_FBC_Gain_Green(); |
3574 | r->writeInt32(ret); |
3575 | break; |
3576 | } |
3577 | |
3578 | case FACTORY_FBC_SET_GAIN_BLUE: { |
3579 | int value = p.readInt32(); |
3580 | int ret = mpTv->Tv_FactorySet_FBC_Gain_Blue(value); |
3581 | r->writeInt32(ret); |
3582 | break; |
3583 | } |
3584 | |
3585 | case FACTORY_FBC_GET_GAIN_BLUE: { |
3586 | int ret = mpTv->Tv_FactoryGet_FBC_Gain_Blue(); |
3587 | r->writeInt32(ret); |
3588 | break; |
3589 | } |
3590 | |
3591 | case FACTORY_FBC_SET_OFFSET_RED: { |
3592 | int value = p.readInt32(); |
3593 | int ret = mpTv->Tv_FactorySet_FBC_Offset_Red(value); |
3594 | r->writeInt32(ret); |
3595 | break; |
3596 | } |
3597 | |
3598 | case FACTORY_FBC_GET_OFFSET_RED: { |
3599 | int ret = mpTv->Tv_FactoryGet_FBC_Offset_Red(); |
3600 | r->writeInt32(ret); |
3601 | break; |
3602 | } |
3603 | |
3604 | case FACTORY_FBC_SET_OFFSET_GREEN: { |
3605 | int value = p.readInt32(); |
3606 | int ret = mpTv->Tv_FactorySet_FBC_Offset_Green(value); |
3607 | r->writeInt32(ret); |
3608 | break; |
3609 | } |
3610 | |
3611 | case FACTORY_FBC_GET_OFFSET_GREEN: { |
3612 | int ret = mpTv->Tv_FactoryGet_FBC_Offset_Green(); |
3613 | r->writeInt32(ret); |
3614 | break; |
3615 | } |
3616 | |
3617 | case FACTORY_FBC_SET_OFFSET_BLUE: { |
3618 | int value = p.readInt32(); |
3619 | int ret = mpTv->Tv_FactorySet_FBC_Offset_Blue(value); |
3620 | r->writeInt32(ret); |
3621 | break; |
3622 | } |
3623 | |
3624 | case FACTORY_FBC_GET_OFFSET_BLUE: { |
3625 | int ret = mpTv->Tv_FactoryGet_FBC_Offset_Blue(); |
3626 | r->writeInt32(ret); |
3627 | break; |
3628 | } |
3629 | |
3630 | case FACTORY_FBC_SET_COLORTEMP_MODE: { |
3631 | int value = p.readInt32(); |
3632 | int ret = mpTv->Tv_FactorySet_FBC_ColorTemp_Mode(value); |
3633 | r->writeInt32(ret); |
3634 | break; |
3635 | } |
3636 | |
3637 | case FACTORY_FBC_GET_COLORTEMP_MODE: { |
3638 | int ret = mpTv->Tv_FactoryGet_FBC_ColorTemp_Mode(); |
3639 | r->writeInt32(ret); |
3640 | break; |
3641 | } |
3642 | |
3643 | case FACTORY_FBC_SET_COLORTEMP_MODE_N360: { |
3644 | int value = p.readInt32(); |
3645 | int ret = mpTv->Tv_FactorySet_FBC_ColorTemp_Mode_N360(value); |
3646 | r->writeInt32(ret); |
3647 | break; |
3648 | } |
3649 | |
3650 | case FACTORY_FBC_GET_COLORTEMP_MODE_N360: { |
3651 | int ret = mpTv->Tv_FactoryGet_FBC_ColorTemp_Mode_N360(); |
3652 | r->writeInt32(ret); |
3653 | break; |
3654 | } |
3655 | |
3656 | case FACTORY_FBC_SET_WB_INIT: { |
3657 | int value = p.readInt32(); |
3658 | int ret = mpTv->Tv_FactorySet_FBC_WB_Initial(value); |
3659 | r->writeInt32(ret); |
3660 | break; |
3661 | } |
3662 | |
3663 | case FACTORY_FBC_GET_WB_INIT: { |
3664 | int ret = mpTv->Tv_FactoryGet_FBC_WB_Initial(); |
3665 | r->writeInt32(ret); |
3666 | break; |
3667 | } |
3668 | |
3669 | case FACTORY_FBC_GET_MAINCODE_VERSION: { |
3670 | char sw_version[64]; |
3671 | char build_time[64]; |
3672 | char git_version[64]; |
3673 | char git_branch[64]; |
3674 | char build_name[64]; |
3675 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3676 | if (fbcIns != NULL) { |
3677 | fbcIns->cfbc_Get_FBC_MAINCODE_Version(COMM_DEV_SERIAL, sw_version, build_time, git_version, git_branch, build_name); |
3678 | r->writeString16(String16(sw_version)); |
3679 | r->writeString16(String16(build_time)); |
3680 | r->writeString16(String16(git_version)); |
3681 | r->writeString16(String16(git_branch)); |
3682 | r->writeString16(String16(build_name)); |
3683 | } else { |
3684 | r->writeString16(String16("No FBC")); |
3685 | r->writeString16(String16("No FBC")); |
3686 | r->writeString16(String16("No FBC")); |
3687 | r->writeString16(String16("No FBC")); |
3688 | r->writeString16(String16("No FBC")); |
3689 | } |
3690 | break; |
3691 | } |
3692 | case FACTORY_SET_SN: { |
3693 | char StrFactSN[64] = {0}; |
3694 | String16 strTemFactorySn = p.readString16(); |
3695 | String8 strFactorySn = String8(strTemFactorySn); |
3696 | sprintf((char *)StrFactSN, "%s", strFactorySn.string()); |
3697 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3698 | if (fbcIns != NULL) { |
3699 | int iRet = fbcIns->cfbc_Set_FBC_Factory_SN(COMM_DEV_SERIAL, (const char *)StrFactSN); |
3700 | r->writeInt32(iRet); |
3701 | } else { |
3702 | r->writeInt32(-1); |
3703 | } |
3704 | break; |
3705 | } |
3706 | case FACTORY_GET_SN: { |
3707 | char factorySerialNumber[64] = {0}; |
3708 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3709 | if (fbcIns != NULL) { |
3710 | fbcIns->cfbc_Get_FBC_Factory_SN(COMM_DEV_SERIAL, factorySerialNumber); |
3711 | r->writeString16(String16(factorySerialNumber)); |
3712 | } else { |
3713 | r->writeString16(String16("No FBC")); |
3714 | } |
3715 | break; |
3716 | } |
3717 | case FACTORY_FBC_PANEL_GET_INFO: { |
3718 | char panel_model[64]; |
3719 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3720 | if (fbcIns != NULL) { |
3721 | fbcIns->cfbc_Get_FBC_Get_PANel_INFO(COMM_DEV_SERIAL, panel_model); |
3722 | r->writeString16(String16(panel_model)); |
3723 | } else { |
3724 | r->writeString16(String16("")); |
3725 | } |
3726 | break; |
3727 | } |
3728 | case FACTORY_FBC_PANEL_POWER_SWITCH: { |
3729 | int value = p.readInt32(); |
3730 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3731 | if (fbcIns != NULL) { |
3732 | int ret = fbcIns->cfbc_Set_FBC_panel_power_switch(COMM_DEV_SERIAL, value); |
3733 | r->writeInt32(ret); |
3734 | } else { |
3735 | r->writeInt32(-1); |
3736 | } |
3737 | break; |
3738 | } |
3739 | case FACTORY_FBC_PANEL_SUSPEND: { |
3740 | int value = p.readInt32(); |
3741 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3742 | if (fbcIns != NULL) { |
3743 | int ret = fbcIns->cfbc_Set_FBC_suspend(COMM_DEV_SERIAL, value); |
3744 | r->writeInt32(ret); |
3745 | } else { |
3746 | r->writeInt32(-1); |
3747 | } |
3748 | break; |
3749 | } |
3750 | case FACTORY_FBC_PANEL_USER_SETTING_DEFAULT: { |
3751 | int value = p.readInt32(); |
3752 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3753 | if (fbcIns != NULL) { |
3754 | int ret = fbcIns->cfbc_Set_FBC_User_Setting_Default(COMM_DEV_SERIAL, value); |
3755 | r->writeInt32(ret); |
3756 | } else { |
3757 | r->writeInt32(-1); |
3758 | } |
3759 | break; |
3760 | } |
3761 | case FACTORY_FBC_POWER_REBOOT: { |
3762 | int value = p.readInt32(); |
3763 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3764 | if (fbcIns != NULL) { |
3765 | int ret = fbcIns->cfbc_SendRebootToUpgradeCmd(COMM_DEV_SERIAL, value); |
3766 | r->writeInt32(ret); |
3767 | } else { |
3768 | r->writeInt32(-1); |
3769 | } |
3770 | break; |
3771 | } |
3772 | case FACTORY_FBC_SEND_KEY_TO_FBC: { |
3773 | int keyCode = p.readInt32(); |
3774 | int param = p.readInt32(); |
3775 | CFbcCommunication *fbcIns = GetSingletonFBC(); |
3776 | if (fbcIns != NULL) { |
3777 | int ret = fbcIns->cfbc_FBC_Send_Key_To_Fbc(COMM_DEV_SERIAL, keyCode, param); |
3778 | r->writeInt32(ret); |
3779 | } else { |
3780 | r->writeInt32(-1); |
3781 | } |
3782 | break; |
3783 | } |
3784 | case FACTORY_WHITE_BALANCE_SET_GAIN_RED: { |
3785 | int source_type = p.readInt32(); |
3786 | int colortemp_mode = p.readInt32(); |
3787 | int value = p.readInt32(); |
3788 | int ret = mpTv->Tv_FactorySetWhiteBalanceRedGain(source_type, colortemp_mode, value); |
3789 | r->writeInt32(ret); |
3790 | break; |
3791 | } |
3792 | case FACTORY_WHITE_BALANCE_GET_GAIN_RED: { |
3793 | int source_type = p.readInt32(); |
3794 | int colortemp_mode = p.readInt32(); |
3795 | int ret = mpTv->Tv_FactoryGetWhiteBalanceRedGain(source_type, colortemp_mode); |
3796 | r->writeInt32(ret); |
3797 | break; |
3798 | } |
3799 | case FACTORY_WHITE_BALANCE_SET_GAIN_GREEN: { |
3800 | int source_type = p.readInt32(); |
3801 | int colortemp_mode = p.readInt32(); |
3802 | int value = p.readInt32(); |
3803 | int ret = mpTv->Tv_FactorySetWhiteBalanceGreenGain(source_type, colortemp_mode, value); |
3804 | r->writeInt32(ret); |
3805 | break; |
3806 | } |
3807 | case FACTORY_WHITE_BALANCE_GET_GAIN_GREEN: { |
3808 | int source_type = p.readInt32(); |
3809 | int colortemp_mode = p.readInt32(); |
3810 | int ret = mpTv->Tv_FactoryGetWhiteBalanceGreenGain(source_type, colortemp_mode); |
3811 | r->writeInt32(ret); |
3812 | break; |
3813 | } |
3814 | case FACTORY_WHITE_BALANCE_SET_GAIN_BLUE: { |
3815 | int source_type = p.readInt32(); |
3816 | int colortemp_mode = p.readInt32(); |
3817 | int value = p.readInt32(); |
3818 | int ret = mpTv->Tv_FactorySetWhiteBalanceBlueGain(source_type, colortemp_mode, value); |
3819 | r->writeInt32(ret); |
3820 | break; |
3821 | } |
3822 | case FACTORY_WHITE_BALANCE_GET_GAIN_BLUE: { |
3823 | int source_type = p.readInt32(); |
3824 | int colortemp_mode = p.readInt32(); |
3825 | int ret = mpTv->Tv_FactoryGetWhiteBalanceBlueGain(source_type, colortemp_mode); |
3826 | r->writeInt32(ret); |
3827 | break; |
3828 | } |
3829 | case FACTORY_WHITE_BALANCE_SET_OFFSET_RED: { |
3830 | int source_type = p.readInt32(); |
3831 | int colortemp_mode = p.readInt32(); |
3832 | int value = p.readInt32(); |
3833 | int ret = mpTv->Tv_FactorySetWhiteBalanceRedOffset(source_type, colortemp_mode, value); |
3834 | r->writeInt32(ret); |
3835 | break; |
3836 | } |
3837 | case FACTORY_WHITE_BALANCE_GET_OFFSET_RED: { |
3838 | int source_type = p.readInt32(); |
3839 | int colortemp_mode = p.readInt32(); |
3840 | int ret = mpTv->Tv_FactoryGetWhiteBalanceRedOffset(source_type, colortemp_mode); |
3841 | r->writeInt32(ret); |
3842 | break; |
3843 | } |
3844 | case FACTORY_WHITE_BALANCE_SET_OFFSET_GREEN: { |
3845 | int source_type = p.readInt32(); |
3846 | int colortemp_mode = p.readInt32(); |
3847 | int value = p.readInt32(); |
3848 | int ret = mpTv->Tv_FactorySetWhiteBalanceGreenOffset(source_type, colortemp_mode, value); |
3849 | r->writeInt32(ret); |
3850 | break; |
3851 | } |
3852 | case FACTORY_WHITE_BALANCE_GET_OFFSET_GREEN: { |
3853 | int source_type = p.readInt32(); |
3854 | int colortemp_mode = p.readInt32(); |
3855 | int ret = mpTv->Tv_FactoryGetWhiteBalanceGreenOffset(source_type, colortemp_mode); |
3856 | r->writeInt32(ret); |
3857 | break; |
3858 | } |
3859 | case FACTORY_WHITE_BALANCE_SET_OFFSET_BLUE: { |
3860 | int source_type = p.readInt32(); |
3861 | int colortemp_mode = p.readInt32(); |
3862 | int value = p.readInt32(); |
3863 | int ret = mpTv->Tv_FactorySetWhiteBalanceBlueOffset(source_type, colortemp_mode, value); |
3864 | r->writeInt32(ret); |
3865 | break; |
3866 | } |
3867 | case FACTORY_WHITE_BALANCE_GET_OFFSET_BLUE: { |
3868 | int source_type = p.readInt32(); |
3869 | int colortemp_mode = p.readInt32(); |
3870 | int ret = mpTv->Tv_FactoryGetWhiteBalanceBlueOffset(source_type, colortemp_mode); |
3871 | r->writeInt32(ret); |
3872 | break; |
3873 | } |
3874 | case FACTORY_WHITE_BALANCE_GET_COLOR_TMP: { |
3875 | int source_type = p.readInt32(); |
3876 | int ret = mpTv->Tv_FactoryGetWhiteBalanceColorTempMode(source_type); |
3877 | r->writeInt32(ret); |
3878 | break; |
3879 | } |
3880 | case FACTORY_WHITE_BALANCE_SET_COLOR_TMP: { |
3881 | int source_type = p.readInt32(); |
3882 | int Tempmode = p.readInt32(); |
3883 | int is_save = p.readInt32(); |
3884 | int ret = mpTv->Tv_FactorySetWhiteBalanceColorTempMode(source_type, Tempmode, is_save); |
3885 | r->writeInt32(ret); |
3886 | break; |
3887 | } |
3888 | case FACTORY_WHITE_BALANCE_SAVE_PRAMAS: { |
3889 | int source_type = p.readInt32(); |
3890 | int mode = p.readInt32(); |
3891 | int r_gain = p.readInt32(); |
3892 | int g_gain = p.readInt32(); |
3893 | int b_gain = p.readInt32(); |
3894 | int r_offset = p.readInt32(); |
3895 | int g_offset = p.readInt32(); |
3896 | int b_offset = p.readInt32(); |
3897 | int ret = mpTv->Tv_FactorySaveWhiteBalancePramas(source_type, mode, r_gain, g_gain, b_gain, r_offset, g_offset, b_offset); |
3898 | r->writeInt32(ret); |
3899 | break; |
3900 | } |
3901 | case FACTORY_WHITE_BALANCE_OPEN_GRAY_PATTERN: { |
3902 | int ret = mpTv->Tv_FactoryOpenWhiteBalanceGrayPattern(); |
3903 | r->writeInt32(ret); |
3904 | break; |
3905 | } |
3906 | case FACTORY_WHITE_BALANCE_CLOSE_GRAY_PATTERN: { |
3907 | int ret = mpTv->Tv_FactoryCloseWhiteBalanceGrayPattern(); |
3908 | r->writeInt32(ret); |
3909 | break; |
3910 | } |
3911 | case FACTORY_WHITE_BALANCE_SET_GRAY_PATTERN: { |
3912 | int value = p.readInt32(); |
3913 | int ret = mpTv->Tv_FactorySetWhiteBalanceGrayPattern(value); |
3914 | r->writeInt32(ret); |
3915 | break; |
3916 | } |
3917 | case FACTORY_WHITE_BALANCE_GET_GRAY_PATTERN: { |
3918 | int ret = mpTv->Tv_FactoryGetWhiteBalanceGrayPattern(); |
3919 | r->writeInt32(ret); |
3920 | break; |
3921 | } |
3922 | case FACTORY_WHITE_BALANCE_GET_ALL_PRAMAS: { |
3923 | int Tempmode = p.readInt32(); |
3924 | int ret = -1; |
3925 | tcon_rgb_ogo_t params; |
3926 | if (GetPlatformHaveFBCFlag() == 0) { //T868 |
3927 | ret = mpTv->GetColorTemperatureParams((vpp_color_temperature_mode_t)Tempmode, ¶ms); |
3928 | } else { //T866 |
3929 | ret = mpTv->Tv_FactoryWhiteBalanceGetAllParams(Tempmode, ¶ms); |
3930 | } |
3931 | r->writeInt32(ret); |
3932 | r->writeInt32(params.r_gain); |
3933 | r->writeInt32(params.g_gain); |
3934 | r->writeInt32(params.b_gain); |
3935 | r->writeInt32(params.r_post_offset); |
3936 | r->writeInt32(params.g_post_offset); |
3937 | r->writeInt32(params.b_post_offset); |
3938 | } |
3939 | case STOP_SCAN: { |
3940 | mpTv->stopScanLock(); |
3941 | break; |
3942 | } |
3943 | case DTV_GET_SNR: { |
3944 | int tmpRet = 0; |
3945 | tmpRet = mpTv->getFrontendSNR(); |
3946 | r->writeInt32(tmpRet); |
3947 | break; |
3948 | } |
3949 | case DTV_GET_BER: { |
3950 | int tmpRet = 0; |
3951 | tmpRet = mpTv->getFrontendBER(); |
3952 | r->writeInt32(tmpRet); |
3953 | break; |
3954 | } |
3955 | case DTV_GET_STRENGTH: { |
3956 | int tmpRet = 0; |
3957 | tmpRet = mpTv->getFrontendSignalStrength(); |
3958 | r->writeInt32(tmpRet); |
3959 | break; |
3960 | } |
3961 | case DTV_GET_AUDIO_TRACK_NUM: { |
3962 | int programId = p.readInt32(); |
3963 | int retCnt = 0; |
3964 | retCnt = mpTv->getAudioTrackNum(programId); |
3965 | r->writeInt32(retCnt); |
3966 | break; |
3967 | } |
3968 | case DTV_GET_AUDIO_TRACK_INFO: { |
3969 | int progId = p.readInt32(); |
3970 | int aIdx = p.readInt32(); |
3971 | int aFmt = -1; |
3972 | int iRet = -1; |
3973 | String8 lang; |
3974 | iRet = mpTv->getAudioInfoByIndex(progId, aIdx, &aFmt, lang); |
3975 | r->writeInt32(aFmt); |
3976 | r->writeString16(String16(lang)); |
3977 | break; |
3978 | } |
3979 | case DTV_SWITCH_AUDIO_TRACK: { |
3980 | int progId = p.readInt32(); |
3981 | int aTackIdx = p.readInt32(); |
3982 | int ret = -1; |
3983 | ret = mpTv->switchAudioTrack(progId, aTackIdx); |
3984 | r->writeInt32(ret); |
3985 | if(0 == ret) { |
3986 | CTvProgram prog; |
3987 | prog.setCurrAudioTrackIndex(progId, aTackIdx); |
3988 | } |
3989 | break; |
3990 | } |
3991 | case DTV_GET_CURR_AUDIO_TRACK_INDEX: { |
3992 | int currAduIdx = -1; |
3993 | int progId = p.readInt32(); |
3994 | CTvProgram prog; |
3995 | CTvProgram::selectByID(progId, prog); |
3996 | currAduIdx = prog.getCurrAudioTrackIndex(); |
3997 | r->writeInt32(currAduIdx); |
3998 | break; |
3999 | } |
4000 | case DTV_SET_AUDIO_CHANNEL_MOD: { |
4001 | int audioChannelIdx = p.readInt32(); |
4002 | mpTv->setAudioChannel(audioChannelIdx); |
4003 | break; |
4004 | } |
4005 | case DTV_GET_AUDIO_CHANNEL_MOD: { |
4006 | int currChannelMod; |
4007 | currChannelMod = mpTv->getAudioChannel(); |
4008 | r->writeInt32(currChannelMod); |
4009 | break; |
4010 | } |
4011 | case DTV_GET_CUR_FREQ: { |
4012 | int progId = p.readInt32(); |
4013 | int freq = 0; |
4014 | int iRet = -1; |
4015 | CTvProgram prog; |
4016 | CTvChannel channel; |
4017 | |
4018 | iRet = CTvProgram::selectByID(progId, prog); |
4019 | if(0 != iRet) return -1; |
4020 | prog.getChannel(channel); |
4021 | freq = channel.getFrequency(); |
4022 | r->writeInt32(freq); |
4023 | break; |
4024 | } |
4025 | case DTV_GET_EPG_UTC_TIME: { |
4026 | int iRet = -1; |
4027 | int utcTime = 0; |
4028 | |
4029 | utcTime = mpTv->getTvTime(); |
4030 | |
4031 | r->writeInt32(utcTime); |
4032 | break; |
4033 | } |
4034 | case DTV_GET_EPG_INFO_POINT_IN_TIME: { |
4035 | int progid = p.readInt32(); |
4036 | int utcTime = p.readInt32(); |
4037 | CTvProgram prog; |
4038 | int ret = CTvProgram::selectByID(progid, prog); |
4039 | CTvEvent ev; |
4040 | ret = ev.getProgPresentEvent(prog.getSrc(), prog.getID(), utcTime, ev); |
4041 | r->writeString16(String16(ev.getName())); |
4042 | r->writeString16(String16(ev.getDescription())); |
4043 | r->writeString16(String16(ev.getExtDescription())); |
4044 | r->writeInt32(ev.getStartTime()); |
4045 | r->writeInt32(ev.getEndTime()); |
4046 | r->writeInt32(ev.getSubFlag()); |
4047 | r->writeInt32(ev.getEventId()); |
4048 | break; |
4049 | } |
4050 | case DTV_GET_EPG_INFO_DURATION: { |
4051 | int iRet = -1; |
4052 | int iObOutSize = 0; |
4053 | Vector<sp<CTvEvent> > epgOut; |
4054 | int progid = p.readInt32(); |
4055 | int iUtcStartTime = p.readInt32(); |
4056 | int iDurationTime = p.readInt32(); |
4057 | CTvProgram prog; |
4058 | CTvEvent ev; |
4059 | iRet = CTvProgram::selectByID(progid, prog); |
4060 | if(0 != iRet) { |
4061 | break; |
4062 | } |
4063 | iRet = ev.getProgScheduleEvents(prog.getSrc(), prog.getID(), iUtcStartTime, iDurationTime, epgOut); |
4064 | if(0 != iRet) { |
4065 | break; |
4066 | } |
4067 | iObOutSize = epgOut.size(); |
4068 | if(0 == iObOutSize) { |
4069 | break; |
4070 | } |
4071 | |
4072 | r->writeInt32(iObOutSize); |
4073 | for(int i = 0; i < iObOutSize; i ++) { |
4074 | r->writeString16(String16(epgOut[i]->getName())); |
4075 | r->writeString16(String16(epgOut[i]->getDescription())); |
4076 | r->writeString16(String16(ev.getExtDescription())); |
4077 | r->writeInt32(epgOut[i]->getStartTime()); |
4078 | r->writeInt32(epgOut[i]->getEndTime()); |
4079 | r->writeInt32(epgOut[i]->getSubFlag()); |
4080 | r->writeInt32(epgOut[i]->getEventId()); |
4081 | } |
4082 | break; |
4083 | } |
4084 | case DTV_SET_PROGRAM_NAME: { |
4085 | CTvProgram prog; |
4086 | int progid = p.readInt32(); |
4087 | String16 tmpName = p.readString16(); |
4088 | String8 strName = String8(tmpName); |
4089 | prog.updateProgramName(progid, strName); |
4090 | break; |
4091 | } |
4092 | case DTV_SET_PROGRAM_SKIPPED: { |
4093 | CTvProgram prog; |
4094 | int progid = p.readInt32(); |
4095 | bool bSkipFlag = p.readInt32(); |
4096 | prog.setSkipFlag(progid, bSkipFlag); |
4097 | break; |
4098 | } |
4099 | case DTV_SET_PROGRAM_FAVORITE: { |
4100 | CTvProgram prog; |
4101 | int progid = p.readInt32(); |
4102 | bool bFavorite = p.readInt32(); |
4103 | prog.setFavoriteFlag(progid, bFavorite); |
4104 | break; |
4105 | } |
4106 | case DTV_DETELE_PROGRAM: { |
4107 | CTvProgram prog; |
4108 | int progid = p.readInt32(); |
4109 | prog.deleteProgram(progid); |
4110 | break; |
4111 | } |
4112 | case SET_BLACKOUT_ENABLE: { |
4113 | int enable = p.readInt32(); |
4114 | mpTv->setBlackoutEnable(enable); |
4115 | break; |
4116 | } |
4117 | case START_AUTO_BACKLIGHT: { |
4118 | mpTv->startAutoBackLight(); |
4119 | break; |
4120 | } |
4121 | case STOP_AUTO_BACKLIGHT: { |
4122 | mpTv->stopAutoBackLight(); |
4123 | break; |
4124 | } |
4125 | case IS_AUTO_BACKLIGHTING: { |
4126 | int on = mpTv->getAutoBackLight_on_off(); |
4127 | r->writeInt32(on); |
4128 | break; |
4129 | } |
4130 | case SSM_READ_BLACKOUT_ENABLE: { |
4131 | int enable = mpTv->getSaveBlackoutEnable(); |
4132 | r->writeInt32(enable); |
4133 | break; |
4134 | } |
4135 | case DTV_SWAP_PROGRAM: { |
4136 | CTvProgram prog; |
4137 | int firstProgId = p.readInt32(); |
4138 | int secondProgId = p.readInt32(); |
4139 | CTvProgram::selectByID(firstProgId, prog); |
4140 | int firstChanOrderNum = prog.getChanOrderNum(); |
4141 | CTvProgram::selectByID(secondProgId, prog); |
4142 | int secondChanOrderNum = prog.getChanOrderNum(); |
4143 | prog.swapChanOrder(firstProgId, firstChanOrderNum, secondProgId, secondChanOrderNum); |
4144 | break; |
4145 | } |
4146 | case DTV_SET_PROGRAM_LOCKED: { |
4147 | CTvProgram prog; |
4148 | int progid = p.readInt32(); |
4149 | bool bLocked = p.readInt32(); |
4150 | prog.setLockFlag(progid, bLocked); |
4151 | break; |
4152 | } |
4153 | case DTV_SET_BOOKING_FLAG: { |
4154 | CTvEvent ev; |
4155 | int iEvtId = p.readInt32(); |
4156 | bool iBookFlag = (bool)p.readInt32(); |
4157 | ev.bookEvent(iEvtId, iBookFlag); |
4158 | break; |
4159 | } |
4160 | case DTV_GET_FREQ_BY_PROG_ID: { |
4161 | int freq = 0; |
4162 | int progid = p.readInt32(); |
4163 | CTvProgram prog; |
4164 | int ret = CTvProgram::selectByID(progid, prog); |
4165 | if(ret != 0) return -1; |
4166 | CTvChannel channel; |
4167 | prog.getChannel(channel); |
4168 | freq = channel.getFrequency(); |
4169 | r->writeInt32(freq); |
4170 | break; |
4171 | } |
4172 | case DTV_GET_BOOKED_EVENT: { |
4173 | CTvBooking tvBook; |
4174 | Vector<sp<CTvBooking> > vTvBookOut; |
4175 | tvBook.getBookedEventList(vTvBookOut); |
4176 | int iObOutSize = vTvBookOut.size(); |
4177 | if(0 == iObOutSize) { |
4178 | break; |
4179 | } |
4180 | r->writeInt32(iObOutSize); |
4181 | for(int i = 0; i < iObOutSize; i ++) { |
4182 | r->writeString16(String16(vTvBookOut[i]->getProgName())); |
4183 | r->writeString16(String16(vTvBookOut[i]->getEvtName())); |
4184 | r->writeInt32(vTvBookOut[i]->getStartTime()); |
4185 | r->writeInt32(vTvBookOut[i]->getDurationTime()); |
4186 | r->writeInt32(vTvBookOut[i]->getBookId()); |
4187 | r->writeInt32(vTvBookOut[i]->getProgramId()); |
4188 | r->writeInt32(vTvBookOut[i]->getEventId()); |
4189 | } |
4190 | break; |
4191 | } |
4192 | case SET_FRONTEND_PARA: { |
4193 | int ret = -1; |
4194 | frontend_para_set_t feParms; |
4195 | feParms.mode = (fe_type_t)p.readInt32(); |
4196 | feParms.freq = p.readInt32(); |
4197 | feParms.videoStd = (atv_video_std_t)p.readInt32(); |
4198 | feParms.audioStd = (atv_audio_std_t)p.readInt32(); |
4199 | feParms.para1 = p.readInt32(); |
4200 | feParms.para2 = p.readInt32(); |
4201 | mpTv->resetFrontEndPara(feParms); |
4202 | r->writeInt32(ret); |
4203 | break; |
4204 | } |
4205 | case PLAY_PROGRAM: { |
4206 | int mode = p.readInt32(); |
4207 | int freq = p.readInt32(); |
4208 | if (mode == FE_ANALOG) { |
4209 | int videoStd = p.readInt32(); |
4210 | int audioStd = p.readInt32(); |
4211 | int fineTune = p.readInt32(); |
4212 | mpTv->playAtvProgram(freq, videoStd, audioStd, fineTune); |
4213 | } else { |
4214 | int para1 = p.readInt32(); |
4215 | int para2 = p.readInt32(); |
4216 | int vid = p.readInt32(); |
4217 | int vfmt = p.readInt32(); |
4218 | int aid = p.readInt32(); |
4219 | int afmt = p.readInt32(); |
4220 | int pcr = p.readInt32(); |
4221 | mpTv->playDtvProgram(mode, freq, para1, para2, vid, vfmt, aid, afmt, pcr); |
4222 | } |
4223 | break; |
4224 | } |
4225 | case GET_PROGRAM_LIST: { |
4226 | Vector<sp<CTvProgram> > out; |
4227 | int type = p.readInt32(); |
4228 | int skip = p.readInt32(); |
4229 | CTvProgram::selectByType(type, skip, out); |
4230 | r->writeInt32(out.size()); |
4231 | for(int i = 0; i < out.size(); i++) { |
4232 | r->writeInt32(out[i]->getID()); |
4233 | r->writeInt32(out[i]->getChanOrderNum()); |
4234 | r->writeInt32(out[i]->getMajor()); |
4235 | r->writeInt32(out[i]->getMinor()); |
4236 | r->writeInt32(out[i]->getProgType()); |
4237 | r->writeString16(String16(out[i]->getName())); |
4238 | r->writeInt32(out[i]->getProgSkipFlag()); |
4239 | r->writeInt32(out[i]->getFavoriteFlag()); |
4240 | r->writeInt32(out[i]->getVideo()->getFormat()); |
4241 | CTvChannel ch; |
4242 | out[i]->getChannel(ch); |
4243 | r->writeInt32(ch.getDVBTSID()); |
4244 | r->writeInt32(out[i]->getServiceId()); |
4245 | r->writeInt32(out[i]->getVideo()->getPID()); |
4246 | r->writeInt32(out[i]->getVideo()->getPID()); |
4247 | |
4248 | int audioTrackSize = out[i]->getAudioTrackSize(); |
4249 | r->writeInt32(audioTrackSize); |
4250 | for(int j = 0; j < audioTrackSize; j++) { |
4251 | r->writeString16(String16(out[i]->getAudio(j)->getLang())); |
4252 | r->writeInt32(out[i]->getAudio(j)->getFormat()); |
4253 | r->writeInt32(out[i]->getAudio(j)->getPID()); |
4254 | } |
4255 | r->writeInt32(ch.getFrequency()); |
4256 | } |
4257 | break; |
4258 | } |
4259 | case DTV_GET_VIDEO_FMT_INFO: { |
4260 | int srcWidth = 0; |
4261 | int srcHeight = 0; |
4262 | int srcFps = 0; |
4263 | int srcInterlace = 0; |
4264 | int iRet = -1; |
4265 | |
4266 | iRet == mpTv->getVideoFormatInfo(&srcWidth, &srcHeight, &srcFps, &srcInterlace); |
4267 | r->writeInt32(srcWidth); |
4268 | r->writeInt32(srcHeight); |
4269 | r->writeInt32(srcFps); |
4270 | r->writeInt32(srcInterlace); |
4271 | r->writeInt32(iRet); |
4272 | } |
4273 | break; |
4274 | |
4275 | case DTV_START_RECORD: { |
4276 | char buf[256]; |
4277 | String16 tmpName = p.readString16(); |
4278 | String8 strName = String8(tmpName); |
4279 | sprintf(buf, "%s", strName.string()); |
4280 | mpTv->SetRecordFileName(buf); |
4281 | mpTv->StartToRecord(); |
4282 | } |
4283 | break; |
4284 | case DTV_STOP_RECORD: |
4285 | mpTv->StopRecording(); |
4286 | break; |
4287 | case DTV_SET_RECORD_ALL_TS: { |
4288 | int sel = p.readInt32(); |
4289 | mpTv->SetRecCurTsOrCurProgram(sel); |
4290 | } |
4291 | break; |
4292 | case TV_PRINT_DEBUG_INFO: |
4293 | mpTv->printDebugInfo(); |
4294 | break; |
4295 | // EXTAR END |
4296 | default: |
4297 | LOGD("default"); |
4298 | break; |
4299 | } |
4300 | return 0; |
4301 | } |
4302 | |
4303 | sp<TvService::Client> TvService::Client::getClientFromCookie(void *user) |
4304 | { |
4305 | sp<Client> client = 0; |
4306 | /* |
4307 | TvService *service = static_cast<TvService*> (user); |
4308 | if (service != NULL) { |
4309 | Mutex::Autolock ourLock(service->mServiceLock); |
4310 | if (service->mClient != 0) { |
4311 | client = service->mClient.promote(); |
4312 | if (client == 0) { |
4313 | LOGE("getClientFromCookie: client appears to have died"); |
4314 | service->mClient.clear(); |
4315 | } |
4316 | } else { |
4317 | LOGE("getClientFromCookie: got callback but client was NULL"); |
4318 | } |
4319 | }*/ |
4320 | return client; |
4321 | } |
4322 | |
4323 | void TvService::Client::notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2, void *user) |
4324 | { |
4325 | LOGD("notifyCallback(%d)", msgType); |
4326 | |
4327 | sp<Client> client = getClientFromCookie(user); |
4328 | if (client == 0) { |
4329 | return; |
4330 | } |
4331 | |
4332 | switch (msgType) { |
4333 | //case TV_MSG_SHUTTER: |
4334 | // ext1 is the dimension of the yuv picture. |
4335 | // client->handleShutter((image_rect_type *)ext1); |
4336 | // break; |
4337 | default: |
4338 | sp<ITvClient> c = client->mTvClient; |
4339 | if (c != NULL) { |
4340 | //c->notifyCallback(msgType, ext1, ext2); |
4341 | } |
4342 | break; |
4343 | } |
4344 | |
4345 | #if DEBUG_CLIENT_REFERENCES |
4346 | if (client->getStrongCount() == 1) { |
4347 | LOGE("++++++++++++++++ (NOTIFY CALLBACK) THIS WILL CAUSE A LOCKUP!"); |
4348 | client->printRefs(); |
4349 | } |
4350 | #endif |
4351 | } |
4352 | |
4353 | int TvService::Client::notifyCallback(const int &msgtype, const Parcel &p) |
4354 | { |
4355 | mTvClient->notifyCallback(msgtype, p); |
4356 | return 0; |
4357 | } |
4358 | |
4359 | status_t TvService::onTransact(uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) |
4360 | { |
4361 | // permission checks... |
4362 | switch (code) { |
4363 | case BnTvService::CONNECT: |
4364 | IPCThreadState *ipc = IPCThreadState::self(); |
4365 | const int pid = ipc->getCallingPid(); |
4366 | const int self_pid = getpid(); |
4367 | if (pid != self_pid) { |
4368 | // we're called from a different process, do the real check |
4369 | /*if (!checkCallingPermission( |
4370 | String16("android.permission.TV"))) |
4371 | { |
4372 | const int uid = ipc->getCallingUid(); |
4373 | LOGE("Permission Denial: " |
4374 | "can't use the tv pid=%d, uid=%d", pid, uid); |
4375 | return PERMISSION_DENIED; |
4376 | }*/ |
4377 | } |
4378 | break; |
4379 | } |
4380 | |
4381 | status_t err = BnTvService::onTransact(code, data, reply, flags); |
4382 | |
4383 | #if DEBUG_HEAP_LEAKS |
4384 | LOGE("+++ onTransact err %d code %d", err, code); |
4385 | |
4386 | if (err == UNKNOWN_TRANSACTION || err == PERMISSION_DENIED) { |
4387 | LOGE("+++ onTransact code %d", code); |
4388 | |
4389 | CHECK_INTERFACE(ITvService, data, reply); |
4390 | |
4391 | switch(code) { |
4392 | case 1000: { |
4393 | if (gWeakHeap != 0) { |
4394 | sp<IMemoryHeap> h = gWeakHeap.promote(); |
4395 | IMemoryHeap *p = gWeakHeap.unsafe_get(); |
4396 | LOGE("CHECKING WEAK REFERENCE %p (%p)", h.get(), p); |
4397 | if (h != 0) |
4398 | h->printRefs(); |
4399 | bool attempt_to_delete = data.readInt32() == 1; |
4400 | if (attempt_to_delete) { |
4401 | // NOT SAFE! |
4402 | LOGE("DELETING WEAK REFERENCE %p (%p)", h.get(), p); |
4403 | if (p) delete p; |
4404 | } |
4405 | return NO_ERROR; |
4406 | } |
4407 | } |
4408 | break; |
4409 | default: |
4410 | break; |
4411 | } |
4412 | } |
4413 | #endif // DEBUG_HEAP_LEAKS |
4414 | return err; |
4415 | } |
4416 | |
4417 |