From 5405273b0af51f49bb0528c29ab81190c8f83a38 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 8 May 2014 00:59:42 +1000 Subject: [PATCH] gl/upload: add get_format method Simply retreives the format set by init_format --- docs/libs/gst-plugins-bad-libs-sections.txt | 1 + gst-libs/gst/gl/gstglupload.c | 20 ++++++++++++++++++++ gst-libs/gst/gl/gstglupload.h | 1 + 3 files changed, 22 insertions(+) diff --git a/docs/libs/gst-plugins-bad-libs-sections.txt b/docs/libs/gst-plugins-bad-libs-sections.txt index 78c341f4cf..4b7c489309 100644 --- a/docs/libs/gst-plugins-bad-libs-sections.txt +++ b/docs/libs/gst-plugins-bad-libs-sections.txt @@ -1011,6 +1011,7 @@ GST_GL_SHADER_GET_CLASS GstGLUpload gst_gl_upload_new gst_gl_upload_init_format +gst_gl_upload_get_format gst_gl_upload_add_video_gl_texture_upload_meta gst_gl_upload_perform_with_data gst_gl_upload_perform_with_memory diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 23c6916253..37778cb180 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -214,6 +214,26 @@ gst_gl_upload_init_format (GstGLUpload * upload, GstVideoInfo * in_info) return ret; } +/** + * gst_gl_upload_get_format: + * @upload: a #GstGLUpload + * + * Returns: (transfer none): The #GstVideoInfo set by gst_gl_upload_init_format() + */ +GstVideoInfo * +gst_gl_upload_get_format (GstGLUpload * upload) +{ + GstVideoInfo *ret; + + g_mutex_lock (&upload->lock); + + ret = &upload->in_info; + + g_mutex_unlock (&upload->lock); + + return ret; +} + /** * gst_gl_upload_perform_with_buffer: * @upload: a #GstGLUpload diff --git a/gst-libs/gst/gl/gstglupload.h b/gst-libs/gst/gl/gstglupload.h index 5cb6333572..6a779ef063 100644 --- a/gst-libs/gst/gl/gstglupload.h +++ b/gst-libs/gst/gl/gstglupload.h @@ -78,6 +78,7 @@ struct _GstGLUploadClass GstGLUpload * gst_gl_upload_new (GstGLContext * context); gboolean gst_gl_upload_init_format (GstGLUpload * upload, GstVideoInfo * in_info); +GstVideoInfo * gst_gl_upload_get_format (GstGLUpload * upload); gboolean gst_gl_upload_add_video_gl_texture_upload_meta (GstGLUpload * upload, GstBuffer * buffer);