diff options
author | wm4 <wm4@nowhere> | 2013-02-06 21:55:35 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-02-06 23:03:39 +0100 |
commit | 37c5c114af8b4747dfa0664bf967958baa9a1c91 (patch) | |
tree | 407250d8226d5ec1a18f4fd93b6b5f47ce56f73f /stream/stream_radio.c | |
parent | c5340512dd5a75079779c896505a038caf3ce69a (diff) | |
download | mpv-37c5c114af8b4747dfa0664bf967958baa9a1c91.tar.bz2 mpv-37c5c114af8b4747dfa0664bf967958baa9a1c91.tar.xz |
Remove BSD legacy TV/radio support (BT848 stuff)
FreeBSD actually supports V4L2, and V4L2 supports this chip. Also,
this chip is from 1997. Farewell.
Diffstat (limited to 'stream/stream_radio.c')
-rw-r--r-- | stream/stream_radio.c | 136 |
1 files changed, 0 insertions, 136 deletions
diff --git a/stream/stream_radio.c b/stream/stream_radio.c index c126aba170..eea5fdca04 100644 --- a/stream/stream_radio.c +++ b/stream/stream_radio.c @@ -35,23 +35,8 @@ #include <errno.h> #include <unistd.h> -#ifdef CONFIG_RADIO_BSDBT848 -#include <sys/param.h> -#ifdef IOCTL_BT848_H_NAME -#include IOCTL_BT848_H_NAME -#endif - -#else /* CONFIG_RADIO_BSDBT848 */ - #include <linux/types.h> -#ifdef CONFIG_RADIO_V4L2 -#include <linux/videodev2.h> -#endif - -#endif // !IOCTL_BT848_H_NAME - - #include "stream.h" #include "demux/demux.h" #include "core/m_struct.h" @@ -85,13 +70,7 @@ typedef struct radio_channels_s { /// default values for options radio_param_t stream_radio_defaults={ -#ifdef CONFIG_RADIO_BSDBT848 - "/dev/tuner0", //device - 87.50, //freq_min - 108.00, //freq_max -#else "/dev/radio0", //device; -#endif "default", //driver NULL, //channels 100, //volume @@ -404,118 +383,6 @@ static const radio_driver_t radio_driver_v4l2={ get_frequency_v4l2 }; #endif /* CONFIG_RADIO_V4L2 */ -#ifdef CONFIG_RADIO_BSDBT848 - -/***************************************************************** - * \brief get fraction value for using in set_frequency and get_frequency - * \return STREAM_OK if success, STREAM_ERROR otherwise - * - * For *BSD BT848 frac=100 - * - * Here is a coment from FreeBSD 5.2-RELEASE source code: - * - * * Tuner Notes: - * * Programming the tuner properly is quite complicated. - * * Here are some notes, based on a FM1246 data sheet for a PAL-I tuner. - * * The tuner (front end) covers 45.75 MHz - 855.25 MHz and an FM band of - * * 87.5 MHz to 108.0 MHz. - * - * Thus, frequency range is limited to 87.5-108.0, but you can change - * it, using freq_min and freq_max options -*/ -static int init_frac_bsdbt848(radio_priv_t* priv){ - priv->frac=100; - priv->rangelow=priv->radio_param->freq_min; - priv->rangehigh=priv->radio_param->freq_max; - return STREAM_OK; -} - -/***************************************************************** - * \brief tune card to given frequency - * \param frequency frequency in MHz - * \return STREAM_OK if success, STREAM_ERROR otherwise - */ -static int set_frequency_bsdbt848(radio_priv_t* priv,float frequency){ - unsigned int freq; - freq=frequency*priv->frac; - if(ioctl(priv->radio_fd,RADIO_SETFREQ,&freq)<0){ - mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl set frequency 0x%x (%.2f) failed: %s\n",freq, frequency, strerror(errno)); - return STREAM_ERROR; - } - return STREAM_OK; -} - -/***************************************************************** - * \brief get current tuned frequency from card - * \param frequency where to store frequency in MHz - * \return STREAM_OK if success, STREAM_ERROR otherwise - */ -static int get_frequency_bsdbt848(radio_priv_t* priv,float* frequency){ - unsigned int freq; - if (ioctl(priv->radio_fd, RADIO_GETFREQ, &freq) < 0) { - mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl get frequency failed: %s\n",strerror(errno)); - return STREAM_ERROR; - } - *frequency=((float)freq)/priv->frac; - return STREAM_OK; -} - -/***************************************************************** - * \brief set volume on radio card - * \param volume volume level (0..100) - * \return STREAM_OK if success, STREAM_ERROR otherwise - * - * *BSD BT848 does not have volume changing abilities, so - * we will just mute sound if volume=0 and unmute it otherwise. - */ -static void set_volume_bsdbt848(radio_priv_t* priv,int volume){ - int audio_flags; - - /*arg must be between 0 and 100*/ - if (volume > 100) volume = 100; - if (volume < 0) volume = 0; - - audio_flags = (volume==0?AUDIO_MUTE:AUDIO_UNMUTE); - if (ioctl(priv->radio_fd, BT848_SAUDIO, &audio_flags)<0){ - mp_tmsg(MSGT_RADIO,MSGL_WARN,"[radio] ioctl set mute failed: %s\n",strerror(errno)); - } -} - -/***************************************************************** - * \brief get current volume from radio card - * \param volume where to store volume level (0..100) - * \return previous STREAM_OK if success, STREAM_ERROR otherwise - * - * *BSD BT848 does not have volume changing abilities, so - * we will return 0 if sound is muted and 100 otherwise. - */ -static int get_volume_bsdbt848(radio_priv_t* priv,int* volume){ - int audio_flags; - - if (ioctl(priv->radio_fd, BT848_GAUDIO, &audio_flags)<0){ - mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl get volume failed: %s\n",strerror(errno)); - return STREAM_ERROR; - } - - if (audio_flags & AUDIO_MUTE) - *volume=0; - else - *volume=100; - - return STREAM_OK; -} - -/* bsdbt848 driver info structure */ -static const radio_driver_t radio_driver_bsdbt848={ - "bsdbt848", - _("[radio] Using *BSD BT848 radio interface.\n"), - init_frac_bsdbt848, - set_volume_bsdbt848, - get_volume_bsdbt848, - set_frequency_bsdbt848, - get_frequency_bsdbt848 -}; -#endif /* CONFIG_RADIO_BSDBT848 */ static inline int init_frac(radio_priv_t* priv){ return priv->driver->init_frac(priv); @@ -943,9 +810,6 @@ static int fill_buffer_s(struct stream *s, char *buffer, int max_len){ when no driver explicitly specified first available will be used */ static const radio_driver_t* radio_drivers[]={ -#ifdef CONFIG_RADIO_BSDBT848 - &radio_driver_bsdbt848, -#endif #ifdef CONFIG_RADIO_V4L2 &radio_driver_v4l2, #endif |