2005-05-09 Wim Taymans <wim@fluendo.com>
+ * ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_setcaps),
+ (gst_vorbisenc_src_query), (gst_vorbisenc_sink_query),
+ (gst_vorbisenc_set_header_on_caps), (gst_vorbisenc_sink_event),
+ (gst_vorbisenc_chain):
+ * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
+ (gst_audio_convert_caps_remove_format_info),
+ (gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
+ (gst_audio_convert_fixate), (gst_audio_convert_channels):
+ Make caps writable before writing to it.
+ Fix negotiation in audioconvert some more.
+
+2005-05-09 Wim Taymans <wim@fluendo.com>
+
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
VorbisEnc *vorbisenc;
GstStructure *structure;
- vorbisenc = GST_VORBISENC (gst_pad_get_parent (pad));
+ vorbisenc = GST_VORBISENC (GST_PAD_PARENT (pad));
vorbisenc->setup = FALSE;
structure = gst_caps_get_structure (caps, 0);
gst_vorbisenc_push_buffer (vorbisenc, outbuf);
}
-static void
+static GstCaps *
gst_vorbisenc_set_header_on_caps (GstCaps * caps, GstBuffer * buf1,
GstBuffer * buf2, GstBuffer * buf3)
{
- GstStructure *structure = gst_caps_get_structure (caps, 0);
+ GstStructure *structure;
GValue list = { 0 };
GValue value = { 0 };
+ caps = gst_caps_make_writable (caps);
+ structure = gst_caps_get_structure (caps, 0);
+
/* mark buffers */
GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_IN_CAPS);
GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_IN_CAPS);
gst_structure_set_value (structure, "streamheader", &list);
g_value_unset (&value);
g_value_unset (&list);
+
+ return caps;
}
static gboolean
/* mark and put on caps */
caps = gst_pad_get_caps (vorbisenc->srcpad);
- gst_vorbisenc_set_header_on_caps (caps, buf1, buf2, buf3);
+ caps = gst_vorbisenc_set_header_on_caps (caps, buf1, buf2, buf3);
/* negotiate with these caps */
GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps);
gst_caps_unref (othercaps);
- /* set the rate on the caps */
+ /* set the rate on the caps, this has to work */
gst_structure_set (structure, "rate", G_TYPE_INT, ac_caps.rate, NULL);
gst_structure_set (structure, "channels", G_TYPE_INT, ac_caps.channels,
NULL);
+
if (strcmp (gst_structure_get_name (structure), "audio/x-raw-float") == 0) {
if (!ac_caps.is_int) {
+ /* copy over */
gst_structure_set (structure, "buffer-frames", G_TYPE_INT,
ac_caps.buffer_frames, NULL);
} else {
- gst_structure_set (structure, "buffer-frames", GST_TYPE_INT_RANGE, 0,
- G_MAXINT, NULL);
+ /* set to anything */
+ gst_structure_set (structure, "buffer-frames", G_TYPE_INT, 0, NULL);
}
}