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