htsmsg_add_str(m, NULL, "DVB-C");
htsmsg_add_str(m, NULL, "ATSC-T");
htsmsg_add_str(m, NULL, "ATSC-C");
+ htsmsg_add_str(m, NULL, "CableCARD");
return m;
}
override_type = "ATSC-T";
type = dvb_str2type(override_type);
if ( ! ( type == DVB_TYPE_C || type == DVB_TYPE_T ||
- type == DVB_TYPE_ATSC_T || type == DVB_TYPE_ATSC_C ) ) {
+ type == DVB_TYPE_ATSC_T || type == DVB_TYPE_ATSC_C ||
+ type == DVB_TYPE_CABLECARD ) ) {
type = DVB_TYPE_C;
}
}
} else {
if (strstr(hd->hd_info.deviceModel, "_atsc"))
type = DVB_TYPE_ATSC_T;
+ if (strstr(hd->hd_info.deviceModel, "_cablecard"))
+ type = DVB_TYPE_CABLECARD;
}
hd->hd_override_type = strdup(dvb_type2str(type));
idclass_register(&tvhdhomerun_frontend_dvbc_class);
idclass_register(&tvhdhomerun_frontend_atsc_t_class);
idclass_register(&tvhdhomerun_frontend_atsc_c_class);
+ idclass_register(&tvhdhomerun_frontend_cablecard_class);
TAILQ_INIT(&tvhdhomerun_discoveries);
pthread_mutex_init(&tvhdhomerun_discovery_lock, NULL);
tvh_cond_init(&tvhdhomerun_discovery_cond);
tvhdebug(LS_TVHDHOMERUN, "locked");
hfe->hf_locked = 1;
+ /* Get CableCARD variables */
+ dvb_mux_t *lm = (dvb_mux_t *)mm;
+ struct hdhomerun_tuner_vstatus_t tuner_vstatus;
+ char *tuner_vstatus_str;
+ pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex);
+ res = hdhomerun_device_get_tuner_vstatus(hfe->hf_hdhomerun_tuner,
+ &tuner_vstatus_str, &tuner_vstatus);
+ pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
+ if (res < 1)
+ tvhwarn(LS_TVHDHOMERUN, "tuner_vstatus (%d)", res);
+ lm->lm_tuning.dmc_fe_vchan.name = strdup(tuner_vstatus.name);
+ sscanf(strstr(tuner_status.channel, ":"), ":%u", &lm->lm_tuning.dmc_fe_freq);
+
/* start input thread */
tvh_pipe(O_NONBLOCK, &hfe->hf_input_thread_pipe);
pthread_mutex_lock(&hfe->hf_input_thread_mutex);
char buf[1024];
int res;
+ if (hfe->hf_type == DVB_TYPE_CABLECARD)
+ return;
+
/* a full mux subscription should specificly set the filter */
if (pid == MPEGTS_FULLMUX_PID) {
tvhdebug(LS_TVHDHOMERUN, "setting PID filter full mux");
break;
}
break;
+ case DVB_TYPE_CABLECARD:
+ if (!dmc->dmc_fe_vchan.minor)
+ snprintf(channel_buf, sizeof(channel_buf), "%u", dmc->dmc_fe_vchan.num);
+ else
+ snprintf(channel_buf, sizeof(channel_buf), "%u.%u",
+ dmc->dmc_fe_vchan.num,
+ dmc->dmc_fe_vchan.minor);
+ break;
default:
snprintf(channel_buf, sizeof(channel_buf), "auto:%u", dmc->dmc_fe_freq);
break;
tvherror(LS_TVHDHOMERUN, "failed to acquire lockkey: %s", perror);
return SM_CODE_TUNING_FAILED;
}
- res = hdhomerun_device_set_tuner_channel(hfe->hf_hdhomerun_tuner, channel_buf);
+ if (hfe->hf_type == DVB_TYPE_CABLECARD)
+ res = hdhomerun_device_set_tuner_vchannel(hfe->hf_hdhomerun_tuner, channel_buf);
+ else
+ res = hdhomerun_device_set_tuner_channel(hfe->hf_hdhomerun_tuner, channel_buf);
pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
if(res < 1) {
tvherror(LS_TVHDHOMERUN, "failed to tune to %s", channel_buf);
res = tvhdhomerun_frontend_tune(hfe, mmi);
/* reset the pfilters */
- pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex);
- r = hdhomerun_device_set_tuner_filter(hfe->hf_hdhomerun_tuner, "0x0000");
- pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
- if(r < 1)
- tvherror(LS_TVHDHOMERUN, "failed to reset pfilter: %d", r);
+ if (hfe->hf_type != DVB_TYPE_CABLECARD) {
+ pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex);
+ r = hdhomerun_device_set_tuner_filter(hfe->hf_hdhomerun_tuner, "0x0000");
+ pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
+ if(r < 1)
+ tvherror(LS_TVHDHOMERUN, "failed to reset pfilter: %d", r);
+ }
return res;
}
}
};
+const idclass_t tvhdhomerun_frontend_cablecard_class =
+{
+ .ic_super = &tvhdhomerun_frontend_class,
+ .ic_class = "tvhdhomerun_frontend_cablecard",
+ .ic_caption = N_("HDHomeRun CableCARD frontend"),
+ .ic_properties = (const property_t[]){
+ {}
+ }
+};
+
static mpegts_network_t *
tvhdhomerun_frontend_wizard_network ( tvhdhomerun_frontend_t *hfe )
{
idc = &tvhdhomerun_frontend_atsc_t_class;
else if (type == DVB_TYPE_ATSC_C)
idc = &tvhdhomerun_frontend_atsc_c_class;
+ else if (type == DVB_TYPE_CABLECARD)
+ idc = &tvhdhomerun_frontend_cablecard_class;
else {
tvherror(LS_TVHDHOMERUN, "unknown FE type %d", type);
return NULL;