summaryrefslogtreecommitdiff
path: root/sys/applemedia/avsamplevideosink.h
diff options
context:
space:
mode:
authorNick Kallen <nickkallen@me.com>2017-02-03 14:46:39 +0100
committerSebastian Dröge <sebastian@centricular.com>2017-03-07 13:37:07 +0200
commit46bbc60d24c1914380b4145fa8595aa2e958c7dc (patch)
tree85c98124552b6638d63b554a950c352c4003c573 /sys/applemedia/avsamplevideosink.h
parent201e71c3aacd4c61771fd6ac20dc39e43e42bb0c (diff)
downloadgstreamer-plugins-bad-46bbc60d24c1914380b4145fa8595aa2e958c7dc.tar.gz
applemedia/gl: Update code to use ARC
All code interacting with Objective-C objects should now use Automated Reference Counting rather than manual memory management or Garbage Collection. Because ARC prohibits C-structs from containing references to Objective-C objects, all such fields are now typed 'gpointer'. Setting and gettings Objective-C fields on such a struct now uses explicit __bridge_* calls to tell ARC about object lifetimes. https://bugzilla.gnome.org/show_bug.cgi?id=777847
Diffstat (limited to 'sys/applemedia/avsamplevideosink.h')
-rw-r--r--sys/applemedia/avsamplevideosink.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/applemedia/avsamplevideosink.h b/sys/applemedia/avsamplevideosink.h
index 3b9ed478d..6e7d5959d 100644
--- a/sys/applemedia/avsamplevideosink.h
+++ b/sys/applemedia/avsamplevideosink.h
@@ -42,6 +42,8 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AV_SAMPLE_VIDEO_SINK))
#define GST_IS_AV_SAMPLE_VIDEO_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AV_SAMPLE_VIDEO_SINK))
+#define GST_AV_SAMPLE_VIDEO_SINK_LAYER(obj) \
+ ((__bridge AVSampleBufferDisplayLayer *)(obj->layer))
typedef struct _GstAVSampleVideoSink GstAVSampleVideoSink;
typedef struct _GstAVSampleVideoSinkClass GstAVSampleVideoSinkClass;
@@ -50,7 +52,9 @@ struct _GstAVSampleVideoSink
{
GstVideoSink video_sink;
- AVSampleBufferDisplayLayer *layer;
+ /* NOTE: ARC no longer allows Objective-C pointers in structs. */
+ /* Instead, use gpointer with explicit __bridge_* calls */
+ gpointer layer;
GstVideoInfo info;