#define DEFAULT_DO_RETRANSMISSION TRUE
#define DEFAULT_NTP_TIME_SOURCE NTP_TIME_SOURCE_NTP
#define DEFAULT_USER_AGENT "GStreamer/" PACKAGE_VERSION
+#define DEFAULT_MAX_RTCP_RTP_TIME_DIFF 1000
enum
{
PROP_TLS_INTERACTION,
PROP_DO_RETRANSMISSION,
PROP_NTP_TIME_SOURCE,
- PROP_USER_AGENT
+ PROP_USER_AGENT,
+ PROP_MAX_RTCP_RTP_TIME_DIFF
};
#define GST_TYPE_RTSP_NAT_METHOD (gst_rtsp_nat_method_get_type())
"The User-Agent string to send to the server",
DEFAULT_USER_AGENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, PROP_MAX_RTCP_RTP_TIME_DIFF,
+ g_param_spec_int ("max-rtcp-rtp-time-diff", "Max RTCP RTP Time Diff",
+ "Maximum amount of time in ms that the RTP time in RTCP SRs "
+ "is allowed to be ahead (-1 disabled)", -1, G_MAXINT,
+ DEFAULT_MAX_RTCP_RTP_TIME_DIFF,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
/**
* GstRTSPSrc::handle-request:
* @rtspsrc: a #GstRTSPSrc
src->do_retransmission = DEFAULT_DO_RETRANSMISSION;
src->ntp_time_source = DEFAULT_NTP_TIME_SOURCE;
src->user_agent = g_strdup (DEFAULT_USER_AGENT);
+ src->max_rtcp_rtp_time_diff = DEFAULT_MAX_RTCP_RTP_TIME_DIFF;
/* get a list of all extensions */
src->extensions = gst_rtsp_ext_list_get ();
gst_rtspsrc_set_proxy (rtspsrc, g_value_get_string (value));
break;
case PROP_PROXY_ID:
- if (rtspsrc->prop_proxy_id)
- g_free (rtspsrc->prop_proxy_id);
+ g_free (rtspsrc->prop_proxy_id);
rtspsrc->prop_proxy_id = g_value_dup_string (value);
break;
case PROP_PROXY_PW:
- if (rtspsrc->prop_proxy_pw)
- g_free (rtspsrc->prop_proxy_pw);
+ g_free (rtspsrc->prop_proxy_pw);
rtspsrc->prop_proxy_pw = g_value_dup_string (value);
break;
case PROP_RTP_BLOCKSIZE:
rtspsrc->rtp_blocksize = g_value_get_uint (value);
break;
case PROP_USER_ID:
- if (rtspsrc->user_id)
- g_free (rtspsrc->user_id);
+ g_free (rtspsrc->user_id);
rtspsrc->user_id = g_value_dup_string (value);
break;
case PROP_USER_PW:
- if (rtspsrc->user_pw)
- g_free (rtspsrc->user_pw);
+ g_free (rtspsrc->user_pw);
rtspsrc->user_pw = g_value_dup_string (value);
break;
case PROP_BUFFER_MODE:
const gchar *str;
str = g_value_get_string (value);
- if (str) {
- sscanf (str, "%u-%u",
- &rtspsrc->client_port_range.min, &rtspsrc->client_port_range.max);
- } else {
+ if (sscanf (str, "%u-%u", &rtspsrc->client_port_range.min,
+ &rtspsrc->client_port_range.max) != 2) {
rtspsrc->client_port_range.min = 0;
rtspsrc->client_port_range.max = 0;
}
g_free (rtspsrc->user_agent);
rtspsrc->user_agent = g_value_dup_string (value);
break;
+ case PROP_MAX_RTCP_RTP_TIME_DIFF:
+ rtspsrc->max_rtcp_rtp_time_diff = g_value_get_int (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_USER_AGENT:
g_value_set_string (value, rtspsrc->user_agent);
break;
+ case PROP_MAX_RTCP_RTP_TIME_DIFF:
+ g_value_set_int (value, rtspsrc->max_rtcp_rtp_time_diff);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
{
guint i, len;
const gchar *proto;
+ GstCaps *global_caps;
/* get proto */
proto = gst_sdp_media_get_proto (media);
else
goto unknown_proto;
+ /* Parse global SDP attributes once */
+ global_caps = gst_caps_new_empty_simple ("application/x-unknown");
+ GST_DEBUG ("mapping sdp session level attributes to caps");
+ gst_rtspsrc_sdp_attributes_to_caps (sdp->attributes, global_caps);
+ GST_DEBUG ("mapping sdp media level attributes to caps");
+ gst_rtspsrc_sdp_attributes_to_caps (media->attributes, global_caps);
+
len = gst_sdp_media_formats_len (media);
for (i = 0; i < len; i++) {
gint pt;
- GstCaps *caps;
+ GstCaps *caps, *outcaps;
GstStructure *s;
const gchar *enc;
PtMapItem item;
if (strcmp (enc, "X-ASF-PF") == 0)
stream->container = TRUE;
}
- GST_DEBUG ("mapping sdp session level attributes to caps");
- gst_rtspsrc_sdp_attributes_to_caps (sdp->attributes, caps);
- GST_DEBUG ("mapping sdp media level attributes to caps");
- gst_rtspsrc_sdp_attributes_to_caps (media->attributes, caps);
+
+ /* Merge in global caps */
+ /* Intersect will merge in missing fields to the current caps */
+ outcaps = gst_caps_intersect (caps, global_caps);
+ gst_caps_unref (caps);
/* the first pt will be the default */
if (stream->ptmap->len == 0)
stream->default_pt = pt;
item.pt = pt;
- item.caps = caps;
+ item.caps = outcaps;
+
g_array_append_val (stream->ptmap, item);
}
+
+ gst_caps_unref (global_caps);
return;
no_proto:
NULL);
}
+ if (g_object_class_find_property (klass, "max-rtcp-rtp-time-diff")) {
+ g_object_set (src->manager, "max-rtcp-rtp-time-diff",
+ src->max_rtcp_rtp_time_diff, NULL);
+ }
+
/* buffer mode pauses are handled by adding offsets to buffer times,
* but some depayloaders may have a hard time syncing output times
* with such input times, e.g. container ones, most notably ASF */
if ((res = gst_rtsp_connection_create (info->url, &info->connection)) < 0)
goto could_not_create;
- if (info->url_str)
- g_free (info->url_str);
+ g_free (info->url_str);
info->url_str = gst_rtsp_url_get_request_uri (info->url);
GST_DEBUG_OBJECT (src, "sanitized uri %s", info->url_str);