summaryrefslogtreecommitdiff
path: root/sys/applemedia
diff options
context:
space:
mode:
authorOle André Vadla Ravnås <oravnas@cisco.com>2010-11-19 15:53:55 +0100
committerOle André Vadla Ravnås <oravnas@cisco.com>2010-12-10 04:06:59 +0100
commitf7e5878c9e4c905ffab0de443ac92715db500cb6 (patch)
treeb1f57dc5a0e3406fbb842878a69aac116b36fd7f /sys/applemedia
parent6cf92cd25c0322058e9e59cd840e46a9dca98c97 (diff)
downloadgstreamer-plugins-bad-f7e5878c9e4c905ffab0de443ac92715db500cb6.tar.gz
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.
Diffstat (limited to 'sys/applemedia')
-rw-r--r--sys/applemedia/coremediactx.h3
-rw-r--r--sys/applemedia/cvapi.c3
-rw-r--r--sys/applemedia/dynapi-internal.h1
-rw-r--r--sys/applemedia/dynapi.c7
-rw-r--r--sys/applemedia/dynapi.h4
5 files changed, 10 insertions, 8 deletions
diff --git a/sys/applemedia/coremediactx.h b/sys/applemedia/coremediactx.h
index 4125ecdf5..0220b3e19 100644
--- a/sys/applemedia/coremediactx.h
+++ b/sys/applemedia/coremediactx.h
@@ -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;
diff --git a/sys/applemedia/cvapi.c b/sys/applemedia/cvapi.c
index 73186f8f5..4307f0737 100644
--- a/sys/applemedia/cvapi.c
+++ b/sys/applemedia/cvapi.c
@@ -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),
diff --git a/sys/applemedia/dynapi-internal.h b/sys/applemedia/dynapi-internal.h
index b584ea76b..d6624d100 100644
--- a/sys/applemedia/dynapi-internal.h
+++ b/sys/applemedia/dynapi-internal.h
@@ -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,
diff --git a/sys/applemedia/dynapi.c b/sys/applemedia/dynapi.c
index 87ff10ccb..139fabd66 100644
--- a/sys/applemedia/dynapi.c
+++ b/sys/applemedia/dynapi.c
@@ -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);
}
}
diff --git a/sys/applemedia/dynapi.h b/sys/applemedia/dynapi.h
index 2b125ba8c..4be83b2c0 100644
--- a/sys/applemedia/dynapi.h
+++ b/sys/applemedia/dynapi.h
@@ -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;