mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-17 05:15:14 +00:00
Run gst-plugin-threadshare through cargo fmt
This commit is contained in:
parent
6c32b702f0
commit
73a7be5ef5
7 changed files with 53 additions and 49 deletions
|
@ -97,7 +97,8 @@ fn main() {
|
|||
let source = gst::ElementFactory::make(
|
||||
"ts-tcpclientsrc",
|
||||
Some(format!("source-{}", i).as_str()),
|
||||
).unwrap();
|
||||
)
|
||||
.unwrap();
|
||||
source.set_property("port", &(40000u32)).unwrap();
|
||||
source
|
||||
.set_property("context", &format!("context-{}", (i as u32) % n_groups))
|
||||
|
@ -110,7 +111,8 @@ fn main() {
|
|||
let source = gst::ElementFactory::make(
|
||||
"tonegeneratesrc",
|
||||
Some(format!("source-{}", i).as_str()),
|
||||
).unwrap();
|
||||
)
|
||||
.unwrap();
|
||||
source
|
||||
.set_property("samplesperbuffer", &((wait as i32) * 8000 / 1000))
|
||||
.unwrap();
|
||||
|
|
|
@ -459,12 +459,13 @@ impl AppSrc {
|
|||
|
||||
let mut state = self.state.lock().unwrap();
|
||||
|
||||
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
let io_context =
|
||||
IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
|
||||
let pending_future_id = io_context.acquire_pending_future_id();
|
||||
gst_debug!(
|
||||
|
@ -666,7 +667,7 @@ impl ImplTypeStatic<Element> for AppSrcStatic {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn register(plugin: &gst::Plugin)-> Result<(), glib::BoolError> {
|
||||
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
||||
let type_ = register_type(AppSrcStatic);
|
||||
gst::Element::register(plugin, "ts-appsrc", 0, type_)
|
||||
}
|
||||
|
|
|
@ -1059,12 +1059,13 @@ impl ProxySrc {
|
|||
|
||||
let mut state = self.state.lock().unwrap();
|
||||
|
||||
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
let io_context =
|
||||
IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
|
||||
let queue = match SharedQueue::get(&settings.proxy_context, false) {
|
||||
Some(queue) => queue,
|
||||
|
|
|
@ -693,12 +693,13 @@ impl Queue {
|
|||
|
||||
let mut state = self.state.lock().unwrap();
|
||||
|
||||
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
let io_context =
|
||||
IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
|
||||
let dataqueue = DataQueue::new(
|
||||
&element.clone().upcast(),
|
||||
|
|
|
@ -443,12 +443,13 @@ impl TcpClientSrc {
|
|||
|
||||
let mut state = self.state.lock().unwrap();
|
||||
|
||||
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
let io_context =
|
||||
IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
|
||||
let addr: IpAddr = match settings.address {
|
||||
None => {
|
||||
|
|
|
@ -430,12 +430,13 @@ impl UdpSrc {
|
|||
|
||||
let mut state = self.state.lock().unwrap();
|
||||
|
||||
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
let io_context =
|
||||
IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create IO context: {}", err]
|
||||
)
|
||||
})?;
|
||||
|
||||
let addr: IpAddr = match settings.address {
|
||||
None => {
|
||||
|
@ -486,7 +487,8 @@ impl UdpSrc {
|
|||
net2::UdpBuilder::new_v4()
|
||||
} else {
|
||||
net2::UdpBuilder::new_v6()
|
||||
}.map_err(|err| {
|
||||
}
|
||||
.map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenRead,
|
||||
["Failed to create socket: {}", err]
|
||||
|
|
|
@ -97,24 +97,20 @@ fn test_push() {
|
|||
.unwrap();
|
||||
|
||||
for _ in 0..3 {
|
||||
assert!(
|
||||
appsrc
|
||||
.emit("push-buffer", &[&gst::Buffer::new()])
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.get::<bool>()
|
||||
.unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
assert!(
|
||||
appsrc
|
||||
.emit("end-of-stream", &[])
|
||||
assert!(appsrc
|
||||
.emit("push-buffer", &[&gst::Buffer::new()])
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.get::<bool>()
|
||||
.unwrap()
|
||||
);
|
||||
.unwrap());
|
||||
}
|
||||
|
||||
assert!(appsrc
|
||||
.emit("end-of-stream", &[])
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.get::<bool>()
|
||||
.unwrap());
|
||||
|
||||
let mut eos = false;
|
||||
let bus = pipeline.get_bus().unwrap();
|
||||
|
|
Loading…
Reference in a new issue