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