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