bbox[n] and spu->scaled_start_row are unsigned, comparison with 0 is pointless.
[mplayer/glamo.git] / stream / stream_tv.c
blob8332b0747774a0cfea45e5cb230905b98e497ae6
1 /*
2 * Copyright (C) 2006 Benjamin Zores
3 * Stream layer for TV Input, based on previous work from Albeu
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "config.h"
22 #include <stdlib.h>
23 #include <string.h>
25 #include "stream.h"
26 #include "libmpdemux/demuxer.h"
27 #include "m_option.h"
28 #include "m_struct.h"
29 #include "tv.h"
31 #include <stdio.h>
33 tv_param_t stream_tv_defaults = {
34 NULL, //freq
35 NULL, //channel
36 "europe-east", //chanlist
37 "pal", //norm
38 0, //automute
39 #ifdef HAVE_TV_V4L2
40 -1, //normid
41 #endif
42 NULL, //device
43 "dummy", //driver
44 -1, //width
45 -1, //height
46 0, //input, used in v4l and bttv
47 -1, //outfmt
48 -1.0, //fps
49 NULL, //channels
50 0, //noaudio;
51 0, //immediate;
52 44100, //audiorate;
53 0, //audio_id
54 #if defined(HAVE_TV_V4L)
55 -1, //amode
56 -1, //volume
57 -1, //bass
58 -1, //treble
59 -1, //balance
60 -1, //forcechan
61 0, //force_audio
62 -1, //buffer_size
63 0, //mjpeg
64 2, //decimation
65 90, //quality
66 #if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X)
67 0, //alsa
68 #endif
69 NULL, //adevice
70 #endif
71 0, //brightness
72 0, //contrast
73 0, //hue
74 0, //saturation
75 NULL, //tdevice
76 0, //tformat
77 100 //tpage
80 #define ST_OFF(f) M_ST_OFF(tv_param_t,f)
81 static m_option_t stream_opts_fields[] = {
82 {"hostname", ST_OFF(channel), CONF_TYPE_STRING, 0, 0 ,0, NULL},
83 {"filename", ST_OFF(input), CONF_TYPE_INT, 0, 0 ,0, NULL},
84 { NULL, NULL, 0, 0, 0, 0, NULL }
87 static struct m_struct_st stream_opts = {
88 "tv",
89 sizeof(tv_param_t),
90 &stream_tv_defaults,
91 stream_opts_fields
94 static void
95 tv_stream_close (stream_t *stream)
97 if(stream->priv)
98 m_struct_free(&stream_opts,stream->priv);
99 stream->priv=NULL;
101 static int
102 tv_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
105 stream->type = STREAMTYPE_TV;
106 stream->priv = opts;
107 stream->close=tv_stream_close;
108 *file_format = DEMUXER_TYPE_TV;
110 return STREAM_OK;
113 stream_info_t stream_info_tv = {
114 "TV Input",
115 "tv",
116 "Benjamin Zores, Albeu",
118 tv_stream_open,
119 { "tv", NULL },
120 &stream_opts,