diff -Naur xine-lib/src/input/dvb/frontend.h xine-lib-atsc/src/input/dvb/frontend.h --- xine-lib/src/input/dvb/frontend.h 2003-01-15 09:08:44.000000000 -0700 +++ xine-lib-atsc/src/input/dvb/frontend.h 2005-07-21 23:13:20.832689242 -0600 @@ -42,7 +42,8 @@ typedef enum { FE_QPSK, FE_QAM, - FE_OFDM + FE_OFDM, + FE_ATSC } fe_type_t; @@ -69,6 +70,8 @@ FE_CAN_BANDWIDTH_AUTO = 0x40000, FE_CAN_GUARD_INTERVAL_AUTO = 0x80000, FE_CAN_HIERARCHY_AUTO = 0x100000, + FE_CAN_8VSB = 0x200000, + FE_CAN_16VSB = 0x400000, FE_CAN_MUTE_TS = 0x80000000, FE_CAN_CLEAN_SETUP = 0x40000000 } fe_caps_t; @@ -163,7 +166,9 @@ QAM_64, QAM_128, QAM_256, - QAM_AUTO + QAM_AUTO, + VSB_8, + VSB_16 } fe_modulation_t; @@ -211,6 +216,9 @@ fe_modulation_t modulation; /* modulation type (see above) */ }; +struct dvb_vsb_parameters { + fe_modulation_t modulation; /* modulation type (see above) */ +}; struct dvb_ofdm_parameters { fe_bandwidth_t bandwidth; @@ -231,6 +239,7 @@ struct dvb_qpsk_parameters qpsk; struct dvb_qam_parameters qam; struct dvb_ofdm_parameters ofdm; + struct dvb_vsb_parameters vsb; } u; }; diff -Naur xine-lib/src/input/input_dvb.c xine-lib-atsc/src/input/input_dvb.c --- xine-lib/src/input/input_dvb.c 2005-02-14 01:30:27.000000000 -0700 +++ xine-lib-atsc/src/input/input_dvb.c 2005-07-21 23:13:21.179624603 -0600 @@ -94,6 +94,8 @@ /* These will eventually be #include */ #include "dvb/dmx.h" #include "dvb/frontend.h" +//#include +//#include #define LOG_MODULE "input_dvb" #define LOG_VERBOSE @@ -395,6 +397,14 @@ { NULL, 0 } }; +static const Param atsc_list [] = { + { "8VSB", VSB_8 }, + { "QAM_256", QAM_256 }, + { "QAM_64", QAM_64 }, + { "QAM", QAM_AUTO }, + { NULL, 0 } +}; + static const Param qam_list [] = { { "QPSK", QPSK }, { "QAM_128", QAM_128 }, @@ -622,6 +632,7 @@ if(this->feinfo.type==FE_QPSK) xprintf(this->xine,XINE_VERBOSITY_DEBUG,"SAT Card\n"); if(this->feinfo.type==FE_QAM) xprintf(this->xine,XINE_VERBOSITY_DEBUG,"CAB Card\n"); if(this->feinfo.type==FE_OFDM) xprintf(this->xine,XINE_VERBOSITY_DEBUG,"TER Card\n"); + if(this->feinfo.type==FE_ATSC) xprintf(this->xine,XINE_VERBOSITY_DEBUG,"US Card\n"); if ((test_video=open(video_device, O_RDWR)) < 0) { xprintf(this->xine,XINE_VERBOSITY_DEBUG,"input_dvb: Card has no hardware decoder\n"); @@ -699,6 +710,7 @@ (DVBT) OFDM: ::: :::: :::: + (DVBA) ATSC: :::: = any string not containing ":" = unsigned long @@ -709,7 +721,7 @@ = INVERSION_ON | INVERSION_OFF | INVERSION_AUTO = FEC_1_2, FEC_2_3, FEC_3_4 .... FEC_AUTO ... FEC_NONE - = QPSK, QAM_128, QAM_16 ... + = QPSK, QAM_128, QAM_16, ATSC ... = BANDWIDTH_6_MHZ, BANDWIDTH_7_MHZ, BANDWIDTH_8_MHZ = @@ -816,6 +828,14 @@ if(!(field = strsep(&tmp, ":")))return -1; channel->front_param.u.ofdm.hierarchy_information = find_param(hierarchy_list, field); break; + case FE_ATSC: + channel->front_param.frequency = freq; + + /* find out the qam */ + if(!(field = strsep(&tmp, ":")))return -1; + channel->front_param.u.vsb.modulation = find_param(atsc_list, field); + break; + } /* Video PID - not used but we"ll take it anyway */ @@ -1116,8 +1136,17 @@ } break; } - break; - }; + break; + case 0x81: // AC3 audio + fprintf(stderr, " pid type 0x%x, has audio %d\n",buf[0],has_audio); //jsk + if(!has_audio) { + xprintf(this->stream->xine,XINE_VERBOSITY_LOG,"input_dvb: Adding AUDIO : PID 0x%04x\n", elementary_pid); + dvb_set_pidfilter(this, AUDFILTER, elementary_pid, DMX_PES_AUDIO, DMX_OUT_TS_TAP); + has_audio=1; + } + break; + + }; // end switch buf += descriptor_len + 5; section_length -= descriptor_len + 5; @@ -2825,6 +2854,33 @@ return 0; } this->channel = 0; + } else if (strncasecmp(this->mrl, "dvba://", 7) == 0) + { + fprintf(stderr,"input_dvb: 2a %x\n",tuner->feinfo.type); //jsk + /* + * This is dvbc://: + */ + if (tuner->feinfo.type != FE_ATSC) + { + fprintf(stderr,"input_dvb: FAILED 1\n"); //jsk + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-C)\n")); + tuner_dispose(tuner); + return 0; + } + ptr = this->mrl; + ptr += 7; + channels = xine_xmalloc(sizeof(channel_t)); + _x_assert(channels != NULL); + if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0) + { + fprintf(stderr,"input_dvb: FAILED 2\n"); //jsk + free(channels); + channels = NULL; + tuner_dispose(tuner); + return 0; + } + this->channel = 0; }else { /* not our mrl */ tuner_dispose(tuner); @@ -2973,7 +3029,10 @@ if(strncasecmp(mrl,"dvbs://",7)) if(strncasecmp(mrl,"dvbt://",7)) if(strncasecmp(mrl,"dvbc://",7)) - return NULL; + if(strncasecmp(mrl,"dvba://",7)) + return NULL; + + fprintf(stderr, "input_dvb: continuing in get_instance\n"); //jsk this = (dvb_input_plugin_t *) xine_xmalloc (sizeof(dvb_input_plugin_t)); @@ -3157,7 +3216,8 @@ this->mrls[1] = "dvbs://"; this->mrls[2] = "dvbc://"; this->mrls[3] = "dvbt://"; - this->mrls[4] = 0; + this->mrls[4] = "dvba://"; + this->mrls[5] = 0; xprintf(this->xine,XINE_VERBOSITY_DEBUG,"init class succeeded\n");