[clutter-gst] autosink: proxy ts-offset property of child sinks
- From: Damien Lespiau <dlespiau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gst] autosink: proxy ts-offset property of child sinks
- Date: Tue, 25 Sep 2012 17:45:15 +0000 (UTC)
commit 9d1f7ff7a0c940a4748332eb19b27c8d924b8459
Author: Josep Torra <n770galaxy gmail com>
Date: Wed Jul 4 13:47:41 2012 +0200
autosink: proxy ts-offset property of child sinks
The playbin2 av-offset property requires be able to configure the
ts-offset property on the video sink.
As we select the proper sink instance on the fly we must take care of
that property.
clutter-gst/clutter-gst-auto-video-sink.c | 25 ++++++++++++++++++++++---
clutter-gst/clutter-gst-auto-video-sink.h | 1 +
2 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/clutter-gst/clutter-gst-auto-video-sink.c b/clutter-gst/clutter-gst-auto-video-sink.c
index 0b49a10..df6d224 100644
--- a/clutter-gst/clutter-gst-auto-video-sink.c
+++ b/clutter-gst/clutter-gst-auto-video-sink.c
@@ -47,9 +47,12 @@ static GstStaticPadTemplate sink_template_factory =
enum
{
PROP_0,
- PROP_TEXTURE
+ PROP_TEXTURE,
+ PROP_TS_OFFSET
};
+#define DEFAULT_TS_OFFSET 0
+
G_DEFINE_TYPE (ClutterGstAutoVideoSink,
clutter_gst_auto_video_sink,
GST_TYPE_BIN);
@@ -381,8 +384,8 @@ clutter_gst_auto_video_sink_reconfigure (ClutterGstAutoVideoSink *bin,
/* Now we are ready to add the sink to bin */
bin->child = gst_object_ref (sink);
- g_object_set (G_OBJECT(bin->child), "texture", bin->texture, NULL);
-
+ g_object_set (G_OBJECT(bin->child), "texture", bin->texture,
+ "ts-offset", bin->ts_offset, NULL);
GST_DEBUG_OBJECT (bin, "going to add %" GST_PTR_FORMAT, bin->child);
/* Add our child */
gst_bin_add (GST_BIN (bin), bin->child);
@@ -690,6 +693,13 @@ clutter_gst_auto_video_sink_set_property (GObject *object,
case PROP_TEXTURE:
clutter_gst_auto_video_sink_set_texture (bin, g_value_get_object (value));
break;
+ case PROP_TS_OFFSET:
+ bin->ts_offset = g_value_get_int64 (value);
+ if (bin->child) {
+ g_object_set_property (G_OBJECT (bin->child), pspec->name,
+ value);
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -709,6 +719,9 @@ clutter_gst_auto_video_sink_get_property (GObject *object,
case PROP_TEXTURE:
g_value_set_object (value, bin->texture);
break;
+ case PROP_TS_OFFSET:
+ g_value_set_int64 (value, bin->ts_offset);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -752,6 +765,11 @@ clutter_gst_auto_video_sink_class_init (ClutterGstAutoVideoSinkClass *klass)
g_object_class_install_property (oclass, PROP_TEXTURE, pspec);
+ g_object_class_install_property (oclass, PROP_TS_OFFSET,
+ g_param_spec_int64 ("ts-offset", "TS Offset",
+ "Timestamp offset in nanoseconds", G_MININT64, G_MAXINT64,
+ DEFAULT_TS_OFFSET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (clutter_gst_auto_video_sink_change_state);
}
@@ -765,6 +783,7 @@ clutter_gst_auto_video_sink_init (ClutterGstAutoVideoSink *bin)
bin->setup = FALSE;
bin->texture = NULL;
+ bin->ts_offset = DEFAULT_TS_OFFSET;
/* Create a ghost pad with no target at first */
template = gst_static_pad_template_get (&sink_template_factory);
diff --git a/clutter-gst/clutter-gst-auto-video-sink.h b/clutter-gst/clutter-gst-auto-video-sink.h
index 7dadd6e..59925e5 100644
--- a/clutter-gst/clutter-gst-auto-video-sink.h
+++ b/clutter-gst/clutter-gst-auto-video-sink.h
@@ -99,6 +99,7 @@ struct _ClutterGstAutoVideoSink
gboolean setup;
ClutterTexture *texture;
+ GstClockTimeDiff ts_offset;
GMutex lock;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]