#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;
}
#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)
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),
{
const gchar * name;
guint offset;
+ gboolean is_required;
};
gpointer _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);
}
}
(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;