summaryrefslogtreecommitdiff
path: root/sys/applemedia
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2016-02-09 13:42:48 +1100
committerAlessandro Decina <alessandro.d@gmail.com>2016-02-09 14:13:26 +1100
commite34fe9fe70e643fb0370fc25e08df09ec6ee0003 (patch)
treefbe6a79cf5a666fb3e1e66efb83f10ad769e9787 /sys/applemedia
parent022e060563e25c739248689a44aa5798dc04b734 (diff)
downloadgstreamer-plugins-bad-e34fe9fe70e643fb0370fc25e08df09ec6ee0003.tar.gz
applemedia: avfvideosrc: implement GstElement::set_context
Needed to properly handle gst.gl.app_context(s).
Diffstat (limited to 'sys/applemedia')
-rw-r--r--sys/applemedia/avfvideosrc.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/applemedia/avfvideosrc.m b/sys/applemedia/avfvideosrc.m
index 86eeff5e6..1c8f63397 100644
--- a/sys/applemedia/avfvideosrc.m
+++ b/sys/applemedia/avfvideosrc.m
@@ -150,6 +150,7 @@ G_DEFINE_TYPE (GstAVFVideoSrc, gst_avf_video_src, GST_TYPE_PUSH_SRC);
- (BOOL)unlock;
- (BOOL)unlockStop;
- (BOOL)query:(GstQuery *)query;
+- (void)setContext:(GstContext *)context;
- (GstStateChangeReturn)changeState:(GstStateChange)transition;
- (GstFlowReturn)create:(GstBuffer **)buf;
- (GstCaps *)fixate:(GstCaps *)caps;
@@ -1005,6 +1006,15 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
return TRUE;
}
+- (void)setContext:(GstContext *)context
+{
+ GST_INFO_OBJECT (element, "setting context %s",
+ gst_context_get_context_type (context));
+ gst_gl_handle_set_context (element, context,
+ &ctxh->display, &ctxh->other_context);
+ GST_ELEMENT_CLASS (parent_class)->set_context (element, context);
+}
+
- (void)getSampleBuffer:(CMSampleBufferRef)sbuf
timestamp:(GstClockTime *)outTimestamp
duration:(GstClockTime *)outDuration
@@ -1137,6 +1147,8 @@ static GstCaps * gst_avf_video_src_fixate (GstBaseSrc * bsrc,
GstCaps * caps);
static gboolean gst_avf_video_src_decide_allocation (GstBaseSrc * bsrc,
GstQuery * query);
+static void gst_avf_video_src_set_context (GstElement * element,
+ GstContext * context);
static void
gst_avf_video_src_class_init (GstAVFVideoSrcClass * klass)
@@ -1151,6 +1163,7 @@ gst_avf_video_src_class_init (GstAVFVideoSrcClass * klass)
gobject_class->set_property = gst_avf_video_src_set_property;
gstelement_class->change_state = gst_avf_video_src_change_state;
+ gstelement_class->set_context = gst_avf_video_src_set_context;
gstbasesrc_class->get_caps = gst_avf_video_src_get_caps;
gstbasesrc_class->set_caps = gst_avf_video_src_set_caps;
@@ -1428,3 +1441,11 @@ gst_avf_video_src_decide_allocation (GstBaseSrc * bsrc,
return ret;
}
+
+static void
+gst_avf_video_src_set_context (GstElement * element, GstContext * context)
+{
+ OBJC_CALLOUT_BEGIN ();
+ [GST_AVF_VIDEO_SRC_IMPL (element) setContext:context];
+ OBJC_CALLOUT_END ();
+}