From f48c4cbe42b6c9207f7f16481af59c4c55212bcf Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 19 Aug 2005 12:44:35 +0000 Subject: ext/amrnb/: Update caps with audio/AMR. Original commit message from CVS: * ext/amrnb/amrnbdec.c: * ext/amrnb/amrnbenc.c: (gst_amrnbenc_setcaps): * ext/amrnb/amrnbparse.c: Update caps with audio/AMR. * gst/rtp/gstrtpamrdec.c: (gst_rtpamrdec_init), (gst_rtpamrdec_sink_setcaps), (gst_rtpamrdec_chain), (gst_rtpamrdec_change_state): * gst/rtp/gstrtpamrdec.h: * gst/rtp/gstrtpamrenc.c: (gst_rtpamrenc_class_init), (gst_rtpamrenc_init), (gst_rtpamrenc_chain): Dont set FT headers twice, it was already in the encoded bitstream. * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_send), (gst_rtspsrc_open), (gst_rtspsrc_close), (gst_rtspsrc_play): * gst/rtsp/rtspconnection.c: (parse_line): Cleanups * gst/udp/gstudpsrc.c: (gst_udpsrc_class_init), (gst_udpsrc_create), (gst_udpsrc_set_property), (gst_udpsrc_get_property): * gst/udp/gstudpsrc.h: Added caps property, we need this soon to type the buffers. --- gst/udp/gstudpsrc.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gst/udp/gstudpsrc.c') diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index 445c1444..61fadcd4 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -75,6 +75,7 @@ enum #define UDP_DEFAULT_PORT 4951 #define UDP_DEFAULT_MULTICAST_GROUP "0.0.0.0" #define UDP_DEFAULT_URI "udp://0.0.0.0:4951" +#define UDP_DEFAULT_CAPS NULL enum { @@ -82,6 +83,7 @@ enum PROP_PORT, PROP_MULTICAST_GROUP, PROP_URI, + PROP_CAPS, /* FILL ME */ }; @@ -180,6 +182,9 @@ gst_udpsrc_class_init (GstUDPSrc * klass) g_param_spec_string ("uri", "URI", "URI in the form of udp://hostname:port", UDP_DEFAULT_URI, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_CAPS, + g_param_spec_boxed ("caps", "Caps", + "The caps of the source pad", GST_TYPE_CAPS, G_PARAM_READWRITE)); gstbasesrc_class->start = gst_udpsrc_start; gstbasesrc_class->stop = gst_udpsrc_stop; @@ -297,6 +302,8 @@ gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf) gst_netaddress_set_ip4_address (&outbuf->from, tmpaddr.sin_addr.s_addr, tmpaddr.sin_port); + gst_buffer_set_caps (GST_BUFFER (outbuf), udpsrc->caps); + GST_LOG_OBJECT (udpsrc, "read %d bytes", readsize); *buf = GST_BUFFER (outbuf); @@ -386,6 +393,23 @@ gst_udpsrc_set_property (GObject * object, guint prop_id, const GValue * value, case PROP_URI: gst_udpsrc_set_uri (udpsrc, g_value_get_string (value)); break; + case PROP_CAPS: + { + const GstCaps *new_caps_val = gst_value_get_caps (value); + GstCaps *new_caps; + GstCaps *old_caps; + + if (new_caps_val == NULL) { + new_caps = gst_caps_new_any (); + } else { + new_caps = gst_caps_copy (new_caps_val); + } + + old_caps = udpsrc->caps; + udpsrc->caps = new_caps; + gst_caps_unref (old_caps); + break; + } default: break; } @@ -409,6 +433,9 @@ gst_udpsrc_get_property (GObject * object, guint prop_id, GValue * value, case PROP_URI: g_value_set_string (value, udpsrc->uri); break; + case PROP_CAPS: + gst_value_set_caps (value, udpsrc->caps); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; -- cgit