annotate libmpdemux/tv.h @ 7058:2e5c07262861

new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>: - multithreaded audio/video buffering (I know mplayer crew hates threads but it seems to me as the only way of doing reliable a/v capture) - a/v timebase synchronization (sample count vs. gettimeofday) - "immediate" mode support for mplayer - fixed colorspace stuff - RGB?? and YUY2 modes now work as expected - native ALSA audio capture - separated audio input layer
author arpi
date Wed, 21 Aug 2002 21:31:20 +0000
parents 8cd761968f35
children a193df8b275b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2941
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
1 #ifndef TV_H
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
2 #define TV_H
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
3
2819
2e58962dc9fe cleaned up some warnings, and tv_param_on moved out from #ifdef USE_TV
alex
parents: 2818
diff changeset
4 extern int tv_param_on;
2e58962dc9fe cleaned up some warnings, and tv_param_on moved out from #ifdef USE_TV
alex
parents: 2818
diff changeset
5
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
6 #ifdef USE_TV
2830
596a6ba3520f never include files from public headers...
arpi
parents: 2819
diff changeset
7 //#include "../libao2/afmt.h"
596a6ba3520f never include files from public headers...
arpi
parents: 2819
diff changeset
8 //#include "../libvo/img_format.h"
596a6ba3520f never include files from public headers...
arpi
parents: 2819
diff changeset
9 //#include "../libvo/fastmemcpy.h"
596a6ba3520f never include files from public headers...
arpi
parents: 2819
diff changeset
10 //#include "mp_msg.h"
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
11
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
12 extern char *tv_param_freq;
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
13 extern char *tv_param_channel;
2941
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
14 extern char *tv_param_chanlist;
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
15 extern char *tv_param_norm;
98769cea155c added tv subsystem
alex
parents:
diff changeset
16 extern char *tv_param_device;
98769cea155c added tv subsystem
alex
parents:
diff changeset
17 extern char *tv_param_driver;
98769cea155c added tv subsystem
alex
parents:
diff changeset
18 extern int tv_param_width;
98769cea155c added tv subsystem
alex
parents:
diff changeset
19 extern int tv_param_height;
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
20 extern int tv_param_input;
2817
cc93d9786954 added support for -tv outfmt
alex
parents: 2802
diff changeset
21 extern char *tv_param_outfmt;
3285
bd7bff4cb453 add tv fps support
alex
parents: 2941
diff changeset
22 extern float tv_param_fps;
5098
b884521bf7f9 0.1l ;)
alex
parents: 3815
diff changeset
23 extern int tv_param_noaudio;
5572
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 5098
diff changeset
24 extern int tv_param_immediate;
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 5098
diff changeset
25 extern int tv_param_audiorate;
7058
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
26 #ifdef HAVE_TV_V4L
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
27 extern int tv_param_mono;
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
28 extern int tv_param_audio_id;
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
29 #ifdef HAVE_ALSA9
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
30 extern int tv_param_alsa;
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
31 #endif
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
32 extern char* tv_param_adevice;
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
33 #endif
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
34
98769cea155c added tv subsystem
alex
parents:
diff changeset
35 typedef struct tvi_info_s
98769cea155c added tv subsystem
alex
parents:
diff changeset
36 {
98769cea155c added tv subsystem
alex
parents:
diff changeset
37 const char *name;
98769cea155c added tv subsystem
alex
parents:
diff changeset
38 const char *short_name;
98769cea155c added tv subsystem
alex
parents:
diff changeset
39 const char *author;
98769cea155c added tv subsystem
alex
parents:
diff changeset
40 const char *comment;
98769cea155c added tv subsystem
alex
parents:
diff changeset
41 } tvi_info_t;
98769cea155c added tv subsystem
alex
parents:
diff changeset
42
98769cea155c added tv subsystem
alex
parents:
diff changeset
43 typedef struct tvi_functions_s
98769cea155c added tv subsystem
alex
parents:
diff changeset
44 {
98769cea155c added tv subsystem
alex
parents:
diff changeset
45 int (*init)();
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
46 int (*uninit)();
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
47 int (*control)();
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
48 int (*start)();
5572
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 5098
diff changeset
49 double (*grab_video_frame)();
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 5098
diff changeset
50 #ifdef HAVE_TV_BSDBT848
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 5098
diff changeset
51 double (*grabimmediate_video_frame)();
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 5098
diff changeset
52 #endif
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
53 int (*get_video_framesize)();
5572
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 5098
diff changeset
54 double (*grab_audio_frame)();
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
55 int (*get_audio_framesize)();
98769cea155c added tv subsystem
alex
parents:
diff changeset
56 } tvi_functions_t;
98769cea155c added tv subsystem
alex
parents:
diff changeset
57
98769cea155c added tv subsystem
alex
parents:
diff changeset
58 typedef struct tvi_handle_s {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
59 tvi_info_t *info;
09d5c9834580 tv update
alex
parents: 2790
diff changeset
60 tvi_functions_t *functions;
09d5c9834580 tv update
alex
parents: 2790
diff changeset
61 void *priv;
09d5c9834580 tv update
alex
parents: 2790
diff changeset
62 int seq;
2941
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
63
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
64 /* specific */
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
65 int norm;
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
66 int chanlist;
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
67 struct CHANLIST *chanlist_s;
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
68 int channel;
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
69 } tvi_handle_t;
98769cea155c added tv subsystem
alex
parents:
diff changeset
70
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
71
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
72 #define TVI_CONTROL_FALSE 0
98769cea155c added tv subsystem
alex
parents:
diff changeset
73 #define TVI_CONTROL_TRUE 1
98769cea155c added tv subsystem
alex
parents:
diff changeset
74 #define TVI_CONTROL_NA -1
98769cea155c added tv subsystem
alex
parents:
diff changeset
75 #define TVI_CONTROL_UNKNOWN -2
98769cea155c added tv subsystem
alex
parents:
diff changeset
76
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
77 /* ======================== CONTROLS =========================== */
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
78
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
79 /* GENERIC controls */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
80 #define TVI_CONTROL_IS_AUDIO 0x1
09d5c9834580 tv update
alex
parents: 2790
diff changeset
81 #define TVI_CONTROL_IS_VIDEO 0x2
09d5c9834580 tv update
alex
parents: 2790
diff changeset
82 #define TVI_CONTROL_IS_TUNER 0x3
7058
2e5c07262861 new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents: 5572
diff changeset
83 #define TVI_CONTROL_IMMEDIATE 0x4
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
84
09d5c9834580 tv update
alex
parents: 2790
diff changeset
85 /* VIDEO controls */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
86 #define TVI_CONTROL_VID_GET_FPS 0x101
09d5c9834580 tv update
alex
parents: 2790
diff changeset
87 #define TVI_CONTROL_VID_GET_PLANES 0x102
09d5c9834580 tv update
alex
parents: 2790
diff changeset
88 #define TVI_CONTROL_VID_GET_BITS 0x103
09d5c9834580 tv update
alex
parents: 2790
diff changeset
89 #define TVI_CONTROL_VID_CHK_BITS 0x104
09d5c9834580 tv update
alex
parents: 2790
diff changeset
90 #define TVI_CONTROL_VID_SET_BITS 0x105
09d5c9834580 tv update
alex
parents: 2790
diff changeset
91 #define TVI_CONTROL_VID_GET_FORMAT 0x106
09d5c9834580 tv update
alex
parents: 2790
diff changeset
92 #define TVI_CONTROL_VID_CHK_FORMAT 0x107
09d5c9834580 tv update
alex
parents: 2790
diff changeset
93 #define TVI_CONTROL_VID_SET_FORMAT 0x108
09d5c9834580 tv update
alex
parents: 2790
diff changeset
94 #define TVI_CONTROL_VID_GET_WIDTH 0x109
09d5c9834580 tv update
alex
parents: 2790
diff changeset
95 #define TVI_CONTROL_VID_CHK_WIDTH 0x110
09d5c9834580 tv update
alex
parents: 2790
diff changeset
96 #define TVI_CONTROL_VID_SET_WIDTH 0x111
09d5c9834580 tv update
alex
parents: 2790
diff changeset
97 #define TVI_CONTROL_VID_GET_HEIGHT 0x112
09d5c9834580 tv update
alex
parents: 2790
diff changeset
98 #define TVI_CONTROL_VID_CHK_HEIGHT 0x113
09d5c9834580 tv update
alex
parents: 2790
diff changeset
99 #define TVI_CONTROL_VID_SET_HEIGHT 0x114
2937
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
100 #define TVI_CONTROL_VID_GET_BRIGHTNESS 0x115
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
101 #define TVI_CONTROL_VID_SET_BRIGHTNESS 0x116
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
102 #define TVI_CONTROL_VID_GET_HUE 0x117
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
103 #define TVI_CONTROL_VID_SET_HUE 0x118
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
104 #define TVI_CONTROL_VID_GET_SATURATION 0x119
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
105 #define TVI_CONTROL_VID_SET_SATURATION 0x11a
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
106 #define TVI_CONTROL_VID_GET_CONTRAST 0x11b
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
107 #define TVI_CONTROL_VID_SET_CONTRAST 0x11c
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
108 #define TVI_CONTROL_VID_GET_PICTURE 0x11d
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
109 #define TVI_CONTROL_VID_SET_PICTURE 0x11e
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
110
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
111 /* TUNER controls */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
112 #define TVI_CONTROL_TUN_GET_FREQ 0x201
09d5c9834580 tv update
alex
parents: 2790
diff changeset
113 #define TVI_CONTROL_TUN_SET_FREQ 0x202
09d5c9834580 tv update
alex
parents: 2790
diff changeset
114 #define TVI_CONTROL_TUN_GET_TUNER 0x203 /* update priv->tuner struct for used input */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
115 #define TVI_CONTROL_TUN_SET_TUNER 0x204 /* update priv->tuner struct for used input */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
116 #define TVI_CONTROL_TUN_GET_NORM 0x205
09d5c9834580 tv update
alex
parents: 2790
diff changeset
117 #define TVI_CONTROL_TUN_SET_NORM 0x206
09d5c9834580 tv update
alex
parents: 2790
diff changeset
118
09d5c9834580 tv update
alex
parents: 2790
diff changeset
119 /* AUDIO controls */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
120 #define TVI_CONTROL_AUD_GET_FORMAT 0x301
09d5c9834580 tv update
alex
parents: 2790
diff changeset
121 #define TVI_CONTROL_AUD_GET_SAMPLERATE 0x302
09d5c9834580 tv update
alex
parents: 2790
diff changeset
122 #define TVI_CONTROL_AUD_GET_SAMPLESIZE 0x303
09d5c9834580 tv update
alex
parents: 2790
diff changeset
123 #define TVI_CONTROL_AUD_GET_CHANNELS 0x304
5572
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 5098
diff changeset
124 #define TVI_CONTROL_AUD_SET_SAMPLERATE 0x305
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
125
09d5c9834580 tv update
alex
parents: 2790
diff changeset
126 /* SPECIFIC controls */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
127 #define TVI_CONTROL_SPC_GET_INPUT 0x401 /* set input channel (tv,s-video,composite..) */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
128 #define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
129
09d5c9834580 tv update
alex
parents: 2790
diff changeset
130 extern tvi_handle_t *tv_begin(void);
09d5c9834580 tv update
alex
parents: 2790
diff changeset
131 extern int tv_init(tvi_handle_t *tvh);
2931
bce9c945b29c tv interface update
alex
parents: 2837
diff changeset
132 extern int tv_uninit(tvi_handle_t *tvh);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
133
2941
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
134 int tv_set_color_options(tvi_handle_t *tvh, int opt, int val);
2937
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
135 #define TV_COLOR_BRIGHTNESS 1
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
136 #define TV_COLOR_HUE 2
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
137 #define TV_COLOR_SATURATION 3
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
138 #define TV_COLOR_CONTRAST 4
4307478ad922 added support for setting color values
alex
parents: 2931
diff changeset
139
2941
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
140 int tv_step_channel(tvi_handle_t *tvh, int direction);
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
141 #define TV_CHANNEL_LOWER 1
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
142 #define TV_CHANNEL_HIGHER 2
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
143
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
144 int tv_step_norm(tvi_handle_t *tvh);
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
145 int tv_step_chanlist(tvi_handle_t *tvh);
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
146
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
147 #define TV_NORM_PAL 1
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
148 #define TV_NORM_NTSC 2
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
149 #define TV_NORM_SECAM 3
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
150
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
151 #endif /* USE_TV */
2941
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
152
60c1b7c0ea21 added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents: 2937
diff changeset
153 #endif /* TV_H */