endif
if USE_SDL
-SDL_DIR=sdl
+#SDL_DIR=sdl
+SDL_DIR=
else
SDL_DIR=
endif
static void gst_alsa_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_alsa_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstElementStateReturn gst_alsa_change_state(GstElement *element);
-static GstPadNegotiateReturn gst_alsa_negotiate(GstPad *pad, GstCaps **caps, gpointer *user_data);
+//static GstPadNegotiateReturn gst_alsa_negotiate(GstPad *pad, GstCaps **caps, gpointer *user_data);
static GstCaps* gst_alsa_caps (GstAlsa *this);
gst_element_add_pad(GST_ELEMENT(this), GST_ALSA_PAD(this->pads)->pad);
- gst_pad_set_negotiate_function(GST_ALSA_PAD(this->pads)->pad, gst_alsa_negotiate);
+ //gst_pad_set_negotiate_function(GST_ALSA_PAD(this->pads)->pad, gst_alsa_negotiate);
gst_element_set_loop_function(GST_ELEMENT(this), gst_alsa_loop);
}
pad->channel = channel;
pad->pad = gst_pad_new_from_template (templ, newname);
gst_element_add_pad (GST_ELEMENT (this), pad->pad);
- gst_pad_set_negotiate_function(pad->pad, gst_alsa_negotiate);
+ //gst_pad_set_negotiate_function(pad->pad, gst_alsa_negotiate);
if (this->data_interleaved && this->pads) {
gst_element_remove_pad (GST_ELEMENT (this), GST_ALSA_PAD(this->pads)->pad);
/*
* Negotiates the caps, "borrowed" from gstosssink.c
*/
+#if 0
GstPadNegotiateReturn
gst_alsa_negotiate(GstPad *pad, GstCaps **caps, gpointer *user_data)
{
return GST_PAD_NEGOTIATE_FAIL;
}
+#endif
/* shamelessly stolen from pbd's audioengine. thanks, paul! */
static void
caps = gst_alsa_caps(this);
l = this->pads;
while (l) {
- if (!gst_pad_set_caps (GST_ALSA_PAD(l)->pad, caps)) {
+ if (!gst_pad_try_set_caps (GST_ALSA_PAD(l)->pad, caps)) {
g_print ("DANGER WILL ROBINSON!\n");
sleep(1);
return FALSE;
cdparanoia->srcpad = gst_pad_new_from_template (
GST_PADTEMPLATE_GET (cdparanoia_src_factory), "src");
gst_pad_set_get_function (cdparanoia->srcpad, cdparanoia_get);
- gst_pad_set_caps (cdparanoia->srcpad, gst_pad_get_padtemplate_caps (cdparanoia->srcpad));
gst_element_add_pad (GST_ELEMENT (cdparanoia), cdparanoia->srcpad);
cdparanoia->device = "/dev/cdrom";
gst_event_new_info ("bitrate_window", GST_PROPS_INT (vi.bitrate_window), NULL));
}
- gst_pad_set_caps (vorbisdec->srcpad,
- gst_caps_new ("vorbisdec_src",
+ gst_pad_try_set_caps (vorbisdec->srcpad,
+ GST_CAPS_NEW ("vorbisdec_src",
"audio/raw",
- gst_props_new ("format", GST_PROPS_STRING ("int"),
- "law", GST_PROPS_INT (0),
- "endianness", GST_PROPS_INT (G_BYTE_ORDER),
- "signed", GST_PROPS_BOOLEAN (TRUE),
- "width", GST_PROPS_INT (16),
- "depth", GST_PROPS_INT (16),
- "rate", GST_PROPS_INT (vi.rate),
- "channels", GST_PROPS_INT (vi.channels),
- NULL)));
+ "format", GST_PROPS_STRING ("int"),
+ "law", GST_PROPS_INT (0),
+ "endianness", GST_PROPS_INT (G_BYTE_ORDER),
+ "signed", GST_PROPS_BOOLEAN (TRUE),
+ "width", GST_PROPS_INT (16),
+ "depth", GST_PROPS_INT (16),
+ "rate", GST_PROPS_INT (vi.rate),
+ "channels", GST_PROPS_INT (vi.channels)
+ ));
vorbisdec->convsize = 4096 / vi.channels;
gobject_class->get_property = gst_vorbisenc_get_property;
}
-static void
-gst_vorbisenc_newcaps (GstPad * pad, GstCaps * caps)
+static GstPadConnectReturn
+gst_vorbisenc_sinkconnect (GstPad * pad, GstCaps * caps)
{
VorbisEnc *vorbisenc;
vorbisenc = GST_VORBISENC (gst_pad_get_parent (pad));
+ if (!GST_CAPS_IS_FIXED (caps))
+ return GST_PAD_CONNECT_DELAYED;
+
vorbisenc->channels = gst_caps_get_int (caps, "channels");
vorbisenc->frequency = gst_caps_get_int (caps, "rate");
gst_vorbisenc_setup (vorbisenc);
+
+ if (vorbisenc->setup)
+ return GST_PAD_CONNECT_OK;
+
+ return GST_PAD_CONNECT_REFUSED;
}
static void
vorbisenc->sinkpad = gst_pad_new_from_template (enc_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (vorbisenc), vorbisenc->sinkpad);
gst_pad_set_chain_function (vorbisenc->sinkpad, gst_vorbisenc_chain);
- gst_pad_set_newcaps_function (vorbisenc->sinkpad, gst_vorbisenc_newcaps);
+ gst_pad_set_connect_function (vorbisenc->sinkpad, gst_vorbisenc_sinkconnect);
vorbisenc->srcpad = gst_pad_new_from_template (enc_src_template, "src");
- gst_pad_set_caps (vorbisenc->srcpad, gst_pad_get_padtemplate_caps (vorbisenc->srcpad));
gst_element_add_pad (GST_ELEMENT (vorbisenc), vorbisenc->srcpad);
vorbisenc->channels = 2;
}
-static GstPadNegotiateReturn
-audioscale_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data)
-{
- Audioscale *audioscale = GST_AUDIOSCALE (gst_pad_get_parent (pad));
-
- g_print ("audioscale_negotiate_src\n");
-
- if (*caps == NULL)
- return GST_PAD_NEGOTIATE_FAIL;
-
- *caps = gst_caps_copy_on_write (*caps);
- gst_caps_set (*caps, "rate", GST_PROPS_INT_RANGE (8000, 48000));
-
- return gst_pad_negotiate_proxy (pad, audioscale->sinkpad, caps);
-}
-
-static GstPadNegotiateReturn
-audioscale_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
-{
- Audioscale *audioscale = GST_AUDIOSCALE (gst_pad_get_parent (pad));
-
- g_print ("audioscale_negotiate_sink\n");
-
- if (*caps == NULL)
- return GST_PAD_NEGOTIATE_FAIL;
-
- *caps = gst_caps_copy_on_write (*caps);
- gst_caps_set (*caps, "rate", GST_PROPS_INT (audioscale->targetfrequency));
-
- return gst_pad_negotiate_proxy (pad, audioscale->srcpad, caps);
-}
-
-static void
-gst_audioscale_newcaps (GstPad * pad, GstCaps * caps)
+static GstPadConnectReturn
+gst_audioscale_sinkconnect (GstPad * pad, GstCaps * caps)
{
Audioscale *audioscale;
resample_t *r;
resample_reinit(r);
//g_print("audioscale: unsupported scaling method %d\n", audioscale->method);
+ return GST_PAD_CONNECT_OK;
}
static void *
resample_t *r;
audioscale->sinkpad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (sink_template), "sink");
- gst_pad_set_negotiate_function (audioscale->sinkpad, audioscale_negotiate_sink);
gst_element_add_pad(GST_ELEMENT(audioscale),audioscale->sinkpad);
gst_pad_set_chain_function(audioscale->sinkpad,gst_audioscale_chain);
- gst_pad_set_newcaps_function (audioscale->sinkpad, gst_audioscale_newcaps);
+ gst_pad_set_connect_function (audioscale->sinkpad, gst_audioscale_sinkconnect);
audioscale->srcpad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (src_template), "src");
- gst_pad_set_negotiate_function (audioscale->srcpad, audioscale_negotiate_src);
gst_element_add_pad(GST_ELEMENT(audioscale),audioscale->srcpad);
static void gst_sinesrc_class_init (GstSineSrcClass *klass);
static void gst_sinesrc_init (GstSineSrc *src);
-static void gst_sinesrc_newcaps (GstPad *pad, GstCaps *caps);
+static void gst_sinesrc_sinkconnect (GstPad *pad, GstCaps *caps);
static void gst_sinesrc_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
static void gst_sinesrc_get_property (GObject *object, guint prop_id,
src->srcpad = gst_pad_new_from_template (
GST_PADTEMPLATE_GET (sinesrc_src_factory), "src");
gst_element_add_pad(GST_ELEMENT(src), src->srcpad);
- gst_pad_set_newcaps_function (src->srcpad, gst_sinesrc_newcaps);
gst_pad_set_get_function(src->srcpad, gst_sinesrc_get);
}
-static void
-gst_sinesrc_newcaps (GstPad *pad, GstCaps *caps)
-{
- GstSineSrc *src;
- g_return_if_fail (pad != NULL);
- g_return_if_fail (caps != NULL);
- src = GST_SINESRC(gst_pad_get_parent (pad));
- src->samplerate = gst_caps_get_int (caps, "rate");
- gst_sinesrc_update_table_inc(src);
-}
-
static GstBuffer *
gst_sinesrc_get(GstPad *pad)
{
src->newcaps=FALSE;
- caps = gst_caps_new (
- "sinesrc_src_caps",
- "audio/raw",
- gst_props_new (
- "format", GST_PROPS_STRING ("int"),
- "law", GST_PROPS_INT (0),
- "endianness", GST_PROPS_INT (G_BYTE_ORDER),
- "signed", GST_PROPS_BOOLEAN (TRUE),
- "width", GST_PROPS_INT (16),
- "depth", GST_PROPS_INT (16),
- "rate", GST_PROPS_INT (src->samplerate),
- "channels", GST_PROPS_INT (1),
- NULL
- )
- );
+ caps = GST_CAPS_NEW (
+ "sinesrc_src_caps",
+ "audio/raw",
+ "format", GST_PROPS_STRING ("int"),
+ "law", GST_PROPS_INT (0),
+ "endianness", GST_PROPS_INT (G_BYTE_ORDER),
+ "signed", GST_PROPS_BOOLEAN (TRUE),
+ "width", GST_PROPS_INT (16),
+ "depth", GST_PROPS_INT (16),
+ "rate", GST_PROPS_INT (src->samplerate),
+ "channels", GST_PROPS_INT (1)
+ );
- gst_pad_set_caps (src->srcpad, caps);
+ gst_pad_try_set_caps (src->srcpad, caps);
}
static gboolean
}
+/*
static GstPadNegotiateReturn
videoscale_negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
return GST_PAD_NEGOTIATE_AGREE;
}
+*/
-static void
-gst_videoscale_newcaps (GstPad *pad, GstCaps *caps)
+static GstPadConnectReturn
+gst_videoscale_sinkconnect (GstPad *pad, GstCaps *caps)
{
GstVideoscale *videoscale;
- GST_DEBUG(0,"gst_videoscale_newcaps\n");
+ GST_DEBUG(0,"gst_videoscale_sinkconnect\n");
videoscale = GST_VIDEOSCALE (gst_pad_get_parent (pad));
+ if (!GST_CAPS_IS_FIXED (caps)) {
+ return GST_PAD_CONNECT_DELAYED;
+ }
+
videoscale->width = gst_caps_get_int (caps, "width");
videoscale->height = gst_caps_get_int (caps, "height");
videoscale->format = gst_caps_get_int (caps, "format");
videoscale->targetheight);
GST_DEBUG(0,"width %d\n",videoscale->targetwidth);
- gst_pad_set_caps (videoscale->srcpad,
+ gst_pad_try_set_caps (videoscale->srcpad,
GST_CAPS_NEW (
"videoscale_src",
"video/raw",
"width", GST_PROPS_INT (videoscale->targetwidth),
"height", GST_PROPS_INT (videoscale->targetheight)
));
+
+ return GST_PAD_CONNECT_OK;
}
static void
GST_DEBUG(0,"gst_videoscale_init\n");
videoscale->sinkpad = gst_pad_new_from_template (
GST_PADTEMPLATE_GET (sink_templ), "sink");
- gst_pad_set_negotiate_function(videoscale->sinkpad,videoscale_negotiate_sink);
+ //gst_pad_set_negotiate_function(videoscale->sinkpad,videoscale_negotiate_sink);
gst_element_add_pad(GST_ELEMENT(videoscale),videoscale->sinkpad);
gst_pad_set_chain_function(videoscale->sinkpad,gst_videoscale_chain);
- gst_pad_set_newcaps_function(videoscale->sinkpad,gst_videoscale_newcaps);
+ gst_pad_set_connect_function(videoscale->sinkpad,gst_videoscale_sinkconnect);
videoscale->srcpad = gst_pad_new_from_template (
GST_PADTEMPLATE_GET (src_templ), "src");
- gst_pad_set_negotiate_function(videoscale->srcpad,videoscale_negotiate_src);
+ //gst_pad_set_negotiate_function(videoscale->srcpad,videoscale_negotiate_src);
gst_element_add_pad(GST_ELEMENT(videoscale),videoscale->srcpad);
videoscale->targetwidth = -1;
return gst_pad_get_bufferpool (filter->srcpad);
}
+/*
static GstPadNegotiateReturn
volume_negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
return gst_pad_negotiate_proxy(pad,filter->srcpad,caps);
}
+*/
static gint
volume_parse_caps (GstVolume *filter, GstCaps *caps)
volume_init (GstVolume *filter)
{
filter->sinkpad = gst_pad_new_from_template(volume_sink_factory (),"sink");
- gst_pad_set_negotiate_function(filter->sinkpad,volume_negotiate_sink);
+ //gst_pad_set_negotiate_function(filter->sinkpad,volume_negotiate_sink);
gst_pad_set_bufferpool_function(filter->sinkpad,volume_get_bufferpool);
filter->srcpad = gst_pad_new_from_template(volume_src_factory (),"src");
- gst_pad_set_negotiate_function(filter->srcpad,volume_negotiate_src);
+ //gst_pad_set_negotiate_function(filter->srcpad,volume_negotiate_src);
gst_element_add_pad(GST_ELEMENT(filter),filter->sinkpad);
gst_element_add_pad(GST_ELEMENT(filter),filter->srcpad);
gstelement_class->change_state = gst_v4lmjpegsink_change_state;
}
-static void
-gst_v4lmjpegsink_newcaps (GstPad *pad,
+static GstPadConnectReturn
+gst_v4lmjpegsink_sinkconnect (GstPad *pad,
GstCaps *caps)
{
GstV4lMjpegSink *v4lmjpegsink;
v4lmjpegsink = GST_V4LMJPEGSINK (gst_pad_get_parent (pad));
+ if (!GST_CAPS_IS_FIXED (caps))
+ return GST_PAD_CONNECT_DELAYED;
+
v4lmjpegsink->width = gst_caps_get_int (caps, "width");
v4lmjpegsink->height = gst_caps_get_int (caps, "height");
g_signal_emit (G_OBJECT (v4lmjpegsink), gst_v4lmjpegsink_signals[SIGNAL_HAVE_SIZE], 0,
v4lmjpegsink->width, v4lmjpegsink->height);
+
+ return GST_PAD_CONNECT_OK;
}
v4lmjpegsink->sinkpad = gst_pad_new_from_template(GST_PADTEMPLATE_GET (sink_template), "sink");
gst_element_add_pad (GST_ELEMENT (v4lmjpegsink), v4lmjpegsink->sinkpad);
gst_pad_set_chain_function (v4lmjpegsink->sinkpad, gst_v4lmjpegsink_chain);
- gst_pad_set_newcaps_function (v4lmjpegsink->sinkpad, gst_v4lmjpegsink_newcaps);
+ gst_pad_set_connect_function (v4lmjpegsink->sinkpad, gst_v4lmjpegsink_sinkconnect);
v4lmjpegsink->clock = gst_clock_get_system();
gst_clock_register(v4lmjpegsink->clock, GST_OBJECT(v4lmjpegsink));
static void gst_v4lmjpegsrc_init (GstV4lMjpegSrc *v4lmjpegsrc);
/* pad/buffer functions */
+/*
static GstPadNegotiateReturn gst_v4lmjpegsrc_negotiate (GstPad *pad,
GstCaps **caps,
gpointer *user_data);
+ */
static GstCaps* gst_v4lmjpegsrc_create_caps (GstV4lMjpegSrc *v4lmjpegsrc);
static GstBuffer* gst_v4lmjpegsrc_get (GstPad *pad);
gst_element_add_pad(GST_ELEMENT(v4lmjpegsrc), v4lmjpegsrc->srcpad);
gst_pad_set_get_function (v4lmjpegsrc->srcpad, gst_v4lmjpegsrc_get);
- gst_pad_set_negotiate_function (v4lmjpegsrc->srcpad, gst_v4lmjpegsrc_negotiate);
+ //gst_pad_set_negotiate_function (v4lmjpegsrc->srcpad, gst_v4lmjpegsrc_negotiate);
v4lmjpegsrc->bufferpool = gst_buffer_pool_new();
gst_buffer_pool_set_buffer_new_function(v4lmjpegsrc->bufferpool, gst_v4lmjpegsrc_buffer_new);
+/*
static GstPadNegotiateReturn
gst_v4lmjpegsrc_negotiate (GstPad *pad,
GstCaps **caps,
return GST_PAD_NEGOTIATE_FAIL;
}
+*/
static GstCaps*
v4lmjpegsrc = GST_V4LMJPEGSRC (gst_pad_get_parent (pad));
if (v4lmjpegsrc->init) {
- gst_pad_set_caps (v4lmjpegsrc->srcpad, gst_v4lmjpegsrc_create_caps (v4lmjpegsrc));
+ gst_pad_try_set_caps (v4lmjpegsrc->srcpad, gst_v4lmjpegsrc_create_caps (v4lmjpegsrc));
v4lmjpegsrc->init = FALSE;
}
else {
static void gst_v4lsrc_init (GstV4lSrc *v4lsrc);
/* pad/buffer functions */
-static GstPadNegotiateReturn gst_v4lsrc_negotiate (GstPad *pad,
+/*static GstPadNegotiateReturn gst_v4lsrc_negotiate (GstPad *pad,
GstCaps **caps,
gpointer *user_data);
+ */
static GstCaps* gst_v4lsrc_create_caps (GstV4lSrc *v4lsrc);
static GstBuffer* gst_v4lsrc_get (GstPad *pad);
gst_element_add_pad(GST_ELEMENT(v4lsrc), v4lsrc->srcpad);
gst_pad_set_get_function (v4lsrc->srcpad, gst_v4lsrc_get);
- gst_pad_set_negotiate_function (v4lsrc->srcpad, gst_v4lsrc_negotiate);
+ //gst_pad_set_negotiate_function (v4lsrc->srcpad, gst_v4lsrc_negotiate);
v4lsrc->bufferpool = gst_buffer_pool_new();
gst_buffer_pool_set_buffer_new_function(v4lsrc->bufferpool, gst_v4lsrc_buffer_new);
}
+#if 0
static GstPadNegotiateReturn
gst_v4lsrc_negotiate (GstPad *pad,
GstCaps **caps,
return GST_PAD_NEGOTIATE_FAIL;
}
+#endif
static GstCaps*
v4lsrc = GST_V4LSRC (gst_pad_get_parent (pad));
if (v4lsrc->init) {
- gst_pad_set_caps (v4lsrc->srcpad, gst_v4lsrc_create_caps (v4lsrc));
+ gst_pad_try_set_caps (v4lsrc->srcpad, gst_v4lsrc_create_caps (v4lsrc));
v4lsrc->init = FALSE;
}
else {