diff options
author | 2003-04-10 10:59:12 +0000 | |
---|---|---|
committer | 2003-04-10 10:59:12 +0000 | |
commit | 66ec24b3e7e63f9b705ea7e49d19469e68dcd1a3 (patch) | |
tree | 6a47cf36aa152c7d03dafe58a0bc455ce6dc60fe | |
parent | e19c6d1784d4d7af9d9a1a875fdd13d25cbf1e58 (diff) |
Add a null streamv Currently used for tv and mf. Could be used to
implement /dev/zero on system how don't have it.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9902 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/Makefile | 2 | ||||
-rw-r--r-- | libmpdemux/open.c | 42 | ||||
-rw-r--r-- | libmpdemux/stream.c | 2 | ||||
-rw-r--r-- | libmpdemux/stream_null.c | 45 |
4 files changed, 48 insertions, 43 deletions
diff --git a/libmpdemux/Makefile b/libmpdemux/Makefile index 21cd4443da..fa71e52bbe 100644 --- a/libmpdemux/Makefile +++ b/libmpdemux/Makefile @@ -3,7 +3,7 @@ LIBNAME = libmpdemux.a include ../config.mak -SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c muxer.c muxer_avi.c muxer_mpeg.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c stream_file.c stream_netstream.c stream_vcd.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c demux_rawvideo.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c cue_read.c extension.c demux_gif.c demux_ts.c +SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c muxer.c muxer_avi.c muxer_mpeg.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c stream_file.c stream_netstream.c stream_vcd.c stream_null.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c demux_rawvideo.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c cue_read.c extension.c demux_gif.c demux_ts.c ifeq ($(XMMS_PLUGINS),yes) SRCS += demux_xmms.c endif diff --git a/libmpdemux/open.c b/libmpdemux/open.c index 38b208d70f..63c80fc999 100644 --- a/libmpdemux/open.c +++ b/libmpdemux/open.c @@ -69,28 +69,14 @@ char * dvd_audio_stream_channels[6] = { "unknown", "stereo", "unknown", "unknown", "unknown", "5.1" }; #endif -extern int vcd_get_track_end(int fd,int track); - #include "cue_read.h" -#ifdef USE_TV -#include "tv.h" -extern char* tv_param_channel; -#endif - #ifdef HAS_DVBIN_SUPPORT #include "dvbin.h" #endif -#ifdef HAVE_CDDA -stream_t* open_cdda(char* dev,char* track); -#ifdef STREAMING -stream_t* cddb_open(char* dev,char* track); -#endif -#endif - // Define function about auth the libsmbclient library // FIXME: I really do not not is this function is properly working @@ -135,9 +121,6 @@ stream_t* open_stream(char* filename,char** options, int* file_format){ stream_t* stream=NULL; int f=-1; off_t len; -#ifdef __FreeBSD__ -int bsize = VCD_SECTOR_SIZE; -#endif *file_format = DEMUXER_TYPE_UNKNOWN; if(!filename) { mp_msg(MSGT_OPEN,MSGL_ERR,"NULL filename, report this bug\n"); @@ -483,31 +466,6 @@ if(strncmp("dvbin://",filename,8) == 0) } #endif - - - -//============ Check for TV-input or multi-file input ==== - if( (strncmp("mf://",filename,5) == 0) -#ifdef USE_TV - || (strncmp("tv://",filename,5) == 0) -#endif - ){ - /* create stream */ - stream = new_stream(-1, STREAMTYPE_DUMMY); - if (!stream) return(NULL); - if(strncmp("mf://",filename,5) == 0) { - *file_format = DEMUXER_TYPE_MF; -#ifdef USE_TV - } else { - *file_format = DEMUXER_TYPE_TV; - if(filename[5] != '\0') - tv_param_channel = strdup(filename + 5); -#endif - } - stream->url= filename[5] != '\0' ? strdup(filename + 5) : NULL; - return(stream); - } - #ifdef STREAMING #ifdef STREAMING_LIVE_DOT_COM // Check for a SDP file: diff --git a/libmpdemux/stream.c b/libmpdemux/stream.c index ad878d334c..85cfc6da77 100644 --- a/libmpdemux/stream.c +++ b/libmpdemux/stream.c @@ -50,6 +50,7 @@ extern stream_info_t stream_info_cdda; #ifdef STREAMING extern stream_info_t stream_info_netstream; #endif +extern stream_info_t stream_info_null; extern stream_info_t stream_info_file; stream_info_t* auto_open_streams[] = { @@ -62,6 +63,7 @@ stream_info_t* auto_open_streams[] = { #ifdef STREAMING &stream_info_netstream, #endif + &stream_info_null, &stream_info_file, NULL }; diff --git a/libmpdemux/stream_null.c b/libmpdemux/stream_null.c new file mode 100644 index 0000000000..a494c7810d --- /dev/null +++ b/libmpdemux/stream_null.c @@ -0,0 +1,45 @@ + +#include "config.h" + +#include <stdlib.h> +#include <string.h> + +#include "stream.h" +#include "demuxer.h" + +#ifdef USE_TV +extern char* tv_param_channel; +#endif + + +static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { + stream->type = STREAMTYPE_DUMMY; + + if(strncmp("mf://",stream->url,5) == 0) { + *file_format = DEMUXER_TYPE_MF; + } +#ifdef USE_TV + else if (strncmp("tv://",stream->url,5) == 0) { + *file_format = DEMUXER_TYPE_TV; + if(stream->url[5] != '\0') + tv_param_channel = strdup(stream->url + 5); + } +#endif + return 1; +} + + +stream_info_t stream_info_null = { + "Null stream", + "null", + "Albeu", + "", + open_s, + { +#ifdef USE_TV +"tv", +#endif +"mf", "null", NULL }, + NULL, + 0 // Urls are an option string +}; |