mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 20:25:25 +00:00
rtmp2: Allow setting flash-version
In case the application has to deal with fussy servers. User agent sniffing is so last decade. Adds a property to set the Flash version on both the sink and the src. The default stays the same (IIRC, Flash plugin for Linux from 2009).
This commit is contained in:
parent
69ef74d96a
commit
91a033a85e
4 changed files with 37 additions and 1 deletions
|
@ -33,6 +33,7 @@
|
||||||
#define DEFAULT_PASSWORD NULL
|
#define DEFAULT_PASSWORD NULL
|
||||||
#define DEFAULT_AUTHMOD GST_RTMP_AUTHMOD_AUTO
|
#define DEFAULT_AUTHMOD GST_RTMP_AUTHMOD_AUTO
|
||||||
#define DEFAULT_TIMEOUT 5
|
#define DEFAULT_TIMEOUT 5
|
||||||
|
#define DEFAULT_FLASH_VERSION "LNX 10,0,32,18"
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (GstRtmpLocationHandler, gst_rtmp_location_handler, 0);
|
G_DEFINE_INTERFACE (GstRtmpLocationHandler, gst_rtmp_location_handler, 0);
|
||||||
|
|
||||||
|
@ -88,6 +89,10 @@ gst_rtmp_location_handler_default_init (GstRtmpLocationHandlerInterface * iface)
|
||||||
"TLS validation flags to use", G_TYPE_TLS_CERTIFICATE_FLAGS,
|
"TLS validation flags to use", G_TYPE_TLS_CERTIFICATE_FLAGS,
|
||||||
G_TLS_CERTIFICATE_VALIDATE_ALL,
|
G_TLS_CERTIFICATE_VALIDATE_ALL,
|
||||||
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
g_object_interface_install_property (iface,
|
||||||
|
g_param_spec_string ("flash-version", "Flash version",
|
||||||
|
"Flash version reported to the server", DEFAULT_FLASH_VERSION,
|
||||||
|
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstURIType
|
static GstURIType
|
||||||
|
|
|
@ -141,6 +141,7 @@ enum
|
||||||
PROP_AUTHMOD,
|
PROP_AUTHMOD,
|
||||||
PROP_TIMEOUT,
|
PROP_TIMEOUT,
|
||||||
PROP_TLS_VALIDATION_FLAGS,
|
PROP_TLS_VALIDATION_FLAGS,
|
||||||
|
PROP_FLASH_VERSION,
|
||||||
PROP_ASYNC_CONNECT,
|
PROP_ASYNC_CONNECT,
|
||||||
PROP_PEAK_KBPS,
|
PROP_PEAK_KBPS,
|
||||||
PROP_CHUNK_SIZE,
|
PROP_CHUNK_SIZE,
|
||||||
|
@ -201,6 +202,8 @@ gst_rtmp2_sink_class_init (GstRtmp2SinkClass * klass)
|
||||||
g_object_class_override_property (gobject_class, PROP_TIMEOUT, "timeout");
|
g_object_class_override_property (gobject_class, PROP_TIMEOUT, "timeout");
|
||||||
g_object_class_override_property (gobject_class, PROP_TLS_VALIDATION_FLAGS,
|
g_object_class_override_property (gobject_class, PROP_TLS_VALIDATION_FLAGS,
|
||||||
"tls-validation-flags");
|
"tls-validation-flags");
|
||||||
|
g_object_class_override_property (gobject_class, PROP_FLASH_VERSION,
|
||||||
|
"flash-version");
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_ASYNC_CONNECT,
|
g_object_class_install_property (gobject_class, PROP_ASYNC_CONNECT,
|
||||||
g_param_spec_boolean ("async-connect", "Async connect",
|
g_param_spec_boolean ("async-connect", "Async connect",
|
||||||
|
@ -323,6 +326,12 @@ gst_rtmp2_sink_set_property (GObject * object, guint property_id,
|
||||||
self->location.tls_flags = g_value_get_flags (value);
|
self->location.tls_flags = g_value_get_flags (value);
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
break;
|
break;
|
||||||
|
case PROP_FLASH_VERSION:
|
||||||
|
GST_OBJECT_LOCK (self);
|
||||||
|
g_free (self->location.flash_ver);
|
||||||
|
self->location.flash_ver = g_value_dup_string (value);
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
break;
|
||||||
case PROP_ASYNC_CONNECT:
|
case PROP_ASYNC_CONNECT:
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
self->async_connect = g_value_get_boolean (value);
|
self->async_connect = g_value_get_boolean (value);
|
||||||
|
@ -422,6 +431,11 @@ gst_rtmp2_sink_get_property (GObject * object, guint property_id,
|
||||||
g_value_set_flags (value, self->location.tls_flags);
|
g_value_set_flags (value, self->location.tls_flags);
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
break;
|
break;
|
||||||
|
case PROP_FLASH_VERSION:
|
||||||
|
GST_OBJECT_LOCK (self);
|
||||||
|
g_value_set_string (value, self->location.flash_ver);
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
break;
|
||||||
case PROP_ASYNC_CONNECT:
|
case PROP_ASYNC_CONNECT:
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
g_value_set_boolean (value, self->async_connect);
|
g_value_set_boolean (value, self->async_connect);
|
||||||
|
|
|
@ -130,6 +130,7 @@ enum
|
||||||
PROP_AUTHMOD,
|
PROP_AUTHMOD,
|
||||||
PROP_TIMEOUT,
|
PROP_TIMEOUT,
|
||||||
PROP_TLS_VALIDATION_FLAGS,
|
PROP_TLS_VALIDATION_FLAGS,
|
||||||
|
PROP_FLASH_VERSION,
|
||||||
PROP_ASYNC_CONNECT,
|
PROP_ASYNC_CONNECT,
|
||||||
PROP_STATS,
|
PROP_STATS,
|
||||||
};
|
};
|
||||||
|
@ -187,6 +188,8 @@ gst_rtmp2_src_class_init (GstRtmp2SrcClass * klass)
|
||||||
g_object_class_override_property (gobject_class, PROP_TIMEOUT, "timeout");
|
g_object_class_override_property (gobject_class, PROP_TIMEOUT, "timeout");
|
||||||
g_object_class_override_property (gobject_class, PROP_TLS_VALIDATION_FLAGS,
|
g_object_class_override_property (gobject_class, PROP_TLS_VALIDATION_FLAGS,
|
||||||
"tls-validation-flags");
|
"tls-validation-flags");
|
||||||
|
g_object_class_override_property (gobject_class, PROP_FLASH_VERSION,
|
||||||
|
"flash-version");
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_ASYNC_CONNECT,
|
g_object_class_install_property (gobject_class, PROP_ASYNC_CONNECT,
|
||||||
g_param_spec_boolean ("async-connect", "Async connect",
|
g_param_spec_boolean ("async-connect", "Async connect",
|
||||||
|
@ -292,6 +295,12 @@ gst_rtmp2_src_set_property (GObject * object, guint property_id,
|
||||||
self->location.tls_flags = g_value_get_flags (value);
|
self->location.tls_flags = g_value_get_flags (value);
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
break;
|
break;
|
||||||
|
case PROP_FLASH_VERSION:
|
||||||
|
GST_OBJECT_LOCK (self);
|
||||||
|
g_free (self->location.flash_ver);
|
||||||
|
self->location.flash_ver = g_value_dup_string (value);
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
break;
|
||||||
case PROP_ASYNC_CONNECT:
|
case PROP_ASYNC_CONNECT:
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
self->async_connect = g_value_get_boolean (value);
|
self->async_connect = g_value_get_boolean (value);
|
||||||
|
@ -371,6 +380,11 @@ gst_rtmp2_src_get_property (GObject * object, guint property_id,
|
||||||
g_value_set_flags (value, self->location.tls_flags);
|
g_value_set_flags (value, self->location.tls_flags);
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
break;
|
break;
|
||||||
|
case PROP_FLASH_VERSION:
|
||||||
|
GST_OBJECT_LOCK (self);
|
||||||
|
g_value_set_string (value, self->location.flash_ver);
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
break;
|
||||||
case PROP_ASYNC_CONNECT:
|
case PROP_ASYNC_CONNECT:
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
g_value_set_boolean (value, self->async_connect);
|
g_value_set_boolean (value, self->async_connect);
|
||||||
|
|
|
@ -513,7 +513,10 @@ send_connect (GTask * task)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!flash_ver) {
|
if (!flash_ver) {
|
||||||
flash_ver = "LNX 10,0,32,18";
|
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_INITIALIZED,
|
||||||
|
"Flash version is not set");
|
||||||
|
g_object_unref (task);
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->auth_query) {
|
if (data->auth_query) {
|
||||||
|
|
Loading…
Reference in a new issue