diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowdecwrapper.cpp b/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowdecwrapper.cpp deleted file mode 100644 index 13289b0516..0000000000 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowdecwrapper.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * GStreamer DirectShow codecs wrapper - * Copyright <2006, 2007, 2008> Fluendo - * Copyright <2006, 2007, 2008> Pioneers of the Inevitable - * Copyright <2007,2008> Sebastien Moutte - * - * 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) - -} diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowdecwrapper.h b/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowdecwrapper.h deleted file mode 100644 index c974d08e4b..0000000000 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowdecwrapper.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * GStreamer DirectShow codecs wrapper - * Copyright <2006, 2007, 2008> Fluendo - * Copyright <2006, 2007, 2008> Pioneers of the Inevitable - * Copyright <2007,2008> Sebastien Moutte - * - * 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 -#include -#include -#include -#include - -#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__ */ diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/meson.build b/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/meson.build deleted file mode 100644 index af71a98225..0000000000 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/meson.build +++ /dev/null @@ -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] diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/dshowdeviceprovider.cpp b/subprojects/gst-plugins-bad/sys/directshow/dshowdeviceprovider.cpp similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/dshowdeviceprovider.cpp rename to subprojects/gst-plugins-bad/sys/directshow/dshowdeviceprovider.cpp diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/dshowdeviceprovider.h b/subprojects/gst-plugins-bad/sys/directshow/dshowdeviceprovider.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/dshowdeviceprovider.h rename to subprojects/gst-plugins-bad/sys/directshow/dshowdeviceprovider.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/meson.build b/subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/meson.build deleted file mode 100644 index 37e14a67b4..0000000000 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/meson.build +++ /dev/null @@ -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] diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/meson.build b/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/meson.build deleted file mode 100644 index 2a64ce85b1..0000000000 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/meson.build +++ /dev/null @@ -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] diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideofakesrc.cpp b/subprojects/gst-plugins-bad/sys/directshow/dshowvideofakesrc.cpp similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideofakesrc.cpp rename to subprojects/gst-plugins-bad/sys/directshow/dshowvideofakesrc.cpp diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideofakesrc.h b/subprojects/gst-plugins-bad/sys/directshow/dshowvideofakesrc.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideofakesrc.h rename to subprojects/gst-plugins-bad/sys/directshow/dshowvideofakesrc.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideosink.cpp b/subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp similarity index 98% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideosink.cpp rename to subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp index 9211ba5bed..356a9274f2 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideosink.cpp +++ b/subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp @@ -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) diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideosink.h b/subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsinkwrapper/dshowvideosink.h rename to subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshow.cpp b/subprojects/gst-plugins-bad/sys/directshow/gstdshow.cpp similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshow.cpp rename to subprojects/gst-plugins-bad/sys/directshow/gstdshow.cpp diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshow.h b/subprojects/gst-plugins-bad/sys/directshow/gstdshow.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshow.h rename to subprojects/gst-plugins-bad/sys/directshow/gstdshow.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowaudiodec.cpp b/subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiodec.cpp similarity index 98% rename from subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowaudiodec.cpp rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiodec.cpp index 49fc0475f8..b0ec6956eb 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowaudiodec.cpp +++ b/subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiodec.cpp @@ -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, diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowaudiodec.h b/subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiodec.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowaudiodec.h rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiodec.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowaudiosrc.cpp b/subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiosrc.cpp similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowaudiosrc.cpp rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiosrc.cpp diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowaudiosrc.h b/subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiosrc.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowaudiosrc.h rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowaudiosrc.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowfakesink.cpp b/subprojects/gst-plugins-bad/sys/directshow/gstdshowfakesink.cpp similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowfakesink.cpp rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowfakesink.cpp diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowfakesink.h b/subprojects/gst-plugins-bad/sys/directshow/gstdshowfakesink.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowfakesink.h rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowfakesink.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowfakesrc.cpp b/subprojects/gst-plugins-bad/sys/directshow/gstdshowfakesrc.cpp similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowfakesrc.cpp rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowfakesrc.cpp diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowfakesrc.h b/subprojects/gst-plugins-bad/sys/directshow/gstdshowfakesrc.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowfakesrc.h rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowfakesrc.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowutil.cpp b/subprojects/gst-plugins-bad/sys/directshow/gstdshowutil.cpp similarity index 96% rename from subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowutil.cpp rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowutil.cpp index c31715485a..1e018c8e4d 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowutil.cpp +++ b/subprojects/gst-plugins-bad/sys/directshow/gstdshowutil.cpp @@ -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) { diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowutil.h b/subprojects/gst-plugins-bad/sys/directshow/gstdshowutil.h similarity index 93% rename from subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowutil.h rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowutil.h index 854087a741..7dbff6e164 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowutil.h +++ b/subprojects/gst-plugins-bad/sys/directshow/gstdshowutil.h @@ -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); diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowvideodec.cpp b/subprojects/gst-plugins-bad/sys/directshow/gstdshowvideodec.cpp similarity index 98% rename from subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowvideodec.cpp rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowvideodec.cpp index 87c08c7f58..16d5b7a4d0 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowvideodec.cpp +++ b/subprojects/gst-plugins-bad/sys/directshow/gstdshowvideodec.cpp @@ -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, diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowvideodec.h b/subprojects/gst-plugins-bad/sys/directshow/gstdshowvideodec.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowdecwrapper/gstdshowvideodec.h rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowvideodec.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.cpp b/subprojects/gst-plugins-bad/sys/directshow/gstdshowvideosrc.cpp similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.cpp rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowvideosrc.cpp diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.h b/subprojects/gst-plugins-bad/sys/directshow/gstdshowvideosrc.h similarity index 100% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.h rename to subprojects/gst-plugins-bad/sys/directshow/gstdshowvideosrc.h diff --git a/subprojects/gst-plugins-bad/sys/directshow/meson.build b/subprojects/gst-plugins-bad/sys/directshow/meson.build index c043544b57..c3c1b88973 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/meson.build +++ b/subprojects/gst-plugins-bad/sys/directshow/meson.build @@ -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_done() -endif - subdir('strmbase') -subdir('dshowdecwrapper') -subdir('dshowsrcwrapper') -subdir('dshowsinkwrapper') + +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 + +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] diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowsrcwrapper.cpp b/subprojects/gst-plugins-bad/sys/directshow/plugin.cpp similarity index 54% rename from subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowsrcwrapper.cpp rename to subprojects/gst-plugins-bad/sys/directshow/plugin.cpp index 747a08c6de..6920760073 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowsrcwrapper.cpp +++ b/subprojects/gst-plugins-bad/sys/directshow/plugin.cpp @@ -1,7 +1,5 @@ /* GStreamer - * Copyright (C) 2007 Sebastien Moutte - * - * gstdshowsrcwrapper.c: + * Copyright (C) 2022 Seungha Yang * * 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 + +#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", - plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) - -} +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + directshow, + "DirectShow plugin", + plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)