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