Added port-range property to PlayerEndpoint #14
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -45,6 +45,7 @@ G_DEFINE_QUARK (APPSINK_KEY, appsink); | |||||
G_DEFINE_QUARK (PTS_KEY, pts); | ||||||
|
||||||
#define NETWORK_CACHE_DEFAULT 2000 | ||||||
#define PORT_RANGE_DEFAULT NULL | ||||||
#define IS_PREROLL TRUE | ||||||
|
||||||
GST_DEBUG_CATEGORY_STATIC (kms_player_endpoint_debug_category); | ||||||
|
@@ -83,6 +84,7 @@ struct _KmsPlayerEndpointPrivate | |||||
KmsLoop *loop; | ||||||
gboolean use_encoded_media; | ||||||
gint network_cache; | ||||||
gchar *port_range; | ||||||
|
||||||
GMutex base_time_mutex; | ||||||
gboolean reset; | ||||||
|
@@ -99,6 +101,7 @@ enum | |||||
PROP_VIDEO_DATA, | ||||||
PROP_POSITION, | ||||||
PROP_NETWORK_CACHE, | ||||||
PROP_PORT_RANGE, | ||||||
PROP_PIPELINE, | ||||||
N_PROPERTIES | ||||||
}; | ||||||
|
@@ -194,6 +197,10 @@ kms_player_endpoint_set_property (GObject * object, guint property_id, | |||||
case PROP_NETWORK_CACHE: | ||||||
playerendpoint->priv->network_cache = g_value_get_int (value); | ||||||
break; | ||||||
case PROP_PORT_RANGE: | ||||||
g_free (playerendpoint->priv->port_range); | ||||||
playerendpoint->priv->port_range = g_value_dup_string (value); | ||||||
break; | ||||||
default: | ||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); | ||||||
break; | ||||||
|
@@ -267,6 +274,9 @@ kms_player_endpoint_get_property (GObject * object, guint property_id, | |||||
case PROP_NETWORK_CACHE: | ||||||
g_value_set_int (value, playerendpoint->priv->network_cache); | ||||||
break; | ||||||
case PROP_PORT_RANGE: | ||||||
g_value_set_string (value, playerendpoint->priv->port_range); | ||||||
break; | ||||||
default: | ||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); | ||||||
break; | ||||||
|
@@ -1089,6 +1099,11 @@ kms_player_endpoint_class_init (KmsPlayerEndpointClass * klass) | |||||
0, G_MAXINT, NETWORK_CACHE_DEFAULT, | ||||||
G_PARAM_READWRITE | GST_PARAM_MUTABLE_READY)); | ||||||
|
||||||
g_object_class_install_property (gobject_class, PROP_PORT_RANGE, | ||||||
g_param_spec_string ("port-range", "UDP Port range for RTSP source", | ||||||
"When using rtsp sources, what range of UDP ports can be allocated", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
PORT_RANGE_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); | ||||||
|
||||||
g_object_class_install_property (gobject_class, PROP_PIPELINE, | ||||||
g_param_spec_object ("pipeline", "Internal pipeline", | ||||||
"PlayerEndpoint's private pipeline", | ||||||
|
@@ -1272,8 +1287,11 @@ kms_player_endpoint_uridecodebin_element_added (GstBin * bin, | |||||
|
||||||
if (g_strcmp0 (gst_plugin_feature_get_name (GST_PLUGIN_FEATURE | ||||||
(gst_element_get_factory (element))), RTSPSRC) == 0) { | ||||||
g_object_set (G_OBJECT (element), "latency", self->priv->network_cache, | ||||||
"drop-on-latency", TRUE, NULL); | ||||||
g_object_set (G_OBJECT (element), | ||||||
"latency", self->priv->network_cache, | ||||||
"drop-on-latency", TRUE, | ||||||
"port-range", self->priv->port_range, | ||||||
NULL); | ||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -1343,6 +1361,7 @@ kms_player_endpoint_init (KmsPlayerEndpoint * self) | |||||
self->priv->uridecodebin = | ||||||
gst_element_factory_make ("uridecodebin", NULL); | ||||||
self->priv->network_cache = NETWORK_CACHE_DEFAULT; | ||||||
self->priv->port_range = PORT_RANGE_DEFAULT; | ||||||
|
||||||
self->priv->stats.probes = kms_list_new_full (g_direct_equal, g_object_unref, | ||||||
(GDestroyNotify) kms_stats_probe_destroy); | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,3 @@ | ||||||
;; This is setting from gstreamer plugin gst-plugins-good | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
;; https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-rtspsrc.html#GstRTSPSrc--port-range | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
;rtspSrcPortRange=<PortMin-PortMax> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -36,6 +36,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); | |||||
#define PIPELINE "pipeline" | ||||||
#define SET_POSITION "set-position" | ||||||
#define NS_TO_MS 1000000 | ||||||
#define RTSP_SRC_PORT_RANGE "rtspSrcPortRange" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
namespace kurento | ||||||
{ | ||||||
|
@@ -106,6 +107,13 @@ PlayerEndpointImpl::PlayerEndpointImpl (const boost::property_tree::ptree &conf, | |||||
|
||||||
g_object_set (G_OBJECT (element), "use-encoded-media", useEncodedMedia, | ||||||
"network-cache", networkCache, NULL); | ||||||
|
||||||
try { | ||||||
std::string portRange = getConfigValue <std::string, PlayerEndpoint> (RTSP_SRC_PORT_RANGE); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
g_object_set (G_OBJECT (element), "port-range", portRange.c_str(), NULL); | ||||||
} catch (boost::property_tree::ptree_error &) { | ||||||
GST_DEBUG ("PlayerEndpoint config file doesn't contain property %s. Ignoring.", RTSP_SRC_PORT_RANGE); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
} | ||||||
|
||||||
PlayerEndpointImpl::~PlayerEndpointImpl() | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.