gst_plugins_base/gst-libs/gst/rtsp/gstrtsptransport.c
branchRCL_3
changeset 29 567bb019e3e3
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
6:9b2c3c7a1a9c 29:567bb019e3e3
   542       transport->lower_transport == GST_RTSP_LOWER_TRANS_TCP) {
   542       transport->lower_transport == GST_RTSP_LOWER_TRANS_TCP) {
   543     g_ptr_array_add (strs, g_strdup ("/"));
   543     g_ptr_array_add (strs, g_strdup ("/"));
   544 
   544 
   545     if ((tmp = rtsp_transport_ltrans_as_text (transport)) == NULL)
   545     if ((tmp = rtsp_transport_ltrans_as_text (transport)) == NULL)
   546       goto invalid_transport;
   546       goto invalid_transport;
       
   547 
   547     g_ptr_array_add (strs, g_ascii_strup (tmp, -1));
   548     g_ptr_array_add (strs, g_ascii_strup (tmp, -1));
   548   }
   549   }
   549 
   550 
   550   /*
   551   /*
   551    * the order of the following parameters is the same as the one specified in
   552    * the order of the following parameters is the same as the one specified in
   599     g_ptr_array_add (strs, g_strdup (";layers="));
   600     g_ptr_array_add (strs, g_strdup (";layers="));
   600     g_ptr_array_add (strs, g_strdup_printf ("%u", transport->layers));
   601     g_ptr_array_add (strs, g_strdup_printf ("%u", transport->layers));
   601   }
   602   }
   602 
   603 
   603   /* add the port parameter */
   604   /* add the port parameter */
   604   if (transport->trans == GST_RTSP_TRANS_RTP && transport->port.min >= 0) {
   605   if (transport->lower_transport != GST_RTSP_LOWER_TRANS_TCP) {
   605     if (transport->port.min < 65536 && transport->port.max < 65536) {
   606     if (transport->trans == GST_RTSP_TRANS_RTP && transport->port.min >= 0) {
   606       g_ptr_array_add (strs, g_strdup (";port="));
   607       if (transport->port.min < 65536 && transport->port.max < 65536) {
   607       g_ptr_array_add (strs, range_as_text (&transport->port));
   608         g_ptr_array_add (strs, g_strdup (";port="));
   608     } else
   609         g_ptr_array_add (strs, range_as_text (&transport->port));
   609       goto invalid_transport;
   610       } else
   610   }
   611         goto invalid_transport;
   611 
   612     }
   612   /* add the client_port parameter */
   613 
   613   if (transport->trans == GST_RTSP_TRANS_RTP && transport->client_port.min >= 0) {
   614     /* add the client_port parameter */
   614     if (transport->client_port.min < 65536 &&
   615     if (transport->trans == GST_RTSP_TRANS_RTP
   615         transport->client_port.max < 65536) {
   616         && transport->client_port.min >= 0) {
   616       g_ptr_array_add (strs, g_strdup (";client_port="));
   617       if (transport->client_port.min < 65536
   617       g_ptr_array_add (strs, range_as_text (&transport->client_port));
   618           && transport->client_port.max < 65536) {
   618     } else
   619         g_ptr_array_add (strs, g_strdup (";client_port="));
   619       goto invalid_transport;
   620         g_ptr_array_add (strs, range_as_text (&transport->client_port));
   620   }
   621       } else
   621 
   622         goto invalid_transport;
   622   /* add the server_port parameter */
   623     }
   623   if (transport->trans == GST_RTSP_TRANS_RTP && transport->server_port.min >= 0) {
   624 
   624     if (transport->server_port.min < 65536 &&
   625     /* add the server_port parameter */
   625         transport->server_port.max < 65536) {
   626     if (transport->trans == GST_RTSP_TRANS_RTP
   626       g_ptr_array_add (strs, g_strdup (";server_port="));
   627         && transport->server_port.min >= 0) {
   627       g_ptr_array_add (strs, range_as_text (&transport->server_port));
   628       if (transport->server_port.min < 65536
   628     } else
   629           && transport->server_port.max < 65536) {
   629       goto invalid_transport;
   630         g_ptr_array_add (strs, g_strdup (";server_port="));
       
   631         g_ptr_array_add (strs, range_as_text (&transport->server_port));
       
   632       } else
       
   633         goto invalid_transport;
       
   634     }
   630   }
   635   }
   631 
   636 
   632   /* add the ssrc parameter */
   637   /* add the ssrc parameter */
   633   if (transport->lower_transport != GST_RTSP_LOWER_TRANS_UDP_MCAST &&
   638   if (transport->lower_transport != GST_RTSP_LOWER_TRANS_UDP_MCAST &&
   634       transport->ssrc != 0) {
   639       transport->ssrc != 0) {