Comment out the correct #endif directive.
[mplayer/greg.git] / stream / stream_tv.c
blob560bb350617a71645f1061490de6146748f116ff
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 -1, //normid
40 NULL, //device
41 NULL, //driver
42 -1, //width
43 -1, //height
44 0, //input, used in v4l and bttv
45 -1, //outfmt
46 -1.0, //fps
47 NULL, //channels
48 0, //noaudio;
49 0, //immediate;
50 44100, //audiorate;
51 0, //audio_id
52 -1, //amode
53 -1, //volume
54 -1, //bass
55 -1, //treble
56 -1, //balance
57 -1, //forcechan
58 0, //force_audio
59 -1, //buffer_size
60 0, //mjpeg
61 2, //decimation
62 90, //quality
63 0, //alsa
64 NULL, //adevice
65 0, //brightness
66 0, //contrast
67 0, //hue
68 0, //saturation
69 -1, //gain
70 NULL, //tdevice
71 0, //tformat
72 100, //tpage
73 0, //tlang
74 0, //scan_autostart
75 50, //scan_threshold
76 0.5, //scan_period
77 0, //hidden_video_renderer;
78 0, //hidden_vp_renderer;
79 0, //system_clock;
80 0 //normalize_audio_chunks;
83 #define ST_OFF(f) M_ST_OFF(tv_param_t,f)
84 static const m_option_t stream_opts_fields[] = {
85 {"hostname", ST_OFF(channel), CONF_TYPE_STRING, 0, 0 ,0, NULL},
86 {"filename", ST_OFF(input), CONF_TYPE_INT, 0, 0 ,0, NULL},
87 { NULL, NULL, 0, 0, 0, 0, NULL }
90 static struct m_struct_st stream_opts = {
91 "tv",
92 sizeof(tv_param_t),
93 &stream_tv_defaults,
94 stream_opts_fields
97 static void
98 tv_stream_close (stream_t *stream)
100 if(stream->priv)
101 m_struct_free(&stream_opts,stream->priv);
102 stream->priv=NULL;
104 static int
105 tv_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
108 stream->type = STREAMTYPE_TV;
109 stream->priv = opts;
110 stream->close=tv_stream_close;
111 *file_format = DEMUXER_TYPE_TV;
113 return STREAM_OK;
116 const stream_info_t stream_info_tv = {
117 "TV Input",
118 "tv",
119 "Benjamin Zores, Albeu",
121 tv_stream_open,
122 { "tv", NULL },
123 &stream_opts,