📄 dvb.c
字号:
break; /* Second device */ case 6: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_VIDEO1 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_VIDEO1; break; case 7: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_AUDIO1 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_AUDIO1; break; case 8: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_TELETEXT1 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_TELETEXT1; break; case 9: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_SUBTITLE1 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_SUBTITLE1; break; case 10: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_PCR1 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_PCR1; break; /* Third device */ case 11: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_VIDEO2 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_VIDEO2; break; case 12: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_AUDIO2 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_AUDIO2; break; case 13: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_TELETEXT2 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_TELETEXT2; break; case 14: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_SUBTITLE2 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_SUBTITLE2; break; case 15: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_PCR2 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_PCR2; break; /* Forth device */ case 16: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_VIDEO3 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_VIDEO3; break; case 17: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_AUDIO3 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_AUDIO3; break; case 18: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_TELETEXT3 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_TELETEXT3; break; case 19: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_SUBTITLE3 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_SUBTITLE3; break; case 20: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_PCR3 for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_PCR3; break; /* Usually used by Nova cards */ case 21: msg_Dbg(p_input, "ioctl_SetDMXFilter: DMX_PES_OTHER for PMT %d", i_pid); s_filter_params.pes_type = DMX_PES_OTHER; break; /* What to do with i? */ default: msg_Err(p_input, "trying to set PMT id to=%d for unknown type %d", i_pid, i_type ); break; } s_filter_params.flags = DMX_IMMEDIATE_START; /* We then give the order to the device : */ if ((result = ioctl(*pi_fd, DMX_SET_PES_FILTER, &s_filter_params)) < 0) {# ifdef HAVE_ERRNO_H msg_Err(p_input, "ioctl_SetDMXFilter: ioctl failed with %d (%s)",result, strerror(errno));# else msg_Err(p_input, "ioctl_SetDMXFilter: ioctl failed with %d",result);# endif return -1; } return 0;}/***************************************************************************** * ioctl_UnsetDMXFilter : removes a filter *****************************************************************************/int ioctl_UnsetDMXFilter(input_thread_t * p_input, int pi_fd){ int ret; if ((ret=ioctl( pi_fd, DMX_STOP))<0) {# ifdef HAVE_ERRNO_H msg_Err(p_input, "ioctl DMX_STOP failed for demux %d (%d) %s", pi_fd, ret, strerror(errno));# else msg_Err(p_input, "ioctl DMX_STOP failed for demux %d (%d)", pi_fd, ret);# endif return -1; } msg_Dbg( p_input, "ioctl_UnsetDMXFilter closing demux %d", pi_fd); close(pi_fd); return 0;}/***************************************************************************** * dvb_DecodeBandwidth : decodes arguments for DVB S/C/T card *****************************************************************************/fe_bandwidth_t dvb_DecodeBandwidth(input_thread_t * p_input, int bandwidth){ fe_bandwidth_t fe_bandwidth = 0; switch (bandwidth) { case 0: fe_bandwidth = BANDWIDTH_AUTO; break; case 6: fe_bandwidth = BANDWIDTH_6_MHZ; break; case 7: fe_bandwidth = BANDWIDTH_7_MHZ; break; case 8: fe_bandwidth = BANDWIDTH_8_MHZ; break; default: msg_Dbg( p_input, "terrestrial dvb has bandwidth not set, using auto"); fe_bandwidth = BANDWIDTH_AUTO; break; } return fe_bandwidth;}fe_code_rate_t dvb_DecodeFEC(input_thread_t * p_input, int fec){ fe_code_rate_t fe_fec = FEC_NONE; switch( fec ) { case 1: fe_fec = FEC_1_2; break; case 2: fe_fec = FEC_2_3; break; case 3: fe_fec = FEC_3_4; break; case 4: fe_fec = FEC_4_5; break; case 5: fe_fec = FEC_5_6; break; case 6: fe_fec = FEC_6_7; break; case 7: fe_fec = FEC_7_8; break; case 8: fe_fec = FEC_8_9; break; case 9: fe_fec = FEC_AUTO; break; default: /* cannot happen */ fe_fec = FEC_NONE; msg_Err( p_input, "argument has invalid FEC (%d)", fec); break; } return fe_fec;}fe_modulation_t dvb_DecodeModulation(input_thread_t * p_input, int modulation){ fe_modulation_t fe_modulation = 0; switch( modulation ) { case -1: fe_modulation = QPSK; break; case 0: fe_modulation = QAM_AUTO; break; case 16: fe_modulation = QAM_16; break; case 32: fe_modulation = QAM_32; break; case 64: fe_modulation = QAM_64; break; case 128: fe_modulation = QAM_128; break; case 256: fe_modulation = QAM_256; break; default: msg_Dbg( p_input, "terrestrial/cable dvb has constellation/modulation not set, using auto"); fe_modulation = QAM_AUTO; break; } return fe_modulation;}fe_transmit_mode_t dvb_DecodeTransmission(input_thread_t * p_input, int transmission){ fe_transmit_mode_t fe_transmission = 0; switch( transmission ) { case 0: fe_transmission = TRANSMISSION_MODE_AUTO; break; case 2: fe_transmission = TRANSMISSION_MODE_2K; break; case 8: fe_transmission = TRANSMISSION_MODE_8K; break; default: msg_Dbg( p_input, "terrestrial dvb has transmission mode not set, using auto"); fe_transmission = TRANSMISSION_MODE_AUTO; break; } return fe_transmission;}fe_guard_interval_t dvb_DecodeGuardInterval(input_thread_t * p_input, int guard){ fe_guard_interval_t fe_guard = 0; switch( guard ) { case 0: fe_guard = GUARD_INTERVAL_AUTO; break; case 4: fe_guard = GUARD_INTERVAL_1_4; break; case 8: fe_guard = GUARD_INTERVAL_1_8; break; case 16: fe_guard = GUARD_INTERVAL_1_16; break; case 32: fe_guard = GUARD_INTERVAL_1_32; break; default: msg_Dbg( p_input, "terrestrial dvb has guard interval not set, using auto"); fe_guard = GUARD_INTERVAL_AUTO; break; } return fe_guard;}fe_hierarchy_t dvb_DecodeHierarchy(input_thread_t * p_input, int hierarchy){ fe_hierarchy_t fe_hierarchy = 0; switch (hierarchy) { case -1: fe_hierarchy = HIERARCHY_NONE; break; case 0: fe_hierarchy = HIERARCHY_AUTO; break; case 1: fe_hierarchy = HIERARCHY_1; break; case 2: fe_hierarchy = HIERARCHY_2; break; case 4: fe_hierarchy = HIERARCHY_4; break; default: msg_Dbg( p_input, "terrestrial dvb has hierarchy not set, using auto"); fe_hierarchy = HIERARCHY_AUTO; break; } return fe_hierarchy;}fe_spectral_inversion_t dvb_DecodeInversion(input_thread_t * p_input, int inversion){ fe_spectral_inversion_t fe_inversion=0; switch (inversion) { case 0: fe_inversion = INVERSION_OFF; break; case 1: fe_inversion = INVERSION_ON; break; case 2: fe_inversion = INVERSION_AUTO; break; default: msg_Dbg( p_input, "dvb has inversion/polarisation not set, using auto"); fe_inversion = INVERSION_AUTO; break; } return fe_inversion;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -