summaryrefslogtreecommitdiff
path: root/sys/applemedia/corevideobuffer.c
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2013-04-24 22:15:01 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-05-20 13:31:02 +0200
commit97bb1edf6c8c13dbede03be13b25ba1d5a6a4d6f (patch)
treea31366385f98bf229ab6b188c190e42e28ed1310 /sys/applemedia/corevideobuffer.c
parent57b97beb6db392eca8e0c284218392ad5529193c (diff)
downloadgstreamer-plugins-bad-97bb1edf6c8c13dbede03be13b25ba1d5a6a4d6f.tar.gz
applemedia: don't use the dynamic API for public frameworks
Public frameworks don't need to build the API dynamically, we instead use the framework directly. The exception is for VideoToolbox which went public in the 10.8 SDK, but it's still private in older version of the SDK and iOS. This allow building the plugin against SDK's where it's not a public framework.
Diffstat (limited to 'sys/applemedia/corevideobuffer.c')
-rw-r--r--sys/applemedia/corevideobuffer.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/sys/applemedia/corevideobuffer.c b/sys/applemedia/corevideobuffer.c
index 072fe6bd2..210311af4 100644
--- a/sys/applemedia/corevideobuffer.c
+++ b/sys/applemedia/corevideobuffer.c
@@ -22,15 +22,12 @@
static void
gst_core_video_meta_free (GstCoreVideoMeta * meta, GstBuffer * buf)
{
- GstCVApi *cv = meta->ctx->cv;
-
if (meta->pixbuf != NULL) {
- cv->CVPixelBufferUnlockBaseAddress (meta->pixbuf,
+ CVPixelBufferUnlockBaseAddress (meta->pixbuf,
kCVPixelBufferLock_ReadOnly);
}
- cv->CVBufferRelease (meta->cvbuf);
- g_object_unref (meta->ctx);
+ CVBufferRelease (meta->cvbuf);
}
GType
@@ -63,10 +60,9 @@ gst_core_video_meta_get_info (void)
}
GstBuffer *
-gst_core_video_buffer_new (GstCoreMediaCtx * ctx, CVBufferRef cvbuf,
+gst_core_video_buffer_new (CVBufferRef cvbuf,
GstVideoInfo * vinfo)
{
- GstCVApi *cv = ctx->cv;
void *data;
size_t size;
CVPixelBufferRef pixbuf = NULL;
@@ -76,13 +72,13 @@ gst_core_video_buffer_new (GstCoreMediaCtx * ctx, CVBufferRef cvbuf,
gsize offset[GST_VIDEO_MAX_PLANES];
gint stride[GST_VIDEO_MAX_PLANES];
- if (CFGetTypeID (cvbuf) != cv->CVPixelBufferGetTypeID ())
+ if (CFGetTypeID (cvbuf) != CVPixelBufferGetTypeID ())
/* TODO: Do we need to handle other buffer types? */
goto error;
pixbuf = (CVPixelBufferRef) cvbuf;
- if (cv->CVPixelBufferLockBaseAddress (pixbuf,
+ if (CVPixelBufferLockBaseAddress (pixbuf,
kCVPixelBufferLock_ReadOnly) != kCVReturnSuccess) {
goto error;
}
@@ -92,22 +88,21 @@ gst_core_video_buffer_new (GstCoreMediaCtx * ctx, CVBufferRef cvbuf,
/* add the corevideo meta to free the underlying corevideo buffer */
meta = (GstCoreVideoMeta *) gst_buffer_add_meta (buf,
gst_core_video_meta_get_info (), NULL);
- meta->ctx = g_object_ref (ctx);
- meta->cvbuf = cv->CVBufferRetain (cvbuf);
+ meta->cvbuf = CVBufferRetain (cvbuf);
meta->pixbuf = pixbuf;
/* set stride, offset and size */
memset (&offset, 0, sizeof (offset));
memset (&stride, 0, sizeof (stride));
- data = cv->CVPixelBufferGetBaseAddress (pixbuf);
- height = cv->CVPixelBufferGetHeight (pixbuf);
- if (cv->CVPixelBufferIsPlanar (pixbuf)) {
+ data = CVPixelBufferGetBaseAddress (pixbuf);
+ height = CVPixelBufferGetHeight (pixbuf);
+ if (CVPixelBufferIsPlanar (pixbuf)) {
GstVideoInfo tmp_vinfo;
- n_planes = cv->CVPixelBufferGetPlaneCount (pixbuf);
+ n_planes = CVPixelBufferGetPlaneCount (pixbuf);
for (i = 0; i < n_planes; ++i)
- stride[i] = cv->CVPixelBufferGetBytesPerRowOfPlane (pixbuf, i);
+ stride[i] = CVPixelBufferGetBytesPerRowOfPlane (pixbuf, i);
/* FIXME: don't hardcode NV12 */
gst_video_info_init (&tmp_vinfo);
@@ -117,7 +112,7 @@ gst_core_video_buffer_new (GstCoreMediaCtx * ctx, CVBufferRef cvbuf,
size = tmp_vinfo.size;
} else {
n_planes = 1;
- size = cv->CVPixelBufferGetBytesPerRow (pixbuf) * height;
+ size = CVPixelBufferGetBytesPerRow (pixbuf) * height;
}
gst_buffer_append_memory (buf,