]> git.sesse.net Git - vlc/blob - modules/access/dshow/common.h
1928792250f78ebd6ee4c829ffaacadb5e91c904
[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 #   define _WINGDI_ 1
38 #   define AM_NOVTABLE
39 #   define _OBJBASE_H_
40 #   undef _X86_
41 #   define _I64_MAX LONG_LONG_MAX
42 #   define LONGLONG long long
43 #endif
44
45 #include <dshow.h>
46
47 typedef struct dshow_stream_t dshow_stream_t;
48
49 /****************************************************************************
50  * Crossbar stuff
51  ****************************************************************************/
52 #define MAX_CROSSBAR_DEPTH 10
53
54 typedef struct CrossbarRouteRec
55 {
56     IAMCrossbar *pXbar;
57     LONG        VideoInputIndex;
58     LONG        VideoOutputIndex;
59     LONG        AudioInputIndex;
60     LONG        AudioOutputIndex;
61
62 } CrossbarRoute;
63
64 void DeleteCrossbarRoutes( access_sys_t * );
65 HRESULT FindCrossbarRoutes( vlc_object_t *, access_sys_t *,
66                             IPin *, LONG, int = 0 );
67
68 /****************************************************************************
69  * Access descriptor declaration
70  ****************************************************************************/
71 struct access_sys_t
72 {
73     /* These 2 must be left at the beginning */
74     vlc_mutex_t lock;
75     vlc_cond_t  wait;
76
77     IFilterGraph           *p_graph;
78     ICaptureGraphBuilder2  *p_capture_graph_builder2;
79     IMediaControl          *p_control;
80
81     int                     i_crossbar_route_depth;
82     CrossbarRoute           crossbar_routes[MAX_CROSSBAR_DEPTH];
83
84     /* list of elementary streams */
85     dshow_stream_t **pp_streams;
86     int            i_streams;
87     int            i_current_stream;
88
89     /* misc properties */
90     int            i_width;
91     int            i_height;
92     int            i_chroma;
93 };