]> git.sesse.net Git - vlc/blob - modules/access/dshow/common.h
6a3f2b5ea22a3c1fb09f567f767a658782e88026
[vlc] / modules / access / dshow / common.h
1 /*****************************************************************************
2  * common.h : DirectShow access module for vlc
3  *****************************************************************************
4  * Copyright (C) 2002 the VideoLAN team
5  * $Id$
6  *
7  * Author: Gildas Bazin <gbazin@videolan.org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <string>
28 #include <list>
29 #include <deque>
30 using namespace std;
31
32 #ifndef _MSC_VER
33 #   include <wtypes.h>
34 #   include <unknwn.h>
35 #   include <ole2.h>
36 #   include <limits.h>
37 #   ifdef _WINGDI_
38 #      undef _WINGDI_
39 #   endif
40 #   define _WINGDI_ 1
41 #   define AM_NOVTABLE
42 #   define _OBJBASE_H_
43 #   undef _X86_
44 #   ifndef _I64_MAX
45 #     define _I64_MAX LONG_LONG_MAX
46 #   endif
47 #   define LONGLONG long long
48 #endif
49
50 #include <dshow.h>
51
52 typedef struct dshow_stream_t dshow_stream_t;
53
54 /****************************************************************************
55  * Crossbar stuff
56  ****************************************************************************/
57 #define MAX_CROSSBAR_DEPTH 10
58
59 typedef struct CrossbarRouteRec
60 {
61     IAMCrossbar *pXbar;
62     LONG        VideoInputIndex;
63     LONG        VideoOutputIndex;
64     LONG        AudioInputIndex;
65     LONG        AudioOutputIndex;
66
67 } CrossbarRoute;
68
69 void DeleteCrossbarRoutes( access_sys_t * );
70 HRESULT FindCrossbarRoutes( vlc_object_t *, access_sys_t *,
71                             IPin *, LONG, int = 0 );
72
73 /****************************************************************************
74  * Access descriptor declaration
75  ****************************************************************************/
76 struct access_sys_t
77 {
78     /* These 2 must be left at the beginning */
79     vlc_mutex_t lock;
80     vlc_cond_t  wait;
81
82     IFilterGraph           *p_graph;
83     ICaptureGraphBuilder2  *p_capture_graph_builder2;
84     IMediaControl          *p_control;
85
86     int                     i_crossbar_route_depth;
87     CrossbarRoute           crossbar_routes[MAX_CROSSBAR_DEPTH];
88
89     /* list of elementary streams */
90     dshow_stream_t **pp_streams;
91     int            i_streams;
92     int            i_current_stream;
93
94     /* misc properties */
95     int            i_width;
96     int            i_height;
97     int            i_chroma;
98     bool           b_chroma; /* Force a specific chroma on the dshow input */
99 };