diff options
author | voroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-06-28 18:36:05 +0000 |
---|---|---|
committer | voroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-06-28 18:36:05 +0000 |
commit | 6aea0fb430d9f1a6b96a1995fce1dc2af4077b19 (patch) | |
tree | 3bb748a5cd5930d670ab2df4f2510a6a1643bca3 /stream | |
parent | ad164e04ee0330426917f00275fccc2203aff653 (diff) |
Implemented tv://[<channel>][/<input_id>] url syntax
to allow users start watching from S-Video or Composite
input without touching '-tv input=' option.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23687 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_tv.c | 37 | ||||
-rw-r--r-- | stream/tvi_vbi.c | 0 |
2 files changed, 34 insertions, 3 deletions
diff --git a/stream/stream_tv.c b/stream/stream_tv.c index de1c48f72f..2bcde2b80d 100644 --- a/stream/stream_tv.c +++ b/stream/stream_tv.c @@ -24,17 +24,48 @@ #include "stream.h" #include "libmpdemux/demuxer.h" +#include "m_option.h" +#include "m_struct.h" + +#include <stdio.h> + +static struct stream_priv_s { + /* if channels parameter exist here will be channel number otherwise - frequency */ + int input; + char* channel; +} stream_priv_dflts = { + 0, + NULL +}; + +#define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f) +static m_option_t stream_opts_fields[] = { + {"hostname", ST_OFF(channel), CONF_TYPE_STRING, 0, 0 ,0, NULL}, + {"filename", ST_OFF(input), CONF_TYPE_INT, 0, 0 ,0, NULL}, + { NULL, NULL, 0, 0, 0, 0, NULL } +}; + +static struct m_struct_st stream_opts = { + "tv", + sizeof(struct stream_priv_s), + &stream_priv_dflts, + stream_opts_fields +}; static int tv_stream_open (stream_t *stream, int mode, void *opts, int *file_format) { extern char* tv_param_channel; + extern int tv_param_input; + struct stream_priv_s* p=(struct stream_priv_s*)opts; stream->type = STREAMTYPE_TV; *file_format = DEMUXER_TYPE_TV; - if (strlen (stream->url) > 5 && stream->url[5] != '\0') - tv_param_channel = strdup (stream->url + 5); + tv_param_input=p->input; + if (p->channel) + tv_param_channel=strdup (p->channel); +fprintf(stderr,"%p\n",p->channel) ; return STREAM_OK; } @@ -45,6 +76,6 @@ stream_info_t stream_info_tv = { "", tv_stream_open, { "tv", NULL }, - NULL, + &stream_opts, 1 }; diff --git a/stream/tvi_vbi.c b/stream/tvi_vbi.c new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/stream/tvi_vbi.c |