summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2004-03-06 00:42:20 +0000
committerDavid Schleef <ds@schleef.org>2004-03-06 00:42:20 +0000
commit86db595f563c3b5da4427055f4afc439c12036b5 (patch)
tree917f010e633963aa567f4c9dd5ba0a6c856a6455
parent42547f3e85c3b208dd1ca7e06445e6e61c6d4b86 (diff)
downloadgst-plugins-bad-86db595f563c3b5da4427055f4afc439c12036b5.tar.gz
gst-plugins-bad-86db595f563c3b5da4427055f4afc439c12036b5.tar.bz2
gst-plugins-bad-86db595f563c3b5da4427055f4afc439c12036b5.zip
ext/faad/gstfaad.c: Fix negotiation.
Original commit message from CVS: * ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_srcgetcaps), (gst_faad_chain): Fix negotiation. * ext/librfb/gstrfbsrc.c: (gst_rfbsrc_handle_src_event): Add key and button events. * gst-libs/gst/floatcast/floatcast.h: Fix a minor bug in this dung heap of code. * gst-libs/gst/gconf/gstreamer-gconf-uninstalled.pc.in: gstgconf depends on gconf * gst-libs/gst/gconf/gstreamer-gconf.pc.in: same * gst-libs/gst/play/play.c: (gst_play_pipeline_setup), (gst_play_video_fixate), (gst_play_audio_fixate): Add a fixate function to encourage better negotiation, particularly between audioconvert and osssink. * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain): * gst/qtdemux/qtdemux.c: (qtdemux_parse_trak): Make some debugging more important. * gst/typefind/gsttypefindfunctions.c: Fix mistake in flash typefinding. * gst/vbidec/vbiscreen.c: Add glib header * pkgconfig/gstreamer-play.pc.in: Depends on gst-interfaces.
-rw-r--r--ChangeLog23
-rw-r--r--ext/faad/gstfaad.c19
-rw-r--r--gst-libs/gst/floatcast/floatcast.h4
-rw-r--r--gst-libs/gst/play/play.c66
-rw-r--r--gst/qtdemux/qtdemux.c7
-rw-r--r--gst/vbidec/vbiscreen.c1
-rw-r--r--pkgconfig/gstreamer-gconf-uninstalled.pc.in2
-rw-r--r--pkgconfig/gstreamer-gconf.pc.in2
-rw-r--r--pkgconfig/gstreamer-play.pc.in2
9 files changed, 113 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a44d768..4c0a2cf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2004-03-05 David Schleef <ds@schleef.org>
+
+ * ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_srcgetcaps),
+ (gst_faad_chain): Fix negotiation.
+ * ext/librfb/gstrfbsrc.c: (gst_rfbsrc_handle_src_event): Add
+ key and button events.
+ * gst-libs/gst/floatcast/floatcast.h: Fix a minor bug in this
+ dung heap of code.
+ * gst-libs/gst/gconf/gstreamer-gconf-uninstalled.pc.in: gstgconf
+ depends on gconf
+ * gst-libs/gst/gconf/gstreamer-gconf.pc.in: same
+ * gst-libs/gst/play/play.c: (gst_play_pipeline_setup),
+ (gst_play_video_fixate), (gst_play_audio_fixate): Add a fixate
+ function to encourage better negotiation, particularly between
+ audioconvert and osssink.
+ * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain):
+ * gst/qtdemux/qtdemux.c: (qtdemux_parse_trak): Make some debugging
+ more important.
+ * gst/typefind/gsttypefindfunctions.c: Fix mistake in flash
+ typefinding.
+ * gst/vbidec/vbiscreen.c: Add glib header
+ * pkgconfig/gstreamer-play.pc.in: Depends on gst-interfaces.
+
2004-03-06 Christophe Fergeau <teuf@users.sourceforge.net>
* ext/mad/gstmad.c: Fix detection of Xing headers
diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c
index bb804cb2..6e272974 100644
--- a/ext/faad/gstfaad.c
+++ b/ext/faad/gstfaad.c
@@ -148,11 +148,7 @@ gst_faad_init (GstFaad *faad)
gst_element_add_pad (GST_ELEMENT (faad), faad->srcpad);
gst_pad_set_link_function (faad->srcpad, gst_faad_srcconnect);
- /* This was originally intended as a getcaps() function, but
- * in the end, we needed a srcconnect() function, so this is
- * not really useful. However, srcconnect() uses it, so it is
- * still there... */
- /*gst_pad_set_getcaps_function (faad->srcpad, gst_faad_srcgetcaps);*/
+ gst_pad_set_getcaps_function (faad->srcpad, gst_faad_srcgetcaps);
}
static GstPadLinkReturn
@@ -244,7 +240,7 @@ gst_faad_srcgetcaps (GstPad *pad)
return caps;
}
- return GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
+ return gst_caps_copy (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad)));
}
static GstPadLinkReturn
@@ -357,12 +353,16 @@ gst_faad_chain (GstPad *pad,
&samplerate, &channels);
faad->samplerate = samplerate;
faad->channels = channels;
+
+ gst_pad_renegotiate (faad->srcpad);
+#if 0
if (gst_faad_srcconnect (faad->srcpad,
gst_pad_get_allowed_caps (faad->srcpad)) <= 0) {
GST_ELEMENT_ERROR (faad, CORE, NEGOTIATION, (NULL), (NULL));
gst_buffer_unref (buf);
return;
}
+#endif
}
out = faacDecDecode (faad->handle, &info,
@@ -379,12 +379,19 @@ gst_faad_chain (GstPad *pad,
info.channels != faad->channels) {
faad->samplerate = info.samplerate;
faad->channels = info.channels;
+ gst_pad_renegotiate (faad->srcpad);
+#if 0
if (gst_faad_srcconnect (faad->srcpad,
gst_pad_get_allowed_caps (faad->srcpad)) <= 0) {
GST_ELEMENT_ERROR (faad, CORE, NEGOTIATION, (NULL), (NULL));
gst_buffer_unref (buf);
return;
}
+#endif
+ }
+
+ if (info.samples == 0) {
+ return;
}
/* FIXME: did it handle the whole buffer? */
diff --git a/gst-libs/gst/floatcast/floatcast.h b/gst-libs/gst/floatcast/floatcast.h
index 99577d91..ae87a43f 100644
--- a/gst-libs/gst/floatcast/floatcast.h
+++ b/gst-libs/gst/floatcast/floatcast.h
@@ -52,8 +52,8 @@ G_BEGIN_DECLS
#else
/* use a standard c cast, but do rounding correctly */
- #define gst_cast_float(x) ((x)>=0?(gint)((x)+0.5):(gint)((x)-0.5))
- #define gst_cast_double(x) ((x)>=0?(gint)((x)+0.5):(gint)((x)-0.5))
+ #define gst_cast_float(x) ((gint)floor((x)+0.5))
+ #define gst_cast_double(x) ((gint)floor((x)+0.5))
#endif
diff --git a/gst-libs/gst/play/play.c b/gst-libs/gst/play/play.c
index 081af994..f46fbabc 100644
--- a/gst-libs/gst/play/play.c
+++ b/gst-libs/gst/play/play.c
@@ -67,6 +67,9 @@ static GstPipelineClass *parent_class = NULL;
/* */
/* ======================================================= */
+static GstCaps * gst_play_video_fixate (GstPad *pad, const GstCaps *caps, gpointer user_data);
+static GstCaps * gst_play_audio_fixate (GstPad *pad, const GstCaps *caps, gpointer user_data);
+
static GQuark
gst_play_error_quark (void)
{
@@ -275,6 +278,8 @@ gst_play_pipeline_setup (GstPlay *play, GError **error)
/* Software scaling of video stream */
GST_PLAY_MAKE_OR_ERROR (video_scaler, "videoscale", "video_scaler", error);
g_hash_table_insert (play->priv->elements, "video_scaler", video_scaler);
+ g_signal_connect (gst_element_get_pad(video_scaler, "src"), "fixate",
+ G_CALLBACK (gst_play_video_fixate), play);
/* Placeholder for future video sink bin */
GST_PLAY_MAKE_OR_ERROR (video_sink, "fakesink", "video_sink", error);
@@ -315,6 +320,8 @@ gst_play_pipeline_setup (GstPlay *play, GError **error)
/* Volume control */
GST_PLAY_MAKE_OR_ERROR (volume, "volume", "volume", error);
g_hash_table_insert (play->priv->elements, "volume", volume);
+ g_signal_connect (gst_element_get_pad(volume, "src"), "fixate",
+ G_CALLBACK (gst_play_audio_fixate), play);
/* Placeholder for future audio sink bin */
GST_PLAY_MAKE_OR_ERROR (audio_sink, "fakesink", "audio_sink", error);
@@ -434,6 +441,65 @@ gst_play_get_length_callback (GstPlay *play)
return TRUE;
}
+static GstCaps *
+gst_play_video_fixate (GstPad *pad, const GstCaps *caps, gpointer user_data)
+{
+ GstStructure *structure;
+ GstCaps *newcaps;
+
+ GST_DEBUG ("video fixate %p %" GST_PTR_FORMAT, pad, caps);
+
+ if (gst_caps_get_size (caps) > 1) return NULL;
+
+ newcaps = gst_caps_copy (caps);
+ structure = gst_caps_get_structure (newcaps, 0);
+
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 320)) {
+ return newcaps;
+ }
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "height", 240)) {
+ return newcaps;
+ }
+ if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate",
+ 30.0)) {
+ return newcaps;
+ }
+
+ /* failed to fixate */
+ gst_caps_free (newcaps);
+ return NULL;
+}
+
+static GstCaps *
+gst_play_audio_fixate (GstPad *pad, const GstCaps *caps, gpointer user_data)
+{
+ GstCaps *newcaps;
+ GstStructure *structure;
+
+ GST_DEBUG ("audio fixate %p %" GST_PTR_FORMAT, pad, caps);
+
+ newcaps = gst_caps_new_full (gst_structure_copy (
+ gst_caps_get_structure (caps, 0)), NULL);
+ structure = gst_caps_get_structure (newcaps, 0);
+
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "rate", 44100)) {
+ return newcaps;
+ }
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "depth", 16)) {
+ return newcaps;
+ }
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 16)) {
+ return newcaps;
+ }
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "channels", 2)) {
+ return newcaps;
+ }
+
+ gst_caps_free (newcaps);
+
+ return NULL;
+}
+
static void
gst_play_state_change (GstElement *element, GstElementState old,
GstElementState state)
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index d33d18ee..5ce3807b 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -1445,7 +1445,9 @@ static void qtdemux_parse_trak(GstQTDemux *qtdemux, GNode *trak)
stream->caps = qtdemux_video_caps(qtdemux,
QTDEMUX_FOURCC_GET(stsd->data+offset+4), stsd->data);
- GST_LOG("caps %s\n",gst_caps_to_string(stream->caps));
+ GST_INFO("type " GST_FOURCC_FORMAT " caps %" GST_PTR_FORMAT "\n",
+ GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET(stsd->data+offset+4)),
+ stream->caps);
}else if(stream->subtype == FOURCC_soun){
int version;
@@ -1480,7 +1482,8 @@ static void qtdemux_parse_trak(GstQTDemux *qtdemux, GNode *trak)
stream->caps = qtdemux_audio_caps(qtdemux,
QTDEMUX_FOURCC_GET(stsd->data+16+4), (QTDEMUX_GUINT32_GET(stsd->data) > offset) ? stsd->data + offset : NULL);
- GST_LOG("caps %s\n",gst_caps_to_string(stream->caps));
+ GST_INFO("type " GST_FOURCC_FORMAT " caps %" GST_PTR_FORMAT "\n",
+ GST_FOURCC_ARGS(QTDEMUX_FOURCC_GET(stsd->data+16+4)), stream->caps);
}else{
GST_LOG("unknown subtype\n");
return;
diff --git a/gst/vbidec/vbiscreen.c b/gst/vbidec/vbiscreen.c
index 4ce0404c..bcce79e2 100644
--- a/gst/vbidec/vbiscreen.c
+++ b/gst/vbidec/vbiscreen.c
@@ -24,6 +24,7 @@
#include "config.h"
#endif
+#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
diff --git a/pkgconfig/gstreamer-gconf-uninstalled.pc.in b/pkgconfig/gstreamer-gconf-uninstalled.pc.in
index 1255a6bf..0d4d5cb3 100644
--- a/pkgconfig/gstreamer-gconf-uninstalled.pc.in
+++ b/pkgconfig/gstreamer-gconf-uninstalled.pc.in
@@ -6,7 +6,7 @@ includedir=${pcfiledir}/../gst-libs
Name: GStreamer GConf Library, uninstalled
Description: Streaming media framework, GConf support library, not installed
-Requires: gstreamer-@GST_MAJORMINOR@ >= @VERSION@
+Requires: gstreamer-@GST_MAJORMINOR@ >= @VERSION@ gconf-2.0
Version: @VERSION@
Libs: ${libdir}/libgstgconf-@GST_MAJORMINOR@.la
diff --git a/pkgconfig/gstreamer-gconf.pc.in b/pkgconfig/gstreamer-gconf.pc.in
index 2cbf8075..e1801c51 100644
--- a/pkgconfig/gstreamer-gconf.pc.in
+++ b/pkgconfig/gstreamer-gconf.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@/gstreamer-@GST_MAJORMINOR@
Name: GStreamer GConf Library
Description: Streaming media framework, GConf support library
-Requires: gstreamer-@GST_MAJORMINOR@
+Requires: gstreamer-@GST_MAJORMINOR@ gconf-2.0
Version: @VERSION@
Libs: -L${libdir} -lgstgconf-@GST_MAJORMINOR@
diff --git a/pkgconfig/gstreamer-play.pc.in b/pkgconfig/gstreamer-play.pc.in
index 99dc6e7d..9d6a2020 100644
--- a/pkgconfig/gstreamer-play.pc.in
+++ b/pkgconfig/gstreamer-play.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@/gstreamer-@GST_MAJORMINOR@
Name: GStreamer Play Library
Description: Streaming-media framework, play libraries
-Requires: gstreamer-@GST_MAJORMINOR@
+Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-interfaces-@GST_MAJORMINOR@
Version: @VERSION@
Libs: -L${libdir} -lgstplay-@GST_MAJORMINOR@ -lgstcontrol-@GST_MAJORMINOR@