diff --git a/gst/inter/gstinteraudiosink.c b/gst/inter/gstinteraudiosink.c index db81811473..91285f126d 100644 --- a/gst/inter/gstinteraudiosink.c +++ b/gst/inter/gstinteraudiosink.c @@ -19,14 +19,21 @@ /** * SECTION:element-gstinteraudiosink * - * The interaudiosink element does FIXME stuff. + * The interaudiosink element is an audio sink element. It is used + * in connection with a interaudiosrc element in a different pipeline, + * similar to intervideosink and intervideosrc. * * * Example launch line * |[ - * gst-launch -v fakesrc ! interaudiosink ! FIXME ! fakesink + * gst-launch -v audiotestsrc ! queue ! interaudiosink * ]| - * FIXME Describe what the pipeline does. + * + * The interaudiosink element cannot be used effectively with gst-launch, + * as it requires a second pipeline in the application to receive the + * audio. + * See the gstintertest.c example in the gst-plugins-bad source code for + * more details. * */ @@ -91,8 +98,7 @@ GST_STATIC_PAD_TEMPLATE ("sink", "endianness = (int) BYTE_ORDER, " "signed = (boolean) true, " "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]") + "depth = (int) 16, " "rate = (int) 48000, " "channels = (int) 2") ); @@ -113,8 +119,11 @@ gst_inter_audio_sink_base_init (gpointer g_class) gst_element_class_add_static_pad_template (element_class, &gst_inter_audio_sink_sink_template); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME "); + gst_element_class_set_details_simple (element_class, + "Internal audio sink", + "Sink/Audio", + "Virtual audio sink for internal process communication", + "David Schleef "); } static void @@ -163,16 +172,20 @@ static void gst_inter_audio_sink_init (GstInterAudioSink * interaudiosink, GstInterAudioSinkClass * interaudiosink_class) { - interaudiosink->surface = gst_inter_surface_get ("default"); + interaudiosink->channel = g_strdup ("default"); } void gst_inter_audio_sink_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - /* GstInterAudioSink *interaudiosink = GST_INTER_AUDIO_SINK (object); */ + GstInterAudioSink *interaudiosink = GST_INTER_AUDIO_SINK (object); switch (property_id) { + case PROP_CHANNEL: + g_free (interaudiosink->channel); + interaudiosink->channel = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -183,9 +196,12 @@ void gst_inter_audio_sink_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - /* GstInterAudioSink *interaudiosink = GST_INTER_AUDIO_SINK (object); */ + GstInterAudioSink *interaudiosink = GST_INTER_AUDIO_SINK (object); switch (property_id) { + case PROP_CHANNEL: + g_value_set_string (value, interaudiosink->channel); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -261,6 +277,11 @@ gst_inter_audio_sink_get_times (GstBaseSink * sink, GstBuffer * buffer, static gboolean gst_inter_audio_sink_start (GstBaseSink * sink) { + GstInterAudioSink *interaudiosink = GST_INTER_AUDIO_SINK (sink); + + GST_DEBUG ("start"); + + interaudiosink->surface = gst_inter_surface_get (interaudiosink->channel); return TRUE; } @@ -276,6 +297,9 @@ gst_inter_audio_sink_stop (GstBaseSink * sink) gst_adapter_clear (interaudiosink->surface->audio_adapter); g_mutex_unlock (interaudiosink->surface->mutex); + gst_inter_surface_unref (interaudiosink->surface); + interaudiosink->surface = NULL; + return TRUE; } diff --git a/gst/inter/gstinteraudiosink.h b/gst/inter/gstinteraudiosink.h index b0a32769ec..5ea09997ad 100644 --- a/gst/inter/gstinteraudiosink.h +++ b/gst/inter/gstinteraudiosink.h @@ -39,6 +39,7 @@ struct _GstInterAudioSink GstBaseSink base_interaudiosink; GstInterSurface *surface; + char *channel; int fps_n; int fps_d; diff --git a/gst/inter/gstinteraudiosrc.c b/gst/inter/gstinteraudiosrc.c index 48641a53ed..0a136ee1c4 100644 --- a/gst/inter/gstinteraudiosrc.c +++ b/gst/inter/gstinteraudiosrc.c @@ -19,14 +19,19 @@ /** * SECTION:element-gstinteraudiosrc * - * The interaudiosrc element does FIXME stuff. + * The interaudiosrc element is an audio source element. It is used + * in connection with a interaudiosink element in a different pipeline. * * * Example launch line * |[ - * gst-launch -v fakesrc ! interaudiosrc ! FIXME ! fakesink + * gst-launch -v interaudiosrc ! queue ! audiosink * ]| - * FIXME Describe what the pipeline does. + * + * The interaudiosrc element cannot be used effectively with gst-launch, + * as it requires a second pipeline in the application to send audio. + * See the gstintertest.c example in the gst-plugins-bad source code for + * more details. * */ @@ -93,8 +98,7 @@ GST_STATIC_PAD_TEMPLATE ("src", "endianness = (int) BYTE_ORDER, " "signed = (boolean) true, " "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]") + "depth = (int) 16, " "rate = (int) 48000, " "channels = (int) 2") ); @@ -115,8 +119,11 @@ gst_inter_audio_src_base_init (gpointer g_class) gst_element_class_add_static_pad_template (element_class, &gst_inter_audio_src_src_template); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME "); + gst_element_class_set_details_simple (element_class, + "Internal audio source", + "Source/Audio", + "Virtual audio source for internal process communication", + "David Schleef "); } static void @@ -175,16 +182,20 @@ gst_inter_audio_src_init (GstInterAudioSrc * interaudiosrc, gst_base_src_set_live (GST_BASE_SRC (interaudiosrc), TRUE); gst_base_src_set_blocksize (GST_BASE_SRC (interaudiosrc), -1); - interaudiosrc->surface = gst_inter_surface_get ("default"); + interaudiosrc->channel = g_strdup ("default"); } void gst_inter_audio_src_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - /* GstInterAudioSrc *interaudiosrc = GST_INTER_AUDIO_SRC (object); */ + GstInterAudioSrc *interaudiosrc = GST_INTER_AUDIO_SRC (object); switch (property_id) { + case PROP_CHANNEL: + g_free (interaudiosrc->channel); + interaudiosrc->channel = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -195,9 +206,12 @@ void gst_inter_audio_src_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - /* GstInterAudioSrc *interaudiosrc = GST_INTER_AUDIO_SRC (object); */ + GstInterAudioSrc *interaudiosrc = GST_INTER_AUDIO_SRC (object); switch (property_id) { + case PROP_CHANNEL: + g_value_set_string (value, interaudiosrc->channel); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -282,6 +296,8 @@ gst_inter_audio_src_start (GstBaseSrc * src) GST_DEBUG_OBJECT (interaudiosrc, "start"); + interaudiosrc->surface = gst_inter_surface_get (interaudiosrc->channel); + return TRUE; } @@ -292,6 +308,9 @@ gst_inter_audio_src_stop (GstBaseSrc * src) GST_DEBUG_OBJECT (interaudiosrc, "stop"); + gst_inter_surface_unref (interaudiosrc->surface); + interaudiosrc->surface = NULL; + return TRUE; } @@ -346,12 +365,20 @@ static gboolean gst_inter_audio_src_event (GstBaseSrc * src, GstEvent * event) { GstInterAudioSrc *interaudiosrc = GST_INTER_AUDIO_SRC (src); + gboolean ret; GST_DEBUG_OBJECT (interaudiosrc, "event"); - return TRUE; + switch (GST_EVENT_TYPE (event)) { + default: + ret = GST_BASE_SRC_CLASS (parent_class)->event (src, event); + } + + return ret; } +#define SIZE 1600 + static GstFlowReturn gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size, GstBuffer ** buf) @@ -366,31 +393,31 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size, g_mutex_lock (interaudiosrc->surface->mutex); n = gst_adapter_available (interaudiosrc->surface->audio_adapter) / 4; - if (n > 1600 * 2) { - GST_DEBUG ("flushing %d samples", 800); - gst_adapter_flush (interaudiosrc->surface->audio_adapter, 800 * 4); - n -= 800; + if (n > SIZE * 2) { + GST_DEBUG ("flushing %d samples", SIZE / 2); + gst_adapter_flush (interaudiosrc->surface->audio_adapter, (SIZE / 2) * 4); + n -= (SIZE / 2); } - if (n > 1600) - n = 1600; + if (n > SIZE) + n = SIZE; if (n > 0) { buffer = gst_adapter_take_buffer (interaudiosrc->surface->audio_adapter, n * 4); } g_mutex_unlock (interaudiosrc->surface->mutex); - if (n < 1600) { - GstBuffer *newbuf = gst_buffer_new_and_alloc (1600 * 4); + if (n < SIZE) { + GstBuffer *newbuf = gst_buffer_new_and_alloc (SIZE * 4); - GST_DEBUG ("creating %d samples of silence", 1600 - n); - memset (GST_BUFFER_DATA (newbuf) + n * 4, 0, 1600 * 4 - n * 4); + GST_DEBUG ("creating %d samples of silence", SIZE - n); + memset (GST_BUFFER_DATA (newbuf) + n * 4, 0, SIZE * 4 - n * 4); if (buffer) { memcpy (GST_BUFFER_DATA (newbuf), GST_BUFFER_DATA (buffer), n * 4); gst_buffer_unref (buffer); } buffer = newbuf; } - n = 1600; + n = SIZE; GST_BUFFER_OFFSET (buffer) = interaudiosrc->n_samples; GST_BUFFER_OFFSET_END (buffer) = interaudiosrc->n_samples + n; @@ -430,10 +457,34 @@ static gboolean gst_inter_audio_src_query (GstBaseSrc * src, GstQuery * query) { GstInterAudioSrc *interaudiosrc = GST_INTER_AUDIO_SRC (src); + gboolean ret; GST_DEBUG_OBJECT (interaudiosrc, "query"); - return TRUE; + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_LATENCY:{ + GstClockTime min_latency, max_latency; + + min_latency = 30 * gst_util_uint64_scale_int (GST_SECOND, SIZE, 48000); + + max_latency = min_latency; + + GST_ERROR_OBJECT (src, + "report latency min %" GST_TIME_FORMAT " max %" GST_TIME_FORMAT, + GST_TIME_ARGS (min_latency), GST_TIME_ARGS (max_latency)); + + gst_query_set_latency (query, + gst_base_src_is_live (src), min_latency, max_latency); + + ret = TRUE; + break; + } + default: + ret = GST_BASE_SRC_CLASS (parent_class)->query (src, query); + break; + } + + return ret; } static gboolean diff --git a/gst/inter/gstinteraudiosrc.h b/gst/inter/gstinteraudiosrc.h index 958a1a53d9..4ccc7f5c51 100644 --- a/gst/inter/gstinteraudiosrc.h +++ b/gst/inter/gstinteraudiosrc.h @@ -39,6 +39,7 @@ struct _GstInterAudioSrc GstBaseSrc base_interaudiosrc; GstInterSurface *surface; + char *channel; guint64 n_samples; int sample_rate; diff --git a/gst/inter/gstintersubsink.c b/gst/inter/gstintersubsink.c index 1328b18a5d..a42b3e5731 100644 --- a/gst/inter/gstintersubsink.c +++ b/gst/inter/gstintersubsink.c @@ -19,14 +19,19 @@ /** * SECTION:element-gstintersubsink * - * The intersubsink element does FIXME stuff. + * The intersubsink element is a subtitle sink element. It is used + * in connection with a intersubsrc element in a different pipeline. * * * Example launch line * |[ - * gst-launch -v fakesrc ! intersubsink ! FIXME ! fakesink + * gst-launch -v ... ! intersubsink * ]| - * FIXME Describe what the pipeline does. + * + * The intersubsink element cannot be used effectively with gst-launch, + * as it requires a second pipeline in the application to send audio. + * See the gstintertest.c example in the gst-plugins-bad source code for + * more details. * */ @@ -73,7 +78,8 @@ static gboolean gst_inter_sub_sink_unlock_stop (GstBaseSink * sink); enum { - PROP_0 + PROP_0, + PROP_CHANNEL }; /* pad templates */ @@ -103,8 +109,11 @@ gst_inter_sub_sink_base_init (gpointer g_class) gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_inter_sub_sink_sink_template)); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME "); + gst_element_class_set_details_simple (element_class, + "Internal subtitle sink", + "Sink/Subtitle", + "Virtual subtitle sink for internal process communication", + "David Schleef "); } static void @@ -139,6 +148,11 @@ gst_inter_sub_sink_class_init (GstInterSubSinkClass * klass) base_sink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_inter_sub_sink_unlock_stop); + g_object_class_install_property (gobject_class, PROP_CHANNEL, + g_param_spec_string ("channel", "Channel", + "Channel name to match inter src and sink elements", + "default", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + } static void @@ -146,7 +160,7 @@ gst_inter_sub_sink_init (GstInterSubSink * intersubsink, GstInterSubSinkClass * intersubsink_class) { - intersubsink->surface = gst_inter_surface_get ("default"); + intersubsink->channel = g_strdup ("default"); intersubsink->fps_n = 1; intersubsink->fps_d = 1; @@ -156,9 +170,13 @@ void gst_inter_sub_sink_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - /* GstInterSubSink *intersubsink = GST_INTER_SUB_SINK (object); */ + GstInterSubSink *intersubsink = GST_INTER_SUB_SINK (object); switch (property_id) { + case PROP_CHANNEL: + g_free (intersubsink->channel); + intersubsink->channel = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -169,9 +187,12 @@ void gst_inter_sub_sink_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - /* GstInterSubSink *intersubsink = GST_INTER_SUB_SINK (object); */ + GstInterSubSink *intersubsink = GST_INTER_SUB_SINK (object); switch (property_id) { + case PROP_CHANNEL: + g_value_set_string (value, intersubsink->channel); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -247,6 +268,9 @@ gst_inter_sub_sink_get_times (GstBaseSink * sink, GstBuffer * buffer, static gboolean gst_inter_sub_sink_start (GstBaseSink * sink) { + GstInterSubSink *intersubsink = GST_INTER_SUB_SINK (sink); + + intersubsink->surface = gst_inter_surface_get (intersubsink->channel); return TRUE; } @@ -263,6 +287,9 @@ gst_inter_sub_sink_stop (GstBaseSink * sink) intersubsink->surface->sub_buffer = NULL; g_mutex_unlock (intersubsink->surface->mutex); + gst_inter_surface_unref (intersubsink->surface); + intersubsink->surface = NULL; + return TRUE; } diff --git a/gst/inter/gstintersubsink.h b/gst/inter/gstintersubsink.h index be2da9b3b2..33b48f78f8 100644 --- a/gst/inter/gstintersubsink.h +++ b/gst/inter/gstintersubsink.h @@ -40,6 +40,7 @@ struct _GstInterSubSink GstPad *sinkpad; GstInterSurface *surface; + char *channel; int fps_n; int fps_d; diff --git a/gst/inter/gstintersubsrc.c b/gst/inter/gstintersubsrc.c index 60a29b3d75..437a3e1ea3 100644 --- a/gst/inter/gstintersubsrc.c +++ b/gst/inter/gstintersubsrc.c @@ -31,6 +31,8 @@ * * The intersubsrc element cannot be used effectively with gst-launch, * as it requires a second pipeline in the application to send subtitles. + * See the gstintertest.c example in the gst-plugins-bad source code for + * more details. * */ @@ -82,7 +84,8 @@ gst_inter_sub_src_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek, enum { - PROP_0 + PROP_0, + PROP_CHANNEL }; /* pad templates */ @@ -113,9 +116,10 @@ gst_inter_sub_src_base_init (gpointer g_class) gst_static_pad_template_get (&gst_inter_sub_src_src_template)); gst_element_class_set_details_simple (element_class, - "Inter-pipeline subtitle source", - "Source/Subtitle", "Inter-pipeline subtitle source", - "David Schleef "); + "Internal subtitle source", + "Source/Subtitle", + "Virtual subtitle source for internal process communication", + "David Schleef "); } static void @@ -159,7 +163,10 @@ gst_inter_sub_src_class_init (GstInterSubSrcClass * klass) base_src_class->prepare_seek_segment = GST_DEBUG_FUNCPTR (gst_inter_sub_src_prepare_seek_segment); - + g_object_class_install_property (gobject_class, PROP_CHANNEL, + g_param_spec_string ("channel", "Channel", + "Channel name to match inter src and sink elements", + "default", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } static void @@ -173,16 +180,20 @@ gst_inter_sub_src_init (GstInterSubSrc * intersubsrc, gst_base_src_set_format (GST_BASE_SRC (intersubsrc), GST_FORMAT_TIME); gst_base_src_set_live (GST_BASE_SRC (intersubsrc), TRUE); - intersubsrc->surface = gst_inter_surface_get ("default"); + intersubsrc->channel = g_strdup ("default"); } void gst_inter_sub_src_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - /* GstInterSubSrc *intersubsrc = GST_INTER_SUB_SRC (object); */ + GstInterSubSrc *intersubsrc = GST_INTER_SUB_SRC (object); switch (property_id) { + case PROP_CHANNEL: + g_free (intersubsrc->channel); + intersubsrc->channel = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -193,9 +204,12 @@ void gst_inter_sub_src_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - /* GstInterSubSrc *intersubsrc = GST_INTER_SUB_SRC (object); */ + GstInterSubSrc *intersubsrc = GST_INTER_SUB_SRC (object); switch (property_id) { + case PROP_CHANNEL: + g_value_set_string (value, intersubsrc->channel); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -270,6 +284,8 @@ gst_inter_sub_src_start (GstBaseSrc * src) GST_DEBUG_OBJECT (intersubsrc, "start"); + intersubsrc->surface = gst_inter_surface_get (intersubsrc->channel); + return TRUE; } @@ -280,6 +296,9 @@ gst_inter_sub_src_stop (GstBaseSrc * src) GST_DEBUG_OBJECT (intersubsrc, "stop"); + gst_inter_surface_unref (intersubsrc->surface); + intersubsrc->surface = NULL; + return TRUE; } @@ -334,10 +353,16 @@ static gboolean gst_inter_sub_src_event (GstBaseSrc * src, GstEvent * event) { GstInterSubSrc *intersubsrc = GST_INTER_SUB_SRC (src); + gboolean ret; GST_DEBUG_OBJECT (intersubsrc, "event"); - return TRUE; + switch (GST_EVENT_TYPE (event)) { + default: + ret = GST_BASE_SRC_CLASS (parent_class)->event (src, event); + } + + return ret; } static GstFlowReturn @@ -409,10 +434,16 @@ static gboolean gst_inter_sub_src_query (GstBaseSrc * src, GstQuery * query) { GstInterSubSrc *intersubsrc = GST_INTER_SUB_SRC (src); + gboolean ret; GST_DEBUG_OBJECT (intersubsrc, "query"); - return TRUE; + switch (GST_QUERY_TYPE (query)) { + default: + ret = GST_BASE_SRC_CLASS (parent_class)->query (src, query); + } + + return ret; } static gboolean diff --git a/gst/inter/gstintersubsrc.h b/gst/inter/gstintersubsrc.h index 74bfed1e75..38f7a6696b 100644 --- a/gst/inter/gstintersubsrc.h +++ b/gst/inter/gstintersubsrc.h @@ -40,6 +40,7 @@ struct _GstInterSubSrc GstPad *srcpad; GstInterSurface *surface; + char *channel; int rate; int n_frames; diff --git a/gst/inter/gstintertest.c b/gst/inter/gstintertest.c index ff4c65f474..269d642792 100644 --- a/gst/inter/gstintertest.c +++ b/gst/inter/gstintertest.c @@ -1,5 +1,5 @@ /* GstInterTest - * Copyright (C) 2011 FIXME + * Copyright (C) 2011 David Schleef * Copyright (C) 2010 Entropy Wave Inc * * Redistribution and use in source and binary forms, with or without @@ -86,7 +86,7 @@ main (int argc, char *argv[]) g_thread_init (NULL); #endif - context = g_option_context_new ("- FIXME"); + context = g_option_context_new ("- Internal src/sink test"); g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); g_option_context_add_group (context, gst_init_get_option_group ()); if (!g_option_context_parse (context, &argc, &argv, &error)) { @@ -188,14 +188,14 @@ gst_inter_test_create_pipeline_vts (GstInterTest * intertest) pipe_desc = g_string_new (""); - g_string_append (pipe_desc, "videotestsrc name=source num-buffers=10000 ! "); + g_string_append (pipe_desc, "videotestsrc name=source num-buffers=100 ! "); g_string_append (pipe_desc, "video/x-raw-yuv,format=(fourcc)I420,width=320,height=240 ! "); g_string_append (pipe_desc, "timeoverlay ! "); g_string_append (pipe_desc, "intervideosink name=sink sync=true "); g_string_append (pipe_desc, - "audiotestsrc samplesperbuffer=1600 num-buffers=100 ! "); - g_string_append (pipe_desc, "interaudiosink "); + "audiotestsrc samplesperbuffer=1600 num-buffers=100 ! audioconvert ! "); + g_string_append (pipe_desc, "interaudiosink sync=true "); if (verbose) g_print ("pipeline: %s\n", pipe_desc->str); @@ -232,7 +232,7 @@ gst_inter_test_create_pipeline_server (GstInterTest * intertest) g_string_append (pipe_desc, "intervideosrc ! queue ! "); g_string_append (pipe_desc, "xvimagesink name=sink "); g_string_append (pipe_desc, "interaudiosrc ! queue ! "); - g_string_append (pipe_desc, "alsasink latency-time=100000000 "); + g_string_append (pipe_desc, "alsasink "); if (verbose) g_print ("pipeline: %s\n", pipe_desc->str); @@ -337,7 +337,7 @@ gst_inter_test_handle_paused_to_ready (GstInterTest * intertest) static void gst_inter_test_handle_ready_to_null (GstInterTest * intertest) { - g_main_loop_quit (intertest->main_loop); + //g_main_loop_quit (intertest->main_loop); } diff --git a/gst/inter/gstintervideosink.c b/gst/inter/gstintervideosink.c index 856a791613..554bf1afaf 100644 --- a/gst/inter/gstintervideosink.c +++ b/gst/inter/gstintervideosink.c @@ -19,14 +19,20 @@ /** * SECTION:element-gstintervideosink * - * The intervideosink element does FIXME stuff. + * The intervideosink element is a video sink element. It is used + * in connection with an intervideosrc element in a different pipeline, + * similar to interaudiosink and interaudiosrc. * * * Example launch line * |[ - * gst-launch -v fakesrc ! intervideosink ! FIXME ! fakesink + * gst-launch -v videotestsrc ! intervideosink * ]| - * FIXME Describe what the pipeline does. + * + * The intervideosink element cannot be used effectively with gst-launch, + * as it requires a second pipeline in the application to send video to. + * See the gstintertest.c example in the gst-plugins-bad source code for + * more details. * */ @@ -107,8 +113,11 @@ gst_inter_video_sink_base_init (gpointer g_class) gst_element_class_add_static_pad_template (element_class, &gst_inter_video_sink_sink_template); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME "); + gst_element_class_set_details_simple (element_class, + "Internal video sink", + "Sink/Video", + "Virtual video sink for internal process communication", + "David Schleef "); } static void @@ -155,8 +164,6 @@ static void gst_inter_video_sink_init (GstInterVideoSink * intervideosink, GstInterVideoSinkClass * intervideosink_class) { - intervideosink->surface = gst_inter_surface_get ("default"); - intervideosink->channel = g_strdup ("default"); } diff --git a/gst/inter/gstintervideosrc.c b/gst/inter/gstintervideosrc.c index 4fa1df8eae..e58cb7fc4f 100644 --- a/gst/inter/gstintervideosrc.c +++ b/gst/inter/gstintervideosrc.c @@ -19,14 +19,18 @@ /** * SECTION:element-gstintervideosrc * - * The intervideosrc element does FIXME stuff. + * The intervideosrc element is a video source element. It is used + * in connection with a intervideosink element in a different pipeline, + * similar to interaudiosink and interaudiosrc. * * * Example launch line * |[ - * gst-launch -v fakesrc ! intervideosrc ! FIXME ! fakesink + * gst-launch -v intervideosrc ! queue ! xvimagesink * ]| - * FIXME Describe what the pipeline does. + * + * The intersubsrc element cannot be used effectively with gst-launch, + * as it requires a second pipeline in the application to send subtitles. * */ @@ -111,8 +115,11 @@ gst_inter_video_src_base_init (gpointer g_class) gst_element_class_add_static_pad_template (element_class, &gst_inter_video_src_src_template); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME "); + gst_element_class_set_details_simple (element_class, + "Internal video source", + "Source/Video", + "Virtual video source for internal process communication", + "David Schleef "); } static void @@ -361,10 +368,16 @@ static gboolean gst_inter_video_src_event (GstBaseSrc * src, GstEvent * event) { GstInterVideoSrc *intervideosrc = GST_INTER_VIDEO_SRC (src); + gboolean ret; GST_DEBUG_OBJECT (intervideosrc, "event"); - return TRUE; + switch (GST_EVENT_TYPE (event)) { + default: + ret = GST_BASE_SRC_CLASS (parent_class)->event (src, event); + } + + return ret; } static GstFlowReturn @@ -450,10 +463,16 @@ static gboolean gst_inter_video_src_query (GstBaseSrc * src, GstQuery * query) { GstInterVideoSrc *intervideosrc = GST_INTER_VIDEO_SRC (src); + gboolean ret; GST_DEBUG_OBJECT (intervideosrc, "query"); - return TRUE; + switch (GST_QUERY_TYPE (query)) { + default: + ret = GST_BASE_SRC_CLASS (parent_class)->query (src, query); + } + + return ret; } static gboolean