mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 03:21:03 +00:00
Update for functions returning bool in most remaining workspaces
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/179
This commit is contained in:
parent
37b717c020
commit
211e476592
14 changed files with 204 additions and 36 deletions
|
@ -152,6 +152,10 @@ status = "generate"
|
||||||
[object.function.return]
|
[object.function.return]
|
||||||
nullable = false
|
nullable = false
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_window"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to set window"
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
name = "GstGL.GLDisplay"
|
name = "GstGL.GLDisplay"
|
||||||
|
@ -217,6 +221,11 @@ status = "generate"
|
||||||
# callback
|
# callback
|
||||||
ignore = true
|
ignore = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_render_rectangle"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to set the specified region"
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "set_resize_callback"
|
name = "set_resize_callback"
|
||||||
# callback
|
# callback
|
||||||
|
@ -242,6 +251,11 @@ name = "GstGL.GLColorConvert"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
final_type = true
|
final_type = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_caps"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to set caps"
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "decide_allocation"
|
name = "decide_allocation"
|
||||||
# correct mutability
|
# correct mutability
|
||||||
|
@ -272,11 +286,26 @@ name = "GstGL.GLSLStage"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
final_type = true
|
final_type = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_strings"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to attach stage to set strings"
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
name = "GstGL.GLShader"
|
name = "GstGL.GLShader"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
final_type = true
|
final_type = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "attach"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to attach stage to shader"
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "attach_unlocked"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to attach stage to shader"
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "set_uniform_matrix_2fv"
|
name = "set_uniform_matrix_2fv"
|
||||||
# array with size
|
# array with size
|
||||||
|
@ -327,6 +356,11 @@ name = "GstGL.GLUpload"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
final_type = true
|
final_type = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_caps"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to set caps"
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "perform_with_buffer"
|
name = "perform_with_buffer"
|
||||||
# Result<Buffer, GLUploadReturn>
|
# Result<Buffer, GLUploadReturn>
|
||||||
|
@ -347,6 +381,11 @@ name = "GstGL.GLViewConvert"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
final_type = true
|
final_type = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_caps"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to set caps"
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "fixate_caps"
|
name = "fixate_caps"
|
||||||
# correct reference ownership
|
# correct reference ownership
|
||||||
|
|
|
@ -110,6 +110,16 @@ status = "generate"
|
||||||
name = "attach"
|
name = "attach"
|
||||||
ignore = true
|
ignore = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "io_func"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to connect the source"
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "transfer_connection"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to transfer to the connection"
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
name = "GstRtspServer.RTSPClient"
|
name = "GstRtspServer.RTSPClient"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
|
@ -160,6 +170,21 @@ status = "generate"
|
||||||
[object.function.return]
|
[object.function.return]
|
||||||
bool_return_is_error = "Failed to leave bin"
|
bool_return_is_error = "Failed to leave bin"
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_blocked"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to block/unblock the dataflow"
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "unblock_linked"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to unblock the dataflow"
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "update_crypto"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Failed to update crypto"
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
name = "GstRtspServer.RTSPAddress"
|
name = "GstRtspServer.RTSPAddress"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
|
@ -258,6 +283,16 @@ status = "generate"
|
||||||
name="GstRtspServer.RTSPAuth"
|
name="GstRtspServer.RTSPAuth"
|
||||||
status="generate"
|
status="generate"
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "check"
|
||||||
|
[object.function.return]
|
||||||
|
bool_return_is_error = "Check failed"
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "connect_accept_certificate"
|
||||||
|
# Use Result<(), LoggableError>
|
||||||
|
ignore = true
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "make_basic"
|
name = "make_basic"
|
||||||
[object.function.return]
|
[object.function.return]
|
||||||
|
|
|
@ -45,9 +45,12 @@ impl TestClock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn crank(&self) -> bool {
|
pub fn crank(&self) -> Result<(), glib::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_test_clock_crank(self.to_glib_none().0))
|
glib_result_from_gboolean!(
|
||||||
|
ffi::gst_test_clock_crank(self.to_glib_none().0),
|
||||||
|
"Failed to crank"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
use GLContext;
|
use GLContext;
|
||||||
use ffi;
|
use ffi;
|
||||||
|
use glib;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
use gst;
|
use gst;
|
||||||
|
@ -24,9 +25,9 @@ impl GLColorConvert {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> bool {
|
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_gl_color_convert_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_gl_color_convert_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0), "Failed to set caps")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ pub trait GLContextExt: 'static {
|
||||||
|
|
||||||
fn set_shared_with<P: IsA<GLContext>>(&self, share: &P);
|
fn set_shared_with<P: IsA<GLContext>>(&self, share: &P);
|
||||||
|
|
||||||
fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> bool;
|
fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), glib::error::BoolError>;
|
||||||
|
|
||||||
fn supports_glsl_profile_version(&self, version: GLSLVersion, profile: GLSLProfile) -> bool;
|
fn supports_glsl_profile_version(&self, version: GLSLVersion, profile: GLSLProfile) -> bool;
|
||||||
|
|
||||||
|
@ -220,9 +220,9 @@ impl<O: IsA<GLContext>> GLContextExt for O {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> bool {
|
fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_gl_context_set_window(self.as_ref().to_glib_none().0, window.as_ref().to_glib_full()))
|
glib_result_from_gboolean!(ffi::gst_gl_context_set_window(self.as_ref().to_glib_none().0, window.as_ref().to_glib_full()), "Failed to set window")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ use Error;
|
||||||
use GLContext;
|
use GLContext;
|
||||||
use GLSLStage;
|
use GLSLStage;
|
||||||
use ffi;
|
use ffi;
|
||||||
|
use glib;
|
||||||
use glib::StaticType;
|
use glib::StaticType;
|
||||||
use glib::Value;
|
use glib::Value;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
|
@ -53,15 +54,15 @@ impl GLShader {
|
||||||
// unsafe { TODO: call ffi::gst_gl_shader_new_with_stages() }
|
// unsafe { TODO: call ffi::gst_gl_shader_new_with_stages() }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
pub fn attach(&self, stage: &GLSLStage) -> bool {
|
pub fn attach(&self, stage: &GLSLStage) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_gl_shader_attach(self.to_glib_none().0, stage.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_gl_shader_attach(self.to_glib_none().0, stage.to_glib_none().0), "Failed to attach stage to shader")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn attach_unlocked(&self, stage: &GLSLStage) -> bool {
|
pub fn attach_unlocked(&self, stage: &GLSLStage) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_gl_shader_attach_unlocked(self.to_glib_none().0, stage.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_gl_shader_attach_unlocked(self.to_glib_none().0, stage.to_glib_none().0), "Failed to attach stage to shader")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
use GLContext;
|
use GLContext;
|
||||||
use ffi;
|
use ffi;
|
||||||
|
use glib;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
use gst;
|
use gst;
|
||||||
|
@ -34,9 +35,9 @@ impl GLUpload {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> bool {
|
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_gl_upload_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_gl_upload_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0), "Failed to set caps")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
use GLContext;
|
use GLContext;
|
||||||
use GLStereoDownmix;
|
use GLStereoDownmix;
|
||||||
use ffi;
|
use ffi;
|
||||||
|
use glib;
|
||||||
use glib::StaticType;
|
use glib::StaticType;
|
||||||
use glib::Value;
|
use glib::Value;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
|
@ -47,9 +48,9 @@ impl GLViewConvert {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> bool {
|
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_gl_view_convert_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_gl_view_convert_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0), "Failed to set caps")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
use GLContext;
|
use GLContext;
|
||||||
use GLDisplay;
|
use GLDisplay;
|
||||||
use ffi;
|
use ffi;
|
||||||
|
use glib;
|
||||||
use glib::GString;
|
use glib::GString;
|
||||||
use glib::object::Cast;
|
use glib::object::Cast;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
|
@ -63,7 +64,7 @@ pub trait GLWindowExt: 'static {
|
||||||
|
|
||||||
fn set_preferred_size(&self, width: i32, height: i32);
|
fn set_preferred_size(&self, width: i32, height: i32);
|
||||||
|
|
||||||
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) -> bool;
|
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) -> Result<(), glib::error::BoolError>;
|
||||||
|
|
||||||
fn show(&self);
|
fn show(&self);
|
||||||
|
|
||||||
|
@ -142,9 +143,9 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) -> bool {
|
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_gl_window_set_render_rectangle(self.as_ref().to_glib_none().0, x, y, width, height))
|
glib_result_from_gboolean!(ffi::gst_gl_window_set_render_rectangle(self.as_ref().to_glib_none().0, x, y, width, height), "Failed to set the specified region")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ use GLContext;
|
||||||
use GLSLProfile;
|
use GLSLProfile;
|
||||||
use GLSLVersion;
|
use GLSLVersion;
|
||||||
use ffi;
|
use ffi;
|
||||||
|
use glib;
|
||||||
use glib::GString;
|
use glib::GString;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
@ -90,10 +91,10 @@ impl GLSLStage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_strings(&self, version: GLSLVersion, profile: GLSLProfile, str: &[&str]) -> bool {
|
pub fn set_strings(&self, version: GLSLVersion, profile: GLSLProfile, str: &[&str]) -> Result<(), glib::error::BoolError> {
|
||||||
let n_strings = str.len() as i32;
|
let n_strings = str.len() as i32;
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_glsl_stage_set_strings(self.to_glib_none().0, version.to_glib(), profile.to_glib(), n_strings, str.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_glsl_stage_set_strings(self.to_glib_none().0, version.to_glib(), profile.to_glib(), n_strings, str.to_glib_none().0), "Failed to attach stage to set strings")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ use RTSPToken;
|
||||||
use ffi;
|
use ffi;
|
||||||
use gio;
|
use gio;
|
||||||
use gio_ffi;
|
use gio_ffi;
|
||||||
|
use glib;
|
||||||
use glib::GString;
|
use glib::GString;
|
||||||
use glib::object::Cast;
|
use glib::object::Cast;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
|
@ -34,10 +35,10 @@ impl RTSPAuth {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check(check: &str) -> bool {
|
pub fn check(check: &str) -> Result<(), glib::error::BoolError> {
|
||||||
assert_initialized_main_thread!();
|
assert_initialized_main_thread!();
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_rtsp_auth_check(check.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_rtsp_auth_check(check.to_glib_none().0), "Check failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,10 @@ impl RTSPServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn io_func<P: IsA<gio::Socket>, Q: IsA<RTSPServer>>(socket: &P, condition: glib::IOCondition, server: &Q) -> bool {
|
pub fn io_func<P: IsA<gio::Socket>, Q: IsA<RTSPServer>>(socket: &P, condition: glib::IOCondition, server: &Q) -> Result<(), glib::error::BoolError> {
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_rtsp_server_io_func(socket.as_ref().to_glib_none().0, condition.to_glib(), server.as_ref().to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_rtsp_server_io_func(socket.as_ref().to_glib_none().0, condition.to_glib(), server.as_ref().to_glib_none().0), "Failed to connect the source")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ pub trait RTSPServerExt: 'static {
|
||||||
|
|
||||||
fn set_thread_pool<'a, P: IsA<RTSPThreadPool> + 'a, Q: Into<Option<&'a P>>>(&self, pool: Q);
|
fn set_thread_pool<'a, P: IsA<RTSPThreadPool> + 'a, Q: Into<Option<&'a P>>>(&self, pool: Q);
|
||||||
|
|
||||||
fn transfer_connection<'a, P: IsA<gio::Socket>, Q: Into<Option<&'a str>>>(&self, socket: &P, ip: &str, port: i32, initial_buffer: Q) -> bool;
|
fn transfer_connection<'a, P: IsA<gio::Socket>, Q: Into<Option<&'a str>>>(&self, socket: &P, ip: &str, port: i32, initial_buffer: Q) -> Result<(), glib::error::BoolError>;
|
||||||
|
|
||||||
fn connect_client_connected<F: Fn(&Self, &RTSPClient) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
fn connect_client_connected<F: Fn(&Self, &RTSPClient) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
||||||
|
|
||||||
|
@ -228,10 +228,10 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transfer_connection<'a, P: IsA<gio::Socket>, Q: Into<Option<&'a str>>>(&self, socket: &P, ip: &str, port: i32, initial_buffer: Q) -> bool {
|
fn transfer_connection<'a, P: IsA<gio::Socket>, Q: Into<Option<&'a str>>>(&self, socket: &P, ip: &str, port: i32, initial_buffer: Q) -> Result<(), glib::error::BoolError> {
|
||||||
let initial_buffer = initial_buffer.into();
|
let initial_buffer = initial_buffer.into();
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_rtsp_server_transfer_connection(self.as_ref().to_glib_none().0, socket.as_ref().to_glib_full(), ip.to_glib_none().0, port, initial_buffer.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_rtsp_server_transfer_connection(self.as_ref().to_glib_none().0, socket.as_ref().to_glib_full(), ip.to_glib_none().0, port, initial_buffer.to_glib_none().0), "Failed to transfer to the connection")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ pub trait RTSPStreamExt: 'static {
|
||||||
|
|
||||||
fn set_address_pool<'a, P: IsA<RTSPAddressPool> + 'a, Q: Into<Option<&'a P>>>(&self, pool: Q);
|
fn set_address_pool<'a, P: IsA<RTSPAddressPool> + 'a, Q: Into<Option<&'a P>>>(&self, pool: Q);
|
||||||
|
|
||||||
fn set_blocked(&self, blocked: bool) -> bool;
|
fn set_blocked(&self, blocked: bool) -> Result<(), glib::error::BoolError>;
|
||||||
|
|
||||||
fn set_buffer_size(&self, size: u32);
|
fn set_buffer_size(&self, size: u32);
|
||||||
|
|
||||||
|
@ -166,9 +166,9 @@ pub trait RTSPStreamExt: 'static {
|
||||||
|
|
||||||
//fn transport_filter(&self, func: /*Unimplemented*/Fn(&RTSPStream, &RTSPStreamTransport) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPStreamTransport>;
|
//fn transport_filter(&self, func: /*Unimplemented*/Fn(&RTSPStream, &RTSPStreamTransport) -> /*Ignored*/RTSPFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Vec<RTSPStreamTransport>;
|
||||||
|
|
||||||
fn unblock_linked(&self) -> bool;
|
fn unblock_linked(&self) -> Result<(), glib::error::BoolError>;
|
||||||
|
|
||||||
fn update_crypto<'a, P: Into<Option<&'a gst::Caps>>>(&self, ssrc: u32, crypto: P) -> bool;
|
fn update_crypto<'a, P: Into<Option<&'a gst::Caps>>>(&self, ssrc: u32, crypto: P) -> Result<(), glib::error::BoolError>;
|
||||||
|
|
||||||
fn connect_new_rtcp_encoder<F: Fn(&Self, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
fn connect_new_rtcp_encoder<F: Fn(&Self, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
||||||
|
|
||||||
|
@ -453,9 +453,9 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_blocked(&self, blocked: bool) -> bool {
|
fn set_blocked(&self, blocked: bool) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_rtsp_stream_set_blocked(self.as_ref().to_glib_none().0, blocked.to_glib()))
|
glib_result_from_gboolean!(ffi::gst_rtsp_stream_set_blocked(self.as_ref().to_glib_none().0, blocked.to_glib()), "Failed to block/unblock the dataflow")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -543,16 +543,16 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
|
||||||
// unsafe { TODO: call ffi::gst_rtsp_stream_transport_filter() }
|
// unsafe { TODO: call ffi::gst_rtsp_stream_transport_filter() }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
fn unblock_linked(&self) -> bool {
|
fn unblock_linked(&self) -> Result<(), glib::error::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_rtsp_stream_unblock_linked(self.as_ref().to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_rtsp_stream_unblock_linked(self.as_ref().to_glib_none().0), "Failed to unblock the dataflow")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_crypto<'a, P: Into<Option<&'a gst::Caps>>>(&self, ssrc: u32, crypto: P) -> bool {
|
fn update_crypto<'a, P: Into<Option<&'a gst::Caps>>>(&self, ssrc: u32, crypto: P) -> Result<(), glib::error::BoolError> {
|
||||||
let crypto = crypto.into();
|
let crypto = crypto.into();
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_rtsp_stream_update_crypto(self.as_ref().to_glib_none().0, ssrc, crypto.to_glib_none().0))
|
glib_result_from_gboolean!(ffi::gst_rtsp_stream_update_crypto(self.as_ref().to_glib_none().0, ssrc, crypto.to_glib_none().0), "Failed to update crypto")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,33 @@
|
||||||
use ffi;
|
use ffi;
|
||||||
|
use glib::object::Cast;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
|
use glib::signal::connect_raw;
|
||||||
|
use glib::signal::SignalHandlerId;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
|
||||||
|
use std::boxed::Box as Box_;
|
||||||
|
use std::mem::transmute;
|
||||||
|
|
||||||
use RTSPAuth;
|
use RTSPAuth;
|
||||||
use RTSPToken;
|
use RTSPToken;
|
||||||
|
|
||||||
pub trait RTSPAuthExtManual: 'static {
|
pub trait RTSPAuthExtManual: 'static {
|
||||||
fn set_default_token<'a, P: Into<Option<&'a mut RTSPToken>>>(&self, token: P);
|
fn set_default_token<'a, P: Into<Option<&'a mut RTSPToken>>>(&self, token: P);
|
||||||
|
|
||||||
|
fn connect_accept_certificate<
|
||||||
|
F: Fn(
|
||||||
|
&Self,
|
||||||
|
&gio::TlsConnection,
|
||||||
|
&gio::TlsCertificate,
|
||||||
|
gio::TlsCertificateFlags,
|
||||||
|
) -> Result<(), gst::LoggableError>
|
||||||
|
+ Send
|
||||||
|
+ Sync
|
||||||
|
+ 'static,
|
||||||
|
>(
|
||||||
|
&self,
|
||||||
|
f: F,
|
||||||
|
) -> SignalHandlerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<O: IsA<RTSPAuth>> RTSPAuthExtManual for O {
|
impl<O: IsA<RTSPAuth>> RTSPAuthExtManual for O {
|
||||||
|
@ -18,4 +40,66 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExtManual for O {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn connect_accept_certificate<
|
||||||
|
F: Fn(
|
||||||
|
&Self,
|
||||||
|
&gio::TlsConnection,
|
||||||
|
&gio::TlsCertificate,
|
||||||
|
gio::TlsCertificateFlags,
|
||||||
|
) -> Result<(), gst::LoggableError>
|
||||||
|
+ Send
|
||||||
|
+ Sync
|
||||||
|
+ 'static,
|
||||||
|
>(
|
||||||
|
&self,
|
||||||
|
f: F,
|
||||||
|
) -> SignalHandlerId {
|
||||||
|
unsafe {
|
||||||
|
let f: Box_<F> = Box_::new(f);
|
||||||
|
connect_raw(
|
||||||
|
self.as_ptr() as *mut _,
|
||||||
|
b"accept-certificate\0".as_ptr() as *const _,
|
||||||
|
Some(transmute(accept_certificate_trampoline::<Self, F> as usize)),
|
||||||
|
Box_::into_raw(f),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe extern "C" fn accept_certificate_trampoline<
|
||||||
|
P,
|
||||||
|
F: Fn(
|
||||||
|
&P,
|
||||||
|
&gio::TlsConnection,
|
||||||
|
&gio::TlsCertificate,
|
||||||
|
gio::TlsCertificateFlags,
|
||||||
|
) -> Result<(), gst::LoggableError>
|
||||||
|
+ Send
|
||||||
|
+ Sync
|
||||||
|
+ 'static,
|
||||||
|
>(
|
||||||
|
this: *mut ffi::GstRTSPAuth,
|
||||||
|
connection: *mut gio_ffi::GTlsConnection,
|
||||||
|
peer_cert: *mut gio_ffi::GTlsCertificate,
|
||||||
|
errors: gio_ffi::GTlsCertificateFlags,
|
||||||
|
f: glib_ffi::gpointer,
|
||||||
|
) -> glib_ffi::gboolean
|
||||||
|
where
|
||||||
|
P: IsA<RTSPAuth>,
|
||||||
|
{
|
||||||
|
let f: &F = transmute(f);
|
||||||
|
match f(
|
||||||
|
&RTSPAuth::from_glib_borrow(this).unsafe_cast(),
|
||||||
|
&from_glib_borrow(connection),
|
||||||
|
&from_glib_borrow(peer_cert),
|
||||||
|
from_glib(errors),
|
||||||
|
) {
|
||||||
|
Ok(()) => true,
|
||||||
|
Err(err) => {
|
||||||
|
err.log();
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.to_glib()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue