mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
applemedia: bring back Leopard compatibility
At least as far as miovideosrc is concerned. Turns out that CoreVideo's CVPixelBufferGetIOSurface is not present in Leopard's version of CoreVideo. We solve this by making it possible for symbols to be marked as optional.
This commit is contained in:
parent
6cf92cd25c
commit
f7e5878c9e
5 changed files with 10 additions and 8 deletions
|
@ -46,9 +46,6 @@ G_BEGIN_DECLS
|
|||
#define GST_IS_CORE_MEDIA_CTX_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CORE_MEDIA_CTX))
|
||||
|
||||
#define GST_DYN_SYM_SPEC(type, name) \
|
||||
{ G_STRINGIFY (name), G_STRUCT_OFFSET (type, name) }
|
||||
|
||||
typedef struct _GstCoreMediaCtx GstCoreMediaCtx;
|
||||
typedef struct _GstCoreMediaCtxClass GstCoreMediaCtxClass;
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ gst_cv_api_class_init (GstCVApiClass * klass)
|
|||
}
|
||||
|
||||
#define SYM_SPEC(name) GST_DYN_SYM_SPEC (GstCVApi, name)
|
||||
#define SYM_SPEC_OPTIONAL(name) GST_DYN_SYM_SPEC_OPTIONAL (GstCVApi, name)
|
||||
|
||||
GstCVApi *
|
||||
gst_cv_api_obtain (GError ** error)
|
||||
|
@ -53,7 +54,7 @@ gst_cv_api_obtain (GError ** error)
|
|||
SYM_SPEC (CVPixelBufferGetBytesPerRowOfPlane),
|
||||
SYM_SPEC (CVPixelBufferGetHeight),
|
||||
SYM_SPEC (CVPixelBufferGetHeightOfPlane),
|
||||
SYM_SPEC (CVPixelBufferGetIOSurface),
|
||||
SYM_SPEC_OPTIONAL (CVPixelBufferGetIOSurface),
|
||||
SYM_SPEC (CVPixelBufferGetPlaneCount),
|
||||
SYM_SPEC (CVPixelBufferGetTypeID),
|
||||
SYM_SPEC (CVPixelBufferIsPlanar),
|
||||
|
|
|
@ -30,6 +30,7 @@ struct _GstDynSymSpec
|
|||
{
|
||||
const gchar * name;
|
||||
guint offset;
|
||||
gboolean is_required;
|
||||
};
|
||||
|
||||
gpointer _gst_dyn_api_new (GType derived_type, const gchar * filename,
|
||||
|
|
|
@ -142,9 +142,10 @@ _gst_dyn_api_new (GType derived_type, const gchar * filename,
|
|||
names_not_found = g_array_new (TRUE, FALSE, sizeof (gchar *));
|
||||
|
||||
for (i = 0; symbols[i].name != NULL; i++) {
|
||||
if (!g_module_symbol (priv->module, symbols[i].name,
|
||||
(gpointer *) (((guint8 *) api) + symbols[i].offset))) {
|
||||
g_array_append_val (names_not_found, symbols[i].name);
|
||||
const GstDynSymSpec *s = &symbols[i];
|
||||
if (!g_module_symbol (priv->module, s->name,
|
||||
(gpointer *) (((guint8 *) api) + s->offset)) && s->is_required) {
|
||||
g_array_append_val (names_not_found, s->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,9 @@ G_BEGIN_DECLS
|
|||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DYN_API))
|
||||
|
||||
#define GST_DYN_SYM_SPEC(type, name) \
|
||||
{ G_STRINGIFY (name), G_STRUCT_OFFSET (type, name) }
|
||||
{ G_STRINGIFY (name), G_STRUCT_OFFSET (type, name), TRUE }
|
||||
#define GST_DYN_SYM_SPEC_OPTIONAL(type, name) \
|
||||
{ G_STRINGIFY (name), G_STRUCT_OFFSET (type, name), FALSE }
|
||||
|
||||
typedef struct _GstDynApi GstDynApi;
|
||||
typedef struct _GstDynApiClass GstDynApiClass;
|
||||
|
|
Loading…
Reference in a new issue