coreelements: move input-selector and output-selector to core

Moved to core from gst-plugins-bad.

https://bugzilla.gnome.org/show_bug.cgi?id=614306
This commit is contained in:
Tim-Philipp Müller 2010-12-30 18:57:13 +00:00
parent 917278c532
commit 52617c91f3
3 changed files with 77 additions and 3 deletions

View file

@ -12,6 +12,8 @@ libgstcoreelements_la_SOURCES = \
gstfilesink.c \
gstfilesrc.c \
gstidentity.c \
gstinputselector.c \
gstoutputselector.c \
gstmultiqueue.c \
gstqueue.c \
gstqueue2.c \
@ -35,6 +37,8 @@ noinst_HEADERS = \
gstfilesink.h \
gstfilesrc.h \
gstidentity.h \
gstinputselector.h \
gstoutputselector.h \
gstmultiqueue.h \
gstqueue.h \
gstqueue2.h \

View file

@ -35,6 +35,8 @@
#include "gstfilesink.h"
#include "gstfilesrc.h"
#include "gstidentity.h"
#include "gstinputselector.h"
#include "gstoutputselector.h"
#include "gstmultiqueue.h"
#include "gstqueue.h"
#include "gstqueue2.h"
@ -60,6 +62,8 @@ static struct _elements_entry _elements[] = {
#endif
{"filesrc", GST_RANK_PRIMARY, gst_file_src_get_type},
{"identity", GST_RANK_NONE, gst_identity_get_type},
{"input-selector", GST_RANK_NONE, gst_input_selector_get_type},
{"output-selector", GST_RANK_NONE, gst_output_selector_get_type},
{"queue", GST_RANK_NONE, gst_queue_get_type},
{"queue2", GST_RANK_NONE, gst_queue2_get_type},
{"filesink", GST_RANK_PRIMARY, gst_file_sink_get_type},

View file

@ -36,7 +36,6 @@
#include <string.h>
#include "gstinputselector.h"
#include "gstselector-marshal.h"
GST_DEBUG_CATEGORY_STATIC (input_selector_debug);
#define GST_CAT_DEFAULT input_selector_debug
@ -701,6 +700,73 @@ static gint64 gst_input_selector_block (GstInputSelector * self);
static void gst_input_selector_switch (GstInputSelector * self,
GstPad * pad, gint64 stop_time, gint64 start_time);
/* FIXME: create these marshallers using glib-genmarshal */
#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
static void
gst_input_selector_marshal_INT64__VOID (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 gint64 (*GMarshalFunc_INT64__VOID) (gpointer data1, gpointer data2);
register GMarshalFunc_INT64__VOID callback;
register GCClosure *cc = (GCClosure *) closure;
register gpointer data1, data2;
gint64 v_return;
g_return_if_fail (return_value != NULL);
g_return_if_fail (n_param_values == 1);
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_INT64__VOID) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1, data2);
g_value_set_int64 (return_value, v_return);
}
static void
gst_input_selector_marshal_VOID__OBJECT_INT64_INT64 (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 void (*GMarshalFunc_VOID__OBJECT_INT64_INT64) (gpointer data1,
gpointer arg_1, gint64 arg_2, gint64 arg_3, gpointer data2);
register GMarshalFunc_VOID__OBJECT_INT64_INT64 callback;
register GCClosure *cc = (GCClosure *) closure;
register gpointer data1, data2;
g_return_if_fail (n_param_values == 4);
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_VOID__OBJECT_INT64_INT64) (marshal_data ? marshal_data :
cc->callback);
callback (data1,
g_marshal_value_peek_object (param_values + 1),
g_marshal_value_peek_int64 (param_values + 2),
g_marshal_value_peek_int64 (param_values + 3), data2);
}
#define _do_init(bla) \
GST_DEBUG_CATEGORY_INIT (input_selector_debug, \
"input-selector", 0, "An input stream selector element");
@ -764,7 +830,7 @@ gst_input_selector_class_init (GstInputSelectorClass * klass)
g_signal_new ("block", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstInputSelectorClass, block), NULL, NULL,
gst_selector_marshal_INT64__VOID, G_TYPE_INT64, 0);
gst_input_selector_marshal_INT64__VOID, G_TYPE_INT64, 0);
/**
* GstInputSelector::switch:
* @inputselector: the #GstInputSelector
@ -814,7 +880,7 @@ gst_input_selector_class_init (GstInputSelectorClass * klass)
gst_input_selector_signals[SIGNAL_SWITCH] =
g_signal_new ("switch", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstInputSelectorClass, switch_),
NULL, NULL, gst_selector_marshal_VOID__OBJECT_INT64_INT64,
NULL, NULL, gst_input_selector_marshal_VOID__OBJECT_INT64_INT64,
G_TYPE_NONE, 3, GST_TYPE_PAD, G_TYPE_INT64, G_TYPE_INT64);
gstelement_class->request_new_pad = gst_input_selector_request_new_pad;