1 /*****************************************************************************
2 * common.h : DirectShow access module for vlc
3 *****************************************************************************
4 * Copyright (C) 2002 the VideoLAN team
7 * Author: Gildas Bazin <gbazin@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
45 # define _I64_MAX LONG_LONG_MAX
47 # define LONGLONG long long
52 typedef struct dshow_stream_t dshow_stream_t;
54 /****************************************************************************
56 ****************************************************************************/
57 #define MAX_CROSSBAR_DEPTH 10
59 typedef struct CrossbarRouteRec
63 LONG VideoOutputIndex;
65 LONG AudioOutputIndex;
69 void DeleteCrossbarRoutes( access_sys_t * );
70 HRESULT FindCrossbarRoutes( vlc_object_t *, access_sys_t *,
71 IPin *, LONG, int = 0 );
73 /****************************************************************************
74 * Access descriptor declaration
75 ****************************************************************************/
78 /* These 2 must be left at the beginning */
82 IFilterGraph *p_graph;
83 ICaptureGraphBuilder2 *p_capture_graph_builder2;
84 IMediaControl *p_control;
86 int i_crossbar_route_depth;
87 CrossbarRoute crossbar_routes[MAX_CROSSBAR_DEPTH];
89 /* list of elementary streams */
90 dshow_stream_t **pp_streams;
98 bool b_chroma; /* Force a specific chroma on the dshow input */
102 /****************************************************************************
103 * The following should be in ks.h and ksmedia.h, but since they are not in
104 * the current version of Mingw, we will be defined here.
105 ****************************************************************************/
107 /* http://msdn.microsoft.com/en-us/library/ff567297%28VS.85%29.aspx */
109 KS_AnalogVideo_None = 0x00000000,
110 KS_AnalogVideo_NTSC_M = 0x00000001,
111 KS_AnalogVideo_NTSC_M_J = 0x00000002,
112 KS_AnalogVideo_NTSC_433 = 0x00000004,
113 KS_AnalogVideo_PAL_B = 0x00000010,
114 KS_AnalogVideo_PAL_D = 0x00000020,
115 KS_AnalogVideo_PAL_G = 0x00000040,
116 KS_AnalogVideo_PAL_H = 0x00000080,
117 KS_AnalogVideo_PAL_I = 0x00000100,
118 KS_AnalogVideo_PAL_M = 0x00000200,
119 KS_AnalogVideo_PAL_N = 0x00000400,
120 KS_AnalogVideo_PAL_60 = 0x00000800,
121 KS_AnalogVideo_SECAM_B = 0x00001000,
122 KS_AnalogVideo_SECAM_D = 0x00002000,
123 KS_AnalogVideo_SECAM_G = 0x00004000,
124 KS_AnalogVideo_SECAM_H = 0x00008000,
125 KS_AnalogVideo_SECAM_K = 0x00010000,
126 KS_AnalogVideo_SECAM_K1 = 0x00020000,
127 KS_AnalogVideo_SECAM_L = 0x00040000,
128 KS_AnalogVideo_SECAM_L1 = 0x00080000,
129 KS_AnalogVideo_PAL_N_COMBO = 0x00100000
130 } KS_AnalogVideoStandard;
132 /* http://msdn.microsoft.com/en-us/library/ff567800%28VS.85%29.aspx and following */
134 KSPROPERTY_TUNER_CAPS, // R -overall device capabilities
135 KSPROPERTY_TUNER_MODE_CAPS, // R -capabilities in this mode
136 KSPROPERTY_TUNER_MODE, // RW -set a mode (TV, FM, AM, DSS)
137 KSPROPERTY_TUNER_STANDARD, // R -get TV standard (only if TV mode)
138 KSPROPERTY_TUNER_FREQUENCY, // RW -set/get frequency
139 KSPROPERTY_TUNER_INPUT, // RW -select an input
140 KSPROPERTY_TUNER_STATUS, // R -tuning status
143 KSPROPERTY_TUNER_IF_MEDIUM, // R O-Medium for IF or Transport Pin
145 /* Mandatory for Vista and + */
146 KSPROPERTY_TUNER_SCAN_CAPS, // R -overall device capabilities for scanning
149 KSPROPERTY_TUNER_SCAN_STATUS, // R -status of scan
150 KSPROPERTY_TUNER_STANDARD_MODE, // RW -autodetect mode for signal standard
151 KSPROPERTY_TUNER_NETWORKTYPE_SCAN_CAPS // R -network type specific tuner capabilities
154 /* http://msdn.microsoft.com/en-us/library/ff567689%28v=VS.85%29.aspx */
156 KS_TUNER_TUNING_EXACT = 1, // Tunes directly to the right freq
157 KS_TUNER_TUNING_FINE, // Comprehensive search to the right freq
158 KS_TUNER_TUNING_COARSE, // Fast search
159 }KS_TUNER_TUNING_FLAGS;
161 /* http://msdn.microsoft.com/en-us/library/ff567687%28v=VS.85%29.aspx */
163 KS_TUNER_STRATEGY_PLL = 0X01, // Phase locked loop (PLL) offset tuning
164 KS_TUNER_STRATEGY_SIGNAL_STRENGTH = 0X02, // Signal strength tuning
165 KS_TUNER_STRATEGY_DRIVER_TUNES = 0X04, // Driver tunes
168 /* http://msdn.microsoft.com/en-us/library/ff562676%28VS.85%29.aspx */
178 } KSIDENTIFIER, *PKSIDENTIFIER;
180 typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY;
182 /* http://msdn.microsoft.com/en-us/library/ff565872%28v=VS.85%29.aspx */
185 ULONG Mode; // KSPROPERTY_TUNER_MODE_*
186 ULONG StandardsSupported; // KS_AnalogVideo_* (if Mode is TV or DSS)
187 ULONG MinFrequency; // Hz
188 ULONG MaxFrequency; // Hz
189 ULONG TuningGranularity; // Hz
190 ULONG NumberOfInputs; // number of inputs
191 ULONG SettlingTime; // milliSeconds
192 ULONG Strategy; // KS_TUNER_STRATEGY
193 } KSPROPERTY_TUNER_MODE_CAPS_S, *PKSPROPERTY_TUNER_MODE_CAPS_S;
195 /* http://msdn.microsoft.com/en-us/library/ff565839%28v=VS.85%29.aspx */
198 ULONG Frequency; // Hz
199 ULONG LastFrequency; // Hz (last tuned)
200 ULONG TuningFlags; // KS_TUNER_TUNING_FLAGS
201 ULONG VideoSubChannel; // DSS
202 ULONG AudioSubChannel; // DSS
203 ULONG Channel; // VBI decoders
204 ULONG Country; // VBI decoders
205 } KSPROPERTY_TUNER_FREQUENCY_S, *PKSPROPERTY_TUNER_FREQUENCY_S;
207 /* http://msdn.microsoft.com/en-us/library/ff565918%28v=VS.85%29.aspx */
210 ULONG Standard; // KS_AnalogVideo_*
211 } KSPROPERTY_TUNER_STANDARD_S, *PKSPROPERTY_TUNER_STANDARD_S;