- char *sfilter = NULL;
- if (b_ssm)
- {
- if (asprintf (&sfilter, "a=source-filter: incl IN IP%c * %s\r\n",
- ipv, p_addr->psz_machine) == -1)
- return NULL;
- }
-
- /* see the lists in modules/stream_out/rtp.c for compliance stuff */
- int res = asprintf (&psz_sdp,
- "v=0\r\n"
- "o=- "I64Fd" %d IN IP%c %s\r\n"
- "s=%s\r\n"
- "c=IN IP%c %s/%d\r\n"
- "t=0 0\r\n"
- "a=tool:"PACKAGE_STRING"\r\n"
- "a=recvonly\r\n"
- "a=type:broadcast\n"
- "%s"
- "m=video %d %s %d\r\n"
- "%s%s%s",
- i_sdp_id, i_sdp_version,
- ipv, p_addr->psz_machine,
- psz_name, ipv, psz_uri,
- (p_session->i_ttl != -1) ? p_session->i_ttl : 255,
- (sfilter != NULL) ? sfilter : "",
- p_session->i_port,
- p_session->b_rtp ? "RTP/AVP" : "udp",
- p_session->i_payload,
- psz_group ? "a=x-plgroup:" : "",
- psz_group ? psz_group : "", psz_group ? "\r\n" : "");
- if (sfilter != NULL)
- free (sfilter);
-
- if (res == -1)
- return NULL;
-
- msg_Dbg( p_sap, "Generated SDP (%i bytes):\n%s", strlen(psz_sdp),
- psz_sdp );
- return psz_sdp;
-}
-
-static int CalculateRate( sap_handler_t *p_sap, sap_address_t *p_address )
-{
- int i_read;
- uint8_t buffer[SAP_MAX_BUFFER];
- int i_tot = 0;
- mtime_t i_temp;
- int i_rate;
-
- if( p_address->t1 == 0 )
- {
- p_address->t1 = mdate();
- return VLC_SUCCESS;
- }
- do
- {
- /* Might be too slow if we have huge data */
- i_read = net_ReadNonBlock( p_sap, p_address->i_rfd, NULL, buffer,
- SAP_MAX_BUFFER, 0 );
- i_tot += i_read;
- } while( i_read > 0 );
-
- i_temp = mdate();