directshow: Merge plugins into single directshow plugin

... and lower rank of dshowvideosink and dshowdeviceprovider
to GST_RANK_MARGINAL since we don't prefer this plugin
by default

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1744>
This commit is contained in:
Seungha Yang 2022-02-19 00:14:38 +09:00 committed by GStreamer Marge Bot
parent d94d338bd5
commit 7eedd52510
29 changed files with 108 additions and 356 deletions

View file

@ -1,79 +0,0 @@
/*
* GStreamer DirectShow codecs wrapper
* Copyright <2006, 2007, 2008> Fluendo <gstreamer@fluendo.com>
* Copyright <2006, 2007, 2008> Pioneers of the Inevitable <songbird@songbirdnest.com>
* Copyright <2007,2008> Sebastien Moutte <sebastien@moutte.net>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Alternatively, the contents of this file may be used under the
* GNU Lesser General Public License Version 2.1 (the "LGPL"), in
* which case the following provisions apply instead of the ones
* mentioned above:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstdshowaudiodec.h"
#include "gstdshowvideodec.h"
GST_DEBUG_CATEGORY (dshowdec_debug);
#define GST_CAT_DEFAULT dshowdec_debug
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!dshow_adec_register (plugin))
return FALSE;
if (!dshow_vdec_register (plugin))
return FALSE;
GST_DEBUG_CATEGORY_INIT (dshowdec_debug, "dshowdec", 0, \
"DirectShow decoder");
return TRUE;
}
extern "C" {
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
dshowdecwrapper,
"DirectShow decoder wrapper plugin",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
}

View file

@ -1,72 +0,0 @@
/*
* GStreamer DirectShow codecs wrapper
* Copyright <2006, 2007, 2008> Fluendo <gstreamer@fluendo.com>
* Copyright <2006, 2007, 2008> Pioneers of the Inevitable <songbird@songbirdnest.com>
* Copyright <2007,2008> Sebastien Moutte <sebastien@moutte.net>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Alternatively, the contents of this file may be used under the
* GNU Lesser General Public License Version 2.1 (the "LGPL"), in
* which case the following provisions apply instead of the ones
* mentioned above:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_DSHOW_H__
#define __GST_DSHOW_H__
#include <windows.h>
#include <objbase.h>
#include <dshow.h>
#include <Rpc.h>
#include <glib.h>
#pragma warning( disable : 4090 4024)
typedef struct _CodecEntry {
gchar *element_name;
gchar *element_longname;
gchar *preferred_filter_substring;
gint32 format;
GUID input_majortype;
GUID input_subtype;
gchar *sinkcaps;
GUID output_majortype;
GUID output_subtype;
gchar *srccaps;
} CodecEntry;
#define GUID_TYPE_ANY {0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}
#endif /* __GST_DSHOW_H__ */

View file

@ -1,49 +0,0 @@
dshowdecwrapper_sources = [
'gstdshowaudiodec.cpp',
'gstdshowdecwrapper.cpp',
'gstdshowfakesrc.cpp',
'gstdshowutil.cpp',
'gstdshowvideodec.cpp'
]
if not strmbase_dep.found()
message('strmbase not found, not building dshowdecwrapper')
subdir_done()
endif
winmm_dep = cxx.find_library('winmm', required: get_option('directshow'))
if not winmm_dep.found()
message('winmm not found, not building dshowdecwrapper')
subdir_done()
endif
dmoguids_dep = cxx.find_library('dmoguids', required: get_option('directshow'))
if not dmoguids_dep.found()
message('dmoguids not found, not building dshowdecwrapper')
subdir_done()
endif
wmcodecdspuuid_dep = cxx.find_library('wmcodecdspuuid', required: get_option('directshow'))
if not wmcodecdspuuid_dep.found()
message('wmcodecdspuuid not found, not building dshowdecwrapper')
subdir_done()
endif
gstdshowdecwrapper = library('gstdshowdecwrapper',
dshowdecwrapper_sources,
cpp_args : gst_plugins_bad_args,
include_directories : [configinc],
dependencies : [
gstaudio_dep,
gstvideo_dep,
strmbase_dep,
winmm_dep,
dmoguids_dep,
wmcodecdspuuid_dep
],
install : true,
install_dir : plugins_install_dir,
override_options : ['cpp_std=none'])
pkgconfig.generate(gstdshowdecwrapper, install_dir : plugins_pkgconfig_install_dir)
plugins += [gstdshowdecwrapper]

View file

