mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-03 07:48:48 +00:00
Replace Foo::from_instance(foo)
with foo.imp()
This commit is contained in:
parent
75d348709c
commit
b2d0172422
19 changed files with 72 additions and 72 deletions
|
@ -130,7 +130,7 @@ impl ObjectImpl for EbuR128Level {
|
|||
.action()
|
||||
.class_handler(|_token, args| {
|
||||
let this = args[0].get::<super::EbuR128Level>().unwrap();
|
||||
let imp = EbuR128Level::from_instance(&this);
|
||||
let imp = this.imp();
|
||||
|
||||
gst_info!(CAT, obj: &this, "Resetting measurements",);
|
||||
imp.reset.store(true, atomic::Ordering::SeqCst);
|
||||
|
|
|
@ -586,7 +586,7 @@ impl ObjectImpl for AppSrc {
|
|||
.class_handler(|_, args| {
|
||||
let element = args[0].get::<super::AppSrc>().expect("signal arg");
|
||||
let buffer = args[1].get::<gst::Buffer>().expect("signal arg");
|
||||
let appsrc = AppSrc::from_instance(&element);
|
||||
let appsrc = element.imp();
|
||||
|
||||
Some(appsrc.push_buffer(&element, buffer).to_value())
|
||||
})
|
||||
|
@ -595,7 +595,7 @@ impl ObjectImpl for AppSrc {
|
|||
.action()
|
||||
.class_handler(|_, args| {
|
||||
let element = args[0].get::<super::AppSrc>().expect("signal arg");
|
||||
let appsrc = AppSrc::from_instance(&element);
|
||||
let appsrc = element.imp();
|
||||
|
||||
Some(appsrc.end_of_stream(&element).to_value())
|
||||
})
|
||||
|
|
|
@ -95,7 +95,7 @@ impl InputSelectorPadSinkHandler {
|
|||
element: &super::InputSelector,
|
||||
mut buffer: gst::Buffer,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let inputselector = InputSelector::from_instance(element);
|
||||
let inputselector = element.imp();
|
||||
|
||||
let (stickies, is_active, sync_future, switched_pad) = {
|
||||
let mut state = inputselector.state.lock().unwrap();
|
||||
|
|
|
@ -304,7 +304,7 @@ impl SinkHandler {
|
|||
element: &super::JitterBuffer,
|
||||
buffer: gst::Buffer,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let jb = JitterBuffer::from_instance(element);
|
||||
let jb = element.imp();
|
||||
let mut state = jb.state.lock().unwrap();
|
||||
|
||||
let (max_misorder_time, max_dropout_time) = {
|
||||
|
@ -499,7 +499,7 @@ impl SinkHandler {
|
|||
if let Err(err) = self.store(&mut inner, pad, element, buf) {
|
||||
match err {
|
||||
gst::FlowError::CustomError => {
|
||||
let jb = JitterBuffer::from_instance(element);
|
||||
let jb = element.imp();
|
||||
let mut state = jb.state.lock().unwrap();
|
||||
for gap_packet in self.reset(&mut inner, &mut state, element) {
|
||||
buffers.push_back(gap_packet.buffer);
|
||||
|
@ -510,7 +510,7 @@ impl SinkHandler {
|
|||
}
|
||||
}
|
||||
|
||||
let jb = JitterBuffer::from_instance(element);
|
||||
let jb = element.imp();
|
||||
let mut state = jb.state.lock().unwrap();
|
||||
|
||||
let (latency, context_wait) = {
|
||||
|
@ -611,7 +611,7 @@ impl PadSinkHandler for SinkHandler {
|
|||
|
||||
gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event);
|
||||
|
||||
let jb = JitterBuffer::from_instance(&element);
|
||||
let jb = element.imp();
|
||||
|
||||
let mut forward = true;
|
||||
match event.view() {
|
||||
|
@ -669,7 +669,7 @@ impl SrcHandler {
|
|||
discont: &mut bool,
|
||||
) -> Vec<gst::Event> {
|
||||
let (latency, do_lost) = {
|
||||
let jb = JitterBuffer::from_instance(element);
|
||||
let jb = element.imp();
|
||||
let settings = jb.settings.lock().unwrap();
|
||||
(settings.latency, settings.do_lost)
|
||||
};
|
||||
|
@ -755,7 +755,7 @@ impl SrcHandler {
|
|||
&self,
|
||||
element: &super::JitterBuffer,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let jb = JitterBuffer::from_instance(element);
|
||||
let jb = element.imp();
|
||||
|
||||
let (lost_events, buffer, seq) = {
|
||||
let mut state = jb.state.lock().unwrap();
|
||||
|
@ -1061,7 +1061,7 @@ impl TaskImpl for JitterBufferTask {
|
|||
self.src_pad_handler.clear();
|
||||
self.sink_pad_handler.clear();
|
||||
|
||||
let jb = JitterBuffer::from_instance(&self.element);
|
||||
let jb = self.element.imp();
|
||||
*jb.state.lock().unwrap() = State::default();
|
||||
|
||||
gst_log!(CAT, obj: &self.element, "Task started");
|
||||
|
@ -1072,7 +1072,7 @@ impl TaskImpl for JitterBufferTask {
|
|||
|
||||
fn iterate(&mut self) -> BoxFuture<'_, Result<(), gst::FlowError>> {
|
||||
async move {
|
||||
let jb = JitterBuffer::from_instance(&self.element);
|
||||
let jb = self.element.imp();
|
||||
let (latency, context_wait) = {
|
||||
let settings = jb.settings.lock().unwrap();
|
||||
(settings.latency, settings.context_wait)
|
||||
|
@ -1208,7 +1208,7 @@ impl TaskImpl for JitterBufferTask {
|
|||
async move {
|
||||
gst_log!(CAT, obj: &self.element, "Stopping task");
|
||||
|
||||
let jb = JitterBuffer::from_instance(&self.element);
|
||||
let jb = self.element.imp();
|
||||
let mut jb_state = jb.state.lock().unwrap();
|
||||
|
||||
if let Some((_, abort_handle)) = jb_state.wait_handle.take() {
|
||||
|
@ -1405,7 +1405,7 @@ impl ObjectImpl for JitterBuffer {
|
|||
.action()
|
||||
.class_handler(|_, args| {
|
||||
let element = args[0].get::<super::JitterBuffer>().expect("signal arg");
|
||||
let jb = JitterBuffer::from_instance(&element);
|
||||
let jb = element.imp();
|
||||
jb.clear_pt_map(&element);
|
||||
None
|
||||
})
|
||||
|
|
|
@ -228,7 +228,7 @@ impl PadSinkHandler for ProxySinkPadHandler {
|
|||
async move {
|
||||
let pad = pad_weak.upgrade().expect("PadSink no longer exists");
|
||||
gst_log!(SINK_CAT, obj: pad.gst_pad(), "Handling {:?}", buffer);
|
||||
let proxysink = ProxySink::from_instance(&element);
|
||||
let proxysink = element.imp();
|
||||
proxysink
|
||||
.enqueue_item(&element, DataQueueItem::Buffer(buffer))
|
||||
.await
|
||||
|
@ -248,7 +248,7 @@ impl PadSinkHandler for ProxySinkPadHandler {
|
|||
async move {
|
||||
let pad = pad_weak.upgrade().expect("PadSink no longer exists");
|
||||
gst_log!(SINK_CAT, obj: pad.gst_pad(), "Handling {:?}", list);
|
||||
let proxysink = ProxySink::from_instance(&element);
|
||||
let proxysink = element.imp();
|
||||
proxysink
|
||||
.enqueue_item(&element, DataQueueItem::BufferList(list))
|
||||
.await
|
||||
|
@ -306,7 +306,7 @@ impl PadSinkHandler for ProxySinkPadHandler {
|
|||
let element = element.clone().downcast::<super::ProxySink>().unwrap();
|
||||
async move {
|
||||
let pad = pad_weak.upgrade().expect("PadSink no longer exists");
|
||||
let proxysink = ProxySink::from_instance(&element);
|
||||
let proxysink = element.imp();
|
||||
|
||||
match event.view() {
|
||||
EventView::Eos(..) => {
|
||||
|
@ -873,7 +873,7 @@ impl TaskImpl for ProxySrcTask {
|
|||
async move {
|
||||
gst_log!(SRC_CAT, obj: &self.element, "Starting task");
|
||||
|
||||
let proxysrc = ProxySrc::from_instance(&self.element);
|
||||
let proxysrc = self.element.imp();
|
||||
let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap();
|
||||
let mut shared_ctx = proxy_ctx.as_ref().unwrap().lock_shared();
|
||||
|
||||
|
@ -904,7 +904,7 @@ impl TaskImpl for ProxySrcTask {
|
|||
};
|
||||
|
||||
let pad = self.src_pad.upgrade().expect("PadSrc no longer exists");
|
||||
let proxysrc = ProxySrc::from_instance(&self.element);
|
||||
let proxysrc = self.element.imp();
|
||||
let res = ProxySrcPadHandler::push_item(&pad, proxysrc, item).await;
|
||||
match res {
|
||||
Ok(()) => {
|
||||
|
@ -948,7 +948,7 @@ impl TaskImpl for ProxySrcTask {
|
|||
async move {
|
||||
gst_log!(SRC_CAT, obj: &self.element, "Stopping task");
|
||||
|
||||
let proxysrc = ProxySrc::from_instance(&self.element);
|
||||
let proxysrc = self.element.imp();
|
||||
let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap();
|
||||
let mut shared_ctx = proxy_ctx.as_ref().unwrap().lock_shared();
|
||||
|
||||
|
@ -971,7 +971,7 @@ impl TaskImpl for ProxySrcTask {
|
|||
async move {
|
||||
gst_log!(SRC_CAT, obj: &self.element, "Starting task flush");
|
||||
|
||||
let proxysrc = ProxySrc::from_instance(&self.element);
|
||||
let proxysrc = self.element.imp();
|
||||
let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap();
|
||||
let mut shared_ctx = proxy_ctx.as_ref().unwrap().lock_shared();
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ impl PadSinkHandler for QueuePadSinkHandler {
|
|||
async move {
|
||||
let pad = pad_weak.upgrade().expect("PadSink no longer exists");
|
||||
gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", buffer);
|
||||
let queue = Queue::from_instance(&element);
|
||||
let queue = element.imp();
|
||||
queue
|
||||
.enqueue_item(&element, DataQueueItem::Buffer(buffer))
|
||||
.await
|
||||
|
@ -116,7 +116,7 @@ impl PadSinkHandler for QueuePadSinkHandler {
|
|||
async move {
|
||||
let pad = pad_weak.upgrade().expect("PadSink no longer exists");
|
||||
gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", list);
|
||||
let queue = Queue::from_instance(&element);
|
||||
let queue = element.imp();
|
||||
queue
|
||||
.enqueue_item(&element, DataQueueItem::BufferList(list))
|
||||
.await
|
||||
|
@ -167,7 +167,7 @@ impl PadSinkHandler for QueuePadSinkHandler {
|
|||
let element = element.clone().downcast::<super::Queue>().unwrap();
|
||||
async move {
|
||||
let pad = pad_weak.upgrade().expect("PadSink no longer exists");
|
||||
let queue = Queue::from_instance(&element);
|
||||
let queue = element.imp();
|
||||
|
||||
if let EventView::FlushStop(..) = event.view() {
|
||||
if let Err(err) = queue.task.flush_stop() {
|
||||
|
@ -342,7 +342,7 @@ impl TaskImpl for QueueTask {
|
|||
async move {
|
||||
gst_log!(CAT, obj: &self.element, "Starting task");
|
||||
|
||||
let queue = Queue::from_instance(&self.element);
|
||||
let queue = self.element.imp();
|
||||
let mut last_res = queue.last_res.lock().unwrap();
|
||||
|
||||
self.dataqueue.start();
|
||||
|
@ -368,7 +368,7 @@ impl TaskImpl for QueueTask {
|
|||
};
|
||||
|
||||
let pad = self.src_pad.upgrade().expect("PadSrc no longer exists");
|
||||
let queue = Queue::from_instance(&self.element);
|
||||
let queue = self.element.imp();
|
||||
let res = QueuePadSrcHandler::push_item(&pad, queue, item).await;
|
||||
match res {
|
||||
Ok(()) => {
|
||||
|
@ -405,7 +405,7 @@ impl TaskImpl for QueueTask {
|
|||
async move {
|
||||
gst_log!(CAT, obj: &self.element, "Stopping task");
|
||||
|
||||
let queue = Queue::from_instance(&self.element);
|
||||
let queue = self.element.imp();
|
||||
let mut last_res = queue.last_res.lock().unwrap();
|
||||
|
||||
self.dataqueue.stop();
|
||||
|
@ -427,7 +427,7 @@ impl TaskImpl for QueueTask {
|
|||
async move {
|
||||
gst_log!(CAT, obj: &self.element, "Starting task flush");
|
||||
|
||||
let queue = Queue::from_instance(&self.element);
|
||||
let queue = self.element.imp();
|
||||
let mut last_res = queue.last_res.lock().unwrap();
|
||||
|
||||
self.dataqueue.clear();
|
||||
|
|
|
@ -617,7 +617,7 @@ impl PadSinkHandler for UdpSinkPadHandler {
|
|||
|
||||
async move {
|
||||
if let EventView::FlushStop(_) = event.view() {
|
||||
let udpsink = UdpSink::from_instance(&element);
|
||||
let udpsink = element.imp();
|
||||
return udpsink.task.flush_stop().is_ok();
|
||||
} else if let Some(sender) = sender.lock().await.as_mut() {
|
||||
if sender.send(TaskItem::Event(event)).await.is_err() {
|
||||
|
@ -1128,7 +1128,7 @@ impl ObjectImpl for UdpSink {
|
|||
let port = args[2].get::<i32>().expect("signal arg");
|
||||
|
||||
if let Ok(addr) = try_into_socket_addr(&element, &host, port) {
|
||||
let udpsink = UdpSink::from_instance(&element);
|
||||
let udpsink = element.imp();
|
||||
udpsink.add_client(addr);
|
||||
}
|
||||
|
||||
|
@ -1147,7 +1147,7 @@ impl ObjectImpl for UdpSink {
|
|||
let port = args[2].get::<i32>().expect("signal arg");
|
||||
|
||||
if let Ok(addr) = try_into_socket_addr(&element, &host, port) {
|
||||
let udpsink = UdpSink::from_instance(&element);
|
||||
let udpsink = element.imp();
|
||||
udpsink.remove_client(addr);
|
||||
}
|
||||
|
||||
|
@ -1159,7 +1159,7 @@ impl ObjectImpl for UdpSink {
|
|||
.class_handler(|_, args| {
|
||||
let element = args[0].get::<super::UdpSink>().expect("signal arg");
|
||||
|
||||
let udpsink = UdpSink::from_instance(&element);
|
||||
let udpsink = element.imp();
|
||||
udpsink.clear_clients(std::iter::empty());
|
||||
|
||||
None
|
||||
|
|
|
@ -488,7 +488,7 @@ mod imp_sink {
|
|||
.downcast::<super::ElementSinkTest>()
|
||||
.unwrap();
|
||||
async move {
|
||||
let elem_sink_test = ElementSinkTest::from_instance(&element);
|
||||
let elem_sink_test = element.imp();
|
||||
elem_sink_test
|
||||
.forward_item(&element, Item::Buffer(buffer))
|
||||
.await
|
||||
|
@ -508,7 +508,7 @@ mod imp_sink {
|
|||
.downcast::<super::ElementSinkTest>()
|
||||
.unwrap();
|
||||
async move {
|
||||
let elem_sink_test = ElementSinkTest::from_instance(&element);
|
||||
let elem_sink_test = element.imp();
|
||||
elem_sink_test
|
||||
.forward_item(&element, Item::BufferList(list))
|
||||
.await
|
||||
|
@ -548,7 +548,7 @@ mod imp_sink {
|
|||
.downcast::<super::ElementSinkTest>()
|
||||
.unwrap();
|
||||
async move {
|
||||
let elem_sink_test = ElementSinkTest::from_instance(&element);
|
||||
let elem_sink_test = element.imp();
|
||||
|
||||
if let EventView::FlushStop(..) = event.view() {
|
||||
elem_sink_test.start(&element);
|
||||
|
@ -806,7 +806,7 @@ fn nominal_scenario(
|
|||
src_element: ElementSrcTest,
|
||||
mut receiver: mpsc::Receiver<Item>,
|
||||
) {
|
||||
let elem_src_test = imp_src::ElementSrcTest::from_instance(&src_element);
|
||||
let elem_src_test = src_element.imp();
|
||||
|
||||
pipeline.set_state(gst::State::Playing).unwrap();
|
||||
|
||||
|
@ -1018,7 +1018,7 @@ fn start_pause_start() {
|
|||
|
||||
let (pipeline, src_element, _sink_element, mut receiver) = setup(scenario_name, None, None);
|
||||
|
||||
let elem_src_test = imp_src::ElementSrcTest::from_instance(&src_element);
|
||||
let elem_src_test = src_element.imp();
|
||||
|
||||
pipeline.set_state(gst::State::Playing).unwrap();
|
||||
|
||||
|
@ -1096,7 +1096,7 @@ fn start_stop_start() {
|
|||
|
||||
let (pipeline, src_element, _sink_element, mut receiver) = setup(scenario_name, None, None);
|
||||
|
||||
let elem_src_test = imp_src::ElementSrcTest::from_instance(&src_element);
|
||||
let elem_src_test = src_element.imp();
|
||||
|
||||
pipeline.set_state(gst::State::Playing).unwrap();
|
||||
|
||||
|
@ -1209,7 +1209,7 @@ fn start_flush() {
|
|||
|
||||
let (pipeline, src_element, sink_element, mut receiver) = setup(scenario_name, None, None);
|
||||
|
||||
let elem_src_test = imp_src::ElementSrcTest::from_instance(&src_element);
|
||||
let elem_src_test = src_element.imp();
|
||||
|
||||
pipeline.set_state(gst::State::Playing).unwrap();
|
||||
|
||||
|
@ -1249,7 +1249,7 @@ fn start_flush() {
|
|||
.try_push(Item::Buffer(gst::Buffer::from_slice(vec![1, 2, 3, 4])))
|
||||
.unwrap();
|
||||
|
||||
let elem_sink_test = imp_sink::ElementSinkTest::from_instance(&sink_element);
|
||||
let elem_sink_test = sink_element.imp();
|
||||
|
||||
elem_sink_test.push_flush_start(&sink_element);
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ impl ObjectImpl for HlsSink3 {
|
|||
.expect("playlist-stream signal arg");
|
||||
let playlist_location =
|
||||
args[1].get::<String>().expect("playlist-stream signal arg");
|
||||
let hlssink3 = HlsSink3::from_instance(&element);
|
||||
let hlssink3 = element.imp();
|
||||
|
||||
Some(
|
||||
hlssink3
|
||||
|
@ -603,7 +603,7 @@ impl ObjectImpl for HlsSink3 {
|
|||
.expect("fragment-stream signal arg");
|
||||
let fragment_location =
|
||||
args[1].get::<String>().expect("fragment-stream signal arg");
|
||||
let hlssink3 = HlsSink3::from_instance(&element);
|
||||
let hlssink3 = element.imp();
|
||||
|
||||
Some(
|
||||
hlssink3
|
||||
|
@ -626,7 +626,7 @@ impl ObjectImpl for HlsSink3 {
|
|||
.class_handler(|_, args| {
|
||||
let element = args[0].get::<super::HlsSink3>().expect("signal arg");
|
||||
let fragment_location = args[1].get::<String>().expect("signal arg");
|
||||
let hlssink3 = HlsSink3::from_instance(&element);
|
||||
let hlssink3 = element.imp();
|
||||
|
||||
hlssink3.delete_fragment(&element, &fragment_location);
|
||||
Some(true.to_value())
|
||||
|
@ -676,7 +676,7 @@ impl ObjectImpl for HlsSink3 {
|
|||
Some(element) => element,
|
||||
None => return Some(None::<String>.to_value()),
|
||||
};
|
||||
let hlssink3 = HlsSink3::from_instance(&element);
|
||||
let hlssink3 = element.imp();
|
||||
|
||||
let fragment_id = args[1].get::<u32>().unwrap();
|
||||
|
||||
|
|
|
@ -599,7 +599,7 @@ impl Transcriber {
|
|||
}
|
||||
};
|
||||
|
||||
let transcribe = Self::from_instance(&element);
|
||||
let transcribe = element.imp();
|
||||
if let Err(err) = transcribe.loop_fn(&element, &mut receiver) {
|
||||
element_error!(
|
||||
&element,
|
||||
|
@ -963,7 +963,7 @@ impl Transcriber {
|
|||
let element_weak = element.downgrade();
|
||||
let future = async move {
|
||||
while let Some(element) = element_weak.upgrade() {
|
||||
let transcribe = Self::from_instance(&element);
|
||||
let transcribe = element.imp();
|
||||
let msg = match ws_stream.next().await {
|
||||
Some(msg) => msg,
|
||||
None => {
|
||||
|
|
|
@ -394,7 +394,7 @@ impl JsonGstParse {
|
|||
}
|
||||
};
|
||||
|
||||
let parse = Self::from_instance(&element);
|
||||
let parse = element.imp();
|
||||
parse.loop_fn(&element);
|
||||
});
|
||||
if res.is_err() {
|
||||
|
|
|
@ -208,7 +208,7 @@ impl CustomSource {
|
|||
None => return,
|
||||
Some(element) => element,
|
||||
};
|
||||
let src = CustomSource::from_instance(&element);
|
||||
let src = element.imp();
|
||||
|
||||
if let Err(msg) = src.handle_source_pad_added(&element, pad) {
|
||||
element.post_error_message(msg);
|
||||
|
@ -220,7 +220,7 @@ impl CustomSource {
|
|||
None => return,
|
||||
Some(element) => element,
|
||||
};
|
||||
let src = CustomSource::from_instance(&element);
|
||||
let src = element.imp();
|
||||
|
||||
src.handle_source_pad_removed(&element, pad);
|
||||
});
|
||||
|
@ -231,7 +231,7 @@ impl CustomSource {
|
|||
None => return,
|
||||
Some(element) => element,
|
||||
};
|
||||
let src = CustomSource::from_instance(&element);
|
||||
let src = element.imp();
|
||||
|
||||
src.handle_source_no_more_pads(&element);
|
||||
});
|
||||
|
|
|
@ -612,7 +612,7 @@ impl ObjectImpl for FallbackSrc {
|
|||
.action()
|
||||
.class_handler(|_token, args| {
|
||||
let element = args[0].get::<super::FallbackSrc>().expect("signal arg");
|
||||
let src = FallbackSrc::from_instance(&element);
|
||||
let src = element.imp();
|
||||
let mut state_guard = src.state.lock().unwrap();
|
||||
let state = match &mut *state_guard {
|
||||
None => {
|
||||
|
@ -840,7 +840,7 @@ impl FallbackSrc {
|
|||
None => return,
|
||||
Some(element) => element,
|
||||
};
|
||||
let src = FallbackSrc::from_instance(&element);
|
||||
let src = element.imp();
|
||||
|
||||
if let Err(msg) = src.handle_source_pad_added(&element, pad) {
|
||||
element.post_error_message(msg);
|
||||
|
@ -852,7 +852,7 @@ impl FallbackSrc {
|
|||
None => return,
|
||||
Some(element) => element,
|
||||
};
|
||||
let src = FallbackSrc::from_instance(&element);
|
||||
let src = element.imp();
|
||||
|
||||
src.handle_source_pad_removed(&element, pad);
|
||||
});
|
||||
|
@ -936,7 +936,7 @@ impl FallbackSrc {
|
|||
Some(element) => element,
|
||||
};
|
||||
|
||||
let src = FallbackSrc::from_instance(&element);
|
||||
let src = element.imp();
|
||||
src.handle_switch_active_pad_change(&element);
|
||||
});
|
||||
switch.set_property("timeout", timeout.nseconds());
|
||||
|
@ -962,7 +962,7 @@ impl FallbackSrc {
|
|||
Some(element) => element,
|
||||
};
|
||||
|
||||
let src = FallbackSrc::from_instance(&element);
|
||||
let src = element.imp();
|
||||
src.proxy_pad_chain(&element, pad, buffer)
|
||||
}
|
||||
})
|
||||
|
@ -1350,7 +1350,7 @@ impl FallbackSrc {
|
|||
Some(element) => element,
|
||||
};
|
||||
|
||||
let src = FallbackSrc::from_instance(&element);
|
||||
let src = element.imp();
|
||||
|
||||
match info.data {
|
||||
Some(gst::PadProbeData::Event(ref ev)) if ev.type_() == gst::EventType::Eos => {
|
||||
|
@ -1446,7 +1446,7 @@ impl FallbackSrc {
|
|||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
let src = FallbackSrc::from_instance(&element);
|
||||
let src = element.imp();
|
||||
|
||||
if let Err(msg) = src.handle_pad_blocked(&element, pad, pts) {
|
||||
element.post_error_message(msg);
|
||||
|
@ -2066,7 +2066,7 @@ impl FallbackSrc {
|
|||
|
||||
let source_weak = state.source.downgrade();
|
||||
element.call_async(move |element| {
|
||||
let src = FallbackSrc::from_instance(element);
|
||||
let src = element.imp();
|
||||
|
||||
let source = match source_weak.upgrade() {
|
||||
None => return,
|
||||
|
@ -2150,7 +2150,7 @@ impl FallbackSrc {
|
|||
|
||||
gst_debug!(CAT, obj: &element, "Woke up, retrying");
|
||||
element.call_async(|element| {
|
||||
let src = FallbackSrc::from_instance(element);
|
||||
let src = element.imp();
|
||||
|
||||
let mut state_guard = src.state.lock().unwrap();
|
||||
let state = match &mut *state_guard {
|
||||
|
@ -2288,7 +2288,7 @@ impl FallbackSrc {
|
|||
};
|
||||
|
||||
element.call_async(move |element| {
|
||||
let src = FallbackSrc::from_instance(element);
|
||||
let src = element.imp();
|
||||
|
||||
gst_debug!(CAT, obj: element, "Source restart timeout triggered");
|
||||
let mut state_guard = src.state.lock().unwrap();
|
||||
|
|
|
@ -840,7 +840,7 @@ impl BinImpl for UriPlaylistBin {
|
|||
}
|
||||
gst::MessageView::Error(error) => {
|
||||
// find item which raised the error
|
||||
let self_ = UriPlaylistBin::from_instance(element);
|
||||
let self_ = element.imp();
|
||||
let mut state_guard = self_.state.lock().unwrap();
|
||||
let state = state_guard.as_mut().unwrap();
|
||||
|
||||
|
@ -1050,7 +1050,7 @@ impl UriPlaylistBin {
|
|||
Some(element) => element,
|
||||
None => return,
|
||||
};
|
||||
let self_ = UriPlaylistBin::from_instance(&element);
|
||||
let self_ = element.imp();
|
||||
|
||||
let item = {
|
||||
let mut state_guard = self_.state.lock().unwrap();
|
||||
|
@ -1289,7 +1289,7 @@ impl UriPlaylistBin {
|
|||
Some(element) => element,
|
||||
None => return gst::PadProbeReturn::Remove,
|
||||
};
|
||||
let self_ = UriPlaylistBin::from_instance(&element);
|
||||
let self_ = element.imp();
|
||||
|
||||
let item = {
|
||||
let mut state_guard = self_.state.lock().unwrap();
|
||||
|
@ -1427,7 +1427,7 @@ impl UriPlaylistBin {
|
|||
item.index()
|
||||
);
|
||||
|
||||
let self_ = UriPlaylistBin::from_instance(&element);
|
||||
let self_ = element.imp();
|
||||
{
|
||||
let mut state_guard = self_.state.lock().unwrap();
|
||||
let state = state_guard.as_mut().unwrap();
|
||||
|
|
|
@ -626,7 +626,7 @@ impl MccParse {
|
|||
}
|
||||
};
|
||||
|
||||
let parse = Self::from_instance(&element);
|
||||
let parse = element.imp();
|
||||
parse.loop_fn(&element);
|
||||
});
|
||||
if res.is_err() {
|
||||
|
|
|
@ -514,7 +514,7 @@ impl SccParse {
|
|||
}
|
||||
};
|
||||
|
||||
let parse = Self::from_instance(&element);
|
||||
let parse = element.imp();
|
||||
parse.loop_fn(&element);
|
||||
});
|
||||
if res.is_err() {
|
||||
|
|
|
@ -302,7 +302,7 @@ impl TranscriberBin {
|
|||
Some(element) => element,
|
||||
};
|
||||
|
||||
let this = TranscriberBin::from_instance(&element);
|
||||
let this = element.imp();
|
||||
|
||||
this.disable_transcription_bin(&element);
|
||||
|
||||
|
@ -858,7 +858,7 @@ impl BinImpl for TranscriberBin {
|
|||
bin.notify("passthrough");
|
||||
drop(settings);
|
||||
bin.call_async(move |bin| {
|
||||
let thiz = TranscriberBin::from_instance(bin);
|
||||
let thiz = bin.imp();
|
||||
thiz.block_and_update(bin, true);
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -46,7 +46,7 @@ impl PaintableSink {
|
|||
}
|
||||
|
||||
fn pending_frame(&self) -> Option<Frame> {
|
||||
let self_ = imp::PaintableSink::from_instance(self);
|
||||
let self_ = self.imp();
|
||||
self_.pending_frame.lock().unwrap().take()
|
||||
}
|
||||
|
||||
|
@ -84,12 +84,12 @@ impl PaintableSink {
|
|||
|
||||
**paintable_storage = Some(paintable);
|
||||
|
||||
let self_ = imp::PaintableSink::from_instance(self);
|
||||
let self_ = self.imp();
|
||||
*self_.sender.lock().unwrap() = Some(sender);
|
||||
}
|
||||
|
||||
fn do_action(&self, action: SinkEvent) -> glib::Continue {
|
||||
let self_ = imp::PaintableSink::from_instance(self);
|
||||
let self_ = self.imp();
|
||||
let paintable = self_.paintable.lock().unwrap().clone();
|
||||
let paintable = match paintable {
|
||||
Some(paintable) => paintable,
|
||||
|
|
|
@ -35,7 +35,7 @@ impl Default for SinkPaintable {
|
|||
|
||||
impl SinkPaintable {
|
||||
pub(crate) fn handle_frame_changed(&self, frame: Option<Frame>) {
|
||||
let self_ = imp::SinkPaintable::from_instance(self);
|
||||
let self_ = self.imp();
|
||||
self_.handle_frame_changed(self, frame);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue