2 * Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef __GST_DSHOWVIDEOSRC_H__
23 #define __GST_DSHOWVIDEOSRC_H__
27 #include <gst/base/gstpushsrc.h>
30 #include "gstdshowfakesink.h"
32 // 30323449-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_I420
33 DEFINE_GUID (MEDIASUBTYPE_I420, 0x30323449, 0x0000, 0x0010, 0x80, 0x00, 0x00,
34 0xAA, 0x00, 0x38, 0x9B, 0x71);
35 DEFINE_GUID (MEDIASUBTYPE_UYVY, 0x59565955, 0x0000, 0x0010, 0x80, 0x00, 0x00,
36 0xAA, 0x00, 0x38, 0x9B, 0x71);
39 #define GST_TYPE_DSHOWVIDEOSRC (gst_dshowvideosrc_get_type())
40 #define GST_DSHOWVIDEOSRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DSHOWVIDEOSRC,GstDshowVideoSrc))
41 #define GST_DSHOWVIDEOSRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DSHOWVIDEOSRC,GstDshowVideoSrcClass))
42 #define GST_IS_DSHOWVIDEOSRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DSHOWVIDEOSRC))
43 #define GST_IS_DSHOWVIDEOSRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DSHOWVIDEOSRC))
44 typedef struct _GstDshowVideoSrc GstDshowVideoSrc;
45 typedef struct _GstDshowVideoSrcClass GstDshowVideoSrcClass;
48 struct _GstDshowVideoSrc
52 /* device dshow reference (generally classid/name) */
55 /* device friendly name */
61 /* list of caps created from the list of supported media types of the dshow capture filter */
64 /* list of dshow media types from the filter's capture pins */
65 GList *pins_mediatypes;
67 /* dshow video capture filter */
68 IBaseFilter *video_cap_filter;
70 /* dshow sink filter */
71 CDshowFakeSink *dshow_fakesink;
73 /* graph manager interfaces */
74 IMediaFilter *media_filter;
75 IFilterGraph *filter_graph;
77 IGraphBuilder *graph_builder;
78 ICaptureGraphBuilder2 *capture_builder;
79 IAMVideoCompression *pVC;
80 //IAMVfwCaptureDialogs *pDlg;
81 //IAMStreamConfig *pASC; // for audio cap
82 IAMStreamConfig *pVSC; // for video cap
84 /* the last buffer from DirectShow */
88 gboolean stop_requested;
96 struct _GstDshowVideoSrcClass
98 GstPushSrcClass parent_class;
101 GType gst_dshowvideosrc_get_type (void);
104 GstCaps * gst_dshowvideosrc_getcaps_from_capture_filter (IBaseFilter * filter,
105 GList ** pins_mediatypes);
109 #endif /* __GST_DSHOWVIDEOSRC_H__ */