diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-03-29 17:41:53 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-03-29 17:41:53 +0200 |
commit | 860ccd414dbb313fabf065b92838f0f39037584b (patch) | |
tree | 0d5c0d3510db3ca3d7e6487420e8d09f74ae1961 /gst/inter | |
parent | a9ec4d62a89dd53aa295af02c7d5f57ef936359b (diff) | |
parent | d84d98943af42ce645ee022207bcf04e747d2d4a (diff) | |
download | gstreamer-plugins-bad-860ccd414dbb313fabf065b92838f0f39037584b.tar.gz |
Merge remote-tracking branch 'origin/0.10'
Conflicts:
NEWS
RELEASE
common
configure.ac
docs/libs/gst-plugins-bad-libs-sections.txt
docs/plugins/gst-plugins-bad-plugins.args
docs/plugins/gst-plugins-bad-plugins.hierarchy
docs/plugins/gst-plugins-bad-plugins.interfaces
docs/plugins/inspect/plugin-adpcmdec.xml
docs/plugins/inspect/plugin-adpcmenc.xml
docs/plugins/inspect/plugin-assrender.xml
docs/plugins/inspect/plugin-audiovisualizers.xml
docs/plugins/inspect/plugin-autoconvert.xml
docs/plugins/inspect/plugin-bayer.xml
docs/plugins/inspect/plugin-bz2.xml
docs/plugins/inspect/plugin-camerabin2.xml
docs/plugins/inspect/plugin-celt.xml
docs/plugins/inspect/plugin-dataurisrc.xml
docs/plugins/inspect/plugin-debugutilsbad.xml
docs/plugins/inspect/plugin-dtmf.xml
docs/plugins/inspect/plugin-dtsdec.xml
docs/plugins/inspect/plugin-dvbsuboverlay.xml
docs/plugins/inspect/plugin-dvdspu.xml
docs/plugins/inspect/plugin-faac.xml
docs/plugins/inspect/plugin-faad.xml
docs/plugins/inspect/plugin-gsm.xml
docs/plugins/inspect/plugin-h264parse.xml
docs/plugins/inspect/plugin-mms.xml
docs/plugins/inspect/plugin-modplug.xml
docs/plugins/inspect/plugin-mpeg2enc.xml
docs/plugins/inspect/plugin-mpegdemux2.xml
docs/plugins/inspect/plugin-mpegtsdemux.xml
docs/plugins/inspect/plugin-mpegvideoparse.xml
docs/plugins/inspect/plugin-mplex.xml
docs/plugins/inspect/plugin-pcapparse.xml
docs/plugins/inspect/plugin-rawparse.xml
docs/plugins/inspect/plugin-rtpmux.xml
docs/plugins/inspect/plugin-rtpvp8.xml
docs/plugins/inspect/plugin-scaletempo.xml
docs/plugins/inspect/plugin-schro.xml
docs/plugins/inspect/plugin-sdp.xml
docs/plugins/inspect/plugin-segmentclip.xml
docs/plugins/inspect/plugin-shm.xml
docs/plugins/inspect/plugin-videomaxrate.xml
docs/plugins/inspect/plugin-videoparsersbad.xml
docs/plugins/inspect/plugin-vp8.xml
docs/plugins/inspect/plugin-y4mdec.xml
ext/celt/gstceltdec.c
ext/dts/gstdtsdec.c
ext/modplug/gstmodplug.cc
ext/opus/gstopusenc.c
gst-libs/gst/video/gstbasevideocodec.c
gst-libs/gst/video/gstbasevideocodec.h
gst-libs/gst/video/gstbasevideodecoder.c
gst-libs/gst/video/gstbasevideodecoder.h
gst-libs/gst/video/gstbasevideoencoder.c
gst-libs/gst/video/gstbasevideoencoder.h
gst/adpcmdec/Makefile.am
gst/audiovisualizers/gstbaseaudiovisualizer.c
gst/h264parse/gsth264parse.c
gst/mpegdemux/mpegtsparse.c
gst/mpegtsdemux/mpegtsbase.c
gst/mpegtsdemux/mpegtspacketizer.c
gst/mpegtsdemux/mpegtsparse.c
gst/mpegtsdemux/tsdemux.c
gst/mpegtsdemux/tsdemux.h
gst/mxf/mxfdemux.c
gst/rawparse/gstaudioparse.c
gst/videoparsers/gsth263parse.c
gst/videoparsers/gsth264parse.c
sys/d3dvideosink/d3dvideosink.c
sys/decklink/gstdecklinksink.cpp
sys/dvb/gstdvbsrc.c
sys/shm/gstshmsrc.c
sys/vdpau/h264/gstvdph264dec.c
sys/vdpau/mpeg/gstvdpmpegdec.c
tests/examples/opencv/gst_element_print_properties.c
win32/common/config.h
Diffstat (limited to 'gst/inter')
-rw-r--r-- | gst/inter/gstinteraudiosink.c | 46 | ||||
-rw-r--r-- | gst/inter/gstinteraudiosink.h | 1 | ||||
-rw-r--r-- | gst/inter/gstinteraudiosrc.c | 100 | ||||
-rw-r--r-- | gst/inter/gstinteraudiosrc.h | 1 | ||||
-rw-r--r-- | gst/inter/gstintersubsink.c | 45 | ||||
-rw-r--r-- | gst/inter/gstintersubsink.h | 1 | ||||
-rw-r--r-- | gst/inter/gstintersubsrc.c | 51 | ||||
-rw-r--r-- | gst/inter/gstintersubsrc.h | 1 | ||||
-rw-r--r-- | gst/inter/gstintertest.c | 14 | ||||
-rw-r--r-- | gst/inter/gstintervideosink.c | 21 | ||||
-rw-r--r-- | gst/inter/gstintervideosrc.c | 33 |
11 files changed, 240 insertions, 74 deletions
diff --git a/gst/inter/gstinteraudiosink.c b/gst/inter/gstinteraudiosink.c index e5ba92687..fd5987e35 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. * * <refsect2> * <title>Example launch line</title> * |[ - * 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. * </refsect2> */ @@ -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_pad_template (element_class, gst_static_pad_template_get (&gst_inter_audio_sink_sink_template)); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME <fixme@example.com>"); + gst_element_class_set_details_simple (element_class, + "Internal audio sink", + "Sink/Audio", + "Virtual audio sink for internal process communication", + "David Schleef <ds@schleef.org>"); } static void @@ -151,26 +160,32 @@ gst_inter_audio_sink_class_init (GstInterAudioSinkClass * klass) base_sink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_inter_audio_sink_unlock_stop); +#if 0 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)); +#endif } 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; @@ -181,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; @@ -259,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; } @@ -274,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 b0a32769e..5ea09997a 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 e659bf024..de2b2687a 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. * * <refsect2> * <title>Example launch line</title> * |[ - * 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. * </refsect2> */ @@ -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_pad_template (element_class, gst_static_pad_template_get (&gst_inter_audio_src_src_template)); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME <fixme@example.com>"); + gst_element_class_set_details_simple (element_class, + "Internal audio source", + "Source/Audio", + "Virtual audio source for internal process communication", + "David Schleef <ds@schleef.org>"); } static void @@ -159,11 +166,12 @@ gst_inter_audio_src_class_init (GstInterAudioSrcClass * klass) base_src_class->prepare_seek_segment = GST_DEBUG_FUNCPTR (gst_inter_audio_src_prepare_seek_segment); +#if 0 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)); - +#endif } static void @@ -174,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; @@ -194,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; @@ -281,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; } @@ -291,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; } @@ -345,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) @@ -365,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; @@ -429,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 958a1a53d..4ccc7f5c5 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 1328b18a5..a42b3e573 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. * * <refsect2> * <title>Example launch line</title> * |[ - * 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. * </refsect2> */ @@ -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 <fixme@example.com>"); + gst_element_class_set_details_simple (element_class, + "Internal subtitle sink", + "Sink/Subtitle", + "Virtual subtitle sink for internal process communication", + "David Schleef <ds@schleef.org>"); } 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 be2da9b3b..33b48f78f 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 60a29b3d7..437a3e1ea 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. * </refsect2> */ @@ -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 <ds@entropywave.com>"); + "Internal subtitle source", + "Source/Subtitle", + "Virtual subtitle source for internal process communication", + "David Schleef <ds@schleef.org>"); } 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 74bfed1e7..38f7a6696 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 ff4c65f47..269d64279 100644 --- a/gst/inter/gstintertest.c +++ b/gst/inter/gstintertest.c @@ -1,5 +1,5 @@ /* GstInterTest - * Copyright (C) 2011 FIXME <fixme@example.com> + * Copyright (C) 2011 David Schleef <ds@schleef.org> * 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 b6be4e99a..d80047e0d 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. * * <refsect2> * <title>Example launch line</title> * |[ - * 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. * </refsect2> */ @@ -107,8 +113,11 @@ gst_inter_video_sink_base_init (gpointer g_class) gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_inter_video_sink_sink_template)); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME <fixme@example.com>"); + gst_element_class_set_details_simple (element_class, + "Internal video sink", + "Sink/Video", + "Virtual video sink for internal process communication", + "David Schleef <ds@schleef.org>"); } 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 65fc7f0e5..ec323e372 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. * * <refsect2> * <title>Example launch line</title> * |[ - * 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. * </refsect2> */ @@ -111,8 +115,11 @@ gst_inter_video_src_base_init (gpointer g_class) gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_inter_video_src_src_template)); - gst_element_class_set_details_simple (element_class, "FIXME Long name", - "Generic", "FIXME Description", "FIXME <fixme@example.com>"); + gst_element_class_set_details_simple (element_class, + "Internal video source", + "Source/Video", + "Virtual video source for internal process communication", + "David Schleef <ds@schleef.org>"); } 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 |