@ -1,38 +0,0 @@
dshowsinkwrapper_sources = [
'dshowvideofakesrc.cpp',
'dshowvideosink.cpp'
]
if not strmbase_dep.found()
message('strmbase not found, not building dshowsinkwrapper')
subdir_done()
endif
winmm_dep = cxx.find_library('winmm', required: get_option('directshow'))
if not winmm_dep.found()
message('winmm not found, not building dshowsinkwrapper')
subdir_done()
endif
mfuuid_dep = cxx.find_library('mfuuid', required: get_option('directshow'))
if not mfuuid_dep.found()
message('mfuuid not found, not building dshowsinkwrapper')
subdir_done()
endif
gstdshowsinkwrapper = library('gstdshowsinkwrapper',
dshowsinkwrapper_sources,
cpp_args : gst_plugins_bad_args,
include_directories : [configinc],
dependencies : [
gstvideo_dep,
strmbase_dep,
winmm_dep,
mfuuid_dep
],
install : true,
install_dir : plugins_install_dir,
override_options : ['cpp_std=none'])
pkgconfig.generate(gstdshowsinkwrapper, install_dir : plugins_pkgconfig_install_dir)
plugins += [gstdshowsinkwrapper]

View file

@ -1,43 +0,0 @@
dshowsrcwrapper_sources = [
'dshowdeviceprovider.cpp',
'gstdshow.cpp',
'gstdshowfakesink.cpp',
'gstdshowaudiosrc.cpp',
'gstdshowvideosrc.cpp',
'gstdshowsrcwrapper.cpp'
]
if not strmbase_dep.found()
message('strmbase not found, not building dshowsrcwrapper')
subdir_done()
endif
winmm_dep = cxx.find_library('winmm', required: get_option('directshow'))
if not winmm_dep.found()
message('winmm not found, not building dshowsrcwrapper')
subdir_done()
endif
rpcrt4_dep = cxx.find_library('rpcrt4', required: get_option('directshow'))
if not rpcrt4_dep.found()
message('rpcrt4 not found, not building dshowsrcwrapper')
subdir_done()
endif
gstdshowsrcwrapper = library('gstdshowsrcwrapper',
dshowsrcwrapper_sources,
cpp_args : gst_plugins_bad_args,
include_directories : [configinc],
dependencies : [
gstaudio_dep,
gstvideo_dep,
strmbase_dep,
winmm_dep,
rpcrt4_dep
],
install : true,
install_dir : plugins_install_dir,
override_options : ['cpp_std=none'])
pkgconfig.generate(gstdshowsrcwrapper, install_dir : plugins_pkgconfig_install_dir)
plugins += [gstdshowsrcwrapper]

View file

@ -468,8 +468,8 @@ dump_all_pin_media_types (IBaseFilter *filter)
enumpins->Release();
}
gboolean
gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir, IPin **pin)
static gboolean
get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir, IPin **pin)
{
gboolean ret = FALSE;
IEnumPins *enumpins = NULL;
@ -813,7 +813,7 @@ gst_dshowvideosink_connect_graph (GstDshowVideoSink *sink)
srcpin = sink->fakesrc->GetOutputPin();
gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
&sinkpin);
if (!sinkpin) {
GST_WARNING_OBJECT (sink, "Cannot get input pin from Renderer");
@ -931,7 +931,7 @@ gst_dshowvideosink_stop_graph (GstDshowVideoSink *sink)
sink->filter_graph->Disconnect(sink->fakesrc->GetOutputPin());
gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
&sinkpin);
sink->filter_graph->Disconnect(sinkpin);
sinkpin->Release();
@ -1547,7 +1547,7 @@ gst_dshowvideosink_set_caps (GstBaseSink * bsink, GstCaps * caps)
if (sink->connected) {
IPin *sinkpin;
sink->filter_graph->Disconnect(sink->fakesrc->GetOutputPin());
gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
&sinkpin);
sink->filter_graph->Disconnect(sinkpin);
sinkpin->Release();
@ -1879,20 +1879,3 @@ gst_caps_to_directshow_media_type (GstDshowVideoSink * sink, GstCaps *caps,
return FALSE;
}
/* Plugin entry point */
extern "C" static gboolean
plugin_init (GstPlugin * plugin)
{
/* PRIMARY: this is the best videosink to use on windows */
if (!gst_element_register (plugin, "dshowvideosink",
GST_RANK_SECONDARY, GST_TYPE_DSHOWVIDEOSINK))
return FALSE;
return TRUE;
}
extern "C" GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
dshowsinkwrapper,
"DirectShow sink wrapper plugin",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)

View file

