+2004-01-15 David Schleef <ds@schleef.org>
+
+ * ext/esd/esdsink.c: (gst_esdsink_class_init): Remove property
+ that handles osssink fallback.
+ * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_init),
+ (gst_audio_convert_getcaps):
+ * gst/qtdemux/qtdemux.c: (qtdemux_audio_caps):
+ Add audio/x-qdm2 for QDM2 audio.
+ * gst/sine/gstsinesrc.c: (gst_sinesrc_get):
+ * gst/sine/gstsinesrc.h: Add example of how to implement tags.
+ * gst/videoscale/gstvideoscale.c: (gst_videoscale_getcaps):
+ Decrease minimum size to 16x16.
+ * gst/wavparse/gstwavparse.c:
+ Convert disabled pad template caps to new caps.
+ * sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get):
+ * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
+ (gst_xvimagesink_chain): Throw element error when display cannot
+ be opened. Increase minimum framerate to 1.0. Check the data
+ free function on a buffer to make sure it is the type we expect
+ before manipulating it.
+
2004-01-15 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
/* gstreamer functions */
static void gst_audio_convert_chain (GstPad *pad, GstData *_data);
static GstPadLinkReturn gst_audio_convert_link (GstPad *pad, const GstCaps *caps);
+static GstCaps * gst_audio_convert_getcaps (GstPad *pad);
static GstElementStateReturn gst_audio_convert_change_state (GstElement *element);
/* actual work */
/* sinkpad */
this->sink = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_audio_convert_sink_template), "sink");
+ gst_pad_set_getcaps_function (this->sink, gst_audio_convert_getcaps);
gst_pad_set_link_function (this->sink, gst_audio_convert_link);
gst_pad_set_getcaps_function (this->sink, gst_audioconvert_getcaps);
gst_element_add_pad (GST_ELEMENT(this), this->sink);
/* srcpad */
this->src = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_audio_convert_src_template), "src");
+ gst_pad_set_getcaps_function (this->src, gst_audio_convert_getcaps);
gst_pad_set_link_function (this->src, gst_audio_convert_link);
gst_pad_set_getcaps_function (this->src, gst_audioconvert_getcaps);
gst_element_add_pad (GST_ELEMENT(this), this->src);
gst_pad_push (this->src, GST_DATA (buf));
}
+static GstCaps *
+gst_audio_convert_getcaps (GstPad *pad)
+{
+ GstAudioConvert *this;
+ GstPad *otherpad;
+ GstCaps *othercaps;
+ GstCaps *caps;
+ int i;
+
+ g_return_val_if_fail(GST_IS_PAD(pad), NULL);
+ g_return_val_if_fail(GST_IS_AUDIO_CONVERT(GST_OBJECT_PARENT (pad)), NULL);
+ this = GST_AUDIO_CONVERT(GST_OBJECT_PARENT (pad));
+
+ otherpad = (pad == this->src) ? this->sink : this->src;
+
+ othercaps = gst_pad_get_allowed_caps (otherpad);
+
+ for (i=0;i<gst_caps_get_size (othercaps); i++) {
+ GstStructure *structure;
+
+ structure = gst_caps_get_structure (othercaps, i);
+ gst_structure_remove_field (structure, "channels");
+ gst_structure_remove_field (structure, "endianness");
+ gst_structure_remove_field (structure, "width");
+ gst_structure_remove_field (structure, "depth");
+ gst_structure_remove_field (structure, "signed");
+ }
+ caps = gst_caps_intersect (othercaps, gst_pad_get_pad_template_caps (pad));
+ gst_caps_free(othercaps);
+
+ return caps;
+}
+
static GstPadLinkReturn
gst_audio_convert_link (GstPad *pad, const GstCaps *caps)
{
g_return_val_if_fail (pad != NULL, NULL);
src = GST_SINESRC (gst_pad_get_parent (pad));
+ if (!src->tags_pushed) {
+ GstTagList *taglist;
+
+ taglist = gst_tag_list_new ();
+
+ gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND,
+ GST_TAG_DESCRIPTION, "sine wave", NULL);
+
+ gst_element_found_tags_for_pad (GST_ELEMENT (src), pad, 0, taglist);
+ src->tags_pushed = TRUE;
+ }
+
tdiff = src->samples_per_buffer * GST_SECOND / src->samplerate;
/* note: the 2 is because of the format we use */
guint64 offset;
gdouble accumulator;
+
+ gboolean tags_pushed;
};
struct _GstSineSrcClass {
GstStructure *structure = gst_caps_get_structure (caps, i);
gst_structure_set (structure,
- "width", GST_TYPE_INT_RANGE, 100, G_MAXINT,
- "height", GST_TYPE_INT_RANGE, 100, G_MAXINT,
+ "width", GST_TYPE_INT_RANGE, 16, G_MAXINT,
+ "height", GST_TYPE_INT_RANGE, 16, G_MAXINT,
NULL);
}
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-raw-rgb, "
- "framerate = (double) [ 0, MAX ], "
+ "framerate = (double) [ 1.0, 100.0 ], "
"width = (int) [ 0, MAX ], "
"height = (int) [ 0, MAX ]")
);
{
g_mutex_unlock (ximagesink->x_lock);
g_free (xcontext);
+ gst_element_error (GST_ELEMENT (ximagesink), "Could not open display");
return NULL;
}
/* Object header */
#include "xvimagesink.h"
+static void gst_xvimagesink_buffer_free (GstBuffer *buffer);
+
/* ElementFactory information */
static GstElementDetails gst_xvimagesink_details = GST_ELEMENT_DETAILS (
"Video sink",
GST_PAD_ALWAYS,
GST_STATIC_CAPS (
"video/x-raw-rgb, "
- "framerate = (double) [ 0, MAX ], "
+ "framerate = (double) [ 1.0, 100.0 ], "
"width = (int) [ 0, MAX ], "
"height = (int) [ 0, MAX ]; "
"video/x-raw-yuv, "
- "framerate = (double) [ 0, MAX ], "
+ "framerate = (double) [ 1.0, 100.0 ], "
"width = (int) [ 0, MAX ], "
"height = (int) [ 0, MAX ]"
)
{
g_mutex_unlock (xvimagesink->x_lock);
g_free (xcontext);
+ gst_element_error (GST_ELEMENT (xvimagesink), "Could not open display");
return NULL;
}
/* If this buffer has been allocated using our buffer management we simply
put the ximage which is in the PRIVATE pointer */
- if (GST_BUFFER_PRIVATE (buf))
+ /* FIXME: need to check for correct xvimagesink here? */
+ if (GST_BUFFER_FREE_DATA_FUNC (buf) == gst_xvimagesink_buffer_free)
{
gst_xvimagesink_xvimage_put (xvimagesink, GST_BUFFER_PRIVATE (buf));
}