access.h 2.84 KB
Newer Older
Gildas Bazin's avatar
Gildas Bazin committed
1
/*****************************************************************************
2 3
 * access.h : DirectShow access module for vlc
 * access_sys_t definition
Gildas Bazin's avatar
Gildas Bazin committed
4
 *****************************************************************************
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
5
 * Copyright (C) 2002, 2004, 2010-2011 VLC authors and VideoLAN
Gildas Bazin's avatar
Gildas Bazin committed
6 7 8 9
 * $Id$
 *
 * Author: Gildas Bazin <gbazin@videolan.org>
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
10 11 12
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
Gildas Bazin's avatar
Gildas Bazin committed
13 14 15 16
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
17 18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
Gildas Bazin's avatar
Gildas Bazin committed
19
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
20 21 22
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
Gildas Bazin's avatar
Gildas Bazin committed
23 24 25 26 27 28 29 30
 *****************************************************************************/

/*****************************************************************************
 * Preamble
 *****************************************************************************/

#include <dshow.h>

31 32
#include <vector>

33 34 35
#include <wrl/client.h>
using Microsoft::WRL::ComPtr;

36 37
typedef struct demux_sys_t demux_sys_t;

Gildas Bazin's avatar
Gildas Bazin committed
38 39 40 41 42
/****************************************************************************
 * Crossbar stuff
 ****************************************************************************/
#define MAX_CROSSBAR_DEPTH 10

Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
43
struct CrossbarRoute
Gildas Bazin's avatar
Gildas Bazin committed
44
{
45
    ComPtr<IAMCrossbar> pXbar;
Gildas Bazin's avatar
Gildas Bazin committed
46 47 48 49
    LONG        VideoInputIndex;
    LONG        VideoOutputIndex;
    LONG        AudioInputIndex;
    LONG        AudioOutputIndex;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
50
};
Gildas Bazin's avatar
Gildas Bazin committed
51

52 53
struct access_sys_t;

Gildas Bazin's avatar
Gildas Bazin committed
54 55 56 57 58 59 60 61 62 63 64 65 66
void DeleteCrossbarRoutes( access_sys_t * );
HRESULT FindCrossbarRoutes( vlc_object_t *, access_sys_t *,
                            IPin *, LONG, int = 0 );

/****************************************************************************
 * Access descriptor declaration
 ****************************************************************************/
struct access_sys_t
{
    /* These 2 must be left at the beginning */
    vlc_mutex_t lock;
    vlc_cond_t  wait;

67 68 69
    ComPtr<IFilterGraph>            p_graph;
    ComPtr<ICaptureGraphBuilder2>   p_capture_graph_builder2;
    ComPtr<IMediaControl>           p_control;
Gildas Bazin's avatar
Gildas Bazin committed
70 71 72 73 74

    int                     i_crossbar_route_depth;
    CrossbarRoute           crossbar_routes[MAX_CROSSBAR_DEPTH];

    /* list of elementary streams */
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
75
    std::vector<struct dshow_stream_t*> pp_streams;
Gildas Bazin's avatar
Gildas Bazin committed
76 77 78 79 80 81
    int            i_current_stream;

    /* misc properties */
    int            i_width;
    int            i_height;
    int            i_chroma;
82
    mtime_t        i_start;
Gildas Bazin's avatar
Gildas Bazin committed
83
};
84