[gst-devel] httpsrc patch to set pad caps from the Content-type header

Andy Wingo apwingo at eos.ncsu.edu
Mon Jul 9 04:33:39 CEST 2001


I haven't fully tested this, but it appears to work properly. This diff
is on gsthttpsrc.c.

160,161c160,163
<   gint status;
< 
---
>   gint status, i, n_headers;
>   gchar **header_names;
>   const gchar *header_value;
>   
178a181,193
>   
>   if ((ghttp_get_header_names(httpsrc->request, &header_names, &n_headers)) == 0) {
>       for (i=0; i<n_headers; i++) {
>           if (strcmp(header_names[i], "Content-type") == 0) {
>               header_value = ghttp_get_header(httpsrc->request, header_names[i]);
>               if (strcmp(header_value,"application/octet-stream") != 0) {
>                   gst_caps_set_mime(GST_PAD_CAPS(httpsrc->srcpad), header_value);
>               }
>           }
>           free (header_names[i]);
>       }
>       free (header_names);
>   }
196a212,214
>   GST_CAPS_LOCK(GST_PAD_CAPS(src->srcpad));
>   GST_PAD_CAPS(src->srcpad)->id = 0;
>   GST_CAPS_UNLOCK(GST_PAD_CAPS(src->srcpad));





More information about the gstreamer-devel mailing list