mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
rtspsrc: add "proxy-id" and "proxy-pw" properties
to match souphttpsrc. user/password passed via the URI will still take precedence though. https://bugzilla.gnome.org/show_bug.cgi?id=395427
This commit is contained in:
parent
644c939fcb
commit
95a37196b3
2 changed files with 55 additions and 2 deletions
|
@ -197,6 +197,8 @@ enum
|
||||||
PROP_DO_RTCP,
|
PROP_DO_RTCP,
|
||||||
PROP_DO_RTSP_KEEP_ALIVE,
|
PROP_DO_RTSP_KEEP_ALIVE,
|
||||||
PROP_PROXY,
|
PROP_PROXY,
|
||||||
|
PROP_PROXY_ID,
|
||||||
|
PROP_PROXY_PW,
|
||||||
PROP_RTP_BLOCKSIZE,
|
PROP_RTP_BLOCKSIZE,
|
||||||
PROP_USER_ID,
|
PROP_USER_ID,
|
||||||
PROP_USER_PW,
|
PROP_USER_PW,
|
||||||
|
@ -410,6 +412,30 @@ gst_rtspsrc_class_init (GstRTSPSrcClass * klass)
|
||||||
g_param_spec_string ("proxy", "Proxy",
|
g_param_spec_string ("proxy", "Proxy",
|
||||||
"Proxy settings for HTTP tunneling. Format: [http://][user:passwd@]host[:port]",
|
"Proxy settings for HTTP tunneling. Format: [http://][user:passwd@]host[:port]",
|
||||||
DEFAULT_PROXY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
DEFAULT_PROXY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
/**
|
||||||
|
* GstRTSPSrc::proxy-id
|
||||||
|
*
|
||||||
|
* Sets the proxy URI user id for authentication. If the URI set via the
|
||||||
|
* "proxy" property contains a user-id already, that will take precedence.
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (gobject_class, PROP_PROXY_ID,
|
||||||
|
g_param_spec_string ("proxy-id", "proxy-id",
|
||||||
|
"HTTP proxy URI user id for authentication", "",
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
/**
|
||||||
|
* GstRTSPSrc::proxy-pw
|
||||||
|
*
|
||||||
|
* Sets the proxy URI password for authentication. If the URI set via the
|
||||||
|
* "proxy" property contains a password already, that will take precedence.
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (gobject_class, PROP_PROXY_PW,
|
||||||
|
g_param_spec_string ("proxy-pw", "proxy-pw",
|
||||||
|
"HTTP proxy URI user password for authentication", "",
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstRTSPSrc::rtp_blocksize
|
* GstRTSPSrc::rtp_blocksize
|
||||||
|
@ -624,6 +650,15 @@ gst_rtspsrc_set_proxy (GstRTSPSrc * rtsp, const gchar * proxy)
|
||||||
|
|
||||||
/* move to host */
|
/* move to host */
|
||||||
p = at + 1;
|
p = at + 1;
|
||||||
|
} else {
|
||||||
|
if (rtsp->prop_proxy_id != NULL && *rtsp->prop_proxy_id != '\0')
|
||||||
|
rtsp->proxy_user = g_strdup (rtsp->prop_proxy_id);
|
||||||
|
if (rtsp->prop_proxy_pw != NULL && *rtsp->prop_proxy_pw != '\0')
|
||||||
|
rtsp->proxy_passwd = g_strdup (rtsp->prop_proxy_pw);
|
||||||
|
if (rtsp->proxy_user != NULL || rtsp->proxy_passwd != NULL) {
|
||||||
|
GST_LOG_OBJECT (rtsp, "set proxy user/pw from properties: %s:%s",
|
||||||
|
GST_STR_NULL (rtsp->proxy_user), GST_STR_NULL (rtsp->proxy_passwd));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
col = strchr (p, ':');
|
col = strchr (p, ':');
|
||||||
|
|
||||||
|
@ -700,6 +735,16 @@ gst_rtspsrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
case PROP_PROXY:
|
case PROP_PROXY:
|
||||||
gst_rtspsrc_set_proxy (rtspsrc, g_value_get_string (value));
|
gst_rtspsrc_set_proxy (rtspsrc, g_value_get_string (value));
|
||||||
break;
|
break;
|
||||||
|
case PROP_PROXY_ID:
|
||||||
|
if (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);
|
||||||
|
rtspsrc->prop_proxy_pw = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
case PROP_RTP_BLOCKSIZE:
|
case PROP_RTP_BLOCKSIZE:
|
||||||
rtspsrc->rtp_blocksize = g_value_get_uint (value);
|
rtspsrc->rtp_blocksize = g_value_get_uint (value);
|
||||||
break;
|
break;
|
||||||
|
@ -812,6 +857,12 @@ gst_rtspsrc_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
g_value_take_string (value, str);
|
g_value_take_string (value, str);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PROP_PROXY_ID:
|
||||||
|
g_value_set_string (value, rtspsrc->prop_proxy_id);
|
||||||
|
break;
|
||||||
|
case PROP_PROXY_PW:
|
||||||
|
g_value_set_string (value, rtspsrc->prop_proxy_pw);
|
||||||
|
break;
|
||||||
case PROP_RTP_BLOCKSIZE:
|
case PROP_RTP_BLOCKSIZE:
|
||||||
g_value_set_uint (value, rtspsrc->rtp_blocksize);
|
g_value_set_uint (value, rtspsrc->rtp_blocksize);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -208,8 +208,10 @@ struct _GstRTSPSrc {
|
||||||
gboolean do_rtsp_keep_alive;
|
gboolean do_rtsp_keep_alive;
|
||||||
gchar *proxy_host;
|
gchar *proxy_host;
|
||||||
guint proxy_port;
|
guint proxy_port;
|
||||||
gchar *proxy_user;
|
gchar *proxy_user; /* from url or property */
|
||||||
gchar *proxy_passwd;
|
gchar *proxy_passwd; /* from url or property */
|
||||||
|
gchar *prop_proxy_id; /* set via property */
|
||||||
|
gchar *prop_proxy_pw; /* set via property */
|
||||||
guint rtp_blocksize;
|
guint rtp_blocksize;
|
||||||
gchar *user_id;
|
gchar *user_id;
|
||||||
gchar *user_pw;
|
gchar *user_pw;
|
||||||
|
|
Loading…
Reference in a new issue