From 3cf75c34d36b1266e488dcb5f07b7bf10d003dcf Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 5 Jun 2010 11:02:24 +0200 Subject: [PATCH] playbin2: move marshaller to screenshot Move the marshaller for the convert_frame signal to the screenshot file in preparation for moving it to playsink. See #620279 --- gst/playback/gstplaybin2.c | 41 +++++------------------------------------ gst/playback/gstscreenshot.c | 32 ++++++++++++++++++++++++++++++++ gst/playback/gstscreenshot.h | 6 ++++++ 3 files changed, 43 insertions(+), 36 deletions(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index c46b45f..00c2a79 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -232,6 +232,7 @@ #include "gstplayback.h" #include "gstplaysink.h" #include "gstfactorylists.h" +#include "gstscreenshot.h" #include "gstinputselector.h" #include "gstsubtitleoverlay.h" @@ -568,38 +569,6 @@ if (id) { \ id = 0; \ } -static void -gst_play_marshal_BUFFER__BOXED (GClosure * closure, - GValue * return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue * param_values, - gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) -{ - typedef GstBuffer *(*GMarshalFunc_OBJECT__BOXED) (gpointer data1, - gpointer arg_1, gpointer data2); - register GMarshalFunc_OBJECT__BOXED callback; - register GCClosure *cc = (GCClosure *) closure; - register gpointer data1, data2; - GstBuffer *v_return; - - g_return_if_fail (return_value != NULL); - g_return_if_fail (n_param_values == 2); - - if (G_CCLOSURE_SWAP_DATA (closure)) { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } else { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = - (GMarshalFunc_OBJECT__BOXED) (marshal_data ? marshal_data : cc->callback); - - v_return = callback (data1, g_value_get_boxed (param_values + 1), data2); - - gst_value_take_buffer (return_value, v_return); -} - static GType gst_play_bin_get_type (void) { @@ -2441,8 +2410,8 @@ _playsink_sink_event_probe_cb (GstPad * pad, GstEvent * event, if (format != GST_FORMAT_TIME) data->group->selector[data->type].group_start_accum = GST_CLOCK_TIME_NONE; - else if (!GST_CLOCK_TIME_IS_VALID (data->group->selector[data->type]. - group_start_accum)) + else if (!GST_CLOCK_TIME_IS_VALID (data->group->selector[data-> + type].group_start_accum)) data->group->selector[data->type].group_start_accum = segment->accum; } else if (GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_STOP) { gst_segment_init (&data->playbin->segments[index], GST_FORMAT_UNDEFINED); @@ -2974,8 +2943,8 @@ autoplug_continue_cb (GstElement * element, GstPad * pad, GstCaps * caps, GstPad *text_sinkpad = NULL; text_sink = - (group->playbin->text_sink) ? gst_object_ref (group->playbin-> - text_sink) : NULL; + (group->playbin->text_sink) ? gst_object_ref (group-> + playbin->text_sink) : NULL; if (text_sink) text_sinkpad = gst_element_get_static_pad (text_sink, "sink"); diff --git a/gst/playback/gstscreenshot.c b/gst/playback/gstscreenshot.c index 6d09c37..ae7f85d 100644 --- a/gst/playback/gstscreenshot.c +++ b/gst/playback/gstscreenshot.c @@ -26,6 +26,38 @@ #include "gstscreenshot.h" +void +gst_play_marshal_BUFFER__BOXED (GClosure * closure, + GValue * return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) +{ + typedef GstBuffer *(*GMarshalFunc_OBJECT__BOXED) (gpointer data1, + gpointer arg_1, gpointer data2); + register GMarshalFunc_OBJECT__BOXED callback; + register GCClosure *cc = (GCClosure *) closure; + register gpointer data1, data2; + GstBuffer *v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } else { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = + (GMarshalFunc_OBJECT__BOXED) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, g_value_get_boxed (param_values + 1), data2); + + gst_value_take_buffer (return_value, v_return); +} + static void feed_fakesrc (GstElement * src, GstBuffer * buf, GstPad * pad, gpointer data) { diff --git a/gst/playback/gstscreenshot.h b/gst/playback/gstscreenshot.h index c17215b..4647a32 100644 --- a/gst/playback/gstscreenshot.h +++ b/gst/playback/gstscreenshot.h @@ -24,6 +24,12 @@ G_BEGIN_DECLS +void gst_play_marshal_BUFFER__BOXED (GClosure * closure, + GValue * return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data); + GstBuffer * gst_play_frame_conv_convert (GstBuffer *buf, GstCaps *to); G_END_DECLS -- 2.7.4