[Cogl] [PATCH] cogl-gst: adds _sink_is_ready() api

Neil Roberts neil at linux.intel.com
Thu Jul 25 08:50:08 PDT 2013


The patch looks good to me so I've just gone ahead and landed it. I made
a minor tweak so that it references sink->priv->renderer instead of
sink->renderer and also added the symbol to cogl-gst-sections.txt so
that it will appear in the documentation.

https://git.gnome.org/browse/cogl/commit/?id=9e7db391a87beee7c

Regards,
- Neil

Lionel Landwerlin <llandwerlin at gmail.com> writes:

> Makes sense. Can we land this?
>
> Cheers,
>
> -
> Lionel
>
> On 09/07/13 18:29, Robert Bragg wrote:
>> From: Robert Bragg <robert at linux.intel.com>
>>
>> Thinking about this a bit more, I realized that this makes the _get_pipeline()
>> api inconsistent with the _setup_pipeline() api which can be used for
>> completely custom pipelines and in the case of _setup_pipeline() we aren't able
>> to just return NULL to indicate that the pipeline wasn't ready.
>>
>> Alternatively I wondered whether a cogl_gst_video_sink_is_ready() function
>> would work for instead so you can directly check the status before calling
>> cogl_gst_video_sink_get_pipeline() in any case where you haven't been able to
>> connect a signal handler for the pipeline-ready signal?
>>
>> If this could work then maybe we can use the patch below?
>>
>> kind regards,
>> - Robert
>>
>> --- >8 ---
>>
>> This adds a cogl_gst_video_sink_is_ready() for code to be able to check
>> if its safe to call cogl_gst_video_sink_get_pipeline() or
>> cogl_gst_video_sink_setup_pipeline() without causing an error. Normally
>> application listen for the pipeline-ready signal but sometimes a sink
>> can be passed between components that didn't have an opportunity to
>> connect a signal handler, so they need a way to directly check the
>> status.
>> ---
>>   cogl-gst/cogl-gst-video-sink.c |  6 ++++++
>>   cogl-gst/cogl-gst-video-sink.h | 20 ++++++++++++++++++++
>>   2 files changed, 26 insertions(+)
>>
>> diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
>> index 2cd63ae..3018de1 100644
>> --- a/cogl-gst/cogl-gst-video-sink.c
>> +++ b/cogl-gst/cogl-gst-video-sink.c
>> @@ -1355,3 +1355,9 @@ cogl_gst_video_sink_fit_size (CoglGstVideoSink *vt,
>>           }
>>       }
>>   }
>> +
>> +CoglBool
>> +cogl_gst_video_sink_is_ready (CoglGstVideoSink *sink)
>> +{
>> +  return !!sink->renderer;
>> +}
>> diff --git a/cogl-gst/cogl-gst-video-sink.h b/cogl-gst/cogl-gst-video-sink.h
>> index 45ed835..6c59e7c 100644
>> --- a/cogl-gst/cogl-gst-video-sink.h
>> +++ b/cogl-gst/cogl-gst-video-sink.h
>> @@ -192,6 +192,26 @@ CoglGstVideoSink *
>>   cogl_gst_video_sink_new (CoglContext *ctx);
>>   
>>   /**
>> + * cogl_gst_video_sink_is_ready:
>> + * @sink: The #CoglGstVideoSink
>> + *
>> + * Returns whether the pipeline is ready and so
>> + * cogl_gst_video_sink_get_pipeline() and
>> + * cogl_gst_video_sink_setup_pipeline() can be called without causing error.
>> + *
>> + * Note: Normally an application will wait until the
>> + * #CoglGstVideoSink::pipeline-ready signal is emitted instead of
>> + * polling the ready status with this api, but sometimes when a sink
>> + * is passed between components that didn't have an opportunity to
>> + * connect a signal handler this can be useful.
>> + *
>> + * Return value: %TRUE if the sink is ready, else %FALSE
>> + * Since: 1.16
>> + */
>> +CoglBool
>> +cogl_gst_video_sink_is_ready (CoglGstVideoSink *sink);
>> +
>> +/**
>>    * cogl_gst_video_sink_get_pipeline:
>>    * @vt: The #CoglGstVideoSink
>>    *
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



More information about the Cogl mailing list