mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
rtsp-server: add more support for multicast
This commit is contained in:
parent
ac8343ea62
commit
09b97dd4ac
3 changed files with 10 additions and 3 deletions
|
@ -23,6 +23,9 @@
|
||||||
#include "rtsp-sdp.h"
|
#include "rtsp-sdp.h"
|
||||||
#include "rtsp-params.h"
|
#include "rtsp-params.h"
|
||||||
|
|
||||||
|
/* temporary multicast address until it's configurable somewhere */
|
||||||
|
#define MCAST_ADDRESS "224.2.0.1"
|
||||||
|
|
||||||
static GMutex *tunnels_lock;
|
static GMutex *tunnels_lock;
|
||||||
static GHashTable *tunnels;
|
static GHashTable *tunnels;
|
||||||
|
|
||||||
|
@ -796,7 +799,7 @@ handle_setup_request (GstRTSPClient * client, GstRTSPUrl * uri,
|
||||||
/* we have a valid transport now, set the destination of the client. */
|
/* we have a valid transport now, set the destination of the client. */
|
||||||
g_free (ct->destination);
|
g_free (ct->destination);
|
||||||
if (ct->lower_transport == GST_RTSP_LOWER_TRANS_UDP_MCAST) {
|
if (ct->lower_transport == GST_RTSP_LOWER_TRANS_UDP_MCAST) {
|
||||||
ct->destination = g_strdup ("224.2.0.1");
|
ct->destination = g_strdup (MCAST_ADDRESS);
|
||||||
} else {
|
} else {
|
||||||
url = gst_rtsp_connection_get_url (client->connection);
|
url = gst_rtsp_connection_get_url (client->connection);
|
||||||
ct->destination = g_strdup (url->host);
|
ct->destination = g_strdup (url->host);
|
||||||
|
@ -953,6 +956,9 @@ create_sdp (GstRTSPClient * client, GstRTSPMedia * media)
|
||||||
gst_sdp_message_add_attribute (sdp, "control", "*");
|
gst_sdp_message_add_attribute (sdp, "control", "*");
|
||||||
|
|
||||||
info.server_proto = proto;
|
info.server_proto = proto;
|
||||||
|
if (media->protocols & GST_RTSP_LOWER_TRANS_UDP_MCAST)
|
||||||
|
info.server_ip = MCAST_ADDRESS;
|
||||||
|
else
|
||||||
info.server_ip = client->server_ip;
|
info.server_ip = client->server_ip;
|
||||||
|
|
||||||
/* create an SDP for the media object */
|
/* create an SDP for the media object */
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#define DEFAULT_SHARED FALSE
|
#define DEFAULT_SHARED FALSE
|
||||||
#define DEFAULT_REUSABLE FALSE
|
#define DEFAULT_REUSABLE FALSE
|
||||||
#define DEFAULT_PROTOCOLS GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_TCP
|
#define DEFAULT_PROTOCOLS GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_TCP
|
||||||
|
//#define DEFAULT_PROTOCOLS GST_RTSP_LOWER_TRANS_UDP_MCAST
|
||||||
|
|
||||||
/* define to dump received RTCP packets */
|
/* define to dump received RTCP packets */
|
||||||
#undef DUMP_STATS
|
#undef DUMP_STATS
|
||||||
|
|
|
@ -85,7 +85,7 @@ gst_rtsp_sdp_from_media (GstSDPMessage *sdp, GstSDPInfo *info, GstRTSPMedia * me
|
||||||
gst_sdp_media_set_proto (smedia, "RTP/AVP");
|
gst_sdp_media_set_proto (smedia, "RTP/AVP");
|
||||||
|
|
||||||
/* for the c= line */
|
/* for the c= line */
|
||||||
gst_sdp_media_add_connection (smedia, "IN", info->server_proto, info->server_ip, 0, 0);
|
gst_sdp_media_add_connection (smedia, "IN", info->server_proto, info->server_ip, 16, 0);
|
||||||
|
|
||||||
/* get clock-rate, media type and params for the rtpmap attribute */
|
/* get clock-rate, media type and params for the rtpmap attribute */
|
||||||
gst_structure_get_int (s, "clock-rate", &caps_rate);
|
gst_structure_get_int (s, "clock-rate", &caps_rate);
|
||||||
|
|
Loading…
Reference in a new issue