macos: Move atdec from applemedia (-bad) to osxaudio (-good)

osxaudio has a few helper methods potentially useful in atdec (or future atenc), like GStreamer -> CoreAudio
channel mapping. Doesn't make sense to duplicate them in applemedia, and atdec is the only audio-oriented
element there anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6223>
This commit is contained in:
Piotr Brzeziński 2024-02-26 14:57:32 +01:00 committed by GStreamer Marge Bot
parent a26b363d3e
commit d3fba31da0
6 changed files with 10 additions and 9 deletions

View file

@ -6,7 +6,6 @@ applemedia_sources = [
'coremediabuffer.c', 'coremediabuffer.c',
'videotexturecache.m', 'videotexturecache.m',
'videotexturecache-gl.m', 'videotexturecache-gl.m',
'atdec.c',
'glcontexthelper.c', 'glcontexthelper.c',
'helpers.c', 'helpers.c',
] ]
@ -42,8 +41,7 @@ applemedia_frameworks = []
corefoundation_dep = dependency('CoreFoundation', required : applemedia_option) corefoundation_dep = dependency('CoreFoundation', required : applemedia_option)
coremedia_dep = dependency('CoreMedia', required : applemedia_option) coremedia_dep = dependency('CoreMedia', required : applemedia_option)
corevideo_dep = dependency('CoreVideo', required : applemedia_option) corevideo_dep = dependency('CoreVideo', required : applemedia_option)
audiotoolbox_dep = dependency('AudioToolbox', required : applemedia_option) applemedia_frameworks += [corefoundation_dep, coremedia_dep, corevideo_dep]
applemedia_frameworks += [corefoundation_dep, coremedia_dep, corevideo_dep, audiotoolbox_dep]
avfoundation_dep = dependency('AVFoundation', required : applemedia_option) avfoundation_dep = dependency('AVFoundation', required : applemedia_option)
if avfoundation_dep.found() if avfoundation_dep.found()
@ -118,7 +116,7 @@ if applemedia_found_deps
objcpp_args : gst_plugins_bad_args + applemedia_args + applemedia_objc_args + applemedia_objcpp_args, objcpp_args : gst_plugins_bad_args + applemedia_args + applemedia_objc_args + applemedia_objcpp_args,
link_args : noseh_link_args, link_args : noseh_link_args,
include_directories : [configinc, libsinc], include_directories : [configinc, libsinc],
dependencies : [gstvideo_dep, gstaudio_dep, gstpbutils_dep, gst_dep, gstbase_dep, gstgl_dep, gstglproto_dep, gstcodecparsers_dep] + applemedia_frameworks, dependencies : [gstvideo_dep, gstpbutils_dep, gst_dep, gstbase_dep, gstgl_dep, gstglproto_dep, gstcodecparsers_dep] + applemedia_frameworks,
override_options : ['cpp_std=c++11'], override_options : ['cpp_std=c++11'],
install : true, install : true,
install_dir : plugins_install_dir, install_dir : plugins_install_dir,

View file

@ -41,7 +41,6 @@
#else #else
#define AV_RANK GST_RANK_PRIMARY #define AV_RANK GST_RANK_PRIMARY
#endif #endif
#include "atdec.h"
#ifdef HAVE_VIDEOTOOLBOX #ifdef HAVE_VIDEOTOOLBOX
void gst_vtenc_register_elements (GstPlugin * plugin); void gst_vtenc_register_elements (GstPlugin * plugin);
@ -85,8 +84,6 @@ plugin_init (GstPlugin * plugin)
GST_RANK_PRIMARY, GST_TYPE_AVF_DEVICE_PROVIDER); GST_RANK_PRIMARY, GST_TYPE_AVF_DEVICE_PROVIDER);
#endif #endif
res &= gst_element_register (plugin, "atdec", GST_RANK_MARGINAL, GST_TYPE_ATDEC);
#ifdef HAVE_VIDEOTOOLBOX #ifdef HAVE_VIDEOTOOLBOX
/* Check if the framework actually exists at runtime */ /* Check if the framework actually exists at runtime */
if (&VTCompressionSessionCreate != NULL) { if (&VTCompressionSessionCreate != NULL) {

View file

@ -36,7 +36,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/audio/gstaudiodecoder.h> #include <gst/audio/gstaudiodecoder.h>
#include "atdec.h" #include "gstatdec.h"
GST_DEBUG_CATEGORY_STATIC (gst_atdec_debug_category); GST_DEBUG_CATEGORY_STATIC (gst_atdec_debug_category);
#define GST_CAT_DEFAULT gst_atdec_debug_category #define GST_CAT_DEFAULT gst_atdec_debug_category
@ -81,6 +81,7 @@ static GstStaticPadTemplate gst_atdec_sink_template =
G_DEFINE_TYPE_WITH_CODE (GstATDec, gst_atdec, GST_TYPE_AUDIO_DECODER, G_DEFINE_TYPE_WITH_CODE (GstATDec, gst_atdec, GST_TYPE_AUDIO_DECODER,
GST_DEBUG_CATEGORY_INIT (gst_atdec_debug_category, "atdec", 0, GST_DEBUG_CATEGORY_INIT (gst_atdec_debug_category, "atdec", 0,
"debug category for atdec element")); "debug category for atdec element"));
GST_ELEMENT_REGISTER_DEFINE (atdec, "atdec", GST_RANK_MARGINAL, GST_TYPE_ATDEC);
static GstStaticCaps aac_caps = GST_STATIC_CAPS ("audio/mpeg, mpegversion=4"); static GstStaticCaps aac_caps = GST_STATIC_CAPS ("audio/mpeg, mpegversion=4");
static GstStaticCaps mp3_caps = static GstStaticCaps mp3_caps =

View file

@ -49,6 +49,8 @@ struct _GstATDecClass
GType gst_atdec_get_type (void); GType gst_atdec_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (atdec);
G_END_DECLS G_END_DECLS
#endif #endif

View file

@ -30,6 +30,7 @@
#include "gstosxaudioelement.h" #include "gstosxaudioelement.h"
#include "gstosxaudiosink.h" #include "gstosxaudiosink.h"
#include "gstosxaudiosrc.h" #include "gstosxaudiosrc.h"
#include "gstatdec.h"
#ifndef HAVE_IOS #ifndef HAVE_IOS
#include "gstosxaudiodeviceprovider.h" #include "gstosxaudiodeviceprovider.h"
#endif #endif
@ -41,6 +42,7 @@ plugin_init (GstPlugin * plugin)
ret |= GST_ELEMENT_REGISTER (osxaudiosrc, plugin); ret |= GST_ELEMENT_REGISTER (osxaudiosrc, plugin);
ret |= GST_ELEMENT_REGISTER (osxaudiosink, plugin); ret |= GST_ELEMENT_REGISTER (osxaudiosink, plugin);
ret |= GST_ELEMENT_REGISTER (atdec, plugin);
#ifndef HAVE_IOS #ifndef HAVE_IOS
ret |= GST_DEVICE_PROVIDER_REGISTER (osxaudiodeviceprovider, plugin); ret |= GST_DEVICE_PROVIDER_REGISTER (osxaudiodeviceprovider, plugin);
#endif #endif

View file

@ -5,7 +5,8 @@ osxaudio_sources = [
'gstosxaudiosrc.c', 'gstosxaudiosrc.c',
'gstosxcoreaudiocommon.c', 'gstosxcoreaudiocommon.c',
'gstosxcoreaudio.c', 'gstosxcoreaudio.c',
'gstosxaudio.c' 'gstosxaudio.c',
'gstatdec.c',
] ]
have_osxaudio = false have_osxaudio = false