58 #ifdef COMMON_INTERFACE 67 #ifdef STB_DP_PRINT_REQUIRED 68 #define STB_DP_PRINT(x) DEBUG_PRINTX_CONDITIONAL(DEBUG_STB_DP) x 71 #define STB_DP_PRINT(x) STB_SPDebugWrite x 73 #define STB_DP_PRINT(x) 78 #define STB_RES_PRINT(x) STB_SPDebugWrite x 80 #define STB_RES_PRINT(x) 84 #define STB_TUNE_PRINT(x) STB_SPDebugWrite x 86 #define STB_TUNE_PRINT(x) 89 #define IS_LIVE_PATH(path) (path_status[path].in_use && \ 90 (path_status[path].tuner_no != INVALID_RES_ID) && \ 91 (path_status[path].audio_decoder_no != INVALID_RES_ID) && \ 92 (path_status[path].video_decoder_no != INVALID_RES_ID)) 94 #define IS_RECORDING_PATH(path) (path_status[path].in_use && \ 95 (path_status[path].tuner_no != INVALID_RES_ID) && \ 96 (path_status[path].is_recording)) 98 #define IS_PLAYBACK_PATH(path) (path_status[path].in_use && \ 99 (path_status[path].tuner_no == INVALID_RES_ID) && \ 100 (path_status[path].audio_decoder_no != INVALID_RES_ID) && \ 101 (path_status[path].video_decoder_no != INVALID_RES_ID)) 103 #define ACTION_DISH 0x01 104 #define ACTION_SKEW 0x02 105 #define ACTION_TUNE 0x04 106 #define ACTION_SI_NEW 0x08 108 #define ACTION_VIDEO 0x10 109 #define ACTION_AUDIO 0x20 110 #define ACTION_AD 0x40 111 #define ACTION_DECODE_MASK 0xf0 114 #define AD_ENABLED 0x01 115 #define AD_PID_PRESENT 0x02 116 #define AD_PAUSED 0x04 118 #define TUNER_MIN_SRATE 2000 119 #define TUNER_MAX_SRATE 45000 121 #define UNICABLE_COMMAND_SIZE 5 122 #define UNICABLE_SIGNAL_THRESHOLD 50 124 #define DISEQC_MESSAGE_DELAY 25 125 #define DISEQC_REPEAT_DELAY 100 132 E_STB_DP_PRIORITY priority;
137 U8BIT video_decoder_no;
138 U8BIT secondary_video_decoder_no;
139 U8BIT audio_decoder_no;
147 BOOLEAN is_recording;
148 E_STB_DP_RES_OWNER owner;
150 U32BIT owner_data_size;
155 U8BIT number_of_bands;
161 E_STB_DP_TUNE_STATUS tune_stat;
163 E_STB_DP_SIGNAL_TYPE signal_type;
168 BOOLEAN scram_search;
173 E_STB_OTA_SW_UPGRADE_SEARCH_MODE ota_search_status;
174 E_STB_DP_LNB_POWER lnb_power;
175 E_STB_DP_LNB_TYPE lnb_type;
179 BOOLEAN pulse_position;
180 BOOLEAN diseqc_position;
181 E_STB_DP_DISEQC_CSWITCH diseqc_cswitch;
182 U8BIT diseqc_uswitch;
183 E_STB_DP_DISEQC_TONE diseqc_tone;
184 BOOLEAN diseqc_smatv;
185 U8BIT diseqc_repeats;
189 E_STB_DP_POLARITY polarity;
193 E_STB_DP_MODULATION modulation;
194 E_STB_DP_TMODE terr_mode;
195 E_STB_DP_TBWIDTH terr_bwidth;
196 E_STB_DP_TTYPE terr_type;
199 E_STB_DP_CMODE cable_mode;
200 E_STB_DP_ANALOG_VIDEO_TYPE anlg_vtype;
203 BOOLEAN unicable_position_b;
204 U32BIT diseqc_msg_time;
205 U8BIT num_additional_frequencies;
206 U32BIT *additional_frequencies;
218 E_STB_DP_VIDEO_CODEC video_codec;
219 E_STB_DP_AUDIO_CODEC audio_codec;
220 E_STB_DP_AUDIO_CODEC ad_codec;
224 E_STB_DP_DEMUX_SOURCE source_type;
230 E_STB_DP_DECODE_STATUS audio_stat;
234 E_STB_DP_DECODE_SOURCE source_type;
237 E_STB_DP_AUDIO_MODE audio_mode;
239 E_STB_DP_AUDIO_CODEC codec;
246 E_STB_DP_DECODE_STATUS audio_stat;
247 E_STB_DP_AD_AUDIO ad_audio;
251 E_STB_DP_DECODE_SOURCE source_type;
253 E_STB_DP_AUDIO_MODE audio_mode;
254 E_STB_DP_AUDIO_CODEC codec;
261 E_STB_DP_DECODE_STATUS video_stat;
263 E_STB_DP_DECODE_SOURCE source_type;
266 E_STB_DP_VIDEO_CODEC codec;
274 static U8BIT num_paths;
277 static U8BIT num_tuners;
280 static U8BIT num_demuxes;
283 static U8BIT num_audio_decoders;
286 static U8BIT num_video_decoders;
289 static void *dp_protect;
290 static BOOLEAN lnb_currently_powered;
291 static BOOLEAN lnb_awake;
295 {POLARITY_HORIZONTAL, 0, 0, 5150, LNB_VOLTAGE_18V, FALSE},
296 {POLARITY_VERTICAL, 0, 0, 5150, LNB_VOLTAGE_14V, FALSE}
300 {POLARITY_HORIZONTAL, 0, 11750, 9750, LNB_VOLTAGE_18V, FALSE},
301 {POLARITY_HORIZONTAL, 11750, 0, 10600, LNB_VOLTAGE_18V, TRUE},
302 {POLARITY_VERTICAL, 0, 11750, 9750, LNB_VOLTAGE_14V, FALSE},
303 {POLARITY_VERTICAL, 11750, 0, 10600, LNB_VOLTAGE_14V, TRUE}
307 {POLARITY_HORIZONTAL, 0, 11750, 9750, LNB_VOLTAGE_14V, FALSE},
308 {POLARITY_HORIZONTAL, 11750, 0, 10600, LNB_VOLTAGE_14V, FALSE},
309 {POLARITY_VERTICAL, 0, 11750, 9750, LNB_VOLTAGE_14V, FALSE},
310 {POLARITY_VERTICAL, 11750, 0, 10600, LNB_VOLTAGE_14V, FALSE}
317 static BOOLEAN AcquireResources(U8BIT path, U16BIT demux_caps, BOOLEAN with_decoders);
318 static BOOLEAN StartTune(U8BIT path);
319 static U8BIT GetADEnabled(U8BIT path);
320 static void UnicableSendCommand(U8BIT path, U8BIT cmd[UNICABLE_COMMAND_SIZE]);
321 static void SendDISEQCMessage(U8BIT tuner, U8BIT *msg_data, U8BIT msg_size);
333 E_STB_DMX_DEMUX_SOURCE dmx_source;
344 num_paths = num_demuxes;
346 STB_RES_PRINT((
"STB_DPInitialise(tuners = %d, demuxes = %d, audio/video decoders = %d/%d)",
347 num_tuners, num_demuxes, num_audio_decoders, num_video_decoders));
348 STB_RES_PRINT((
"STB_DPInitialise: Max number of paths = %d", num_paths));
351 if (tuner_status != NULL)
353 memset(tuner_status, 0, num_tuners *
sizeof(
TUNER_STATUS));
355 for (i = 0; i < num_tuners; i++)
357 tuner_status[i].tune_stat = TUNE_NO_LOCK;
358 tuner_status[i].actions = 0;
359 tuner_status[i].signal_type = SIGNAL_NONE;
360 tuner_status[i].auto_relock = TRUE;
361 tuner_status[i].tv_search = TRUE;
362 tuner_status[i].rad_search = TRUE;
363 tuner_status[i].fta_search = TRUE;
364 tuner_status[i].scram_search = TRUE;
365 tuner_status[i].net_search = TRUE;
366 tuner_status[i].si_rparam1 = 0;
367 tuner_status[i].si_rparam2 = 0;
368 tuner_status[i].si_rparam3 = 0;
369 tuner_status[i].ota_search_status = OTA_SEARCH_OFF;
370 tuner_status[i].lnb_power = LNB_POWER_AUTO;
371 tuner_status[i].lnb_type = LNB_TYPE_UNIVERSAL;
373 memset(tuner_status[i].lnb_definition, 0, LNB_TYPE_MAX *
sizeof(
S_LNB_DEFINITION));
375 tuner_status[i].lnb_definition[LNB_TYPE_SINGLE].band_list = lnb_single;
376 tuner_status[i].lnb_definition[LNB_TYPE_SINGLE].number_of_bands =
379 tuner_status[i].lnb_definition[LNB_TYPE_UNIVERSAL].band_list = lnb_universal;
380 tuner_status[i].lnb_definition[LNB_TYPE_UNIVERSAL].number_of_bands =
383 tuner_status[i].lnb_definition[LNB_TYPE_UNICABLE].band_list = lnb_unicable;
384 tuner_status[i].lnb_definition[LNB_TYPE_UNICABLE].number_of_bands =
387 tuner_status[i].lnb_22k = FALSE;
388 tuner_status[i].lnb_12v = FALSE;
389 tuner_status[i].pulse_position = FALSE;
390 tuner_status[i].diseqc_position = FALSE;
391 tuner_status[i].diseqc_cswitch = DISEQC_CSWITCH_OFF;
392 tuner_status[i].diseqc_uswitch = 0;
393 tuner_status[i].diseqc_tone = DISEQC_TONE_OFF;
394 tuner_status[i].diseqc_smatv = FALSE;
395 tuner_status[i].diseqc_repeats = 0;
396 tuner_status[i].dish_pos = 0;
397 tuner_status[i].skew_pos = 0;
398 tuner_status[i].frequency = 0;
399 tuner_status[i].polarity = POLARITY_HORIZONTAL;
400 tuner_status[i].sym_rate = 0;
401 tuner_status[i].fec = FEC_AUTOMATIC;
402 tuner_status[i].dvb_s2 = FALSE;
403 tuner_status[i].modulation = MOD_QPSK;
404 tuner_status[i].terr_mode = MODE_COFDM_2K;
405 tuner_status[i].terr_bwidth = TBWIDTH_8MHZ;
406 tuner_status[i].terr_type = TERR_TYPE_UNKNOWN;
407 tuner_status[i].plp_id = 0;
408 tuner_status[i].freq_offset = 0;
409 tuner_status[i].cable_mode = MODE_QAM_AUTO;
410 tuner_status[i].diseqc_msg_time = 0;
415 if (demux_status != NULL)
417 for (i = 0; i < num_demuxes; i++)
419 demux_status[i].pcr_pid = 0;
420 demux_status[i].video_pid = 0;
421 demux_status[i].audio_pid = 0;
422 demux_status[i].AD_pid = 0;
423 demux_status[i].text_pid = 0;
424 demux_status[i].data_pid = 0;
426 demux_status[i].actions = 0;
433 demux_status[i].source_type = DEMUX_SOURCE_TUNER;
437 demux_status[i].source_type = DEMUX_SOURCE_FILE;
441 demux_status[i].source_type = DEMUX_SOURCE_LINEIN;
445 demux_status[i].source_param = (U32BIT)dmx_param;
450 if (ad_decoder_status != NULL)
452 for (i = 0; i < num_audio_decoders; i++)
454 ad_decoder_status[i].audio_stat = DECODE_STOPPED;
455 ad_decoder_status[i].ad_audio = AD_AUDIO_OFF;
456 ad_decoder_status[i].ad_status = 0;
457 ad_decoder_status[i].actions = 0;
458 ad_decoder_status[i].source_type = DECODE_SOURCE_DEMUX;
459 ad_decoder_status[i].source_param = i;
460 ad_decoder_status[i].audio_mode = AUDIO_MONO;
461 ad_decoder_status[i].codec = AUDIO_CODEC_AUTO;
466 if (audio_decoder_status != NULL)
468 for (i = 0; i < num_audio_decoders; i++)
470 audio_decoder_status[i].audio_stat = DECODE_STOPPED;
471 audio_decoder_status[i].actions = 0;
472 audio_decoder_status[i].source_type = DECODE_SOURCE_DEMUX;
473 audio_decoder_status[i].source_param = i;
475 audio_decoder_status[i].audio_mode = AUDIO_STEREO;
476 audio_decoder_status[i].codec = AUDIO_CODEC_AUTO;
481 if (video_decoder_status != NULL)
483 for (i = 0; i < num_video_decoders; i++)
485 video_decoder_status[i].video_stat = DECODE_STOPPED;
486 video_decoder_status[i].actions = 0;
487 video_decoder_status[i].source_type = DECODE_SOURCE_DEMUX;
488 video_decoder_status[i].source_param = i;
489 video_decoder_status[i].codec = VIDEO_CODEC_AUTO;
494 if (path_status != NULL)
496 for (i = 0; i < num_paths; i++)
500 path_status[i].tuner_no = INVALID_RES_ID;
501 path_status[i].demux_no = INVALID_RES_ID;
502 path_status[i].video_decoder_no = INVALID_RES_ID;
503 path_status[i].secondary_video_decoder_no = INVALID_RES_ID;
504 path_status[i].audio_decoder_no = INVALID_RES_ID;
505 path_status[i].ad_decoder_no = INVALID_RES_ID;
506 path_status[i].slot_id = INVALID_RES_ID;
507 path_status[i].ca_acquired = FALSE;
508 path_status[i].ca_handle = INVALID_CA_DESCRAMBLER_HANDLE;
509 path_status[i].lock_enable = FALSE;
510 path_status[i].lock_mode = FALSE;
511 path_status[i].search_mode = FALSE;
512 path_status[i].is_recording = FALSE;
513 path_status[i].owner = RES_OWNER_NONE;
514 path_status[i].owner_data = NULL;
515 path_status[i].owner_data_size = 0;
520 lnb_currently_powered = FALSE;
559 E_STB_DP_RES_OWNER owner, E_STB_DP_PRIORITY priority, BOOLEAN with_decoders, BOOLEAN for_recording)
563 BOOLEAN high_priority;
569 STB_RES_PRINT((
"STB_DPAcquireTunerPath(type=%u, serv=%p, trans=%p, owner=%u, priority=%u, decoders=%u, recording=%u)",
570 tuner_type, service, transport, owner, priority, with_decoders, for_recording));
572 path = INVALID_RES_ID;
575 for (i = 0; (i < num_paths) && (path == INVALID_RES_ID); i++)
577 if (!path_status[i].in_use)
579 if (priority == DP_PRIORITY_HIGH)
581 high_priority = TRUE;
585 high_priority = FALSE;
589 tuner_num =
STB_RESAcquireTuner(tuner_type, transport, owner, high_priority, &tuner_taken);
590 if (tuner_num != INVALID_RES_ID)
592 path_status[i].tuner_no = tuner_num;
596 dmx_caps = DMX_CAPS_RECORDING;
598 else if (with_decoders)
600 dmx_caps = DMX_CAPS_LIVE;
605 dmx_caps = DMX_CAPS_MONITOR_SI;
608 if (AcquireResources(i, dmx_caps, with_decoders))
613 tuner_status[tuner_num].tune_stat = TUNE_NO_LOCK;
620 for (j = 0; j < num_paths; j++)
622 if ((j != i) && path_status[j].in_use &&
623 (path_status[j].tuner_no == tuner_num) && (path_status[j].service != service))
627 path_status[j].service = service;
629 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_APPLICATION, EV_TYPE_FORCED_SERVICE_CHANGE,
636 tuner_status[tuner_num].signal_type = tuner_type;
638 path_status[i].in_use = TRUE;
639 path_status[i].priority = priority;
640 path_status[i].service = service;
641 path_status[i].owner = owner;
642 path_status[i].is_recording = for_recording;
649 path_status[i].tuner_no = INVALID_RES_ID;
656 if (path != INVALID_RES_ID)
658 STB_RES_PRINT((
"STB_DPAcquireTunerPath: Acquired path %u, tuner=%u, demux=%u, video=%u, audio=%u",
659 path, path_status[path].tuner_no, path_status[path].demux_no,
660 path_status[path].video_decoder_no, path_status[path].audio_decoder_no));
664 STB_RES_PRINT((
"STB_DPAcquireTunerPath: Failed to acquired tuner path"));
686 path = INVALID_RES_ID;
690 for (i = 0; (i < num_paths) && (path == INVALID_RES_ID); i++)
692 if (IS_PLAYBACK_PATH(i))
698 if (path == INVALID_RES_ID)
701 for (i = 0; (i < num_paths) && (path == INVALID_RES_ID); i++)
703 if (!path_status[i].in_use)
707 if (path_status[i].demux_no != INVALID_RES_ID)
710 if (path_status[i].video_decoder_no != INVALID_RES_ID)
712 param = (INVALID_RES_ID << 8) | path_status[i].demux_no;
713 STB_RES_PRINT((
"STB_DPAcquirePlaybackPath: path=%u, setting video source=0x%x param=0x%x", i, AV_DEMUX, param));
717 if (path_status[i].audio_decoder_no != INVALID_RES_ID)
720 STB_RES_PRINT((
"STB_DPAcquirePlaybackPath: path=%u, setting audio source=0x%x param=0x%x", i, AV_DEMUX, param));
725 if (path_status[i].ad_decoder_no != INVALID_RES_ID)
730 path_status[i].in_use = TRUE;
731 path_status[i].service = service;
732 path_status[i].owner = RES_OWNER_NONE;
742 path_status[i].video_decoder_no = INVALID_RES_ID;
745 path_status[i].demux_no = INVALID_RES_ID;
752 path_status[i].demux_no = INVALID_RES_ID;
760 if (path != INVALID_RES_ID)
762 STB_RES_PRINT((
"STB_DPAcquirePlaybackPath: Acquired playback path %u, demux=%u, video=%u, audio=%u",
763 path, path_status[path].demux_no, path_status[path].video_decoder_no,
764 path_status[path].audio_decoder_no));
768 STB_RES_PRINT((
"STB_DPAcquirePlaybackPath: Acquired playback path %u", path));
788 BOOLEAN high_priority;
792 ASSERT(path < num_paths);
796 if (path < num_paths)
798 STB_RES_PRINT((
"STB_DPReleasePath(path=%u, owner=%u): in_use=%u, owner=%u",
799 path, owner, path_status[path].in_use, path_status[path].owner));
801 if (path_status[path].in_use &&
802 ((path_status[path].owner == RES_OWNER_NONE) || (path_status[path].owner == owner)))
804 path_status[path].in_use = FALSE;
809 if (path_status[path].tuner_no != INVALID_RES_ID)
811 if (path_status[path].priority == DP_PRIORITY_HIGH)
813 high_priority = TRUE;
817 high_priority = FALSE;
821 path_status[path].tuner_no = INVALID_RES_ID;
824 path_status[path].service = NULL;
827 path_status[path].demux_no = INVALID_RES_ID;
829 if (path_status[path].video_decoder_no != INVALID_RES_ID)
832 path_status[path].video_decoder_no = INVALID_RES_ID;
835 if (path_status[path].secondary_video_decoder_no != INVALID_RES_ID)
838 path_status[path].secondary_video_decoder_no = INVALID_RES_ID;
841 if (path_status[path].audio_decoder_no != INVALID_RES_ID)
844 path_status[path].audio_decoder_no = INVALID_RES_ID;
847 if (path_status[path].ad_decoder_no != INVALID_RES_ID)
850 path_status[path].ad_decoder_no = INVALID_RES_ID;
853 if (path_status[path].ca_acquired)
860 STB_RES_PRINT((
"STB_DPReleasePath(path=%u): no CA slot on this path", path));
864 path_status[path].owner = RES_OWNER_NONE;
866 if (path_status[path].owner_data != NULL)
869 path_status[path].owner_data = NULL;
870 path_status[path].owner_data_size = 0;
878 STB_RES_PRINT((
"STB_DPReleasePath(path=%u): Failed to release path", path));
895 ASSERT(path < num_paths);
897 STB_RES_PRINT((
"STB_DPReleaseDecoders(%u)", path));
899 if (path < num_paths)
901 if (path_status[path].video_decoder_no != INVALID_RES_ID)
904 path_status[path].video_decoder_no = INVALID_RES_ID;
907 if (path_status[path].secondary_video_decoder_no != INVALID_RES_ID)
910 path_status[path].secondary_video_decoder_no = INVALID_RES_ID;
913 if (path_status[path].audio_decoder_no != INVALID_RES_ID)
916 path_status[path].audio_decoder_no = INVALID_RES_ID;
919 if (path_status[path].ad_decoder_no != INVALID_RES_ID)
922 path_status[path].ad_decoder_no = INVALID_RES_ID;
935 U8BIT path, num_paths;
939 STB_RES_PRINT((
"STB_DPReleaseAllPaths()"));
943 for (path = 0; path < num_paths; path++)
962 #ifndef COMMON_INTERFACE 963 USE_UNWANTED_PARAM(path);
964 USE_UNWANTED_PARAM(pmt_data);
965 USE_UNWANTED_PARAM(ci_protection_desc);
968 ASSERT(path < num_paths);
970 retval = INVALID_RES_ID;
972 #ifdef COMMON_INTERFACE 973 if (path < num_paths)
975 if (path_status[path].slot_id == INVALID_RES_ID)
977 retval = STB_RESAcquireCISlot(path_status[path].service,
978 pmt_data, ci_protection_desc);
979 if (retval != INVALID_RES_ID)
983 if ((path_status[path].tuner_no != INVALID_RES_ID) &&
986 STB_CIRouteTS(path_status[path].tuner_no, retval, TRUE);
988 path_status[path].slot_id = retval;
993 retval = path_status[path].slot_id;
994 STB_RES_PRINT((
"%s(%u): Path already has CI slot %u", __FUNCTION__, path,
995 path_status[path].slot_id));
1017 #ifndef COMMON_INTERFACE 1018 USE_UNWANTED_PARAM(path);
1019 USE_UNWANTED_PARAM(slot_id);
1024 STB_RES_PRINT((
"%s(path=%u, slot=%u)", __FUNCTION__, path, slot_id));
1026 #ifdef COMMON_INTERFACE 1027 if (STB_RESUseCISlot(slot_id))
1029 path_status[path].slot_id = slot_id;
1033 if (path_status[path].tuner_no != INVALID_RES_ID)
1035 STB_CIRouteTS(path_status[path].tuner_no, slot_id, TRUE);
1055 ASSERT(path < num_paths);
1057 STB_RES_PRINT((
"STB_DPReleaseCISlotFromPath(%u): slot_id=%u", path, path_status[path].slot_id));
1059 if ((path < num_paths) && (path_status[path].slot_id != INVALID_RES_ID))
1063 #ifdef COMMON_INTERFACE 1064 if ((path_status[path].tuner_no != INVALID_RES_ID) &&
1068 STB_CIRouteTS(path_status[path].tuner_no, path_status[path].slot_id, FALSE);
1072 path_status[path].slot_id = INVALID_RES_ID;
1088 slot_id = INVALID_RES_ID;
1090 if (path < num_paths)
1092 slot_id = path_status[path].slot_id;
1116 retval = INVALID_RES_ID;
1118 if (start_path == INVALID_RES_ID)
1123 for (path = start_path; (path < num_paths) && (retval == INVALID_RES_ID); path++)
1125 if (path_status[path].slot_id == slot_id)
1127 if ((ignore_path == INVALID_RES_ID) || (path != ignore_path))
1150 U16BIT num_pmt_ca_ids;
1157 ASSERT(path < num_paths);
1159 if (path < num_paths)
1161 retval = path_status[path].ca_acquired;
1162 if ((pmt_data != NULL) && !path_status[path].ca_acquired)
1165 if (demux_path != INVALID_RES_ID)
1168 serv_id = (pmt_data[3] << 8) + pmt_data[4];
1175 pmt_ca_ids, num_pmt_ca_ids, &path_status[path].ca_handle);
1176 if (path_status[path].ca_acquired)
1179 *ca_handle = path_status[path].ca_handle;
1180 STB_RES_PRINT((
"%s(%u): Acquired CA descrambler 0x%lx", __FUNCTION__, path,
1181 path_status[path].ca_handle));
1183 #ifdef STB_RES_DEBUG 1186 STB_RES_PRINT((
"%s(%u): No CA descrambler acquired", __FUNCTION__, path));
1191 #ifdef STB_RES_DEBUG 1194 STB_RES_PRINT((
"%s(%u), invalid demux path", __FUNCTION__, path));
1198 #ifdef STB_RES_DEBUG 1201 STB_RES_PRINT((
"%s(%u): Path already has a CA descrambler", __FUNCTION__, path));
1208 STB_RES_PRINT((
"%s(%u): Invalid path", __FUNCTION__, path));
1224 ASSERT(path < num_paths);
1226 STB_RES_PRINT((
"%s(path=%u): acquired=%u, handle=0x%lx", __FUNCTION__, path,
1227 path_status[path].ca_acquired, path_status[path].ca_handle));
1229 if ((path < num_paths) && path_status[path].ca_acquired)
1251 *handle = INVALID_CA_DESCRAMBLER_HANDLE;
1253 if (path < num_paths)
1255 retval = path_status[path].ca_acquired;
1258 *handle = path_status[path].ca_handle;
1277 path = INVALID_RES_ID;
1279 for (i = 0; (i < num_paths) && (path == INVALID_RES_ID); i++)
1281 if (IS_LIVE_PATH(i))
1299 BOOLEAN is_live = FALSE;
1303 ASSERT(path < num_paths);
1305 if (path < num_paths)
1307 is_live = IS_LIVE_PATH(path);
1322 BOOLEAN is_recording = FALSE;
1326 ASSERT(path < num_paths);
1328 if (path < num_paths)
1330 if (IS_RECORDING_PATH(path))
1332 is_recording = TRUE;
1338 return(is_recording);
1348 BOOLEAN is_decoding = FALSE;
1352 ASSERT(path < num_paths);
1354 if (path < num_paths)
1356 if ((path_status[path].video_decoder_no != INVALID_RES_ID) ||
1357 (path_status[path].audio_decoder_no != INVALID_RES_ID))
1365 return(is_decoding);
1379 path = INVALID_RES_ID;
1381 for (i = 0; (i < num_paths) && (path == INVALID_RES_ID); i++)
1383 if (IS_PLAYBACK_PATH(i))
1402 U8BIT path = INVALID_RES_ID;
1407 ASSERT(tuner_num < num_tuners);
1409 if (start_path == INVALID_RES_ID)
1418 for (; (i < num_paths) && (path == INVALID_RES_ID); i++)
1420 if (path_status[i].tuner_no == tuner_num)
1438 U8BIT path = INVALID_RES_ID;
1443 ASSERT(decoder_num < num_audio_decoders);
1445 for (i = 0; (i < num_paths) && (path == INVALID_RES_ID); i++)
1447 if (path_status[i].audio_decoder_no == decoder_num)
1465 U8BIT path = INVALID_RES_ID;
1470 ASSERT(decoder_num < num_audio_decoders);
1472 for (i = 0; (i < num_paths) && (path == INVALID_RES_ID); i++)
1474 if (path_status[i].ad_decoder_no == decoder_num)
1492 U8BIT path = INVALID_RES_ID;
1497 ASSERT(decoder_num < num_video_decoders);
1499 for (i = 0; (i < num_paths) && (path == INVALID_RES_ID); i++)
1501 if (path_status[i].video_decoder_no == decoder_num)
1522 ASSERT(path < num_paths);
1524 if ((path < num_paths) && (path_status[path].tuner_no != INVALID_RES_ID))
1539 void *transport = NULL;
1543 ASSERT(path < num_paths);
1545 if ((path < num_paths) && (path_status[path].tuner_no != INVALID_RES_ID))
1547 if (tuner_status[path_status[path].tuner_no].tune_stat == TUNE_LOCKED)
1567 ASSERT(path < num_paths);
1569 if ((path < num_paths) && path_status[path].in_use)
1571 path_status[path].service = service;
1584 void *service = NULL;
1588 ASSERT(path < num_paths);
1590 if ((path < num_paths) && path_status[path].in_use)
1592 service = path_status[path].service;
1607 U8BIT tuner_num = INVALID_RES_ID;
1611 ASSERT(path < num_paths);
1613 if (path < num_paths)
1615 tuner_num = path_status[path].tuner_no;
1630 E_STB_DP_SIGNAL_TYPE type;
1634 ASSERT(path < num_paths);
1638 if (path < num_paths)
1658 for (
id = 0;
id < num_tuners;
id++)
1675 if ((path < num_paths) && (path_status[path].tuner_no != INVALID_RES_ID))
1713 U8BIT demux_num = INVALID_RES_ID;
1717 ASSERT(path < num_paths);
1719 if (path < num_paths)
1721 demux_num = path_status[path].demux_no;
1736 U8BIT decoder_num = INVALID_RES_ID;
1740 ASSERT(path < num_paths);
1742 if (path < num_paths)
1744 decoder_num = path_status[path].audio_decoder_no;
1749 return(decoder_num);
1759 U8BIT decoder_num = INVALID_RES_ID;
1763 ASSERT(path < num_paths);
1765 if (path < num_paths)
1767 decoder_num = path_status[path].video_decoder_no;
1772 return(decoder_num);
1783 U8BIT decoder_num = INVALID_RES_ID;
1787 ASSERT(path < num_paths);
1789 if (path < num_paths)
1791 decoder_num = path_status[path].secondary_video_decoder_no;
1796 return(decoder_num);
1807 U8BIT tuned_path = INVALID_RES_ID;
1811 for (path = 0; (path < num_paths) && (tuned_path == INVALID_RES_ID); path++)
1813 if (path_status[path].in_use && (path_status[path].service == service))
1839 if (service != NULL)
1842 for (i = 0; (i < num_paths) && !can_tune; i++)
1844 if (path_status[i].in_use && (path_status[i].service == service))
1889 if (path < num_paths)
1891 path_status[path].owner = owner;
1893 if (path_status[path].tuner_no != INVALID_RES_ID)
1919 if (path < num_paths)
1923 if (path_status[path].owner_data != NULL)
1928 path_status[path].owner_data = NULL;
1929 path_status[path].owner_data_size = 0;
1933 if ((path_status[path].owner_data =
STB_GetMemory(data_size)) != NULL)
1935 memcpy(path_status[path].owner_data, data, data_size);
1936 path_status[path].owner_data_size = data_size;
1942 if (path_status[path].owner_data != NULL)
1947 path_status[path].owner_data = NULL;
1948 path_status[path].owner_data_size = 0;
1974 if (path < num_paths)
1976 if (path_status[path].owner == owner)
1997 FUNCTION_START(STB_DPGetTunerOwnerData);
1999 if (path < num_paths)
2001 data = path_status[path].owner_data;
2002 *data_size = path_status[path].owner_data_size;
2010 FUNCTION_FINISH(STB_DPGetTunerOwnerData);
2023 U8BIT audio_num, video_num;
2026 E_STB_AV_DECODE_SOURCE av_source;
2030 ASSERT(path < num_paths);
2032 STB_DP_PRINT((
"STB_DPSetDecodeSource(%d): %d 0x%x", path, source, param));
2034 ad_num = path_status[path].ad_decoder_no;
2035 audio_num = path_status[path].audio_decoder_no;
2036 video_num = path_status[path].video_decoder_no;
2037 demux_num = path_status[path].demux_no;
2039 STB_DP_PRINT((
"STB_DPSetDecodeSource(%d): audio = %d, AD = %d, video = %d", path, audio_num, ad_num, video_num));
2041 if ((audio_num != INVALID_RES_ID) && (video_num != INVALID_RES_ID))
2043 if ((source != audio_decoder_status[audio_num].source_type) ||
2044 (param != audio_decoder_status[audio_num].source_param) ||
2045 (source != video_decoder_status[video_num].source_type) ||
2046 (param != video_decoder_status[video_num].source_param) ||
2047 (source != ad_decoder_status[ad_num].source_type) ||
2048 (param != ad_decoder_status[ad_num].source_param) ||
2049 (demux_num != ad_decoder_status[ad_num].source_dmx) ||
2050 (demux_num != audio_decoder_status[audio_num].source_dmx) ||
2051 (demux_num != video_decoder_status[video_num].source_dmx))
2053 ad_decoder_status[ad_num].source_type = source;
2054 ad_decoder_status[ad_num].source_param = param;
2055 ad_decoder_status[ad_num].actions |= ACTION_AD;
2057 audio_decoder_status[audio_num].source_type = source;
2058 audio_decoder_status[audio_num].source_param = param;
2059 audio_decoder_status[audio_num].actions |= ACTION_AUDIO;
2061 video_decoder_status[video_num].source_type = source;
2062 video_decoder_status[video_num].source_param = param;
2063 video_decoder_status[video_num].actions |= ACTION_VIDEO;
2068 case DECODE_SOURCE_DEMUX: {av_source = AV_DEMUX;
break; }
2069 case DECODE_SOURCE_FILE: {av_source = AV_MEMORY;
break; }
2070 default: {av_source = AV_DEMUX;
break; }
2093 ASSERT(path < num_paths);
2095 decode_num = path_status[path].video_decoder_no;
2097 if (decode_num != INVALID_RES_ID)
2099 *source = video_decoder_status[decode_num].source_type;
2100 *param = video_decoder_status[decode_num].source_param;
2116 BOOLEAN retval = FALSE;
2120 ASSERT(path < num_paths);
2122 STB_DP_PRINT((
"STB_DPStartRecording(%d)", path));
2132 demux_num = path_status[path].demux_no;
2134 ASSERT(demux_num != INVALID_RES_ID);
2136 if ((demux_status[demux_num].actions & ACTION_DECODE_MASK) != 0)
2138 STB_DP_PRINT((
"STB_DPStartRecording(%u): Updating audio/video/pcr/AD PIDs (%u/%u/%u/%u) for demux %u", path,
2139 demux_status[demux_num].audio_pid, demux_status[demux_num].video_pid,
2140 demux_status[demux_num].pcr_pid, demux_status[demux_num].AD_pid, demux_num));
2143 demux_status[demux_num].actions &= ~ACTION_DECODE_MASK;
2146 demux_status[demux_num].video_pid, demux_status[demux_num].audio_pid,
2147 demux_status[demux_num].text_pid, demux_status[demux_num].data_pid,
2148 demux_status[demux_num].AD_pid);
2170 ASSERT(path < num_paths);
2172 STB_DP_PRINT((
"STB_DPStopRecording(%d)", path));
2208 E_STB_DP_TUNE_STATUS status;
2213 ASSERT(path < num_paths);
2215 tuner_num = path_status[path].tuner_no;
2217 STB_TUNE_PRINT((
"STB_DPStartTune(%d): Tuner %d, status=%d", path, tuner_num, status));
2219 if ((tuner_status[tuner_num].actions & ACTION_TUNE) != 0)
2222 tuner_status[tuner_num].actions &= ~ACTION_TUNE;
2225 status = TUNE_NO_LOCK;
2226 tuner_status[tuner_num].actions |= ACTION_SI_NEW;
2235 STB_TUNE_PRINT((
"STB_DPStartTune(%d): re-tune", path));
2238 if (StartTune(path) == FALSE)
2240 STB_TUNE_PRINT((
"STB_DPStartTune(%d): Tune failed", path));
2244 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_TUNE, EV_TYPE_NOTLOCKED, &tuner_num,
sizeof(U8BIT));
2251 STB_TUNE_PRINT((
"STB_DPStartTune(%d): re-tune not required", path));
2252 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_TUNE, EV_TYPE_LOCKED, &tuner_num,
sizeof(U8BIT));
2258 STB_TUNE_PRINT((
"STB_DPStartTune(%d): no action", path));
2274 USE_UNWANTED_PARAM(path);
2276 ASSERT(path < num_paths);
2291 ASSERT(path < num_paths);
2299 tuner_num = path_status[path].tuner_no;
2301 STB_TUNE_PRINT((
"STB_DPStopTune(%d): stop tuner %d", path, tuner_num));
2312 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_TUNE, EV_TYPE_STOPPED, &tuner_num,
sizeof(U8BIT));
2319 STB_TUNE_PRINT((
"STB_DPStopTune(%d): no action", path));
2337 ASSERT(path < num_paths);
2344 tuner_num = path_status[path].tuner_no;
2345 if (tuner_num != INVALID_RES_ID)
2347 STB_TUNE_PRINT((
"STB_DPTuneOff(%d): Tuner %d off", path, tuner_num));
2359 if (tuner_status[tuner_num].signal_type == SIGNAL_QPSK)
2361 if (tuner_status[tuner_num].lnb_power == LNB_POWER_AUTO)
2369 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_TUNE, EV_TYPE_STOPPED, &tuner_num,
sizeof(U8BIT));
2375 STB_TUNE_PRINT((
"STB_DPTuneOff(%d): status=%u, no action", path,
STB_DPGetTuneStatus(path)));
2381 lnb_currently_powered = FALSE;
2392 BOOLEAN lock = FALSE;
2393 E_STB_DP_DECODE_STATUS status;
2399 ASSERT(path < num_paths);
2403 decoder_num = path_status[path].video_decoder_no;
2404 demux_num = path_status[path].demux_no;
2406 if ((demux_status[demux_num].actions & ACTION_VIDEO) != 0)
2409 demux_status[demux_num].actions &= ~ACTION_VIDEO;
2410 status = DECODE_STOPPED;
2413 if (video_decoder_status[decoder_num].source_type == DECODE_SOURCE_DEMUX)
2415 STB_DP_PRINT((
"STB_DPStartVideoDecoding(%d): setting pids (video=%u, audio=%u, ad=%u)", path,
2416 demux_status[demux_num].video_pid, demux_status[demux_num].audio_pid, demux_status[demux_num].AD_pid));
2419 demux_status[demux_num].video_pid, demux_status[demux_num].audio_pid,
2420 demux_status[demux_num].text_pid, demux_status[demux_num].data_pid,
2421 demux_status[demux_num].AD_pid);
2425 if ((video_decoder_status[decoder_num].actions & ACTION_VIDEO) != 0)
2428 video_decoder_status[decoder_num].actions &= ~ACTION_VIDEO;
2429 status = DECODE_STOPPED;
2432 lock = (path_status[path].lock_mode && path_status[path].lock_enable);
2436 STB_DP_PRINT((
"STB_DPStartVideoDecoding(%d): locked", path));
2440 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_LOCKED, &decoder_num,
sizeof(U8BIT));
2446 case DECODE_STOPPING:
2447 case DECODE_STOPPED:
2451 STB_DP_PRINT((
"STB_DPStartVideoDecoding(%d): starting video decoder %d", path, decoder_num));
2457 case DECODE_RUNNING:
2459 STB_DP_PRINT((
"STB_DPStartVideoDecoding(%d): re-start not required", path));
2460 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_VIDEO_STARTED, &decoder_num,
sizeof(U8BIT));
2466 STB_DP_PRINT((
"STB_DPStartVideoDecoding(%d): no action", path));
2481 E_STB_AV_AUDIO_MODE audio_mode;
2482 BOOLEAN lock = FALSE;
2483 E_STB_DP_DECODE_STATUS status;
2490 ASSERT(path < num_paths);
2493 ad_status = GetADEnabled(path);
2494 decoder_num = path_status[path].ad_decoder_no;
2495 demux_num = path_status[path].demux_no;
2496 ASSERT(demux_num < num_demuxes);
2498 STB_DP_PRINT((
"STB_DPStartADDecoding %s, %s\n", (ad_status & AD_ENABLED) ?
"On" :
"Off",
2499 (ad_status & AD_PID_PRESENT) ?
"PID" :
"No PID"));
2501 if ((demux_status[demux_num].actions & ACTION_AD) != 0)
2504 demux_status[demux_num].actions &= ~ACTION_AD;
2505 status = DECODE_STOPPED;
2506 if (ad_decoder_status[decoder_num].source_type == DECODE_SOURCE_DEMUX)
2509 demux_status[demux_num].video_pid, demux_status[demux_num].audio_pid,
2510 demux_status[demux_num].text_pid, demux_status[demux_num].data_pid,
2511 demux_status[demux_num].AD_pid);
2515 if ((ad_status & AD_ENABLED) && (ad_status & AD_PID_PRESENT))
2517 if ((ad_decoder_status[decoder_num].actions & ACTION_AD) != 0)
2520 ad_decoder_status[decoder_num].actions &= ~ACTION_AD;
2521 status = DECODE_STOPPED;
2525 switch (ad_decoder_status[decoder_num].audio_mode)
2527 case AUDIO_MONO: {audio_mode = AV_AUDIO_MONO;
break; }
2528 case AUDIO_STEREO: {audio_mode = AV_AUDIO_STEREO;
break; }
2529 case AUDIO_LEFT: {audio_mode = AV_AUDIO_LEFT;
break; }
2530 case AUDIO_RIGHT: {audio_mode = AV_AUDIO_RIGHT;
break; }
2531 case AUDIO_MULTICHANNEL: {audio_mode = AV_AUDIO_MULTICHANNEL;
break; }
2532 default: {audio_mode = AV_AUDIO_MONO;
break; }
2537 lock = (path_status[path].lock_mode && path_status[path].lock_enable);
2540 STB_DP_PRINT((
"STB_DPStartADDecoding(%d): locked", path));
2544 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_LOCKED, &decoder_num,
sizeof(U8BIT));
2550 case DECODE_STOPPING:
2551 case DECODE_STOPPED:
2555 STB_DP_PRINT((
"STB_DPStartADDecoding(%d): start", path));
2557 ad_decoder_status[decoder_num].ad_status |= AD_ENABLED;
2562 case DECODE_RUNNING:
2564 STB_DP_PRINT((
"STB_DPStartADDecoding(%d): re-start not required", path));
2565 ad_decoder_status[decoder_num].ad_audio = AD_AUDIO_PLAYING;
2566 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_AD_STARTED, &decoder_num,
sizeof(U8BIT));
2571 STB_DP_PRINT((
"STB_DPStartADDecoding(%d): no action", path));
2587 E_STB_AV_AUDIO_MODE audio_mode;
2588 BOOLEAN lock = FALSE;
2589 E_STB_DP_DECODE_STATUS status;
2595 ASSERT(path < num_paths);
2599 decoder_num = path_status[path].audio_decoder_no;
2600 demux_num = path_status[path].demux_no;
2602 ASSERT(demux_num < num_demuxes);
2604 if ((demux_status[demux_num].actions & ACTION_AUDIO) != 0)
2607 demux_status[demux_num].actions &= ~ACTION_AUDIO;
2608 status = DECODE_STOPPED;
2610 if (audio_decoder_status[decoder_num].source_type == DECODE_SOURCE_DEMUX)
2613 demux_status[demux_num].video_pid, demux_status[demux_num].audio_pid,
2614 demux_status[demux_num].text_pid, demux_status[demux_num].data_pid,
2615 demux_status[demux_num].AD_pid);
2619 if ((audio_decoder_status[decoder_num].actions & ACTION_AUDIO) != 0)
2622 audio_decoder_status[decoder_num].actions &= ~ACTION_AUDIO;
2623 status = DECODE_STOPPED;
2627 switch (audio_decoder_status[decoder_num].audio_mode)
2629 case AUDIO_MONO: {audio_mode = AV_AUDIO_MONO;
break; }
2630 case AUDIO_STEREO: {audio_mode = AV_AUDIO_STEREO;
break; }
2631 case AUDIO_LEFT: {audio_mode = AV_AUDIO_LEFT;
break; }
2632 case AUDIO_RIGHT: {audio_mode = AV_AUDIO_RIGHT;
break; }
2633 case AUDIO_MULTICHANNEL: {audio_mode = AV_AUDIO_MULTICHANNEL;
break; }
2634 default: {audio_mode = AV_AUDIO_STEREO;
break; }
2639 lock = (path_status[path].lock_mode && path_status[path].lock_enable);
2643 STB_DP_PRINT((
"STB_DPStartAudioDecoding(%d): locked", path));
2647 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_LOCKED, &decoder_num,
sizeof(U8BIT));
2653 case DECODE_STOPPING:
2654 case DECODE_STOPPED:
2658 STB_DP_PRINT((
"STB_DPStartAudioDecoding(%d): start", path));
2664 case DECODE_RUNNING:
2666 STB_DP_PRINT((
"STB_DPStartAudioDecoding(%d): re-start not required", path));
2667 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_AUDIO_STARTED, &decoder_num,
sizeof(U8BIT));
2673 STB_DP_PRINT((
"STB_DPStartAudioDecoding(%d): no action", path));
2692 ASSERT(path < num_paths);
2694 STB_DP_PRINT((
"%s(%u)", __FUNCTION__, path));
2696 if (path_status[path].ca_acquired)
2704 if ((decoder_num = path_status[path].ad_decoder_no) != INVALID_RES_ID)
2706 if ((ad_decoder_status[decoder_num].ad_status & AD_ENABLED) != 0)
2721 U8BIT demux_num, decoder_num;
2725 ASSERT(path < num_paths);
2727 decoder_num = path_status[path].video_decoder_no;
2728 demux_num = path_status[path].demux_no;
2730 ASSERT(demux_num < num_demuxes);
2734 case DECODE_RUNNING:
2737 STB_DP_PRINT((
"STB_DPStopVideoDecoding(%d): stop (was running)", path));
2739 if ((demux_num != INVALID_RES_ID) && (decoder_num != INVALID_RES_ID))
2746 case DECODE_STARTING:
2748 STB_DP_PRINT((
"STB_DPStopVideoDecoding(%d): stop (was starting)", path));
2750 if ((demux_num != INVALID_RES_ID) && (decoder_num != INVALID_RES_ID))
2754 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_VIDEO_STOPPED, &decoder_num,
sizeof(U8BIT));
2758 case DECODE_STOPPED:
2761 STB_DP_PRINT((
"STB_DPStopVideoDecoding(%d): already stopped", path));
2763 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_VIDEO_STOPPED, &decoder_num,
sizeof(U8BIT));
2769 STB_DP_PRINT((
"STB_DPStopVideoDecoding(%d): no action", path));
2783 U8BIT demux_num, decoder_num;
2786 STB_DP_PRINT((
"STB_DPStopADDecoding"));
2787 ASSERT(path < num_paths);
2789 decoder_num = path_status[path].ad_decoder_no;
2790 demux_num = path_status[path].demux_no;
2792 ASSERT(decoder_num < num_audio_decoders);
2793 ASSERT(demux_num < num_demuxes);
2797 case DECODE_RUNNING:
2800 STB_DP_PRINT((
"STB_DPStopADDecoding(%d): stop (was running)", path));
2802 if ((demux_num != INVALID_RES_ID) && (decoder_num != INVALID_RES_ID))
2810 case DECODE_STARTING:
2812 STB_DP_PRINT((
"STB_DPStopADDecoding(%d): stop (was starting)", path));
2814 if ((demux_num != INVALID_RES_ID) && (decoder_num != INVALID_RES_ID))
2819 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_AD_STOPPED, &decoder_num,
sizeof(U8BIT));
2823 case DECODE_STOPPED:
2826 STB_DP_PRINT((
"STB_DPStopADDecoding(%d): already stopped", path));
2828 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_AD_STOPPED, &decoder_num,
sizeof(U8BIT));
2834 STB_DP_PRINT((
"STB_DPStopADDecoding(%d): no action", path));
2848 U8BIT demux_num, decoder_num;
2852 ASSERT(path < num_paths);
2854 decoder_num = path_status[path].audio_decoder_no;
2855 demux_num = path_status[path].demux_no;
2857 ASSERT(decoder_num < num_audio_decoders);
2858 ASSERT(demux_num < num_demuxes);
2862 case DECODE_RUNNING:
2865 STB_DP_PRINT((
"STB_DPStopAudioDecoding(%d): stop (was running)", path));
2867 if ((demux_num != INVALID_RES_ID) && (decoder_num != INVALID_RES_ID))
2875 case DECODE_STARTING:
2877 STB_DP_PRINT((
"STB_DPStopAudioDecoding(%d): stop (was starting)", path));
2879 if ((demux_num != INVALID_RES_ID) && (decoder_num != INVALID_RES_ID))
2883 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_AUDIO_STOPPED, &decoder_num,
sizeof(U8BIT));
2887 case DECODE_STOPPED:
2890 STB_DP_PRINT((
"STB_DPStopAudioDecoding(%d): already stopped", path));
2892 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DECODE, EV_TYPE_AUDIO_STOPPED, &decoder_num,
sizeof(U8BIT));
2898 STB_DP_PRINT((
"STB_DPStopAudioDecoding(%d): no action", path));
2914 ASSERT(path < num_paths);
2916 STB_DP_PRINT((
"%s(%u)", __FUNCTION__, path));
2922 if (path_status[path].ca_acquired)
2937 E_STB_SI_STATUS status;
2941 ASSERT(path < num_paths);
2943 tuner_num = path_status[path].tuner_no;
2945 if (tuner_num != INVALID_RES_ID)
2948 if (tuner_status[tuner_num].signal_type == SIGNAL_COFDM)
2950 STB_DP_PRINT((
"Signal Type = COFDM..."));
2952 else if (tuner_status[tuner_num].signal_type == SIGNAL_QPSK)
2954 STB_DP_PRINT((
"Signal Type = QPSK..."));
2956 else if (tuner_status[tuner_num].signal_type == SIGNAL_QAM)
2958 STB_DP_PRINT((
"Signal Type = QAM..."));
2962 STB_DP_PRINT((
"Signal type = UNRECOGNISED!"));
2968 if ((tuner_status[tuner_num].actions & ACTION_SI_NEW) != 0)
2971 tuner_status[tuner_num].actions &= ~ACTION_SI_NEW;
2972 status = SI_STOPPED;
2976 if (path_status[path].search_mode == TRUE)
2982 STB_DP_PRINT((
"STB_DPStartSI(%d): tuner %d - search invoked", path, tuner_num));
2989 STB_DP_PRINT((
"STB_DPStartSI(%d): tuner %d - no action", path, tuner_num));
3000 STB_DP_PRINT((
"STB_DPStartSI(%d): tuner %d - service change", path, tuner_num));
3007 STB_DP_PRINT((
"STB_DPStartSI(%d): tuner %d - start update", path, tuner_num));
3014 STB_DP_PRINT((
"STB_DPStartSI(%d): tuner %d - no action", path, tuner_num));
3024 if (path_status[path].search_mode == TRUE)
3030 STB_DP_PRINT((
"STB_DPStartSI(%d): playback - search", path));
3037 STB_DP_PRINT((
"STB_DPStartSI(%d): playback - no action", path));
3048 STB_DP_PRINT((
"STB_DPStartSI(%d): playback - service change", path));
3055 STB_DP_PRINT((
"STB_DPStartSI(%d): playback - start update", path));
3062 STB_DP_PRINT((
"STB_DPStartSI(%d): playback - no action", path));
3082 ASSERT(path < num_paths);
3085 STB_DP_PRINT((
"STB_DPStopSI(path=%d), tuner_num=%d", path, tuner_num));
3087 if (tuner_num != INVALID_RES_ID)
3090 if (tuner_status[tuner_num].signal_type == SIGNAL_COFDM)
3092 STB_DP_PRINT((
"Signal Type = COFDM..."));
3094 else if (tuner_status[tuner_num].signal_type == SIGNAL_QPSK)
3096 STB_DP_PRINT((
"Signal Type = QPSK..."));
3098 else if (tuner_status[tuner_num].signal_type == SIGNAL_QAM)
3100 STB_DP_PRINT((
"Signal Type = QAM..."));
3104 STB_DP_PRINT((
"Signal Type = UNRECOGNISED!"));
3114 STB_DP_PRINT((
"STB_DPStopSI(%d): tuner %d - stop invoked", path, tuner_num));
3121 STB_DP_PRINT((
"STB_DPStopSI(%d): tuner %d - stopped", path, tuner_num));
3127 STB_DP_PRINT((
"STB_DPStopSI(%d) : tuner %d - no action", path, tuner_num));
3140 STB_DP_PRINT((
"STB_DPStopSI(%d): terrestrial - stop", path));
3147 STB_DP_PRINT((
"STB_DPStopSI(%d): Stopped", path));
3153 STB_DP_PRINT((
"STB_DPStopSI(%d): status = 0x%x terrestrial - no action", path,
STB_SITerrGetStatus(path)));
3175 ASSERT(path < num_paths);
3177 tuner_num = path_status[path].tuner_no;
3179 ASSERT(tuner_num < num_tuners);
3181 tuner_status[tuner_num].si_rparam1 = start_date;
3182 tuner_status[tuner_num].si_rparam2 = start_hour;
3183 tuner_status[tuner_num].si_rparam3 = start_min;
3186 if (tuner_status[tuner_num].signal_type == SIGNAL_COFDM)
3188 STB_DP_PRINT((
"Signal Type = COFDM..."));
3190 else if (tuner_status[tuner_num].signal_type == SIGNAL_QPSK)
3192 STB_DP_PRINT((
"Signal Type = QPSK..."));
3194 else if (tuner_status[tuner_num].signal_type == SIGNAL_QAM)
3196 STB_DP_PRINT((
"Signal Type = QAM..."));
3200 STB_DP_PRINT((
"Signal Type = UNRECOGNISED!"));
3209 STB_DP_PRINT((
"STB_DPRequestSIExtendedEvent(%d): tuner %d - request", path, tuner_num));
3216 STB_DP_PRINT((
"STB_DPRequestSIExtendedEvent(%d): tuner %d - no action", path, tuner_num));
3236 ASSERT(path < num_paths);
3238 tuner_num = path_status[path].tuner_no;
3240 ASSERT(tuner_num < num_tuners);
3242 ret_val = tuner_status[tuner_num].si_rparam1;
3261 ASSERT(path < num_paths);
3263 tuner_num = path_status[path].tuner_no;
3265 ASSERT(tuner_num < num_tuners);
3267 ret_val = tuner_status[tuner_num].si_rparam2;
3286 ASSERT(path < num_paths);
3288 tuner_num = path_status[path].tuner_no;
3290 ASSERT(tuner_num < num_tuners);
3292 ret_val = tuner_status[tuner_num].si_rparam3;
3310 ASSERT(path < num_paths);
3314 tuner_num = path_status[path].tuner_no;
3316 STB_TUNE_PRINT((
"STB_DPSetTuneStatus(%u, %u): tuner=%u", path, state, tuner_num));
3318 ASSERT(tuner_num < num_tuners);
3320 tuner_status[tuner_num].tune_stat = state;
3335 E_STB_DP_TUNE_STATUS ret_val;
3339 ASSERT(path < num_paths);
3341 tuner_num = path_status[path].tuner_no;
3343 ASSERT(tuner_num < num_tuners);
3347 ret_val = tuner_status[tuner_num].tune_stat;
3349 STB_TUNE_PRINT((
"STB_DPGetTuneStatus(%u): tuner=%u, state=%u", path, tuner_num, ret_val));
3377 STB_DP_PRINT((
"STB_DPSetADEnabled"));
3378 ASSERT(path < num_paths);
3380 decoder_num = path_status[path].ad_decoder_no;
3382 ASSERT(decoder_num < num_audio_decoders);
3384 STB_DP_PRINT((
"STB_DPSetADEnabled(%d): decoder=%d, audio state=%d", path, decoder_num, state));
3390 ad_decoder_status[decoder_num].ad_status &= ~AD_ENABLED;
3394 ad_decoder_status[decoder_num].ad_status |= AD_ENABLED;
3415 static U8BIT GetADEnabled(U8BIT path)
3420 FUNCTION_START(GetADEnabled);
3422 ASSERT(path < num_paths);
3424 decoder_num = path_status[path].ad_decoder_no;
3426 ASSERT(decoder_num < num_audio_decoders);
3430 ad_status = ad_decoder_status[decoder_num].ad_status;
3434 STB_DP_PRINT((
"GetADEnabled(%d): decoder=%d, ad status=%d", path, decoder_num, ad_status));
3436 FUNCTION_FINISH(GetADEnabled);
3458 ASSERT(path < num_paths);
3460 decoder_num = path_status[path].ad_decoder_no;
3462 ASSERT(decoder_num < num_audio_decoders);
3466 ad_decoder_status[decoder_num].ad_audio = ad_audio;
3470 STB_DP_PRINT((
"STB_DPSetADAudio = %d\n", ad_audio));
3490 E_STB_DP_AD_AUDIO ret_val;
3494 ASSERT(path < num_paths);
3496 decoder_num = path_status[path].ad_decoder_no;
3498 ASSERT(decoder_num < num_audio_decoders);
3502 ret_val = ad_decoder_status[decoder_num].ad_audio;
3506 STB_DP_PRINT((
"STB_DPGetADAudio = %d\n", ret_val));
3530 ASSERT(path < num_paths);
3532 decoder_num = path_status[path].ad_decoder_no;
3534 ASSERT(decoder_num < num_audio_decoders);
3536 STB_DP_PRINT((
"STB_DPSetADStatus(%d): decoder=%d, state=%d", path, decoder_num, state));
3540 if ((ad_decoder_status[decoder_num].audio_stat != state) &&
3541 path_status[path].ca_acquired)
3546 case DECODE_STARTING:
3550 case DECODE_RUNNING:
3554 case DECODE_STOPPED:
3563 ad_decoder_status[decoder_num].audio_stat = state;
3584 E_STB_DP_DECODE_STATUS ret_val;
3588 ASSERT(path < num_paths);
3590 decoder_num = path_status[path].ad_decoder_no;
3592 ASSERT(decoder_num < num_audio_decoders);
3596 ret_val = ad_decoder_status[decoder_num].audio_stat;
3623 ASSERT(path < num_paths);
3625 decoder_num = path_status[path].audio_decoder_no;
3627 ASSERT(decoder_num < num_audio_decoders);
3629 STB_DP_PRINT((
"STB_DPSetAudioStatus(%d): decoder=%d, state=%d", path, decoder_num, state));
3633 if ((audio_decoder_status[decoder_num].audio_stat != state) &&
3634 path_status[path].ca_acquired)
3639 case DECODE_STARTING:
3643 case DECODE_RUNNING:
3647 case DECODE_STOPPED:
3656 audio_decoder_status[decoder_num].audio_stat = state;
3677 E_STB_DP_DECODE_STATUS ret_val;
3681 ASSERT(path < num_paths);
3683 decoder_num = path_status[path].audio_decoder_no;
3685 ASSERT(decoder_num < num_audio_decoders);
3689 ret_val = audio_decoder_status[decoder_num].audio_stat;
3716 ASSERT(path < num_paths);
3718 decoder_num = path_status[path].video_decoder_no;
3720 ASSERT(decoder_num < num_video_decoders);
3722 STB_DP_PRINT((
"STB_DPSetVideoStatus(%d): decoder=%d, state=%d", path, decoder_num, state));
3726 if ((video_decoder_status[decoder_num].video_stat != state) &&
3727 path_status[path].ca_acquired)
3732 case DECODE_STARTING:
3736 case DECODE_RUNNING:
3740 case DECODE_STOPPED:
3749 video_decoder_status[decoder_num].video_stat = state;
3770 E_STB_DP_DECODE_STATUS ret_val;
3774 ASSERT(path < num_paths);
3776 decoder_num = path_status[path].video_decoder_no;
3778 ASSERT(decoder_num < num_video_decoders);
3782 ret_val = video_decoder_status[decoder_num].video_stat;
3809 ASSERT(path < num_paths);
3811 tuner_num = path_status[path].tuner_no;
3813 ASSERT(tuner_num < num_tuners);
3815 STB_TUNE_PRINT((
"STB_DPSetSignalType(%d): sigtype %d", path, sigtype));
3816 if (sigtype != tuner_status[tuner_num].signal_type)
3818 tuner_status[tuner_num].signal_type = sigtype;
3819 tuner_status[tuner_num].actions |= ACTION_TUNE;
3839 E_STB_DP_SIGNAL_TYPE ret_val;
3843 ASSERT(path < num_paths);
3845 tuner_num = path_status[path].tuner_no;
3847 ASSERT(tuner_num < num_tuners);
3849 ret_val = tuner_status[tuner_num].signal_type;
3874 ASSERT(path < num_paths);
3876 tuner_num = path_status[path].tuner_no;
3878 ASSERT(tuner_num < num_tuners);
3880 STB_TUNE_PRINT((
"STB_DPSetTuneRelock(%d): tuner %d state %d", path, tuner_num, state));
3881 tuner_status[tuner_num].auto_relock = state;
3906 ASSERT(path < num_paths);
3908 tuner_num = path_status[path].tuner_no;
3910 ASSERT(tuner_num < num_tuners);
3912 ret_val = tuner_status[tuner_num].auto_relock;
3935 ASSERT(path < num_paths);
3937 STB_DP_PRINT((
"STB_DPSetLockEnable(%d): state %d", path, state));
3938 path_status[path].lock_enable = state;
3960 ASSERT(path < num_paths);
3962 ret_val = path_status[path].lock_enable;
3985 ASSERT(path < num_paths);
3987 STB_DP_PRINT((
"STB_DPSetSearchMode(%d): state %d", path, state));
3988 path_status[path].search_mode = state;
4010 ASSERT(path < num_paths);
4012 ret_val = path_status[path].search_mode;
4037 ASSERT(path < num_paths);
4039 tuner_num = path_status[path].tuner_no;
4041 ASSERT(tuner_num < num_tuners);
4043 STB_DP_PRINT((
"STB_DPSetTVSearch(%d): tuner %d state %d", path, tuner_num, state));
4044 tuner_status[tuner_num].tv_search = state;
4067 ASSERT(path < num_paths);
4069 tuner_num = path_status[path].tuner_no;
4071 ASSERT(tuner_num < num_tuners);
4073 ret_val = tuner_status[tuner_num].tv_search;
4098 ASSERT(path < num_paths);
4100 tuner_num = path_status[path].tuner_no;
4102 ASSERT(tuner_num < num_tuners);
4104 STB_DP_PRINT((
"STB_DPSetRadioSearch(%d): tuner %d state %d", path, tuner_num, state));
4105 tuner_status[tuner_num].rad_search = state;
4128 ASSERT(path < num_paths);
4130 tuner_num = path_status[path].tuner_no;
4132 ASSERT(tuner_num < num_tuners);
4134 ret_val = tuner_status[tuner_num].rad_search;
4159 ASSERT(path < num_paths);
4161 tuner_num = path_status[path].tuner_no;
4163 ASSERT(tuner_num < num_tuners);
4165 STB_DP_PRINT((
"STB_DPSetFTASearch(%d): tuner %d state %d", path, tuner_num, state));
4166 tuner_status[tuner_num].fta_search = state;
4189 ASSERT(path < num_paths);
4191 tuner_num = path_status[path].tuner_no;
4193 ASSERT(tuner_num < num_tuners);
4195 ret_val = tuner_status[tuner_num].fta_search;
4220 ASSERT(path < num_paths);
4222 tuner_num = path_status[path].tuner_no;
4224 ASSERT(tuner_num < num_tuners);
4226 STB_DP_PRINT((
"STB_DPSetScramSearch(%d): tuner %d state %d", path, tuner_num, state));
4227 tuner_status[tuner_num].scram_search = state;
4250 ASSERT(path < num_paths);
4252 tuner_num = path_status[path].tuner_no;
4254 ASSERT(tuner_num < num_tuners);
4256 ret_val = tuner_status[tuner_num].scram_search;
4281 ASSERT(path < num_paths);
4283 tuner_num = path_status[path].tuner_no;
4285 ASSERT(tuner_num < num_tuners);
4287 STB_DP_PRINT((
"STB_DPSetNetworkSearch(%d): tuner %d state %d", path, tuner_num, state));
4288 tuner_status[tuner_num].net_search = state;
4311 ASSERT(path < num_paths);
4313 tuner_num = path_status[path].tuner_no;
4315 ASSERT(tuner_num < num_tuners);
4317 ret_val = tuner_status[tuner_num].net_search;
4344 ASSERT(path < num_paths);
4346 tuner_num = path_status[path].tuner_no;
4348 ASSERT(tuner_num < num_tuners);
4350 STB_DP_PRINT((
"STB_DPSetOTASearchMode(%d): tuner %d mode %d", path, tuner_num, mode));
4351 tuner_status[tuner_num].ota_search_status = mode;
4372 E_STB_OTA_SW_UPGRADE_SEARCH_MODE ret_val;
4376 ASSERT(path < num_paths);
4378 tuner_num = path_status[path].tuner_no;
4380 ASSERT(tuner_num < num_tuners);
4382 ret_val = tuner_status[tuner_num].ota_search_status;
4408 ASSERT(path < num_paths);
4410 tuner_num = path_status[path].tuner_no;
4412 ASSERT(tuner_num < num_tuners);
4414 ret_val = (tuner_status[tuner_num].ota_search_status != OTA_SEARCH_OFF);
4439 ASSERT(path < num_paths);
4441 tuner_num = path_status[path].tuner_no;
4443 ASSERT(tuner_num < num_tuners);
4445 STB_TUNE_PRINT((
"STB_DPSetLNBPower(%d) : tuner %d state %d", path, tuner_num, state));
4446 if (state != tuner_status[tuner_num].lnb_power)
4448 tuner_status[tuner_num].lnb_power = state;
4449 tuner_status[tuner_num].actions |= ACTION_TUNE;
4469 E_STB_DP_LNB_POWER ret_val;
4473 ASSERT(path < num_paths);
4475 tuner_num = path_status[path].tuner_no;
4477 ASSERT(tuner_num < num_tuners);
4479 ret_val = tuner_status[tuner_num].lnb_power;
4504 ASSERT(path < num_paths);
4506 tuner_num = path_status[path].tuner_no;
4508 ASSERT(tuner_num < num_tuners);
4510 STB_TUNE_PRINT((
"STB_DPSetLNBType(%d) : tuner %d type %d", path, tuner_num, type));
4511 if (type != tuner_status[tuner_num].lnb_type)
4513 tuner_status[tuner_num].lnb_type = type;
4514 tuner_status[tuner_num].actions |= ACTION_TUNE;
4534 E_STB_DP_LNB_TYPE ret_val;
4538 ASSERT(path < num_paths);
4540 tuner_num = path_status[path].tuner_no;
4542 ASSERT(tuner_num < num_tuners);
4544 ret_val = tuner_status[tuner_num].lnb_type;
4566 ASSERT(path < num_paths);
4568 tuner_num = path_status[path].tuner_no;
4570 ASSERT(tuner_num < num_tuners);
4572 tuner_status[tuner_num].lnb_definition[LNB_TYPE_USER_DEFINED].number_of_bands = number_of_bands;
4573 tuner_status[tuner_num].lnb_definition[LNB_TYPE_USER_DEFINED].band_list = band_definitions;
4596 ASSERT(path < num_paths);
4598 tuner_num = path_status[path].tuner_no;
4600 ASSERT(tuner_num < num_tuners);
4602 STB_TUNE_PRINT((
"STB_DPSetLNB22k(%d) : tuner %d state %d", path, tuner_num, state));
4603 if (state != tuner_status[tuner_num].lnb_22k)
4605 tuner_status[tuner_num].lnb_22k = state;
4608 if (tuner_status[tuner_num].lnb_power != LNB_POWER_OFF)
4611 if (tuner_status[tuner_num].lnb_type == LNB_TYPE_SINGLE)
4613 tuner_status[tuner_num].actions |= ACTION_TUNE;
4639 ASSERT(path < num_paths);
4641 tuner_num = path_status[path].tuner_no;
4643 ASSERT(tuner_num < num_tuners);
4645 ret_val = tuner_status[tuner_num].lnb_22k;
4670 ASSERT(path < num_paths);
4672 tuner_num = path_status[path].tuner_no;
4674 ASSERT(tuner_num < num_tuners);
4676 STB_TUNE_PRINT((
"STB_DPSetLNB12v(%d) : tuner %d state %d", path, tuner_num, state));
4677 if (state != tuner_status[tuner_num].lnb_12v)
4679 tuner_status[tuner_num].lnb_12v = state;
4680 tuner_status[tuner_num].actions |= ACTION_TUNE;
4704 ASSERT(path < num_paths);
4706 tuner_num = path_status[path].tuner_no;
4708 ASSERT(tuner_num < num_tuners);
4710 ret_val = tuner_status[tuner_num].lnb_12v;
4735 ASSERT(path < num_paths);
4737 tuner_num = path_status[path].tuner_no;
4739 ASSERT(tuner_num < num_tuners);
4741 STB_TUNE_PRINT((
"STB_DPSetPulsePosition(%d): state %d", path, state));
4742 tuner_status[tuner_num].pulse_position = state;
4765 ASSERT(path < num_paths);
4767 tuner_num = path_status[path].tuner_no;
4769 ASSERT(tuner_num < num_tuners);
4771 ret_val = tuner_status[tuner_num].pulse_position;
4796 ASSERT(path < num_paths);
4798 tuner_num = path_status[path].tuner_no;
4800 ASSERT(tuner_num < num_tuners);
4802 STB_TUNE_PRINT((
"STB_DPSetDISEQCPosition(%d): state %d", path, state));
4803 tuner_status[tuner_num].diseqc_position = state;
4826 ASSERT(path < num_paths);
4828 tuner_num = path_status[path].tuner_no;
4830 ASSERT(tuner_num < num_tuners);
4832 ret_val = tuner_status[tuner_num].diseqc_position;
4857 ASSERT(path < num_paths);
4859 tuner_num = path_status[path].tuner_no;
4861 ASSERT(tuner_num < num_tuners);
4863 STB_TUNE_PRINT((
"STB_DPSetDISEQCCSwitch(%d): state %d", path, state));
4864 if (state != tuner_status[tuner_num].diseqc_cswitch)
4866 tuner_status[tuner_num].diseqc_cswitch = state;
4867 tuner_status[tuner_num].actions |= ACTION_TUNE;
4887 E_STB_DP_DISEQC_CSWITCH ret_val;
4891 ASSERT(path < num_paths);
4893 tuner_num = path_status[path].tuner_no;
4895 ASSERT(tuner_num < num_tuners);
4897 ret_val = tuner_status[tuner_num].diseqc_cswitch;
4922 ASSERT(path < num_paths);
4924 tuner_num = path_status[path].tuner_no;
4926 ASSERT(tuner_num < num_tuners);
4928 STB_TUNE_PRINT((
"STB_DPSetDISEQCUSwitch(%d): state %d", path, state));
4929 if (state != tuner_status[tuner_num].diseqc_uswitch)
4931 tuner_status[tuner_num].diseqc_uswitch = state;
4932 tuner_status[tuner_num].actions |= ACTION_TUNE;
4956 ASSERT(path < num_paths);
4958 tuner_num = path_status[path].tuner_no;
4960 ASSERT(tuner_num < num_tuners);
4962 ret_val = tuner_status[tuner_num].diseqc_uswitch;
4987 ASSERT(path < num_paths);
4989 tuner_num = path_status[path].tuner_no;
4991 ASSERT(tuner_num < num_tuners);
4993 STB_TUNE_PRINT((
"STB_DPSetDISEQCTone(%d): state %d", path, state));
4994 if (state != tuner_status[tuner_num].diseqc_tone)
4996 tuner_status[tuner_num].diseqc_tone = state;
4997 tuner_status[tuner_num].actions |= ACTION_TUNE;
5017 E_STB_DP_DISEQC_TONE ret_val;
5021 ASSERT(path < num_paths);
5023 tuner_num = path_status[path].tuner_no;
5025 ASSERT(tuner_num < num_tuners);
5027 ret_val = tuner_status[tuner_num].diseqc_tone;
5052 ASSERT(path < num_paths);
5054 tuner_num = path_status[path].tuner_no;
5056 ASSERT(tuner_num < num_tuners);
5058 STB_TUNE_PRINT((
"STB_DPSetDISEQCSMATV(%d): state %d", path, state));
5059 if (state != tuner_status[tuner_num].diseqc_smatv)
5061 tuner_status[tuner_num].diseqc_smatv = state;
5062 tuner_status[tuner_num].actions |= ACTION_TUNE;
5086 ASSERT(path < num_paths);
5088 tuner_num = path_status[path].tuner_no;
5090 ASSERT(tuner_num < num_tuners);
5092 ret_val = tuner_status[tuner_num].diseqc_smatv;
5117 ASSERT(path < num_paths);
5119 tuner_num = path_status[path].tuner_no;
5121 ASSERT(tuner_num < num_tuners);
5123 STB_TUNE_PRINT((
"STB_DPSetDISEQCRepeats(%u, %u): current count=%u", path, count,
5124 tuner_status[tuner_num].diseqc_repeats));
5126 if (count != tuner_status[tuner_num].diseqc_repeats)
5128 tuner_status[tuner_num].diseqc_repeats = count;
5129 tuner_status[tuner_num].actions |= ACTION_TUNE;
5153 ASSERT(path < num_paths);
5155 tuner_num = path_status[path].tuner_no;
5157 ASSERT(tuner_num < num_tuners);
5159 ret_val = tuner_status[tuner_num].diseqc_repeats;
5183 U8BIT cmd_signals_on[5] = {0xe0, 0x10, 0x5b, 0x00, 0x00};
5184 U8BIT cmd_lofreq[5] = {0xe0, 0x10, 0x5b, 0x02, 0x00};
5190 U32BIT lofreq_lut[0x0c] = {9750000, 10000000, 10600000, 10750000, 11000000, 11250000, 11475000, 20250000, 5150000, 1585000, 13850000};
5192 tuner = path_status[path].tuner_no;
5198 UnicableSendCommand(tuner, cmd_signals_on);
5201 for (f = 950000; f < 2150000; f += 4000)
5204 if (stren > UNICABLE_SIGNAL_THRESHOLD)
5206 unicable_if[bank_n] = f;
5216 for (lut = 0x02; lut < 0x0c; lut++)
5218 cmd_lofreq[4] = lut;
5219 UnicableSendCommand(tuner, cmd_lofreq);
5222 if (stren < UNICABLE_SIGNAL_THRESHOLD)
5226 if (stren > UNICABLE_SIGNAL_THRESHOLD)
5229 if (*lnb_lo_freq == 0)
5231 *lnb_lo_freq = lofreq_lut[lut];
5233 else if (*lnb_hi_freq == 0)
5235 *lnb_hi_freq = lofreq_lut[lut];
5264 ASSERT(path < num_paths);
5266 tuner_num = path_status[path].tuner_no;
5268 ASSERT(tuner_num < num_tuners);
5270 tuner_status[tuner_num].unicable_position_b = position_b;
5293 ASSERT(path < num_paths);
5295 tuner_num = path_status[path].tuner_no;
5297 ASSERT(tuner_num < num_tuners);
5299 ret_val = tuner_status[tuner_num].unicable_position_b;
5324 ASSERT(path < num_paths);
5326 tuner_num = path_status[path].tuner_no;
5328 ASSERT(tuner_num < num_tuners);
5330 tuner_status[tuner_num].unicable_chan = chan;
5353 ASSERT(path < num_paths);
5355 tuner_num = path_status[path].tuner_no;
5357 ASSERT(tuner_num < num_tuners);
5359 ret_val = tuner_status[tuner_num].unicable_chan;
5384 ASSERT(path < num_paths);
5386 tuner_num = path_status[path].tuner_no;
5388 ASSERT(tuner_num < num_tuners);
5390 tuner_status[tuner_num].unicable_if = freq;
5413 ASSERT(path < num_paths);
5415 tuner_num = path_status[path].tuner_no;
5417 ASSERT(tuner_num < num_tuners);
5419 ret_val = tuner_status[tuner_num].unicable_if;
5445 ASSERT(path < num_paths);
5447 tuner_num = path_status[path].tuner_no;
5449 ASSERT(tuner_num < num_tuners);
5451 STB_TUNE_PRINT((
"STB_DPSetDishLimitE(%d)", path));
5453 if (tuner_status[tuner_num].pulse_position == TRUE)
5459 if (tuner_status[tuner_num].diseqc_position == TRUE)
5461 dmsg_data[0] = 0xe0;
5462 dmsg_data[1] = 0x31;
5463 dmsg_data[2] = 0x66;
5464 SendDISEQCMessage(tuner_num, dmsg_data, 3);
5489 ASSERT(path < num_paths);
5491 tuner_num = path_status[path].tuner_no;
5493 ASSERT(tuner_num < num_tuners);
5495 STB_TUNE_PRINT((
"STB_DPSetDishLimitW(%d)", path));
5497 if (tuner_status[tuner_num].pulse_position == TRUE)
5503 if (tuner_status[tuner_num].diseqc_position == TRUE)
5505 dmsg_data[0] = 0xe0;
5506 dmsg_data[1] = 0x31;
5507 dmsg_data[2] = 0x67;
5508 SendDISEQCMessage(tuner_num, dmsg_data, 3);
5534 ASSERT(path < num_paths);
5536 tuner_num = path_status[path].tuner_no;
5538 ASSERT(tuner_num < num_tuners);
5540 STB_TUNE_PRINT((
"STB_DPEnableDishLimits(%d)", path));
5542 if (tuner_status[tuner_num].pulse_position == TRUE)
5548 if (tuner_status[tuner_num].diseqc_position == TRUE)
5550 dmsg_data[0] = 0xe0;
5551 dmsg_data[1] = 0x31;
5552 dmsg_data[2] = 0x6a;
5553 dmsg_data[3] = 0x00;
5554 SendDISEQCMessage(tuner_num, dmsg_data, 4);
5578 ASSERT(path < num_paths);
5580 tuner_num = path_status[path].tuner_no;
5582 ASSERT(tuner_num < num_tuners);
5584 STB_TUNE_PRINT((
"STB_DPDisableDishLimits(%d)", path));
5586 if (tuner_status[tuner_num].pulse_position == TRUE)
5592 if (tuner_status[tuner_num].diseqc_position == TRUE)
5594 dmsg_data[0] = 0xe0;
5595 dmsg_data[1] = 0x31;
5596 dmsg_data[2] = 0x63;
5597 SendDISEQCMessage(tuner_num, dmsg_data, 3);
5623 ASSERT(path < num_paths);
5625 tuner_num = path_status[path].tuner_no;
5627 ASSERT(tuner_num < num_tuners);
5629 STB_TUNE_PRINT((
"STB_DPStartDishMoveE(%d): count %d", path, count));
5631 tuner_status[tuner_num].actions |= (ACTION_TUNE | ACTION_DISH);
5633 if (tuner_status[tuner_num].pulse_position == TRUE)
5636 if ((pos > count) && (count != 0))
5645 STB_TuneChangePulsePosition(tuner_num, pos);
5648 if (tuner_status[tuner_num].diseqc_position == TRUE)
5650 if ((U8BIT)count < 0x80)
5652 dmsg_data[0] = 0xe0;
5653 dmsg_data[1] = 0x31;
5654 dmsg_data[2] = 0x68;
5657 dmsg_data[3] = 0x00;
5661 dmsg_data[3] = (0xff - (U8BIT)count + 1);
5664 SendDISEQCMessage(tuner_num, dmsg_data, 4);
5691 ASSERT(path < num_paths);
5693 tuner_num = path_status[path].tuner_no;
5695 ASSERT(tuner_num < num_tuners);
5697 STB_TUNE_PRINT((
"STB_DPStartDishMoveW(%d): count %d", path, count));
5699 tuner_status[tuner_num].actions |= (ACTION_TUNE | ACTION_DISH);
5701 if (tuner_status[tuner_num].pulse_position == TRUE)
5704 if ((pos < (9999 - count)) && (count != 0))
5712 STB_TuneChangePulsePosition(tuner_num, pos);
5715 if (tuner_status[tuner_num].diseqc_position == TRUE)
5717 if ((U8BIT)count < 0x80)
5719 dmsg_data[0] = 0xe0;
5720 dmsg_data[1] = 0x31;
5721 dmsg_data[2] = 0x69;
5724 dmsg_data[3] = 0x00;
5728 dmsg_data[3] = (0xff - (U8BIT)count + 1);
5730 SendDISEQCMessage(tuner_num, dmsg_data, 4);
5756 ASSERT(path < num_paths);
5758 tuner_num = path_status[path].tuner_no;
5760 ASSERT(tuner_num < num_tuners);
5762 STB_TUNE_PRINT((
"STB_DPStopDishMove(%d)", path));
5764 if (tuner_status[tuner_num].pulse_position == TRUE)
5767 STB_TuneChangePulsePosition(tuner_num, pos);
5770 if (tuner_status[tuner_num].diseqc_position == TRUE)
5772 dmsg_data[0] = 0xe0;
5773 dmsg_data[1] = 0x31;
5774 dmsg_data[2] = 0x60;
5775 SendDISEQCMessage(tuner_num, dmsg_data, 3);
5799 ASSERT(path < num_paths);
5801 tuner_num = path_status[path].tuner_no;
5803 ASSERT(tuner_num < num_tuners);
5805 STB_TUNE_PRINT((
"STB_DPCentreDishMove(%d)", path));
5807 tuner_status[tuner_num].actions |= (ACTION_TUNE | ACTION_DISH);
5809 if (tuner_status[tuner_num].diseqc_position == TRUE)
5811 dmsg_data[0] = 0xe0;
5812 dmsg_data[1] = 0x31;
5813 dmsg_data[2] = 0x6b;
5814 dmsg_data[3] = 0x00;
5815 SendDISEQCMessage(tuner_num, dmsg_data, 4);
5840 ASSERT(path < num_paths);
5842 tuner_num = path_status[path].tuner_no;
5844 ASSERT(tuner_num < num_tuners);
5846 STB_TUNE_PRINT((
"STB_DPStoreDishPosition(%d): count %d", path, count));
5848 if (tuner_status[tuner_num].pulse_position == TRUE)
5854 STB_TuneAtPulsePosition(tuner_num, count);
5857 if (tuner_status[tuner_num].diseqc_position == TRUE)
5861 dmsg_data[0] = 0xe0;
5862 dmsg_data[1] = 0x31;
5863 dmsg_data[2] = 0x6a;
5864 dmsg_data[3] = (U8BIT)count;
5865 SendDISEQCMessage(tuner_num, dmsg_data, 4);
5869 tuner_status[tuner_num].dish_pos = count;
5892 ASSERT(path < num_paths);
5894 tuner_num = path_status[path].tuner_no;
5896 ASSERT(tuner_num < num_tuners);
5898 STB_TUNE_PRINT((
"STB_DPSetDishPosition(p%d): count %d", path, count));
5899 if (count != tuner_status[tuner_num].dish_pos)
5904 tuner_status[tuner_num].dish_pos = count;
5907 tuner_status[tuner_num].actions |= (ACTION_TUNE | ACTION_DISH);
5932 ASSERT(path < num_paths);
5934 tuner_num = path_status[path].tuner_no;
5936 ASSERT(tuner_num < num_tuners);
5938 ret_val = tuner_status[tuner_num].dish_pos;
5941 if (tuner_status[tuner_num].pulse_position == TRUE)
5969 ASSERT(path < num_paths);
5971 tuner_num = path_status[path].tuner_no;
5973 ASSERT(tuner_num < num_tuners);
5975 ret_val = tuner_status[tuner_num].dish_pos;
6000 ASSERT(path < num_paths);
6002 tuner_num = path_status[path].tuner_no;
6004 ASSERT(tuner_num < num_tuners);
6006 STB_TUNE_PRINT((
"STB_DPSetSkewPosition(p%d,t%d): count %d", path, tuner_num, count));
6007 if (count != tuner_status[tuner_num].skew_pos)
6009 tuner_status[tuner_num].skew_pos = count;
6010 tuner_status[tuner_num].actions |= (ACTION_TUNE | ACTION_SKEW);
6034 ASSERT(path < num_paths);
6036 tuner_num = path_status[path].tuner_no;
6038 ASSERT(tuner_num < num_tuners);
6040 ret_val = tuner_status[tuner_num].skew_pos;
6065 ASSERT(path < num_paths);
6067 tuner_num = path_status[path].tuner_no;
6069 ASSERT(tuner_num < num_tuners);
6071 STB_TUNE_PRINT((
"STB_DPSetFrequency(%d) : tuner %d freq %d", path, tuner_num, freq));
6072 if (freq != tuner_status[tuner_num].frequency)
6074 tuner_status[tuner_num].frequency = freq;
6075 tuner_status[tuner_num].actions |= ACTION_TUNE;
6099 ASSERT(path < num_paths);
6101 tuner_num = path_status[path].tuner_no;
6103 ASSERT(tuner_num < num_tuners);
6105 ret_val = tuner_status[tuner_num].frequency;
6130 ASSERT(path < num_paths);
6132 tuner_num = path_status[path].tuner_no;
6134 ASSERT(tuner_num < num_tuners);
6136 STB_TUNE_PRINT((
"STB_DPSetPolarity(%d) : tuner %d pol %d", path, tuner_num, pol));
6137 if (pol != tuner_status[tuner_num].polarity)
6139 tuner_status[tuner_num].polarity = pol;
6140 tuner_status[tuner_num].actions |= ACTION_TUNE;
6160 E_STB_DP_POLARITY ret_val;
6164 ASSERT(path < num_paths);
6166 tuner_num = path_status[path].tuner_no;
6168 ASSERT(tuner_num < num_tuners);
6170 ret_val = tuner_status[tuner_num].polarity;
6195 ASSERT(path < num_paths);
6197 tuner_num = path_status[path].tuner_no;
6199 ASSERT(tuner_num < num_tuners);
6201 STB_TUNE_PRINT((
"STB_DPSetSymbolRate(%d): tuner %d sym %d", path, tuner_num, sym));
6202 if (sym != tuner_status[tuner_num].sym_rate)
6204 tuner_status[tuner_num].sym_rate = sym;
6205 tuner_status[tuner_num].actions |= ACTION_TUNE;
6229 ASSERT(path < num_paths);
6231 tuner_num = path_status[path].tuner_no;
6233 ASSERT(tuner_num < num_tuners);
6235 ret_val = tuner_status[tuner_num].sym_rate;
6260 ASSERT(path < num_paths);
6262 tuner_num = path_status[path].tuner_no;
6264 ASSERT(tuner_num < num_tuners);
6266 STB_TUNE_PRINT((
"STB_DPSetFEC(%d) : tuner %d fec %d", path, tuner_num, fec));
6267 if (fec != tuner_status[tuner_num].fec)
6269 tuner_status[tuner_num].fec = fec;
6270 tuner_status[tuner_num].actions |= ACTION_TUNE;
6290 E_STB_DP_FEC ret_val;
6294 ASSERT(path < num_paths);
6296 tuner_num = path_status[path].tuner_no;
6298 ASSERT(tuner_num < num_tuners);
6300 ret_val = tuner_status[tuner_num].fec;
6318 tuner_num = path_status[path].tuner_no;
6320 ASSERT(tuner_num < num_tuners);
6322 STB_TUNE_PRINT((
"STB_DPSetDVBS2(%u): tuner %u DVB-S2 %d", path, tuner_num, dvb_s2));
6324 if (dvb_s2 != tuner_status[tuner_num].dvb_s2)
6326 tuner_status[tuner_num].dvb_s2 = dvb_s2;
6327 tuner_status[tuner_num].actions |= ACTION_TUNE;
6345 tuner_num = path_status[path].tuner_no;
6346 ASSERT(tuner_num < num_tuners);
6347 retval = tuner_status[tuner_num].dvb_s2;
6365 tuner_num = path_status[path].tuner_no;
6367 ASSERT(tuner_num < num_tuners);
6369 STB_TUNE_PRINT((
"STB_DPSetModulation(%u): tuner %u modulation %d", path, tuner_num, modulation));
6371 if (modulation != tuner_status[tuner_num].modulation)
6373 tuner_status[tuner_num].modulation = modulation;
6374 tuner_status[tuner_num].actions |= ACTION_TUNE;
6388 E_STB_DP_MODULATION retval;
6392 tuner_num = path_status[path].tuner_no;
6393 ASSERT(tuner_num < num_tuners);
6394 retval = tuner_status[tuner_num].modulation;
6419 ASSERT(path < num_paths);
6421 tuner_num = path_status[path].tuner_no;
6423 ASSERT(tuner_num < num_tuners);
6425 STB_TUNE_PRINT((
"STB_DPSetTerrMode(%d): mode %d", path, mode));
6426 if (mode != tuner_status[tuner_num].terr_mode)
6428 tuner_status[tuner_num].terr_mode = mode;
6429 tuner_status[tuner_num].actions |= ACTION_TUNE;
6449 E_STB_DP_TMODE ret_val;
6453 ASSERT(path < num_paths);
6455 tuner_num = path_status[path].tuner_no;
6457 ASSERT(tuner_num < num_tuners);
6459 ret_val = tuner_status[tuner_num].terr_mode;
6484 ASSERT(path < num_paths);
6486 tuner_num = path_status[path].tuner_no;
6488 ASSERT(tuner_num < num_tuners);
6490 STB_TUNE_PRINT((
"STB_DPSetTerrBandwidth(%d): bwidth %d", path, bwidth));
6491 if (bwidth != tuner_status[tuner_num].terr_bwidth)
6493 tuner_status[tuner_num].terr_bwidth = bwidth;
6494 tuner_status[tuner_num].actions |= ACTION_TUNE;
6514 E_STB_DP_TBWIDTH ret_val;
6518 ASSERT(path < num_paths);
6520 tuner_num = path_status[path].tuner_no;
6522 ASSERT(tuner_num < num_tuners);
6524 ret_val = tuner_status[tuner_num].terr_bwidth;
6549 ASSERT(path < num_paths);
6551 tuner_num = path_status[path].tuner_no;
6553 ASSERT(tuner_num < num_tuners);
6555 STB_TUNE_PRINT((
"STB_DPSetTerrFreqOff(%d): offset %d", path, offset));
6556 if (offset != tuner_status[tuner_num].freq_offset)
6558 tuner_status[tuner_num].freq_offset = offset;
6559 tuner_status[tuner_num].actions |= ACTION_TUNE;
6583 ASSERT(path < num_paths);
6585 tuner_num = path_status[path].tuner_no;
6587 ASSERT(tuner_num < num_tuners);
6589 ret_val = tuner_status[tuner_num].freq_offset;
6614 ASSERT(path < num_paths);
6616 tuner_num = path_status[path].tuner_no;
6618 ASSERT(tuner_num < num_tuners);
6620 STB_TUNE_PRINT((
"STB_DPSetTerrType(%d): DVB-%s", path, ((type == TERR_TYPE_DVBT) ?
"T" :
6621 ((type == TERR_TYPE_DVBT2) ?
"T2" :
"unknown"))));
6623 if (type != tuner_status[tuner_num].terr_type)
6625 tuner_status[tuner_num].terr_type = type;
6626 tuner_status[tuner_num].actions |= ACTION_TUNE;
6646 E_STB_DP_TTYPE ret_val;
6650 ASSERT(path < num_paths);
6652 tuner_num = path_status[path].tuner_no;
6654 ASSERT(tuner_num < num_tuners);
6656 ret_val = tuner_status[tuner_num].terr_type;
6681 ASSERT(path < num_paths);
6683 tuner_num = path_status[path].tuner_no;
6685 ASSERT(tuner_num < num_tuners);
6687 STB_TUNE_PRINT((
"STB_DPSetTerrPLP(%d, %u)", path, plp_id));
6689 if (plp_id != tuner_status[tuner_num].plp_id)
6691 tuner_status[tuner_num].plp_id = plp_id;
6692 tuner_status[tuner_num].actions |= ACTION_TUNE;
6716 ASSERT(path < num_paths);
6718 tuner_num = path_status[path].tuner_no;
6720 ASSERT(tuner_num < num_tuners);
6722 ret_val = tuner_status[tuner_num].plp_id;
6724 STB_TUNE_PRINT((
"STB_DPGetTerrPLP(%d): %u", path, tuner_status[tuner_num].plp_id));
6749 ASSERT(path < num_paths);
6751 tuner_num = path_status[path].tuner_no;
6753 ASSERT(tuner_num < num_tuners);
6755 STB_TUNE_PRINT((
"STB_DPSetCableMode(%d): mode %d", path, mode));
6756 if (mode != tuner_status[tuner_num].cable_mode)
6758 tuner_status[tuner_num].cable_mode = mode;
6759 tuner_status[tuner_num].actions |= ACTION_TUNE;
6779 E_STB_DP_CMODE ret_val;
6783 ASSERT(path < num_paths);
6785 tuner_num = path_status[path].tuner_no;
6787 ASSERT(tuner_num < num_tuners);
6789 ret_val = tuner_status[tuner_num].cable_mode;
6814 ASSERT(path < num_paths);
6816 tuner_num = path_status[path].tuner_no;
6818 ASSERT(tuner_num < num_tuners);
6820 STB_TUNE_PRINT((
"STB_DPSetAnalogVideoType(%d): type %d", path, vtype));
6821 if (vtype != tuner_status[tuner_num].anlg_vtype)
6823 tuner_status[tuner_num].anlg_vtype = vtype;
6824 tuner_status[tuner_num].actions |= ACTION_TUNE;
6844 E_STB_DP_ANALOG_VIDEO_TYPE ret_val;
6848 ASSERT(path < num_paths);
6850 tuner_num = path_status[path].tuner_no;
6852 ASSERT(tuner_num < num_tuners);
6854 ret_val = tuner_status[tuner_num].anlg_vtype;
6879 ASSERT(path < num_paths);
6881 tuner_num = path_status[path].tuner_no;
6883 ASSERT(tuner_num < num_tuners);
6885 STB_TUNE_PRINT((
"STB_DPSetAnalogFreqOff(%d): offset %d", path, offset));
6886 if (offset != tuner_status[tuner_num].freq_offset)
6888 tuner_status[tuner_num].freq_offset = offset;
6889 tuner_status[tuner_num].actions |= ACTION_TUNE;
6913 ASSERT(path < num_paths);
6915 tuner_num = path_status[path].tuner_no;
6917 ASSERT(tuner_num < num_tuners);
6919 ret_val = tuner_status[tuner_num].freq_offset;
6939 if (path < num_paths)
6941 tuner_num = path_status[path].tuner_no;
6942 if (tuner_num < num_tuners)
6944 if (tuner_status[tuner_num].additional_frequencies != NULL)
6948 tuner_status[tuner_num].additional_frequencies = NULL;
6949 tuner_status[tuner_num].num_additional_frequencies = 0;
6952 if ((num_freqs != 0) && (frequencies != NULL))
6954 tuner_status[tuner_num].additional_frequencies =
STB_GetMemory(num_freqs *
sizeof(U32BIT));
6955 if (tuner_status[tuner_num].additional_frequencies != NULL)
6957 memcpy(tuner_status[tuner_num].additional_frequencies, frequencies, num_freqs *
sizeof(U32BIT));
6958 tuner_status[tuner_num].num_additional_frequencies = num_freqs;
6981 if (tuner_num < num_tuners)
6983 if ((tuner_status[tuner_num].additional_frequencies != NULL) &&
6984 (tuner_status[tuner_num].num_additional_frequencies != 0))
6989 tuner_status[tuner_num].num_additional_frequencies--;
6990 tuner_status[tuner_num].frequency = tuner_status[tuner_num].additional_frequencies[tuner_status[tuner_num].num_additional_frequencies];
6991 tuner_status[tuner_num].actions |= ACTION_TUNE;
7019 ASSERT(path < num_paths);
7021 demux_num = path_status[path].demux_no;
7023 ASSERT(demux_num < num_demuxes);
7025 STB_DP_PRINT((
"STB_DPSetPCRPID(%d): pid %x", path, pid));
7027 if (pid != demux_status[demux_num].pcr_pid)
7029 demux_status[demux_num].pcr_pid = pid;
7030 demux_status[demux_num].actions |= (ACTION_VIDEO | ACTION_AUDIO);
7054 ASSERT(path < num_paths);
7056 demux_num = path_status[path].demux_no;
7058 ASSERT(demux_num < num_demuxes);
7060 ret_val = demux_status[demux_num].pcr_pid;
7085 ASSERT(path < num_paths);
7087 demux_num = path_status[path].demux_no;
7089 ASSERT(demux_num < num_demuxes);
7091 STB_DP_PRINT((
"STB_DPSetVideoPID(%d): pid %u", path, pid));
7093 if (pid != demux_status[demux_num].video_pid)
7095 demux_status[demux_num].video_pid = pid;
7096 demux_status[demux_num].actions |= ACTION_VIDEO;
7120 ASSERT(path < num_paths);
7122 demux_num = path_status[path].demux_no;
7124 ASSERT(demux_num < num_demuxes);
7126 ret_val = demux_status[demux_num].video_pid;
7151 ASSERT(path < num_paths);
7153 demux_num = path_status[path].demux_no;
7155 ASSERT(demux_num < num_demuxes);
7157 STB_DP_PRINT((
"STB_DPSetAudioPID(%d): pid %u", path, pid));
7159 if (pid != demux_status[demux_num].audio_pid)
7161 demux_status[demux_num].audio_pid = pid;
7162 demux_status[demux_num].actions |= ACTION_AUDIO;
7186 ASSERT(path < num_paths);
7188 demux_num = path_status[path].demux_no;
7190 ASSERT(demux_num < num_demuxes);
7192 ret_val = demux_status[demux_num].audio_pid;
7218 ASSERT(path < num_paths);
7220 demux_num = path_status[path].demux_no;
7221 decoder_num = path_status[path].ad_decoder_no;
7223 ASSERT(demux_num < num_demuxes);
7225 STB_DP_PRINT((
"STB_DPSetADPID(%d): pid %u", path, pid));
7229 ad_decoder_status[decoder_num].ad_status &= ~AD_PID_PRESENT;
7233 ad_decoder_status[decoder_num].ad_status |= AD_PID_PRESENT;
7236 if (pid != demux_status[demux_num].AD_pid)
7238 demux_status[demux_num].AD_pid = pid;
7239 demux_status[demux_num].actions |= ACTION_AD;
7263 ASSERT(path < num_paths);
7265 demux_num = path_status[path].demux_no;
7267 ASSERT(demux_num < num_demuxes);
7269 ret_val = demux_status[demux_num].AD_pid;
7294 ASSERT(path < num_paths);
7296 if ((demux_num = path_status[path].demux_no) != INVALID_RES_ID)
7298 STB_DP_PRINT((
"STB_DPSetTextPID(%d): pid %u", path, pid));
7300 if (pid != demux_status[demux_num].text_pid)
7302 demux_status[demux_num].text_pid = pid;
7330 ASSERT(path < num_paths);
7332 demux_num = path_status[path].demux_no;
7334 ASSERT(demux_num < num_demuxes);
7336 ret_val = demux_status[demux_num].text_pid;
7361 ASSERT(path < num_paths);
7363 demux_num = path_status[path].demux_no;
7365 ASSERT(demux_num < num_demuxes);
7367 STB_DP_PRINT((
"STB_DPSetDataPID(%d): pid %u", path, pid));
7369 if (pid != demux_status[demux_num].data_pid)
7371 demux_status[demux_num].data_pid = pid;
7372 demux_status[demux_num].actions |= (ACTION_VIDEO | ACTION_AUDIO);
7396 ASSERT(path < num_paths);
7398 demux_num = path_status[path].demux_no;
7400 ASSERT(demux_num < num_demuxes);
7402 ret_val = demux_status[demux_num].data_pid;
7415 U16BIT text_pid, U16BIT data_pid, U16BIT AD_pid)
7421 ASSERT(path < num_paths);
7423 demux_num = path_status[path].demux_no;
7425 ASSERT(demux_num < num_demuxes);
7427 STB_DP_PRINT((
"STB_DPSetDecodePIDs(%u): PIDs = %u/%u/%u/%u/%u/%u", path, pcr_pid, video_pid,
7428 audio_pid, text_pid, data_pid, AD_pid));
7430 demux_status[demux_num].pcr_pid = pcr_pid;
7431 demux_status[demux_num].video_pid = video_pid;
7432 demux_status[demux_num].audio_pid = audio_pid;
7433 demux_status[demux_num].AD_pid = AD_pid;
7434 demux_status[demux_num].text_pid = text_pid;
7435 demux_status[demux_num].data_pid = data_pid;
7460 ASSERT(path < num_paths);
7462 decoder_num = path_status[path].ad_decoder_no;
7464 ASSERT(decoder_num < num_audio_decoders);
7466 STB_DP_PRINT((
"STB_DPSetADMode(%d): mode %d", path, mode));
7468 if (mode != ad_decoder_status[decoder_num].audio_mode)
7470 ad_decoder_status[decoder_num].audio_mode = mode;
7490 E_STB_DP_AUDIO_MODE ret_val;
7494 ASSERT(path < num_paths);
7496 decoder_num = path_status[path].ad_decoder_no;
7498 ASSERT(decoder_num < num_audio_decoders);
7500 ret_val = ad_decoder_status[decoder_num].audio_mode;
7525 ASSERT(path < num_paths);
7527 decoder_num = path_status[path].audio_decoder_no;
7529 ASSERT(decoder_num < num_audio_decoders);
7531 STB_DP_PRINT((
"STB_DPSetAudioMode(%d): mode %d", path, mode));
7533 if (mode != audio_decoder_status[decoder_num].audio_mode)
7535 audio_decoder_status[decoder_num].audio_mode = mode;
7555 E_STB_DP_AUDIO_MODE ret_val;
7559 ASSERT(path < num_paths);
7561 decoder_num = path_status[path].audio_decoder_no;
7563 ASSERT(decoder_num < num_audio_decoders);
7565 ret_val = audio_decoder_status[decoder_num].audio_mode;
7588 ASSERT(path < num_paths);
7590 STB_DP_PRINT((
"STB_DPSetLockMode(%d): mode %d", path, mode));
7592 if (mode != path_status[path].lock_mode)
7594 path_status[path].lock_mode = mode;
7617 ASSERT(path < num_paths);
7619 ret_val = path_status[path].lock_mode;
7642 E_STB_AV_VIDEO_CODEC av_codec;
7647 ASSERT(path < num_paths);
7649 demux_num = path_status[path].demux_no;
7650 decoder_num = path_status[path].video_decoder_no;
7652 ASSERT(demux_num < num_demuxes);
7654 demux_status[demux_num].video_codec = codec;
7657 if (decoder_num < num_video_decoders)
7661 case VIDEO_CODEC_MPEG1:
7662 av_codec = AV_VIDEO_CODEC_MPEG1;
7665 case VIDEO_CODEC_MPEG2:
7666 av_codec = AV_VIDEO_CODEC_MPEG2;
7669 case VIDEO_CODEC_H264:
7670 av_codec = AV_VIDEO_CODEC_H264;
7673 case VIDEO_CODEC_H265:
7674 av_codec = AV_VIDEO_CODEC_H265;
7678 av_codec = AV_VIDEO_CODEC_AUTO;
7685 video_decoder_status[decoder_num].codec = codec;
7709 E_STB_DP_VIDEO_CODEC ret_val;
7713 ASSERT(path < num_paths);
7715 decoder_num = path_status[path].video_decoder_no;
7717 if (decoder_num < num_video_decoders)
7719 ret_val = video_decoder_status[decoder_num].codec;
7723 demux_num = path_status[path].demux_no;
7724 ASSERT(demux_num < num_demuxes);
7725 ret_val = demux_status[demux_num].video_codec;
7749 E_STB_AV_AUDIO_CODEC av_codec;
7754 ASSERT(path < num_paths);
7756 demux_num = path_status[path].demux_no;
7757 decoder_num = path_status[path].ad_decoder_no;
7759 ASSERT(demux_num < num_demuxes);
7761 demux_status[demux_num].ad_codec = codec;
7764 if (decoder_num < num_audio_decoders)
7768 case AUDIO_CODEC_MP2:
7769 av_codec = AV_AUDIO_CODEC_MP2;
7772 case AUDIO_CODEC_AC3:
7773 av_codec = AV_AUDIO_CODEC_AC3;
7776 case AUDIO_CODEC_EAC3:
7777 av_codec = AV_AUDIO_CODEC_EAC3;
7780 case AUDIO_CODEC_AAC:
7781 av_codec = AV_AUDIO_CODEC_AAC;
7784 case AUDIO_CODEC_HEAAC:
7785 av_codec = AV_AUDIO_CODEC_HEAAC;
7789 av_codec = AV_AUDIO_CODEC_MP2;
7796 ad_decoder_status[decoder_num].codec = codec;
7819 E_STB_DP_AUDIO_CODEC ret_val;
7823 ASSERT(path < num_paths);
7825 demux_num = path_status[path].demux_no;
7826 ASSERT(demux_num < num_demuxes);
7827 ret_val = demux_status[demux_num].ad_codec;
7850 E_STB_AV_AUDIO_CODEC av_codec;
7855 ASSERT(path < num_paths);
7857 demux_num = path_status[path].demux_no;
7858 decoder_num = path_status[path].audio_decoder_no;
7860 ASSERT(demux_num < num_demuxes);
7862 demux_status[demux_num].audio_codec = codec;
7865 if (decoder_num < num_video_decoders)
7869 case AUDIO_CODEC_MP2:
7870 av_codec = AV_AUDIO_CODEC_MP2;
7873 case AUDIO_CODEC_MP3:
7874 av_codec = AV_AUDIO_CODEC_MP3;
7877 case AUDIO_CODEC_AC3:
7878 av_codec = AV_AUDIO_CODEC_AC3;
7881 case AUDIO_CODEC_EAC3:
7882 av_codec = AV_AUDIO_CODEC_EAC3;
7885 case AUDIO_CODEC_AAC:
7886 av_codec = AV_AUDIO_CODEC_AAC;
7889 case AUDIO_CODEC_HEAAC:
7890 av_codec = AV_AUDIO_CODEC_HEAAC;
7893 case AUDIO_CODEC_AAC_ADTS:
7894 av_codec = AV_AUDIO_CODEC_AAC_ADTS;
7898 av_codec = AV_AUDIO_CODEC_AUTO;
7905 audio_decoder_status[decoder_num].codec = codec;
7929 E_STB_DP_AUDIO_CODEC ret_val;
7933 ASSERT(path < num_paths);
7935 decoder_num = path_status[path].audio_decoder_no;
7937 if (decoder_num < num_audio_decoders)
7939 ret_val = audio_decoder_status[decoder_num].codec;
7943 demux_num = path_status[path].demux_no;
7944 ASSERT(demux_num < num_demuxes);
7945 ret_val = demux_status[demux_num].audio_codec;
7962 static BOOLEAN AcquireResources(U8BIT path, U16BIT demux_caps, BOOLEAN with_decoders)
7965 BOOLEAN result = FALSE;
7967 FUNCTION_START(AcquireResources);
7969 if (path != INVALID_RES_ID)
7973 if (path_status[path].demux_no != INVALID_RES_ID)
7978 if (path_status[path].video_decoder_no != INVALID_RES_ID)
7981 if (path_status[path].audio_decoder_no != INVALID_RES_ID)
7990 param = ((U32BIT)path_status[path].tuner_no << 8) | path_status[path].demux_no;
7996 if (path_status[path].ad_decoder_no != INVALID_RES_ID)
8003 if (path_status[path].secondary_video_decoder_no != INVALID_RES_ID)
8012 path_status[path].video_decoder_no = INVALID_RES_ID;
8015 path_status[path].demux_no = INVALID_RES_ID;
8022 path_status[path].demux_no = INVALID_RES_ID;
8028 path_status[path].video_decoder_no = INVALID_RES_ID;
8029 path_status[path].secondary_video_decoder_no = INVALID_RES_ID;
8030 path_status[path].audio_decoder_no = INVALID_RES_ID;
8031 path_status[path].ad_decoder_no = INVALID_RES_ID;
8042 FUNCTION_FINISH(AcquireResources);
8054 static void SendDISEQCMessage(U8BIT tuner, U8BIT *msg_data, U8BIT msg_size)
8061 FUNCTION_START(SendDISEQCMessage);
8069 for (i = 0; i < (tuner_status[tuner].diseqc_repeats + 1); i++)
8073 dmsg_data[0] = 0xe0;
8077 dmsg_data[0] = 0xe1;
8080 dmsg_data[1] = 0x10;
8081 dmsg_data[2] = 0x31;
8102 if (tuner_status[tuner].diseqc_msg_time != 0)
8105 if ((delay_time =
STB_OSGetClockDiff(tuner_status[tuner].diseqc_msg_time)) < DISEQC_MESSAGE_DELAY)
8115 FUNCTION_FINISH(SendDISEQCMessage);
8129 static BOOLEAN StartTune(U8BIT path)
8133 E_STB_TUNE_SYSTEM_TYPE system_type;
8135 E_STB_TUNE_MODULATION tnr_mod;
8136 E_STB_TUNE_FEC tnr_fec;
8137 E_STB_TUNE_LNB_VOLTAGE lnb_volts;
8141 E_STB_TUNE_TMODE tnr_tmode;
8142 E_STB_TUNE_TBWIDTH tnr_tbwidth;
8143 E_STB_TUNE_ANALOG_VIDEO_TYPE tnr_avtype;
8145 E_STB_TUNE_CMODE cmode;
8150 S32BIT tnr_min_freq;
8151 S32BIT tnr_max_freq;
8157 U8BIT unicablecmd[UNICABLE_COMMAND_SIZE];
8159 BOOLEAN tone_22khz_on;
8162 BOOLEAN retval = FALSE;
8164 FUNCTION_START(StartTune);
8166 tuner = path_status[path].tuner_no;
8168 switch (tuner_status[tuner].signal_type)
8172 sig_freq = tuner_status[tuner].frequency * 1000;
8178 band = FindLNBBand(tuner);
8181 lo_freq = band->local_oscillator_frequency * 1000;
8188 DBGPRINT(
"QPSK f(%d,%d,%d) sr=%d", tnr_min_freq, sig_freq, tnr_max_freq, tuner_status[tuner].sym_rate);
8190 tone_22khz_on = FALSE;
8194 switch (tuner_status[tuner].lnb_type)
8196 case LNB_TYPE_SINGLE:
8199 tone_22khz_on = tuner_status[tuner].lnb_22k;
8204 if ((tnr_freq = sig_freq - lo_freq) < 0)
8206 tnr_freq = -tnr_freq;
8211 case LNB_TYPE_UNICABLE:
8215 if ((band != NULL) && (band->min_freq > 0))
8226 tnr_freq = tuner_status[tuner].unicable_if;
8230 case LNB_TYPE_USER_DEFINED:
8234 tone_22khz_on = band->tone_22k;
8239 tnr_freq = sig_freq - lo_freq;
8243 case LNB_TYPE_UNIVERSAL:
8250 tone_22khz_on = band->tone_22k;
8251 if (band->min_freq > 0)
8262 tnr_freq = sig_freq - lo_freq;
8267 if ((tnr_min_freq <= tnr_freq) && (tnr_freq <= tnr_max_freq) &&
8268 (tuner_status[tuner].sym_rate >= TUNER_MIN_SRATE) &&
8269 (tuner_status[tuner].sym_rate <= TUNER_MAX_SRATE))
8272 switch (tuner_status[tuner].lnb_power)
8275 case LNB_POWER_AUTO:
8279 lnb_volts = band->lnb_voltage;
8283 lnb_volts = LNB_VOLTAGE_OFF;
8291 lnb_volts = LNB_VOLTAGE_OFF;
8302 if ((tuner_status[tuner].diseqc_position == TRUE) &&
8303 (lnb_currently_powered == FALSE) &&
8304 (lnb_volts != LNB_VOLTAGE_OFF))
8311 lnb_currently_powered = TRUE;
8315 if (lnb_volts != LNB_VOLTAGE_OFF)
8319 for (i = 0; i < (tuner_status[tuner].diseqc_repeats + 1); i++)
8324 dmsg_data[0] = 0xe0;
8328 dmsg_data[0] = 0xe1;
8331 dmsg_data[1] = 0x10;
8332 dmsg_data[2] = 0x38;
8333 dmsg_data[3] = 0xf0;
8335 if (tuner_status[tuner].polarity == POLARITY_HORIZONTAL)
8337 dmsg_data[3] |= 0x02;
8339 if (high_band == TRUE)
8341 dmsg_data[3] |= 0x01;
8353 switch (tuner_status[tuner].diseqc_cswitch)
8355 case DISEQC_CSWITCH_A:
8357 dmsg_data[3] |= 0x00;
8358 SendDISEQCMessage(tuner, dmsg_data, 4);
8362 case DISEQC_CSWITCH_B:
8364 dmsg_data[3] |= 0x04;
8365 SendDISEQCMessage(tuner, dmsg_data, 4);
8369 case DISEQC_CSWITCH_C:
8371 dmsg_data[3] |= 0x08;
8372 SendDISEQCMessage(tuner, dmsg_data, 4);
8376 case DISEQC_CSWITCH_D:
8378 dmsg_data[3] |= 0x0c;
8379 SendDISEQCMessage(tuner, dmsg_data, 4);
8390 if (tuner_status[tuner].diseqc_uswitch != 0)
8392 dmsg_data[1] = 0x10;
8393 dmsg_data[2] = 0x39;
8394 dmsg_data[3] = 0xf0;
8395 dmsg_data[3] |= (tuner_status[tuner].diseqc_uswitch - 1);
8396 SendDISEQCMessage(tuner, dmsg_data, 4);
8401 if (tuner_status[tuner].diseqc_smatv == TRUE)
8404 if (tuner_status[tuner].diseqc_cswitch == DISEQC_CSWITCH_OFF)
8406 dmsg_data[0] = 0xe0;
8407 dmsg_data[1] = 0x10;
8408 dmsg_data[2] = 0x38;
8409 dmsg_data[3] = 0xf0;
8410 if (tuner_status[tuner].polarity == POLARITY_HORIZONTAL)
8412 dmsg_data[3] |= 0x02;
8414 if (high_band == TRUE)
8416 dmsg_data[3] |= 0x01;
8418 SendDISEQCMessage(tuner, dmsg_data, 4);
8422 sig_freq = tuner_status[tuner].frequency;
8423 dmsg_data[0] = 0xe0;
8424 dmsg_data[1] = 0x10;
8425 dmsg_data[2] = 0x58;
8426 dmsg_data[3] = (U8BIT)((sig_freq / 10000) << 4);
8427 sig_freq = (sig_freq % 10000);
8428 dmsg_data[3] |= (U8BIT)(sig_freq / 1000);
8429 sig_freq = (sig_freq % 1000);
8430 dmsg_data[4] = (U8BIT)((sig_freq / 100) << 4);
8431 sig_freq = (sig_freq % 100);
8432 dmsg_data[4] |= (U8BIT)(sig_freq / 10);
8433 sig_freq = (sig_freq % 10);
8434 dmsg_data[5] = (U8BIT)((sig_freq / 1) << 4);
8435 SendDISEQCMessage(tuner, dmsg_data, 6);
8438 if (tuner_status[tuner].diseqc_tone != DISEQC_TONE_OFF)
8441 switch (tuner_status[tuner].diseqc_tone)
8444 dmsg_data[0] = 0x00;
8445 SendDISEQCMessage(tuner, dmsg_data, 1);
8449 dmsg_data[0] = 0xff;
8450 SendDISEQCMessage(tuner, dmsg_data, 1);
8460 if ((tuner_status[tuner].actions & ACTION_SKEW) != 0)
8462 tuner_status[tuner].actions &= ~ACTION_SKEW;
8467 if ((tuner_status[tuner].actions & ACTION_DISH) != 0)
8469 tuner_status[tuner].actions &= ~ACTION_DISH;
8470 if (tuner_status[tuner].pulse_position == TRUE)
8472 STB_TuneChangePulsePosition(tuner, tuner_status[tuner].dish_pos);
8474 if ((tuner_status[tuner].diseqc_position == TRUE) && (lnb_volts != LNB_VOLTAGE_OFF))
8476 dmsg_data[0] = 0xe0;
8477 dmsg_data[1] = 0x31;
8478 dmsg_data[2] = 0x6b;
8479 dmsg_data[3] = (U8BIT)(tuner_status[tuner].dish_pos & 0x00ff);
8484 if (dmsg_data[3] != 0x00)
8486 SendDISEQCMessage(tuner, dmsg_data, 4);
8492 switch (tuner_status[tuner].modulation)
8495 tnr_mod = TUNE_MOD_QPSK;
8499 tnr_mod = TUNE_MOD_8PSK;
8503 tnr_mod = TUNE_MOD_16QAM;
8508 tnr_mod = TUNE_MOD_AUTO;
8515 switch (tuner_status[tuner].fec)
8517 case FEC_AUTOMATIC: {tnr_fec = TUNE_FEC_AUTOMATIC;
break; }
8518 case FEC_1_2: {tnr_fec = TUNE_FEC_1_2;
break; }
8519 case FEC_2_3: {tnr_fec = TUNE_FEC_2_3;
break; }
8520 case FEC_3_4: {tnr_fec = TUNE_FEC_3_4;
break; }
8521 case FEC_5_6: {tnr_fec = TUNE_FEC_5_6;
break; }
8522 case FEC_7_8: {tnr_fec = TUNE_FEC_7_8;
break; }
8523 case FEC_1_4: {tnr_fec = TUNE_FEC_1_4;
break; }
8524 case FEC_1_3: {tnr_fec = TUNE_FEC_1_3;
break; }
8525 case FEC_2_5: {tnr_fec = TUNE_FEC_2_5;
break; }
8526 case FEC_8_9: {tnr_fec = TUNE_FEC_8_9;
break; }
8527 case FEC_9_10: {tnr_fec = TUNE_FEC_9_10;
break; }
8528 case FEC_3_5: {tnr_fec = TUNE_FEC_3_5;
break; }
8529 case FEC_4_5: {tnr_fec = TUNE_FEC_4_5;
break; }
8530 default: {tnr_fec = TUNE_FEC_AUTOMATIC;
break; }
8534 if (tuner_status[tuner].dvb_s2 == TRUE)
8536 system_type = TUNE_SYSTEM_TYPE_DVBS2;
8540 system_type = TUNE_SYSTEM_TYPE_DVBS;
8544 STB_TUNE_PRINT((
"STB_DP:StartTune(%d,%d): %d %s fec %d (%s_BAND, LO %d, LNB_%s, %s)",
8545 path, tuner, tnr_freq / 1000,
8546 (tuner_status[tuner].polarity == POLARITY_VERTICAL) ?
"V" :
"H",
8547 tuner_status[tuner].fec,
8548 high_band == TRUE ?
"HIGH" :
"LOW",
8550 (tone_22khz_on == TRUE) ?
"22khz" :
"OFF",
8551 (lnb_volts == LNB_VOLTAGE_18V) ?
"18V" : ((lnb_volts == LNB_VOLTAGE_14V) ?
"14V" :
"OFF")));
8553 if (tuner_status[tuner].lnb_type == LNB_TYPE_UNICABLE)
8556 data_1 = (tuner_status[path].unicable_chan & 0x07) << 5;
8559 if (tuner_status[path].unicable_position_b == TRUE)
8563 if (tuner_status[tuner].polarity == POLARITY_HORIZONTAL)
8567 if (high_band == TRUE)
8573 t_word = (U16BIT)(((abs((sig_freq / 1000) - (lo_freq / 1000)) + (tnr_freq / 1000)) / 4) - 350);
8574 data_1 |= (((U8BIT) (t_word >> 8)) & 0x03);
8575 data_2 = (U8BIT) (t_word & 0x00ff);
8578 unicablecmd[0] = 0xE0;
8579 unicablecmd[1] = 0x10;
8580 unicablecmd[2] = 0x5A;
8581 unicablecmd[3] = data_1;
8582 unicablecmd[4] = data_2;
8583 UnicableSendCommand(tuner, unicablecmd);
8592 STB_TuneStartTuner(tuner, tnr_freq, tuner_status[tuner].sym_rate * 1000, tnr_fec, 0, 0, 0, 0, 0);
8601 tnr_freq = tuner_status[tuner].frequency;
8604 if ((tnr_min_freq <= tnr_freq) && (tnr_freq <= tnr_max_freq))
8607 switch (tuner_status[tuner].terr_mode)
8609 case MODE_COFDM_2K: {tnr_tmode = TUNE_MODE_COFDM_2K;
break; }
8610 case MODE_COFDM_8K: {tnr_tmode = TUNE_MODE_COFDM_8K;
break; }
8611 default: {tnr_tmode = TUNE_MODE_COFDM_UNDEFINED;
break; }
8614 switch (tuner_status[tuner].terr_bwidth)
8616 case TBWIDTH_8MHZ: {tnr_tbwidth = TUNE_TBWIDTH_8MHZ;
break; }
8617 case TBWIDTH_7MHZ: {tnr_tbwidth = TUNE_TBWIDTH_7MHZ;
break; }
8618 case TBWIDTH_6MHZ: {tnr_tbwidth = TUNE_TBWIDTH_6MHZ;
break; }
8619 default: {tnr_tbwidth = TUNE_TBWIDTH_8MHZ;
break; }
8624 switch (tuner_status[tuner].terr_type)
8626 case TERR_TYPE_DVBT: {system_type = TUNE_SYSTEM_TYPE_DVBT;
break; }
8627 case TERR_TYPE_DVBT2: {system_type = TUNE_SYSTEM_TYPE_DVBT2;
break; }
8628 default: {system_type = TUNE_SYSTEM_TYPE_DVBT;
break; }
8632 STB_TuneStartTuner(tuner, tnr_freq, 0, 0, tuner_status[tuner].freq_offset, tnr_tmode,
8633 tnr_tbwidth, TUNE_MODE_QAM_UNDEFINED, 0);
8641 tnr_freq = tuner_status[tuner].frequency;
8644 if ((tnr_min_freq <= tnr_freq) && (tnr_freq <= tnr_max_freq))
8646 switch (tuner_status[tuner].cable_mode)
8649 cmode = TUNE_MODE_QAM_4;
8653 cmode = TUNE_MODE_QAM_8;
8657 cmode = TUNE_MODE_QAM_16;
8661 cmode = TUNE_MODE_QAM_32;
8665 cmode = TUNE_MODE_QAM_64;
8669 cmode = TUNE_MODE_QAM_128;
8673 cmode = TUNE_MODE_QAM_256;
8677 cmode = TUNE_MODE_QAM_UNDEFINED;
8681 switch (tuner_status[tuner].fec)
8684 tnr_fec = TUNE_FEC_AUTOMATIC;
8687 tnr_fec = TUNE_FEC_1_2;
8690 tnr_fec = TUNE_FEC_2_3;
8693 tnr_fec = TUNE_FEC_3_4;
8696 tnr_fec = TUNE_FEC_5_6;
8699 tnr_fec = TUNE_FEC_7_8;
8702 tnr_fec = TUNE_FEC_AUTOMATIC;
8708 STB_TuneStartTuner(tuner, tnr_freq, tuner_status[tuner].sym_rate * 1000, tnr_fec, 0, 0,
8718 tnr_freq = tuner_status[tuner].frequency;
8721 if ((tnr_min_freq <= tnr_freq) && (tnr_freq <= tnr_max_freq))
8724 switch (tuner_status[tuner].anlg_vtype)
8726 case ANLG_VIDEO_PAL_I: {tnr_avtype = TUNE_ANLG_VIDEO_PAL_I;
break; }
8727 case ANLG_VIDEO_PAL_B: {tnr_avtype = TUNE_ANLG_VIDEO_PAL_B;
break; }
8728 case ANLG_VIDEO_PAL_G: {tnr_avtype = TUNE_ANLG_VIDEO_PAL_G;
break; }
8729 case ANLG_VIDEO_PAL_D: {tnr_avtype = TUNE_ANLG_VIDEO_PAL_D;
break; }
8730 case ANLG_VIDEO_PAL_K: {tnr_avtype = TUNE_ANLG_VIDEO_PAL_K;
break; }
8731 case ANLG_VIDEO_PAL_L: {tnr_avtype = TUNE_ANLG_VIDEO_PAL_L;
break; }
8732 case ANLG_VIDEO_PAL_LDASH: {tnr_avtype = TUNE_ANLG_VIDEO_PAL_LDASH;
break; }
8733 default: {tnr_avtype = TUNE_ANLG_VIDEO_PAL_I;
break; }
8747 STB_TUNE_PRINT((
"Unhandled SIGNAL_TYPE %d", tuner_status[tuner].signal_type));
8752 FUNCTION_FINISH(StartTune);
8762 static void UnicableSendCommand(U8BIT path, U8BIT cmd[UNICABLE_COMMAND_SIZE])
8765 SendDISEQCMessage(path, cmd, UNICABLE_COMMAND_SIZE);
8774 FUNCTION_START(FindLNBBand);
8776 if (tuner_status[tuner].lnb_definition[tuner_status[tuner].lnb_type].band_list != NULL)
8778 n = tuner_status[tuner].lnb_definition[tuner_status[tuner].lnb_type].number_of_bands;
8779 band = tuner_status[tuner].lnb_definition[tuner_status[tuner].lnb_type].band_list;
8781 while ((band != NULL) && (i < n))
8783 if ((band->polarity == tuner_status[tuner].polarity) &&
8784 (tuner_status[tuner].frequency > band->min_freq) &&
8785 ((band->max_freq == 0) || (tuner_status[tuner].frequency <= band->max_freq)))
8802 FUNCTION_FINISH(FindLNBBand);
void STB_DPSetModulation(U8BIT path, E_STB_DP_MODULATION modulation)
Set the satellite modulation for the tuner in the given decode path.
E_STB_OTA_SW_UPGRADE_SEARCH_MODE STB_DPGetOTASearchMode(U8BIT path)
Returns the current 'Over The Air' Software Upgrade Search Mode for the given path.
BOOLEAN STB_CAReleaseDescrambler(U32BIT handle)
Will be called when a CA descrambler is no longer required.
void STB_DPDisableDishLimits(U8BIT path)
Disables sat dish limits.
U8BIT STB_DPGetPlaybackPath(void)
Returns the ID of the decode path being used for playback.
void STB_TuneSendDISEQCMessage(U8BIT path, U8BIT *data, U8BIT size)
Sends the DisEqc message.
BOOLEAN STB_DPGetLNB22k(U8BIT path)
Reads the status of LNB 22kHz from decode path store.
void STB_DPSetDishLimitE(U8BIT path)
Sets current sat dish position as East limit.
BOOLEAN STB_DPSetAudioCodec(U8BIT path, E_STB_DP_AUDIO_CODEC codec)
Sets the type of CODEC to be used for Audio decoding.
void STB_DPSetPolarity(U8BIT path, E_STB_DP_POLARITY pol)
Writes polarity value into decode path store.
void STB_DPSetADEnabled(U8BIT path, BOOLEAN state)
Writes the AD Audio into decode path store. To be set to ON or OFF. The exact ON state is depends if ...
void STB_DPStartDecoding(U8BIT path)
Requests start of channel decoding process.
void * STB_GetMemory(U32BIT bytes)
Attempts to allocate memory from the heap.
void STB_DPSetDISEQCTone(U8BIT path, E_STB_DP_DISEQC_TONE state)
Sets DiSEqC tone and writes status into decode path store.
void STB_AVChangeADMode(U8BIT path, E_STB_AV_AUDIO_MODE mode)
Configures the audio description channel mode (stereo/left/right) in the case where dual-mono audio i...
void STB_DPStoreDishPosition(U8BIT path, U16BIT count)
Stores sat dish position as given DiSEqC index number, or pulse count.
U8BIT STB_DPGetPathDemux(U8BIT path)
Returns the demux path ID acquired by the given decode path.
U8BIT STB_DPGetTerrPLP(U8BIT path)
Reads the terrestrial T2 PLP id from decode path store.
void STB_DPReleaseCISlotFromPath(U8BIT path)
Release the CI slot associated with the given path.
E_STB_DP_TTYPE STB_DPGetTerrType(U8BIT path)
Reads the terrestrial tuner type from decode path store.
void STB_DPSetTerrFreqOff(U8BIT path, S8BIT offset)
Writes terrestrial frequency offset value into decode path store.
void STB_TuneSetModulation(U8BIT path, E_STB_TUNE_MODULATION modulation)
Sets the type of modulation for the specified tuner.
BOOLEAN STB_DPGetNetworkSearch(U8BIT path)
Reads the SI network search flag state from decode path store.
U8BIT STB_DPAcquirePlaybackPath(void *service)
Acquires a decode path and all the required resources (demux, audio and video decoders) for playing b...
void STB_RESReleaseAudioDecoder(U8BIT decoder_id)
Releases a previously acquired audio decoder.
void STB_DPSetTerrMode(U8BIT path, E_STB_DP_TMODE mode)
Writes terrestrial tuning mode value into decode path store.
BOOLEAN STB_DPGetSearchMode(U8BIT path)
Reads the SI search mode flag state from decode path store.
void STB_DPSetVideoPID(U8BIT path, U16BIT pid)
Writes video PID value into decode path store.
U8BIT STB_HWGetTunerPaths(void)
Returns the number of front end (Tuner) paths on the platform.
void STB_RESSetTunerDisabled(U8BIT tuner_id, BOOLEAN disable)
Set the disable state for a tuner. When disabled, a tuner will be ignored when acquiring a new tuner ...
E_STB_SI_STATUS STB_SITerrGetStatus(U8BIT path)
Reads the SI status.
void STB_DPReleaseDecoders(U8BIT path)
Releases all decoders from the given path.
E_STB_DP_LNB_POWER STB_DPGetLNBPower(U8BIT path)
Reads the LNB power status from decode path store.
U8BIT STB_DPGetUnicableParams(U8BIT path, U32BIT unicable_if[MAX_UNICABLE_BANKS], U32BIT *lnb_lo_freq, U32BIT *lnb_hi_freq)
Interrogates Unicable LNB for its user and local oscillator frequencies.
BOOLEAN STB_RESCanTuneToTransport(E_STB_DP_SIGNAL_TYPE tuner_type, void *transport)
Returns whether there's a tuner available to tune to the given transport.
E_STB_DP_TBWIDTH STB_DPGetTerrBandwidth(U8BIT path)
Reads the terrestrial frequency offset value from decode path store.
void STB_DPSetFEC(U8BIT path, E_STB_DP_FEC fec)
Writes FEC value into decode path store.
BOOLEAN STB_DPGetFTASearch(U8BIT path)
Reads the SI FTA chan search flag state from decode path store.
void STB_DPSetAnalogFreqOff(U8BIT path, S8BIT offset)
Writes analogue frequency offset value into decode path store.
U16BIT STB_DPGetVideoPID(U8BIT path)
Reads the video PID value from decode path store.
E_STB_DP_CMODE STB_DPGetCableMode(U8BIT path)
Reads the cable tuning mode value from decode path store.
U8BIT STB_DPAcquireTunerPath(E_STB_DP_SIGNAL_TYPE tuner_type, void *service, void *transport, E_STB_DP_RES_OWNER owner, E_STB_DP_PRIORITY priority, BOOLEAN with_decoders, BOOLEAN for_recording)
Acquires a decode path and all the required resources (tuner, demux, audio and video decoders)...
U32BIT STB_OSGetClockDiff(U32BIT timestamp)
Get Difference between Given Time and Current Time.
void STB_DPSetTunedTransport(U8BIT path, void *transport)
Saves the given transport with the specified decode path.
E_STB_DP_SIGNAL_TYPE STB_DPGetSignalType(U8BIT path)
Reads the signal type value from decode path store.
Header file - macros and function prototypes for public use.
void STB_DPStartSI(U8BIT path)
Requests start of SI engine, mode is determined by flags in general control.
void * STB_OSCreateSemaphore(void)
Create a Semaphore.
U32BIT STB_DPGetSIRequestParam3(U8BIT path)
Returns parameters for previous SI request.
BOOLEAN STB_DPGetTVSearch(U8BIT path)
Reads the SI TV chan search flag state from decode path store.
void STB_DPSetTunerDisabled(U8BIT path, BOOLEAN disabled)
Disables/enables the tuner associated with this decode path.
U8BIT STB_DPPathForVideoDecoder(U8BIT decoder_num)
Returns the decode path that is using the given video decoder.
void STB_DPSetDishPosition(U8BIT path, U16BIT count)
Writes sat dish position value into decode path store.
void STB_DPSetAudioStatus(U8BIT path, E_STB_DP_DECODE_STATUS state)
Writes the audio status into decode path store.
void STB_DPStopRecording(U8BIT path)
Requests stop of recording on specified path.
void STB_RESSetTunerOwner(U8BIT tuner_id, E_STB_DP_RES_OWNER owner)
Sets the owner of the tuner.
U32BIT STB_TuneGetMinTunerFreqKHz(U8BIT path)
Returns the minimum tuner frequency in KHz.
void STB_DPSetPCRPID(U8BIT path, U16BIT pid)
Writes PCR PID value into decode path store.
void STB_DPSetUnicablePositionB(U8BIT path, BOOLEAN position_b)
Sets whether to use the alternate satellite position (Position B)
U8BIT STB_DPGetLivePath(void)
Returns the ID of the decode path being used for live viewing.
void STB_DPSetADMode(U8BIT path, E_STB_DP_AUDIO_MODE mode)
Writes AD mode value into decode path store.
void STB_DPSetDISEQCCSwitch(U8BIT path, E_STB_DP_DISEQC_CSWITCH state)
Sets DiSEqC committed switch and writes status into decode path store.
U8BIT STB_RESAcquireADDecoder(void)
Acquires an AD decoder and marks it as used.
BOOLEAN STB_DPReleasePath(U8BIT path, E_STB_DP_RES_OWNER owner)
Releases the decode path and all resources no longer needed. The path won't be released if the path i...
U32BIT STB_DPGetUnicableFrequency(U8BIT path)
Gets the currently set Unicable (IF) frequency.
void STB_AVStopAudioDecoding(U8BIT decoder)
Stops audio decoding on the given audio path.
void STB_DPSetLNB22k(U8BIT path, BOOLEAN state)
Sets LNB 22kHz on or off and writes status into decode path store.
void STB_DPSetTerrPLP(U8BIT path, U8BIT plp_id)
Sets terrestrial T2 PLP id into decode path store.
void STB_DMXChangeDecodePIDs(U8BIT path, U16BIT pcr_pid, U16BIT video_pid, U16BIT audio_pid, U16BIT text_pid, U16BIT data_pid, U16BIT ad_pid)
Changes the packet IDs for the PCR Video, Audio, Text and Data.
BOOLEAN STB_DPGetLNB12v(U8BIT path)
Reads the status of LNB 12v from decode path store.
void STB_DPSetVideoStatus(U8BIT path, E_STB_DP_DECODE_STATUS state)
Writes the video status into decode path store.
void * STB_DPGetTunedTransport(U8BIT path)
Returns the transport saved with the given decode path.
void STB_DPSetDISEQCSMATV(U8BIT path, BOOLEAN state)
Enables/disables DiSEqC SMATV and writes status into decode path store.
void STB_DMXGetDemuxSource(U8BIT path, E_STB_DMX_DEMUX_SOURCE *source, U8BIT *param)
Gets the current source of a given demux.
void STB_AVStopADDecoding(U8BIT decoder)
Stops decoding audio description on the given audio path.
BOOLEAN STB_DPSetVideoCodec(U8BIT path, E_STB_DP_VIDEO_CODEC codec)
Sets the type of CODEC to be used for Video decoding.
BOOLEAN STB_DPStartRecording(U8BIT path, U32BIT param)
Requests start of recording on specified path.
U8BIT STB_TuneSatGetCarrierStrength(U8BIT path, U32BIT freq)
Returns the carrier signal strength as a percentage.
BOOLEAN STB_DPGetLockMode(U8BIT path)
Reads the lock mode value from decode path store.
BOOLEAN STB_DPUseCISlotWithPath(U8BIT path, U8BIT slot_id)
Use the given CI slot with the given path.
BOOLEAN STB_DPAcquireCADescramblerForPath(U8BIT path, U8BIT *pmt_data, U32BIT *ca_handle)
Acquire a CA descrambler and assign it to the given path.
U32BIT STB_DPGetSIRequestParam1(U8BIT path)
Returns parameters for previous SI request.
void STB_DPSetADPID(U8BIT path, U16BIT pid)
Writes AD PID value into decode path store.
U8BIT STB_RESAcquireDemux(U8BIT demux_id, U16BIT caps)
Acquires a demux path and marks it as being used.
void STB_DPSetADStatus(U8BIT path, E_STB_DP_DECODE_STATUS state)
Writes the AD status into decode path store.
U16BIT STB_DPGetSkewPosition(U8BIT path)
Reads the sat skew position value from decode path store.
void STB_DPSetAudioMode(U8BIT path, E_STB_DP_AUDIO_MODE mode)
Writes audio mode value into decode path store.
U8BIT STB_DPGetNumPaths(void)
Returns the maximum number of decode paths.
Header file - Function prototypes for A/V control.
void STB_DPReleaseCADescramblerFromPath(U8BIT path)
Release the CA descrambler associated with the given path.
U8BIT STB_DPPathForAudioDecoder(U8BIT decoder_num)
Returns the decode path that is using the given audio decoder.
E_STB_DP_TUNE_STATUS STB_DPGetTuneStatus(U8BIT path)
Reads the tuning status from decode path store.
void STB_DMXSetDemuxSource(U8BIT path, E_STB_DMX_DEMUX_SOURCE source, U8BIT param)
Configures the source of the demux.
void STB_OSSemaphoreSignal(void *semaphore)
Signal a Semaphore to Release it by decrementing its counter.
BOOLEAN STB_DPGetUnicablePositionB(U8BIT path)
Gets whether Satellite Position B is currently set.
void STB_TuneSetPLP(U8BIT path, U8BIT plp)
Sets the Physical Layer Pipe to be acquired.
void STB_TuneSetLNBVoltage(U8BIT path, E_STB_TUNE_LNB_VOLTAGE voltage)
Sets the LNB voltage for the given tuner.
U8BIT STB_DPGetPathVideoDecoder(U8BIT path)
Returns the video decoder ID acquired by the given decode path.
U16BIT STB_DPGetPCRPID(U8BIT path)
Reads the PCR PID value from decode path store.
void * STB_DPGetTunedService(U8BIT path)
Returns the service saved with the given decode path.
void STB_TuneSetPulseLimitWest(U8BIT path, U16BIT count)
Sets the pulse limit for the west.
void STB_DPSetCableMode(U8BIT path, E_STB_DP_CMODE mode)
Writes cable tuning mode value into decode path store.
void STB_CADecodeVideoStatus(U32BIT handle, E_CA_DECODE_STATUS decode_status)
Notifies the CA system of a change in the video decoding state.
void STB_AVSetAudioSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param)
Sets the source of the input for the main audio on the given audio decoder path.
void STB_DPRequestSIExtendedEvent(U8BIT path, U32BIT start_date, U32BIT start_hour, U32BIT start_min)
Requests SI engine to get extended event data for specified event.
BOOLEAN STB_PVRStartRecording(U8BIT path, U32BIT handle)
Start the PVR record tasks.
void STB_DPSetTerrType(U8BIT path, E_STB_DP_TTYPE type)
Sets terrestrial tuning type into decode path store.
E_STB_DP_DISEQC_TONE STB_DPGetDISEQCTone(U8BIT path)
Reads the status of DiSEqC tone from decode path store.
void STB_TuneAutoRelock(U8BIT path, BOOLEAN state)
Enables or disabled auto tuner relocking.
BOOLEAN STB_DPIsLivePath(U8BIT path)
Is the given decode path being used for live viewing.
BOOLEAN STB_PVRIsInitialised(void)
Returns Initialised status.
U8BIT STB_DPGetUnicableChannel(U8BIT path)
Gets the currently set Unicable Channel (User Band).
void STB_TuneSet22kState(U8BIT path, BOOLEAN state)
Turns the 22 kHz tone on or off.
void STB_DPStartVideoDecoding(U8BIT path)
Requests start of channel decoding process.
void * STB_RESGetTunedTransport(U8BIT tuner_id)
Returns the transport record saved with the specified tuner.
void STB_OSSemaphoreWait(void *semaphore)
Wait on Semaphore Indefinity or Until Released.
Header file - macros and function prototypes for public use.
U8BIT STB_DPGetPathTuner(U8BIT path)
Returns the tuner ID acquired by the given decode path.
void STB_DPSetLockMode(U8BIT path, BOOLEAN mode)
Writes lock mode value into decode path store.
BOOLEAN STB_DPGetDVBS2(U8BIT path)
Returns whether the sat tuner is tuned to DVB-S or DVB-S2.
E_STB_DP_SIGNAL_TYPE STB_RESGetTunerType(U8BIT tuner_id)
Returns the type of the given tuner.
void STB_DPEnableAllTuners(void)
Sets the 'disabled' state of all tuners to FALSE so they can all be used by the resource manager...
void STB_ERSendEvent(BOOLEAN latched, BOOLEAN repeat, U16BIT path_class, U16BIT type, void *data, U32BIT data_size)
Sends an event to event reporting control module.
void STB_DPSetTerrBandwidth(U8BIT path, E_STB_DP_TBWIDTH bwidth)
Writes terrestrial bandwidth value into decode path store.
void STB_DPSetLockEnable(U8BIT path, BOOLEAN state)
Writes lock enable flag into decode path store.
void STB_TuneChangeSkewPosition(U8BIT path, U16BIT count)
Changes the value of skew position count.
BOOLEAN STB_DPGetScramSearch(U8BIT path)
Reads the SI scram chan search flag state from decode path store.
void * STB_DPGetOwnerData(U8BIT path, U32BIT *data_size)
Returns the owner data saved with the path. This data should not be freed.
BOOLEAN STB_AVSetAudioCodec(U8BIT path, E_STB_AV_AUDIO_CODEC codec)
Sets the audio codec to be used when decoding audio with the given audio decoder path.
void STB_DPSetOwner(U8BIT path, E_STB_DP_RES_OWNER owner)
Sets the owner of the given path.
void STB_DPSetDISEQCRepeats(U8BIT path, U8BIT count)
Sets DiSEqC repeats and writes value into decode path store.
void STB_DPSetTuneRelock(U8BIT path, BOOLEAN state)
Writes tuner auto relock flag into decode path store.
E_STB_DP_AUDIO_CODEC STB_DPGetAudioCodec(U8BIT path)
Returns the type of CODEC to be used for Audio decoding.
BOOLEAN STB_AVSetVideoCodec(U8BIT path, E_STB_AV_VIDEO_CODEC codec)
Sets the video codec to be used when decoding video with the given video decoder path.
BOOLEAN STB_RESIsTunerDisabled(U8BIT tuner_id)
Returns whether a tuner has been disabled or not.
void STB_DPCentreDishMove(U8BIT path)
Moves dish to centre.
void STB_DPSetSignalType(U8BIT path, E_STB_DP_SIGNAL_TYPE sigtype)
Writes signal type value into decode path store.
void STB_DPStartAudioDecoding(U8BIT path)
Requests start of channel decoding process.
void STB_PVRStopRecording(U8BIT path)
Stop the PVR recording.
void STB_DMXChangeTextPID(U8BIT path, U16BIT text_pid)
Changes just the teletext PID.
void STB_CADescrambleServiceStop(U32BIT handle)
This function will be called when decoding of a service is stopped.
U8BIT STB_DPGetNumEnabledTuners(void)
Returns the number of enabled tuners (i.e. that haven't been disabled)
U8BIT STB_DPPathForADDecoder(U8BIT decoder_num)
Returns the decode path that is using the given AD decoder.
E_STB_DP_DECODE_STATUS STB_DPGetAudioStatus(U8BIT path)
Reads the audio status from decode path store.
BOOLEAN STB_DPGetPulsePosition(U8BIT path)
Reads the status of pulse positioning from decode path store.
void STB_TuneSetPulseLimitEast(U8BIT path, U16BIT count)
Sets the pulse limit for the east.
void STB_DPStopVideoDecoding(U8BIT path)
Requests stop of channel decoding (blanks screen).
void STB_DPSetDecodePIDs(U8BIT path, U16BIT pcr_pid, U16BIT video_pid, U16BIT audio_pid, U16BIT text_pid, U16BIT data_pid, U16BIT AD_pid)
BOOLEAN STB_DPCanTuneTo(E_STB_DP_SIGNAL_TYPE tuner_type, void *service, void *transport)
Checks whether there's a tuner available to tune to the given service or transport.
void STB_DPStartScan(U8BIT path)
Requests start of tuning signal scan process.
U16BIT STB_DPGetADPID(U8BIT path)
Reads the audio PID value from decode path store.
void STB_FreeMemory(void *addr)
Releases previously allocated heap memory.
void STB_AVSetVideoSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param)
Sets the source of the input to the given video decoder path.
U8BIT STB_HWGetVideoDecodePaths(void)
Returns the number of video decoding paths on the platform.
void STB_DPSetTunedService(U8BIT path, void *service)
Saves the given service with the specified decode path.
void STB_DPSetDISEQCPosition(U8BIT path, BOOLEAN state)
Enables/disables DiSEqC positioning and writes status into decode path store.
void STB_DPSetLNBPower(U8BIT path, E_STB_DP_LNB_POWER state)
Sets LNB power on or off and writes status into decode path store.
BOOLEAN STB_CAAcquireDescrambler(U8BIT demux, U16BIT serv_id, U16BIT *ca_ids, U16BIT num_ca_ids, U32BIT *handle)
This function is used by the resource manager to acquire a CA descrambler that's able to descramble a...
void STB_DPSetLNB12v(U8BIT path, BOOLEAN state)
Sets LNB 12v on or off and writes status into decode path store.
U16BIT STB_TuneGetPulsePosition(U8BIT path)
Returns the current pulse position.
void STB_DPSetDISEQCUSwitch(U8BIT path, U8BIT state)
Sets DiSEqC uncommitted switch and writes status into decode path store.
E_STB_DP_DECODE_STATUS STB_DPGetADStatus(U8BIT path)
Reads the AD status from decode path store.
BOOLEAN STB_DPIsDecodingPath(U8BIT path)
Is the given decode path being used for decoding.
void STB_DPSetAdditionalFrequencies(U8BIT path, U8BIT num_freqs, U32BIT *frequencies)
Sets an array of frequencies that can be tried when tuning to a transport if the tuner fails to lock ...
U8BIT STB_DPGetDISEQCUSwitch(U8BIT path)
Reads the status of DiSEqC uncommitted switch from decode path store.
Debug functions header file.
void STB_DPSetTuneStatus(U8BIT path, E_STB_DP_TUNE_STATUS state)
Writes the tuning status into decode path store.
Header file - macros and function prototypes for public use.
void STB_DPStopAudioDecoding(U8BIT path)
Requests stop of channel decoding.
E_STB_DP_AD_AUDIO STB_DPGetADAudio(U8BIT path)
Reads the AD audio status from decode path store.
U16BIT STB_DPGetTextPID(U8BIT path)
Reads the teletext PID value from decode path store.
E_STB_DP_AUDIO_CODEC STB_DPGetADCodec(U8BIT path)
Returns the type of CODEC to be used for AD decoding.
void STB_AVStartVideoDecoding(U8BIT path)
Starts video decoding on the given video path.
void STB_TuneStopTuner(U8BIT path)
Stops any locking attempt, or unlocks if locked.
void STB_AVStopVideoDecoding(U8BIT decoder)
Stops video decoding on the given video path. The video is not expected to be blanked.
E_STB_DP_POLARITY STB_DPGetPolarity(U8BIT path)
Reads the polarity value from decode path store.
U8BIT STB_RESAcquireAudioDecoder(void)
Acquires an audio decoder and marks it as used.
U32BIT STB_DPGetSIRequestParam2(U8BIT path)
Returns parameters for previous SI request.
void STB_DPEnableDishLimits(U8BIT path, U16BIT ecount, U16BIT wcount)
Enables sat dish limits.
void STB_DPReleaseAllPaths(void)
Releases all decode paths and all the resources they are using.
U16BIT STB_DPGetSymbolRate(U8BIT path)
Reads the symbol rate value from decode path store.
E_STB_DP_ANALOG_VIDEO_TYPE STB_DPGetAnalogVideoType(U8BIT path)
Reads the analogue video type value from decode path store.
U32BIT STB_TuneGetMaxTunerFreqKHz(U8BIT path)
Returns the maximum tuner frequency in KHz.
void STB_DPSetAnalogVideoType(U8BIT path, E_STB_DP_ANALOG_VIDEO_TYPE vtype)
Writes analogue video type into decode path store.
void STB_DPSetFTASearch(U8BIT path, BOOLEAN state)
Writes SI FTA chan search flag into decode path store.
void STB_RESReleaseADDecoder(U8BIT decoder_id)
Releases a previously acquired AD decoder.
void STB_DPGetDecodeSource(U8BIT path, E_STB_DP_DECODE_SOURCE *source, U32BIT *param)
Gets source for specified decoder.
void STB_CADescrambleServiceStart(U32BIT handle)
This function will be called when decoding of a service is about to start and there's an associated d...
U8BIT STB_DPPathForTuner(U8BIT start_path, U8BIT tuner_num)
Returns the decode path that is using the given tuner ID.
void STB_DPStopDishMove(U8BIT path)
Stops sat dish moving.
Header file - Function prototypes for Event Reporting.
U8BIT STB_DPIsCISlotInUse(U8BIT start_path, U8BIT slot_id, U8BIT ignore_path)
Checks whether a given CI slot is in use.
U32BIT STB_DPGetFrequency(U8BIT path)
Reads the frequency value from decode path store.
BOOLEAN STB_DPGetRadioSearch(U8BIT path)
Reads the SI radio chan search flag state from decode path store.
void STB_DPSetTVSearch(U8BIT path, BOOLEAN state)
Writes SI TV chan search flag into decode path store.
U8BIT STB_HWGetAudioDecodePaths(void)
Returns the number of audio decoding paths on the platform.
Glue layer between DVB and conditional access systems.
void STB_DPSetDVBS2(U8BIT path, BOOLEAN dvb_s2)
Set whether the satellite should be tuned to DVB-S/S2 for the tuner in the given decode path...
void STB_RESReleaseDemux(U8BIT demux_id)
Releases a previously acquired demux path.
void STB_DPTuneOff(U8BIT path)
Requests stop of tuning and powers down tuner.
void STB_DPSetPulsePosition(U8BIT path, BOOLEAN state)
Enables/disables pulse positioning and writes status into decode path store.
BOOLEAN STB_DPSetOwnerData(U8BIT path, void *data, U32BIT data_size)
Saves a copy of the given data with the path. If data is passed as NULL and owner data already exists...
E_STB_DP_LNB_TYPE STB_DPGetLNBType(U8BIT path)
Reads the LNB type value from decode path store.
E_STB_DP_AUDIO_MODE STB_DPGetADMode(U8BIT path)
Reads the AD mode value from decode path store.
void STB_TuneSetSystemType(U8BIT path, E_STB_TUNE_SYSTEM_TYPE type)
Set the demodulator's signal type. This function must be called before each call to STB_TuneStartTune...
void STB_AVStartADDecoding(U8BIT decoder)
Starts decoding audio description on the given audio path.
BOOLEAN STB_DPSetADCodec(U8BIT path, E_STB_DP_AUDIO_CODEC codec)
Sets the type of CODEC to be used for AD decoding.
E_STB_DP_FEC STB_DPGetFEC(U8BIT path)
Reads the FEC value from decode path store.
E_STB_DP_VIDEO_CODEC STB_DPGetVideoCodec(U8BIT path)
Returns the type of CODEC to be used for Video decoding.
Header file - Function prototypes for operating system.
U16BIT STB_DPGetAudioPID(U8BIT path)
Reads the audio PID value from decode path store.
System Wide Global Technical Data Type Definitions.
BOOLEAN STB_AVSetADCodec(U8BIT path, E_STB_AV_AUDIO_CODEC codec)
Sets the codec to be used for audio description when decoding audio with the given audio decoder path...
E_STB_DP_SIGNAL_TYPE STB_DPGetPathTunerType(U8BIT path)
Returns the tuner type for the given path.
STB middleware resource management module header file.
void STB_DPSetAudioPID(U8BIT path, U16BIT pid)
Writes audio PID value into decode path store.
S8BIT STB_DPGetTerrFreqOff(U8BIT path)
Reads the terrestrial frequency offset value from decode path store.
Header file - macros and function prototypes for public use.
void STB_TuneSet12VSwitch(U8BIT path, BOOLEAN state)
Sets the 12V switch for the given tuner.
void STB_DPSetSymbolRate(U8BIT path, U16BIT sym)
Writes symbol rate value into decode path store.
E_STB_DP_TMODE STB_DPGetTerrMode(U8BIT path)
Reads the terrestrial tuning mode value from decode path store.
void STB_DPStopSI(U8BIT path)
Requests stop of SI engine.
void STB_CADecodeAudioStatus(U32BIT handle, E_CA_DECODE_STATUS decode_status)
Notifies the CA system of a change in the audio decoding state.
BOOLEAN STB_PVRIsRecording(U8BIT path, U32BIT *handle)
Reads the PVR record status.
BOOLEAN STB_DPIsOwnedBy(U8BIT path, E_STB_DP_RES_OWNER owner)
Checks whether the path is owned by the given owner.
U8BIT STB_DPGetPathAudioDecoder(U8BIT path)
Returns the audio decoder ID acquired by the given decode path.
void STB_DPSetNetworkSearch(U8BIT path, BOOLEAN state)
Writes SI network search flag into decode path store.
void STB_AVStartAudioDecoding(U8BIT decoder)
Starts audio decoding on the given audio path.
U8BIT STB_DPGetPathSecondaryVideoDecoder(U8BIT path)
Returns the secondary video decoder ID acquired by the given decode path.
BOOLEAN STB_DPGetDISEQCSMATV(U8BIT path)
Reads the status of DiSEqC SMATV from decode path store.
U8BIT STB_RESAcquireVideoDecoder(void)
Acquires a video decoder and marks it as used.
E_STB_DP_DECODE_STATUS STB_DPGetVideoStatus(U8BIT path)
Reads the video status from decode path store.
void STB_AVChangeAudioMode(U8BIT path, E_STB_AV_AUDIO_MODE mode)
Configures the main audio channel mode (stereo/left/right) in the case where dual-mono audio is used...
E_STB_DP_DISEQC_CSWITCH STB_DPGetDISEQCCSwitch(U8BIT path)
Reads the status of DiSEqC committed switch from decode path store.
Header file - macros and function prototypes for public use.
U16BIT STB_SIGetPmtCaIdDescArray(U8BIT *pmt_data, U16BIT **pmt_ca_ids)
Parses the given PMT to produce an array of the CA system IDs required by the service or streams on t...
BOOLEAN STB_DPIsRecordingPath(U8BIT path)
Is the given decode path being used for recording.
BOOLEAN STB_DPGetTuneRelock(U8BIT path)
Reads the tuner auto relock flag state from decode path store.
Header file - Function prototypes for heap memory.
BOOLEAN STB_DPGetLockEnable(U8BIT path)
Reads the lock enable flag state from decode path store.
void STB_DPInitialise(void)
Initialises decode path control and sets up the structures for restricting access to resources...
S8BIT STB_DPGetAnalogFreqOff(U8BIT path)
Reads the analogue frequency offset value from decode path store.
void STB_DPSetDishLimitW(U8BIT path)
Sets current sat dish position as West limit.
U8BIT STB_DPGetMHEGPath(void)
Returns the path for Cabot MHEG software to use.
void STB_RESSetTunedTransport(U8BIT tuner_id, void *t_ptr)
Saves the transport pointer with the specified tuner.
void STB_DPSetOTASearchMode(U8BIT path, E_STB_OTA_SW_UPGRADE_SEARCH_MODE mode)
Sets the 'Over The Air' Software Upgrade Search Mode for a given path.
BOOLEAN STB_DPGetDISEQCPosition(U8BIT path)
Reads the status of DiSEqC positioning from decode path store.
E_STB_DP_MODULATION STB_DPGetModulation(U8BIT path)
Returns the satellite modulation type for the give decode path.
void STB_DPStartDishMoveE(U8BIT path, U16BIT count)
Starts sat dish moving east.
void STB_DPSetScramSearch(U8BIT path, BOOLEAN state)
Writes SI scram chan search flag into decode path store.
E_STB_DP_AUDIO_MODE STB_DPGetAudioMode(U8BIT path)
Reads the audio mode value from decode path store.
void STB_DPSetLNBType(U8BIT path, E_STB_DP_LNB_TYPE type)
Writes LNB type value into decode path store.
U16BIT STB_DPGetDishRequest(U8BIT path)
Reads the sat dish position value from decode path store.
U16BIT STB_DPGetDataPID(U8BIT path)
Reads the data PID value from decode path store.
void STB_SIReleaseCaIdDescArray(U16BIT *desc_array, U8BIT num_entries)
Frees the memory used by the descriptor array specified.
U8BIT STB_DPGetPathCISlot(U8BIT path)
Returns the CI slot id associated with the given path.
void STB_DPStartDishMoveW(U8BIT path, U16BIT count)
Starts sat dish moving west.
void STB_DPSetSearchMode(U8BIT path, BOOLEAN state)
Writes SI search mode flag into decode path store.
void STB_DPSetDecodeSource(U8BIT path, E_STB_DP_DECODE_SOURCE source, U32BIT param)
Sets source for specified decoder.
void STB_SITerrSendEvent(U8BIT path, U32BIT events)
Sends an event to STB layer SI Terrestrial engine.
void STB_OSTaskDelay(U16BIT timeout)
Delay Task for Specifed Time Period.
BOOLEAN STB_DPTryAdditionalFrequency(U8BIT tuner_num)
Checks to see if there's an additional frequency available on the given decode path that hasn't yet b...
U8BIT STB_RESNumEnabledTuners(void)
Returns the number of tuners that aren't disabled.
void STB_RESReleaseTuner(U8BIT tuner_id, BOOLEAN high_priority, E_STB_DP_RES_OWNER owner)
Releases a tuner that has previously been acquired.
Header file - Function prototypes for Demux control.
U8BIT STB_HWGetDemuxPaths(void)
Queries the number of demux paths available.
void STB_AVSetADSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param)
Sets the source of the input for the audio description audio on the given audio decoder path...
U8BIT STB_DPAcquireCISlotForPath(U8BIT path, U8BIT *pmt_data, U8BIT *ci_protection_desc)
Acquire a CI slot and assign it to the given path.
U32BIT STB_OSGetClockMilliseconds(void)
Get Current Computer Clock Time.
void STB_DPStopDecoding(U8BIT path)
Requests stop of channel decoding (blanks screen).
U16BIT STB_DPGetDishPosition(U8BIT path)
Reads the actual sat dish position value.
BOOLEAN STB_DPGetPathCADescrambler(U8BIT path, U32BIT *handle)
Get the handle of the CA descrambler associated with the given path.
void STB_DPSetSkewPosition(U8BIT path, U16BIT count)
Writes sat skew position value into decode path store.
BOOLEAN STB_DPIsTunerEnabled(U8BIT tuner_num)
Returns the 'enabled' status for the given tuner number.
void STB_AVBlankVideo(U8BIT path, BOOLEAN blank)
Blanks or unblanks the video display.
void STB_DPSetUnicableChannel(U8BIT path, U8BIT chan)
Sets the current Unicable Channel (User Band).
void STB_TuneStartTuner(U8BIT path, U32BIT freq, U32BIT srate, E_STB_TUNE_FEC fec, S8BIT freq_off, E_STB_TUNE_TMODE tmode, E_STB_TUNE_TBWIDTH tbwidth, E_STB_TUNE_CMODE cmode, E_STB_TUNE_ANALOG_VIDEO_TYPE anlg_vtype)
Starts the tuner, it will then attempt to lock specified signal. Unrequired parameters can be passed ...
U8BIT STB_RESAcquireTuner(E_STB_DP_SIGNAL_TYPE tuner_type, void *transport, E_STB_DP_RES_OWNER owner, BOOLEAN high_priority, BOOLEAN *tuner_taken)
Acquires a tuner. Tuners will be reused if possible.
void STB_CADecodeADStatus(U32BIT handle, E_CA_DECODE_STATUS decode_status)
Notifies the CA system of a change in the AD decoding state.
void STB_RESReleaseCISlot(U8BIT slot_id)
Releases a previously acquired CI slot.
void STB_DPSetDataPID(U8BIT path, U16BIT pid)
Writes data PID value into decode path store.
U8BIT STB_RESTunerUsageCount(U8BIT tuner_id)
Returns the number of paths using the tuner.
void STB_DPStopTune(U8BIT path)
Stops of tuning signal scan and unlocks.
void STB_DPSetRadioSearch(U8BIT path, BOOLEAN state)
Writes SI radio chan search flag into decode path store.
void STB_DPSetTextPID(U8BIT path, U16BIT pid)
Writes teletext PID value into decode path store.
void STB_DPSetFrequency(U8BIT path, U32BIT freq)
Writes frequency value into decode path store.
void STB_DPStopADDecoding(U8BIT path)
Requests stop of channel decoding.
BOOLEAN STB_DPOTASearchEnabled(U8BIT path)
Returns TRUE if the current 'Over The Air' Software Upgrade Search Mode is manual or automatic...
U8BIT STB_DPGetPathForService(void *service)
Checks whether any of the paths are tuned to the given service.
void STB_DPStartTune(U8BIT path)
Requests start of tuning process.
void STB_DPSetADAudio(U8BIT path, E_STB_DP_AD_AUDIO ad_audio)
Reads the AD audio status from decode path store.
void STB_DPSetUnicableFrequency(U8BIT path, U32BIT freq)
Sets the Unicable (IF) frequency.
void STB_DPSetUserDefinedLNBBands(U8BIT path, U8BIT number_of_bands, S_STB_DP_LNB_BAND *band_definitions)
Stores the pointer to the array of band definitions for the user defined LNB.
void STB_RESReleaseVideoDecoder(U8BIT decoder_id)
Releases a previously acquired video decoder.
U8BIT STB_RESGetCISlotUsageCount(U8BIT slot_id)
Returns the number of times the given slot is in use.
void STB_TuneSetLOFrequency(U8BIT tuner, U16BIT lo_freq)
Sets the local oscillator frequency used by the LNB.
Header file - Function prototypes for tuner control.
BOOLEAN STB_DPIsRecording(U8BIT path, U32BIT *handle)
Returns status of recording on specified path.
U8BIT STB_DPGetDISEQCRepeats(U8BIT path)
Reads the value of DiSEqC repeats from decode path store.
void STB_DPStartADDecoding(U8BIT path)
Requests start of channel decoding process.