@ -888,13 +888,13 @@ gst_dshowaudiodec_setup_graph (GstDshowAudioDec * adec, GstCaps *caps)
srcfilter = adec->fakesrc;
/* connect our fake source to decoder */
output_pin = gst_dshow_get_pin_from_filter (srcfilter, PINDIR_OUTPUT);
output_pin = gst_dshow_util_get_pin_from_filter (srcfilter, PINDIR_OUTPUT);
if (!output_pin) {
GST_ELEMENT_ERROR (adec, CORE, NEGOTIATION,
("Can't get output pin from our directshow fakesrc filter"), (NULL));
goto end;
}
input_pin = gst_dshow_get_pin_from_filter (adec->decfilter, PINDIR_INPUT);
input_pin = gst_dshow_util_get_pin_from_filter (adec->decfilter, PINDIR_INPUT);
if (!input_pin) {
GST_ELEMENT_ERROR (adec, CORE, NEGOTIATION,
("Can't get input pin from decoder filter"), (NULL));
@ -932,7 +932,7 @@ gst_dshowaudiodec_setup_graph (GstDshowAudioDec * adec, GstCaps *caps)
}
/* connect the decoder to our fake sink */
output_pin = gst_dshow_get_pin_from_filter (adec->decfilter, PINDIR_OUTPUT);
output_pin = gst_dshow_util_get_pin_from_filter (adec->decfilter, PINDIR_OUTPUT);
if (!output_pin) {
GST_ELEMENT_ERROR (adec, CORE, NEGOTIATION,
("Can't get output pin from our decoder filter"), (NULL));
@ -940,7 +940,7 @@ gst_dshowaudiodec_setup_graph (GstDshowAudioDec * adec, GstCaps *caps)
}
sinkfilter = adec->fakesink;
input_pin = gst_dshow_get_pin_from_filter (sinkfilter, PINDIR_INPUT);
input_pin = gst_dshow_util_get_pin_from_filter (sinkfilter, PINDIR_INPUT);
if (!input_pin) {
GST_ELEMENT_ERROR (adec, CORE, NEGOTIATION,
("Can't get input pin from our directshow fakesink filter"), (NULL));
@ -986,7 +986,7 @@ gst_dshowaudiodec_get_filter_settings (GstDshowAudioDec * adec)
if (adec->decfilter == 0)
return FALSE;
output_pin = gst_dshow_get_pin_from_filter (adec->decfilter, PINDIR_OUTPUT);
output_pin = gst_dshow_util_get_pin_from_filter (adec->decfilter, PINDIR_OUTPUT);
if (!output_pin) {
GST_ELEMENT_ERROR (adec, CORE, NEGOTIATION,
("failed getting output pin from the decoder"), (NULL));
@ -1050,7 +1050,7 @@ gst_dshowaudiodec_create_graph_and_filters (GstDshowAudioDec * adec)
adec->fakesrc->AddRef();
/* create decoder filter */
adec->decfilter = gst_dshow_find_filter (MEDIATYPE_Audio,
adec->decfilter = gst_dshow_util_find_filter (MEDIATYPE_Audio,
insubtype,
MEDIATYPE_Audio,
outsubtype,
@ -1172,7 +1172,7 @@ dshow_adec_register (GstPlugin * plugin)
GUID insubtype = GUID_MEDIASUBTYPE_FROM_FOURCC (audio_dec_codecs[i].format);
GUID outsubtype = GUID_MEDIASUBTYPE_FROM_FOURCC (WAVE_FORMAT_PCM);
filter = gst_dshow_find_filter (MEDIATYPE_Audio,
filter = gst_dshow_util_find_filter (MEDIATYPE_Audio,
insubtype,
MEDIATYPE_Audio,
outsubtype,

View file

@ -28,7 +28,7 @@
_COM_SMARTPTR_TYPEDEF(IDMOWrapperFilter, __uuidof(IDMOWrapperFilter));
IPin *
gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir)
gst_dshow_util_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir)
{
IEnumPinsPtr enumpins;
IPinPtr pin;
@ -53,7 +53,7 @@ gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir)
}
IBaseFilter *
gst_dshow_find_filter(CLSID input_majortype, CLSID input_subtype,
gst_dshow_util_find_filter(CLSID input_majortype, CLSID input_subtype,
CLSID output_majortype, CLSID output_subtype,
PreferredFilter *preferred_filters)
{

View file

@ -51,11 +51,11 @@ typedef struct {
} PreferredFilter;
/* get a pin from directshow filter */
IPin *gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir);
IPin *gst_dshow_util_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir);
/* find and return a filter according to the input and output types */
IBaseFilter *
gst_dshow_find_filter(CLSID input_majortype, CLSID input_subtype,
gst_dshow_util_find_filter(CLSID input_majortype, CLSID input_subtype,
CLSID output_majortype, CLSID output_subtype,
PreferredFilter *preferred_filters);

View file

@ -705,13 +705,13 @@ gst_dshowvideodec_sink_setcaps (GstPad * pad, GstCaps * caps)
goto end;
}
output_pin = gst_dshow_get_pin_from_filter (srcfilter, PINDIR_OUTPUT);
output_pin = gst_dshow_util_get_pin_from_filter (srcfilter, PINDIR_OUTPUT);
if (!output_pin) {
GST_ELEMENT_ERROR (vdec, CORE, NEGOTIATION,
("Can't get output pin from our directshow fakesrc filter"), (NULL));
goto end;
}
input_pin = gst_dshow_get_pin_from_filter (vdec->decfilter, PINDIR_INPUT);
input_pin = gst_dshow_util_get_pin_from_filter (vdec->decfilter, PINDIR_INPUT);
if (!input_pin) {
GST_ELEMENT_ERROR (vdec, CORE, NEGOTIATION,
("Can't get input pin from decoder filter"), (NULL));
@ -746,7 +746,7 @@ gst_dshowvideodec_sink_setcaps (GstPad * pad, GstCaps * caps)
vdec->fakesink->SetMediaType (&output_mediatype);
/* connect decoder to our fake sink */
output_pin = gst_dshow_get_pin_from_filter (vdec->decfilter, PINDIR_OUTPUT);
output_pin = gst_dshow_util_get_pin_from_filter (vdec->decfilter, PINDIR_OUTPUT);
if (!output_pin) {
GST_ELEMENT_ERROR (vdec, CORE, NEGOTIATION,
("Can't get output pin from our decoder filter"), (NULL));
@ -761,7 +761,7 @@ gst_dshowvideodec_sink_setcaps (GstPad * pad, GstCaps * caps)
goto end;
}
input_pin = gst_dshow_get_pin_from_filter (sinkfilter, PINDIR_INPUT);
input_pin = gst_dshow_util_get_pin_from_filter (sinkfilter, PINDIR_INPUT);
if (!input_pin) {
GST_ELEMENT_ERROR (vdec, CORE, NEGOTIATION,
("Can't get input pin from our directshow fakesink filter"), (NULL));
@ -976,7 +976,7 @@ gst_dshowvideodec_src_getcaps (GstPad * pad)
HRESULT hres;
ULONG fetched;
output_pin = gst_dshow_get_pin_from_filter (vdec->decfilter, PINDIR_OUTPUT);
output_pin = gst_dshow_util_get_pin_from_filter (vdec->decfilter, PINDIR_OUTPUT);
if (!output_pin) {
GST_ELEMENT_ERROR (vdec, STREAM, FAILED,
("failed getting output pin from the decoder"), (NULL));
@ -1070,7 +1070,7 @@ gst_dshowvideodec_get_filter_output_format (GstDshowVideoDec * vdec,
if (!vdec->decfilter)
return FALSE;
output_pin = gst_dshow_get_pin_from_filter (vdec->decfilter, PINDIR_OUTPUT);
output_pin = gst_dshow_util_get_pin_from_filter (vdec->decfilter, PINDIR_OUTPUT);
if (!output_pin) {
GST_ELEMENT_ERROR (vdec, CORE, NEGOTIATION,
("failed getting output pin from the decoder"), (NULL));
@ -1144,7 +1144,7 @@ gst_dshowvideodec_create_graph_and_filters (GstDshowVideoDec * vdec)
}
/* search a decoder filter and create it */
vdec->decfilter = gst_dshow_find_filter (
vdec->decfilter = gst_dshow_util_find_filter (
klass->entry->input_majortype,
klass->entry->input_subtype,
klass->entry->output_majortype,
@ -1310,7 +1310,7 @@ dshow_vdec_register (GstPlugin * plugin)
IBaseFilterPtr filter;
guint rank = GST_RANK_MARGINAL;
filter = gst_dshow_find_filter (
filter = gst_dshow_util_find_filter (
video_dec_codecs[i].input_majortype,
video_dec_codecs[i].input_subtype,
video_dec_codecs[i].output_majortype,

View file

@ -1,3 +1,27 @@
dshow_sources = [
'dshowdeviceprovider.cpp',
'dshowvideofakesrc.cpp',
'dshowvideosink.cpp',
'gstdshow.cpp',
'gstdshowaudiodec.cpp',
'gstdshowaudiosrc.cpp',
'gstdshowfakesink.cpp',
'gstdshowfakesrc.cpp',
'gstdshowutil.cpp',
'gstdshowvideodec.cpp',
'gstdshowvideosrc.cpp',
'plugin.cpp',
]
dshow_option = get_option('directshow')
if cxx.get_id() != 'msvc' or dshow_option.disabled()
if get_option('directshow').enabled()
error('directshow plugins can only be built with MSVC')
endif
subdir_done()
endif
if host_system == 'windows'
# Check whether we're building for UWP apps
code = '''
@ -5,22 +29,46 @@ if host_system == 'windows'
#if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
#error "Not building for UWP"
#endif'''
if cc.compiles(code, name : 'building for UWP')
if get_option('directshow').enabled()
if cxx.compiles(code, name: 'building for UWP')
if dshow_option.enabled()
error('directshow plugins cannot be built for UWP')
endif
subdir_done()
endif
endif
if cxx.get_id() != 'msvc' or get_option('directshow').disabled()
if get_option('directshow').enabled()
error('directshow plugins can only be built with MSVC')
endif
subdir('strmbase')
winmm_lib = cxx.find_library('winmm', required: dshow_option)
dmoguids_lib = cxx.find_library('dmoguids', required: dshow_option)
wmcodecdspuuid_lib = cxx.find_library('wmcodecdspuuid', required: dshow_option)
mfuuid_dep = cxx.find_library('mfuuid', required: dshow_option)
rpcrt4_dep = cxx.find_library('rpcrt4', required: dshow_option)
dshow_deps = [
strmbase_dep,
winmm_lib,
dmoguids_lib,
wmcodecdspuuid_lib,
mfuuid_dep,
rpcrt4_dep
]
foreach dep: dshow_deps
if not dep.found()
subdir_done()
endif
endforeach
subdir('strmbase')
subdir('dshowdecwrapper')
subdir('dshowsrcwrapper')
subdir('dshowsinkwrapper')
gstdirectshow = library('gstdirectshow',
dshow_sources,
c_args: gst_plugins_bad_args,
cpp_args: gst_plugins_bad_args,
include_directories: [configinc],
dependencies: [gstvideo_dep, gstaudio_dep] + dshow_deps,
install: true,
install_dir: plugins_install_dir,
override_options: ['cpp_std=none']
)
pkgconfig.generate(gstdirectshow, install_dir: plugins_pkgconfig_install_dir)
plugins += [gstdirectshow]

View file

@ -1,7 +1,5 @@
/* GStreamer
* Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
*
* gstdshowsrcwrapper.c:
* Copyright (C) 2022 Seungha Yang <seungha@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -23,39 +21,43 @@
#include "config.h"
#endif
#include <gst/gst.h>
#include "dshowvideosink.h"
#include "gstdshowaudiodec.h"
#include "gstdshowvideodec.h"
#include "gstdshowaudiosrc.h"
#include "gstdshowvideosrc.h"
#include "dshowdeviceprovider.h"
GST_DEBUG_CATEGORY (dshowdec_debug);
GST_DEBUG_CATEGORY (dshowsrcwrapper_debug);
#define GST_CAT_DEFAULT dshowsrcwrapper_debug
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (dshowdec_debug, "dshowdec", 0, "DirectShow decoder");
GST_DEBUG_CATEGORY_INIT (dshowsrcwrapper_debug, "dshowsrcwrapper", 0,
"DirectShow source wrapper");
if (!gst_element_register (plugin, "dshowaudiosrc",
GST_RANK_NONE, GST_TYPE_DSHOWAUDIOSRC) ||
!gst_element_register (plugin, "dshowvideosrc",
GST_RANK_NONE, GST_TYPE_DSHOWVIDEOSRC))
return FALSE;
dshow_adec_register (plugin);
dshow_vdec_register (plugin);
if (!gst_device_provider_register (plugin, "dshowdeviceprovider",
GST_RANK_PRIMARY, GST_TYPE_DSHOW_DEVICE_PROVIDER))
return FALSE;
gst_element_register (plugin, "dshowvideosink",
GST_RANK_MARGINAL, GST_TYPE_DSHOWVIDEOSINK);
gst_element_register (plugin, "dshowaudiosrc",
GST_RANK_NONE, GST_TYPE_DSHOWAUDIOSRC);
gst_element_register (plugin, "dshowvideosrc",
GST_RANK_NONE, GST_TYPE_DSHOWVIDEOSRC);
gst_device_provider_register (plugin, "dshowdeviceprovider",
GST_RANK_MARGINAL, GST_TYPE_DSHOW_DEVICE_PROVIDER);
return TRUE;
}
extern "C"
{
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
dshowsrcwrapper,
"DirectShow sources wrapper plugin",
directshow,
"DirectShow plugin",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
}