fix-getters-{def,calls} pass

This commit is contained in:
François Laignel 2021-04-11 21:39:50 +02:00
parent 08545cbefc
commit 53be8e5f58
169 changed files with 2215 additions and 2338 deletions

View file

@ -74,7 +74,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
.new_sample(|appsink| { .new_sample(|appsink| {
// Pull the sample in question out of the appsink's buffer. // Pull the sample in question out of the appsink's buffer.
let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?; let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?;
let buffer = sample.get_buffer().ok_or_else(|| { let buffer = sample.buffer().ok_or_else(|| {
element_error!( element_error!(
appsink, appsink,
gst::ResourceError::Failed, gst::ResourceError::Failed,
@ -138,7 +138,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
@ -150,12 +150,12 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Null)?; pipeline.set_state(gst::State::Null)?;
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }

View file

@ -147,7 +147,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
@ -159,12 +159,12 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Null)?; pipeline.set_state(gst::State::Null)?;
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }

View file

@ -29,8 +29,8 @@ impl ExampleCustomEvent {
pub fn parse(ev: &gst::EventRef) -> Option<ExampleCustomEvent> { pub fn parse(ev: &gst::EventRef) -> Option<ExampleCustomEvent> {
match ev.view() { match ev.view() {
gst::EventView::CustomDownstream(e) => { gst::EventView::CustomDownstream(e) => {
let s = match e.get_structure() { let s = match e.structure() {
Some(s) if s.get_name() == Self::EVENT_NAME => s, Some(s) if s.name() == Self::EVENT_NAME => s,
_ => return None, // No structure in this event, or the name didn't match _ => return None, // No structure in this event, or the name didn't match
}; };
@ -52,7 +52,7 @@ fn example_main() {
"audiotestsrc name=src ! queue max-size-time=2000000000 ! fakesink name=sink sync=true", "audiotestsrc name=src ! queue max-size-time=2000000000 ! fakesink name=sink sync=true",
) )
.unwrap(); .unwrap();
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -77,7 +77,7 @@ fn example_main() {
sinkpad.add_probe(gst::PadProbeType::EVENT_DOWNSTREAM, move |_, probe_info| { sinkpad.add_probe(gst::PadProbeType::EVENT_DOWNSTREAM, move |_, probe_info| {
match probe_info.data { match probe_info.data {
Some(gst::PadProbeData::Event(ref ev)) Some(gst::PadProbeData::Event(ref ev))
if ev.get_type() == gst::EventType::CustomDownstream => if ev.type_() == gst::EventType::CustomDownstream =>
{ {
if let Some(custom_event) = ExampleCustomEvent::parse(ev) { if let Some(custom_event) = ExampleCustomEvent::parse(ev) {
if let Some(pipeline) = pipeline_weak.upgrade() { if let Some(pipeline) = pipeline_weak.upgrade() {
@ -150,9 +150,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
main_loop.quit(); main_loop.quit();
} }

View file

@ -45,7 +45,7 @@ mod custom_meta {
} }
// Retrieve the stored label. // Retrieve the stored label.
pub fn get_label(&self) -> &str { pub fn label(&self) -> &str {
self.0.label.as_str() self.0.label.as_str()
} }
} }
@ -62,7 +62,7 @@ mod custom_meta {
impl fmt::Debug for CustomMeta { impl fmt::Debug for CustomMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("CustomMeta") f.debug_struct("CustomMeta")
.field("label", &self.get_label()) .field("label", &self.label())
.finish() .finish()
} }
} }
@ -231,7 +231,7 @@ fn example_main() {
.new_sample(|appsink| { .new_sample(|appsink| {
// Pull the sample in question out of the appsink's buffer. // Pull the sample in question out of the appsink's buffer.
let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?; let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?;
let buffer = sample.get_buffer().ok_or_else(|| { let buffer = sample.buffer().ok_or_else(|| {
element_error!( element_error!(
appsink, appsink,
gst::ResourceError::Failed, gst::ResourceError::Failed,
@ -245,7 +245,7 @@ fn example_main() {
let meta = buffer let meta = buffer
.get_meta::<custom_meta::CustomMeta>() .get_meta::<custom_meta::CustomMeta>()
.expect("No custom meta found"); .expect("No custom meta found");
println!("Got buffer with label: {}", meta.get_label()); println!("Got buffer with label: {}", meta.label());
Ok(gst::FlowSuccess::Ok) Ok(gst::FlowSuccess::Ok)
}) })
@ -259,7 +259,7 @@ fn example_main() {
let pipeline = pipeline.dynamic_cast::<gst::Pipeline>().unwrap(); let pipeline = pipeline.dynamic_cast::<gst::Pipeline>().unwrap();
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
// And run until EOS or an error happened. // And run until EOS or an error happened.
@ -271,9 +271,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }

View file

@ -32,7 +32,7 @@ fn example_main() {
Ok(pipeline) => pipeline, Ok(pipeline) => pipeline,
Err(err) => { Err(err) => {
if let Some(gst::ParseError::NoSuchElement) = err.kind::<gst::ParseError>() { if let Some(gst::ParseError::NoSuchElement) = err.kind::<gst::ParseError>() {
println!("Missing element(s): {:?}", context.get_missing_elements()); println!("Missing element(s): {:?}", context.missing_elements());
} else { } else {
println!("Failed to parse pipeline: {}", err); println!("Failed to parse pipeline: {}", err);
} }
@ -40,7 +40,7 @@ fn example_main() {
process::exit(-1) process::exit(-1)
} }
}; };
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -56,9 +56,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }

View file

@ -111,9 +111,9 @@ fn example_main() -> Result<(), Error> {
// Try to detect whether the raw stream decodebin provided us with // Try to detect whether the raw stream decodebin provided us with
// just now is either audio or video (or none of both, e.g. subtitles). // just now is either audio or video (or none of both, e.g. subtitles).
let (is_audio, is_video) = { let (is_audio, is_video) = {
let media_type = src_pad.get_current_caps().and_then(|caps| { let media_type = src_pad.current_caps().and_then(|caps| {
caps.get_structure(0).map(|s| { caps.get_structure(0).map(|s| {
let name = s.get_name(); let name = s.name();
(name.starts_with("audio/"), name.starts_with("video/")) (name.starts_with("audio/"), name.starts_with("video/"))
}) })
}); });
@ -123,7 +123,7 @@ fn example_main() -> Result<(), Error> {
element_warning!( element_warning!(
dbin, dbin,
gst::CoreError::Negotiation, gst::CoreError::Negotiation,
("Failed to get media type from pad {}", src_pad.get_name()) ("Failed to get media type from pad {}", src_pad.name())
); );
return; return;
@ -229,7 +229,7 @@ fn example_main() -> Result<(), Error> {
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
// This code iterates over all messages that are sent across our pipeline's bus. // This code iterates over all messages that are sent across our pipeline's bus.
@ -246,13 +246,13 @@ fn example_main() -> Result<(), Error> {
#[cfg(feature = "v1_10")] #[cfg(feature = "v1_10")]
{ {
match err.get_details() { match err.details() {
// This bus-message of type error contained our custom error-details struct // This bus-message of type error contained our custom error-details struct
// that we sent in the pad-added callback above. So we unpack it and log // that we sent in the pad-added callback above. So we unpack it and log
// the detailed error information here. details contains a glib::SendValue. // the detailed error information here. details contains a glib::SendValue.
// The unpacked error is the converted to a Result::Err, stopping the // The unpacked error is the converted to a Result::Err, stopping the
// application's execution. // application's execution.
Some(details) if details.get_name() == "error-details" => details Some(details) if details.name() == "error-details" => details
.get::<&ErrorValue>("error") .get::<&ErrorValue>("error")
.unwrap() .unwrap()
.and_then(|v| v.0.lock().unwrap().take()) .and_then(|v| v.0.lock().unwrap().take())
@ -260,12 +260,12 @@ fn example_main() -> Result<(), Error> {
.expect("error-details message without actual error"), .expect("error-details message without actual error"),
_ => Err(ErrorMessage { _ => Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()), .into()),
}?; }?;
@ -274,12 +274,12 @@ fn example_main() -> Result<(), Error> {
{ {
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }
@ -287,10 +287,10 @@ fn example_main() -> Result<(), Error> {
MessageView::StateChanged(s) => { MessageView::StateChanged(s) => {
println!( println!(
"State changed from {:?}: {:?} -> {:?} ({:?})", "State changed from {:?}: {:?} -> {:?} ({:?})",
s.get_src().map(|s| s.get_path_string()), s.src().map(|s| s.path_string()),
s.get_old(), s.old(),
s.get_current(), s.current(),
s.get_pending() s.pending()
); );
} }
_ => (), _ => (),

View file

@ -28,7 +28,7 @@ struct DiscovererError(#[error(not(source))] &'static str);
fn print_tags(info: &DiscovererInfo) { fn print_tags(info: &DiscovererInfo) {
println!("Tags:"); println!("Tags:");
let tags = info.get_tags(); let tags = info.tags();
match tags { match tags {
Some(taglist) => { Some(taglist) => {
println!(" {}", taglist.to_string()); // FIXME use an iterator println!(" {}", taglist.to_string()); // FIXME use an iterator
@ -41,10 +41,10 @@ fn print_tags(info: &DiscovererInfo) {
fn print_stream_info(stream: &DiscovererStreamInfo) { fn print_stream_info(stream: &DiscovererStreamInfo) {
println!("Stream: "); println!("Stream: ");
if let Some(id) = stream.get_stream_id() { if let Some(id) = stream.stream_id() {
println!(" Stream id: {}", id); println!(" Stream id: {}", id);
} }
let caps_str = match stream.get_caps() { let caps_str = match stream.caps() {
Some(caps) => caps.to_string(), Some(caps) => caps.to_string(),
None => String::from("--"), None => String::from("--"),
}; };
@ -53,18 +53,18 @@ fn print_stream_info(stream: &DiscovererStreamInfo) {
fn print_discoverer_info(info: &DiscovererInfo) -> Result<(), Error> { fn print_discoverer_info(info: &DiscovererInfo) -> Result<(), Error> {
let uri = info let uri = info
.get_uri() .uri()
.ok_or(DiscovererError("URI should not be null"))?; .ok_or(DiscovererError("URI should not be null"))?;
println!("URI: {}", uri); println!("URI: {}", uri);
println!("Duration: {}", info.get_duration()); println!("Duration: {}", info.duration());
print_tags(info); print_tags(info);
print_stream_info( print_stream_info(
&info &info
.get_stream_info() .stream_info()
.ok_or(DiscovererError("Error while obtaining stream info"))?, .ok_or(DiscovererError("Error while obtaining stream info"))?,
); );
let children = info.get_stream_list(); let children = info.stream_list();
println!("Children streams:"); println!("Children streams:");
for child in children { for child in children {
print_stream_info(&child); print_stream_info(&child);

View file

@ -145,9 +145,9 @@ fn example_main() -> Result<(), Error> {
}; };
let (is_audio, is_video) = { let (is_audio, is_video) = {
let media_type = dbin_src_pad.get_current_caps().and_then(|caps| { let media_type = dbin_src_pad.current_caps().and_then(|caps| {
caps.get_structure(0).map(|s| { caps.get_structure(0).map(|s| {
let name = s.get_name(); let name = s.name();
(name.starts_with("audio/"), name.starts_with("video/")) (name.starts_with("audio/"), name.starts_with("video/"))
}) })
}); });
@ -157,10 +157,7 @@ fn example_main() -> Result<(), Error> {
element_warning!( element_warning!(
dbin, dbin,
gst::CoreError::Negotiation, gst::CoreError::Negotiation,
( ("Failed to get media type from pad {}", dbin_src_pad.name())
"Failed to get media type from pad {}",
dbin_src_pad.get_name()
)
); );
return; return;
@ -266,7 +263,7 @@ fn example_main() -> Result<(), Error> {
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
@ -279,8 +276,8 @@ fn example_main() -> Result<(), Error> {
#[cfg(feature = "v1_10")] #[cfg(feature = "v1_10")]
{ {
match err.get_details() { match err.details() {
Some(details) if details.get_name() == "error-details" => details Some(details) if details.name() == "error-details" => details
.get::<&ErrorValue>("error") .get::<&ErrorValue>("error")
.unwrap() .unwrap()
.cloned() .cloned()
@ -289,12 +286,12 @@ fn example_main() -> Result<(), Error> {
.expect("error-details message without actual error"), .expect("error-details message without actual error"),
_ => Err(ErrorMessage { _ => Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()), .into()),
}?; }?;
@ -303,12 +300,12 @@ fn example_main() -> Result<(), Error> {
{ {
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }
@ -316,10 +313,10 @@ fn example_main() -> Result<(), Error> {
MessageView::StateChanged(s) => { MessageView::StateChanged(s) => {
println!( println!(
"State changed from {:?}: {:?} -> {:?} ({:?})", "State changed from {:?}: {:?} -> {:?} ({:?})",
s.get_src().map(|s| s.get_path_string()), s.src().map(|s| s.path_string()),
s.get_old(), s.old(),
s.get_current(), s.current(),
s.get_pending() s.pending()
); );
} }
_ => (), _ => (),

View file

@ -31,7 +31,7 @@ fn example_main() {
// This creates a pipeline by parsing the gst-launch pipeline syntax. // This creates a pipeline by parsing the gst-launch pipeline syntax.
let pipeline = gst::parse_launch("audiotestsrc ! fakesink").unwrap(); let pipeline = gst::parse_launch("audiotestsrc ! fakesink").unwrap();
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -101,9 +101,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
main_loop.quit(); main_loop.quit();
} }

View file

@ -26,9 +26,9 @@ async fn message_loop(bus: gst::Bus) {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }
@ -45,7 +45,7 @@ fn example_main() {
// Create a pipeline from the launch-syntax given on the cli. // Create a pipeline from the launch-syntax given on the cli.
let pipeline = gst::parse_launch(&pipeline_str).unwrap(); let pipeline = gst::parse_launch(&pipeline_str).unwrap();
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)

View file

@ -73,11 +73,8 @@ fn main_loop(uri: &str) -> Result<(), glib::BoolError> {
// Retrieve the asset that was automatically used behind the scenes, to // Retrieve the asset that was automatically used behind the scenes, to
// extract the clip from. // extract the clip from.
let asset = clip.get_asset().unwrap(); let asset = clip.asset().unwrap();
let duration = asset let duration = asset.downcast::<ges::UriClipAsset>().unwrap().duration();
.downcast::<ges::UriClipAsset>()
.unwrap()
.get_duration();
println!( println!(
"Clip duration: {} - playing file from {} for {}", "Clip duration: {} - playing file from {} for {}",
duration, duration,
@ -96,7 +93,7 @@ fn main_loop(uri: &str) -> Result<(), glib::BoolError> {
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
.expect("Unable to set the pipeline to the `Playing` state"); .expect("Unable to set the pipeline to the `Playing` state");
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
use gst::MessageView; use gst::MessageView;
@ -105,9 +102,9 @@ fn main_loop(uri: &str) -> Result<(), glib::BoolError> {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }

View file

@ -20,9 +20,9 @@ async fn message_handler(loop_: glib::MainLoop, bus: gst::Bus) {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
loop_.quit(); loop_.quit();
} }
@ -45,7 +45,7 @@ fn example_main() {
// Create a pipeline from the launch-syntax given on the cli. // Create a pipeline from the launch-syntax given on the cli.
let pipeline = gst::parse_launch(&pipeline_str).unwrap(); let pipeline = gst::parse_launch(&pipeline_str).unwrap();
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)

View file

@ -335,7 +335,7 @@ impl App {
let (pipeline, appsink, glupload) = App::create_pipeline()?; let (pipeline, appsink, glupload) = App::create_pipeline()?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
let event_loop = glutin::event_loop::EventLoop::with_user_event(); let event_loop = glutin::event_loop::EventLoop::with_user_event();
@ -356,7 +356,7 @@ impl App {
use glutin::platform::unix::WindowExtUnix; use glutin::platform::unix::WindowExtUnix;
use glutin::platform::ContextTraitExt; use glutin::platform::ContextTraitExt;
let api = App::map_gl_api(windowed_context.get_api()); let api = App::map_gl_api(windowed_context.api());
let (gl_context, gl_display, platform) = match unsafe { windowed_context.raw_handle() } let (gl_context, gl_display, platform) = match unsafe { windowed_context.raw_handle() }
{ {
@ -365,7 +365,7 @@ impl App {
let mut gl_display = None; let mut gl_display = None;
#[cfg(feature = "gst-gl-egl")] #[cfg(feature = "gst-gl-egl")]
if let Some(display) = unsafe { windowed_context.get_egl_display() } { if let Some(display) = unsafe { windowed_context.egl_display() } {
gl_display = Some( gl_display = Some(
unsafe { gst_gl_egl::GLDisplayEGL::with_egl_display(display as usize) } unsafe { gst_gl_egl::GLDisplayEGL::with_egl_display(display as usize) }
.unwrap() .unwrap()
@ -425,10 +425,10 @@ impl App {
bus.set_sync_handler(move |_, msg| { bus.set_sync_handler(move |_, msg| {
match msg.view() { match msg.view() {
gst::MessageView::NeedContext(ctxt) => { gst::MessageView::NeedContext(ctxt) => {
let context_type = ctxt.get_context_type(); let context_type = ctxt.context_type();
if context_type == *gst_gl::GL_DISPLAY_CONTEXT_TYPE { if context_type == *gst_gl::GL_DISPLAY_CONTEXT_TYPE {
if let Some(el) = if let Some(el) =
msg.get_src().map(|s| s.downcast::<gst::Element>().unwrap()) msg.src().map(|s| s.downcast::<gst::Element>().unwrap())
{ {
let context = gst::Context::new(context_type, true); let context = gst::Context::new(context_type, true);
context.set_gl_display(&gl_display); context.set_gl_display(&gl_display);
@ -437,12 +437,12 @@ impl App {
} }
if context_type == "gst.gl.app_context" { if context_type == "gst.gl.app_context" {
if let Some(el) = if let Some(el) =
msg.get_src().map(|s| s.downcast::<gst::Element>().unwrap()) msg.src().map(|s| s.downcast::<gst::Element>().unwrap())
{ {
let mut context = gst::Context::new(context_type, true); let mut context = gst::Context::new(context_type, true);
{ {
let context = context.get_mut().unwrap(); let context = context.get_mut().unwrap();
let s = context.get_mut_structure(); let s = context.structure_mut();
s.set("context", &gl_context); s.set("context", &gl_context);
} }
el.set_context(&context); el.set_context(&context);
@ -481,7 +481,7 @@ impl App {
let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?; let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?;
{ {
let _buffer = sample.get_buffer().ok_or_else(|| { let _buffer = sample.buffer().ok_or_else(|| {
element_error!( element_error!(
appsink, appsink,
gst::ResourceError::Failed, gst::ResourceError::Failed,
@ -492,7 +492,7 @@ impl App {
})?; })?;
let _info = sample let _info = sample
.get_caps() .caps()
.and_then(|caps| gst_video::VideoInfo::from_caps(caps).ok()) .and_then(|caps| gst_video::VideoInfo::from_caps(caps).ok())
.ok_or_else(|| { .ok_or_else(|| {
element_error!( element_error!(
@ -567,7 +567,7 @@ impl App {
let glupload = loop { let glupload = loop {
match iter.next() { match iter.next() {
Ok(Some(element)) => { Ok(Some(element)) => {
if "glupload" == element.get_factory().unwrap().get_name() { if "glupload" == element.factory().unwrap().name() {
break Some(element); break Some(element);
} }
} }
@ -588,12 +588,12 @@ impl App {
MessageView::Error(err) => { MessageView::Error(err) => {
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }
@ -610,7 +610,7 @@ fn main_loop(app: App) -> Result<(), Error> {
println!( println!(
"Pixel format of the window's GL context {:?}", "Pixel format of the window's GL context {:?}",
app.windowed_context.get_pixel_format() app.windowed_context.pixel_format()
); );
let gl = load(&app.windowed_context); let gl = load(&app.windowed_context);
@ -657,9 +657,9 @@ fn main_loop(app: App) -> Result<(), Error> {
glutin::event::Event::RedrawRequested(_) => needs_redraw = true, glutin::event::Event::RedrawRequested(_) => needs_redraw = true,
// Receive a frame // Receive a frame
glutin::event::Event::UserEvent(Message::Sample(sample)) => { glutin::event::Event::UserEvent(Message::Sample(sample)) => {
let buffer = sample.get_buffer_owned().unwrap(); let buffer = sample.buffer_owned().unwrap();
let info = sample let info = sample
.get_caps() .caps()
.and_then(|caps| gst_video::VideoInfo::from_caps(caps).ok()) .and_then(|caps| gst_video::VideoInfo::from_caps(caps).ok())
.unwrap(); .unwrap();

View file

@ -98,7 +98,7 @@ fn create_ui(app: &gtk::Application) {
glib::Continue(true) glib::Continue(true)
}); });
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -118,9 +118,9 @@ fn create_ui(app: &gtk::Application) {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
app.quit(); app.quit();
} }

View file

@ -40,7 +40,7 @@ fn create_video_sink() -> gst::Element {
} }
#[cfg(all(target_os = "linux", feature = "gtkvideooverlay-x11"))] #[cfg(all(target_os = "linux", feature = "gtkvideooverlay-x11"))]
fn set_window_handle(video_overlay: &gst_video::VideoOverlay, gdk_window: &gdk::Window) { fn set_window_handle(video_overlay: &gst_video::VideoOverlay, gdk_window: &gdk::Window) {
let display_type_name = gdk_window.get_display().get_type().name(); let display_type_name = gdk_window.display().type_().name();
// Check if we're using X11 or ... // Check if we're using X11 or ...
if display_type_name == "GdkX11Display" { if display_type_name == "GdkX11Display" {
@ -75,7 +75,7 @@ fn create_video_sink() -> gst::Element {
#[cfg(all(target_os = "macos", feature = "gtkvideooverlay-quartz"))] #[cfg(all(target_os = "macos", feature = "gtkvideooverlay-quartz"))]
fn set_window_handle(video_overlay: &gst_video::VideoOverlay, gdk_window: &gdk::Window) { fn set_window_handle(video_overlay: &gst_video::VideoOverlay, gdk_window: &gdk::Window) {
let display_type_name = gdk_window.get_display().get_type().name(); let display_type_name = gdk_window.display().type_().name();
if display_type_name == "GdkQuartzDisplay" { if display_type_name == "GdkQuartzDisplay" {
extern "C" { extern "C" {
@ -149,7 +149,7 @@ fn create_ui(app: &gtk::Application) {
// Gtk uses gdk under the hood, to handle its drawing. Drawing regions are // Gtk uses gdk under the hood, to handle its drawing. Drawing regions are
// called gdk windows. We request this underlying drawing region from the // called gdk windows. We request this underlying drawing region from the
// widget we will overlay with our video. // widget we will overlay with our video.
let gdk_window = video_window.get_window().unwrap(); let gdk_window = video_window.window().unwrap();
// This is where we tell our window system about the drawing-region we // This is where we tell our window system about the drawing-region we
// want it to overlay. Most often, the window system would only know // want it to overlay. Most often, the window system would only know
@ -205,7 +205,7 @@ fn create_ui(app: &gtk::Application) {
glib::Continue(true) glib::Continue(true)
}); });
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -225,9 +225,9 @@ fn create_ui(app: &gtk::Application) {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
app.quit(); app.quit();
} }

View file

@ -20,7 +20,7 @@ fn example_main() {
// In an endless-loop, we use the iterator until we either reach the end // In an endless-loop, we use the iterator until we either reach the end
// or we hit an error. // or we hit an error.
match iter.next() { match iter.next() {
Ok(Some(pad)) => println!("Pad: {}", pad.get_name()), Ok(Some(pad)) => println!("Pad: {}", pad.name()),
Ok(None) => { Ok(None) => {
// We reached the end of the iterator, there are no more pads // We reached the end of the iterator, there are no more pads
println!("Done"); println!("Done");

View file

@ -32,7 +32,7 @@ fn example_main() {
Ok(pipeline) => pipeline, Ok(pipeline) => pipeline,
Err(err) => { Err(err) => {
if let Some(gst::ParseError::NoSuchElement) = err.kind::<gst::ParseError>() { if let Some(gst::ParseError::NoSuchElement) = err.kind::<gst::ParseError>() {
println!("Missing element(s): {:?}", context.get_missing_elements()); println!("Missing element(s): {:?}", context.missing_elements());
} else { } else {
println!("Failed to parse pipeline: {}", err); println!("Failed to parse pipeline: {}", err);
} }
@ -40,7 +40,7 @@ fn example_main() {
process::exit(-1) process::exit(-1)
} }
}; };
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -54,9 +54,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }

View file

@ -25,7 +25,7 @@ fn example_main() {
// Let GStreamer create a pipeline from the parsed launch syntax on the cli. // Let GStreamer create a pipeline from the parsed launch syntax on the cli.
let pipeline = gst::parse_launch(&pipeline_str).unwrap(); let pipeline = gst::parse_launch(&pipeline_str).unwrap();
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -44,9 +44,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
main_loop.quit(); main_loop.quit();
} }

View file

@ -141,8 +141,8 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
// Get the signal's arguments // Get the signal's arguments
let _overlay = args[0].get::<gst::Element>().unwrap().unwrap(); let _overlay = args[0].get::<gst::Element>().unwrap().unwrap();
let sample = args[1].get::<gst::Sample>().unwrap().unwrap(); let sample = args[1].get::<gst::Sample>().unwrap().unwrap();
let buffer = sample.get_buffer().unwrap(); let buffer = sample.buffer().unwrap();
let timestamp = buffer.get_pts(); let timestamp = buffer.pts();
let info = drawer.info.as_ref().unwrap(); let info = drawer.info.as_ref().unwrap();
let layout = drawer.layout.borrow(); let layout = drawer.layout.borrow();
@ -171,7 +171,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
let buffer = buffer.into_mapped_buffer_writable().unwrap(); let buffer = buffer.into_mapped_buffer_writable().unwrap();
let buffer = { let buffer = {
let buffer_ptr = unsafe { buffer.get_buffer().as_ptr() }; let buffer_ptr = unsafe { buffer.buffer().as_ptr() };
let surface = cairo::ImageSurface::create_for_data( let surface = cairo::ImageSurface::create_for_data(
buffer, buffer,
cairo::Format::ARgb32, cairo::Format::ARgb32,
@ -218,7 +218,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
// So e.g. that after a 90 degree rotation it knows that what was previously going // So e.g. that after a 90 degree rotation it knows that what was previously going
// to end up as a 200x100 rectangle would now be 100x200. // to end up as a 200x100 rectangle would now be 100x200.
pangocairo::functions::update_layout(&cr, &**layout); pangocairo::functions::update_layout(&cr, &**layout);
let (width, _height) = layout.get_size(); let (width, _height) = layout.size();
// Using width and height of the text, we can properly possition it within // Using width and height of the text, we can properly possition it within
// our canvas. // our canvas.
cr.move_to( cr.move_to(
@ -293,7 +293,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
@ -305,12 +305,12 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Null)?; pipeline.set_state(gst::State::Null)?;
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }

View file

@ -76,7 +76,7 @@ fn example_main() {
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
.expect("Unable to set the pipeline to the `Playing` state"); .expect("Unable to set the pipeline to the `Playing` state");
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
use gst::MessageView; use gst::MessageView;
@ -85,9 +85,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }

View file

@ -178,7 +178,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
// So e.g. that after a 90 degree rotation it knows that what was previously going // So e.g. that after a 90 degree rotation it knows that what was previously going
// to end up as a 200x100 rectangle would now be 100x200. // to end up as a 200x100 rectangle would now be 100x200.
pangocairo::functions::update_layout(&cr, &**layout); pangocairo::functions::update_layout(&cr, &**layout);
let (width, _height) = layout.get_size(); let (width, _height) = layout.size();
// Using width and height of the text, we can properly possition it within // Using width and height of the text, we can properly possition it within
// our canvas. // our canvas.
cr.move_to( cr.move_to(
@ -224,7 +224,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
@ -236,12 +236,12 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Null)?; pipeline.set_state(gst::State::Null)?;
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }

View file

@ -101,7 +101,7 @@ fn example_main() {
// The playbin element itself is a playbin, so it can be used as one, despite being // The playbin element itself is a playbin, so it can be used as one, despite being
// created from an element factory. // created from an element factory.
let bus = playbin.get_bus().unwrap(); let bus = playbin.bus().unwrap();
playbin playbin
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -115,20 +115,17 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }
MessageView::StateChanged(state_changed) => MessageView::StateChanged(state_changed) =>
// We are only interested in state-changed messages from playbin // We are only interested in state-changed messages from playbin
{ {
if state_changed if state_changed.src().map(|s| s == playbin).unwrap_or(false)
.get_src() && state_changed.current() == gst::State::Playing
.map(|s| s == playbin)
.unwrap_or(false)
&& state_changed.get_current() == gst::State::Playing
{ {
// Generate a dot graph of the pipeline to GST_DEBUG_DUMP_DOT_DIR if defined // Generate a dot graph of the pipeline to GST_DEBUG_DUMP_DOT_DIR if defined
let bin_ref = playbin.downcast_ref::<gst::Bin>().unwrap(); let bin_ref = playbin.downcast_ref::<gst::Bin>().unwrap();

View file

@ -30,7 +30,7 @@ fn example_main() {
// Let GStreamer create a pipeline from the parsed launch syntax on the cli. // Let GStreamer create a pipeline from the parsed launch syntax on the cli.
let pipeline = gst::parse_launch(&pipeline_str).unwrap(); let pipeline = gst::parse_launch(&pipeline_str).unwrap();
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline pipeline
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
@ -64,7 +64,7 @@ fn example_main() {
// capable of answering the query. // capable of answering the query.
let mut q = gst::query::Position::new(gst::Format::Time); let mut q = gst::query::Position::new(gst::Format::Time);
if pipeline.query(&mut q) { if pipeline.query(&mut q) {
Some(q.get_result()) Some(q.result())
} else { } else {
None None
} }
@ -78,7 +78,7 @@ fn example_main() {
// capable of answering the query. // capable of answering the query.
let mut q = gst::query::Duration::new(gst::Format::Time); let mut q = gst::query::Duration::new(gst::Format::Time);
if pipeline.query(&mut q) { if pipeline.query(&mut q) {
Some(q.get_result()) Some(q.result())
} else { } else {
None None
} }
@ -104,9 +104,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
main_loop.quit(); main_loop.quit();
} }

View file

@ -48,7 +48,7 @@ fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst:
match element.get_static_pad(pad_name) { match element.get_static_pad(pad_name) {
Some(pad) => Ok(pad), Some(pad) => Ok(pad),
None => { None => {
let element_name = element.get_name(); let element_name = element.name();
Err(Error::from(NoSuchPad(pad_name, element_name.to_string()))) Err(Error::from(NoSuchPad(pad_name, element_name.to_string())))
} }
} }
@ -58,14 +58,14 @@ fn get_request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst
match element.get_request_pad(pad_name) { match element.get_request_pad(pad_name) {
Some(pad) => Ok(pad), Some(pad) => Ok(pad),
None => { None => {
let element_name = element.get_name(); let element_name = element.name();
Err(Error::from(NoSuchPad(pad_name, element_name.to_string()))) Err(Error::from(NoSuchPad(pad_name, element_name.to_string())))
} }
} }
} }
fn connect_rtpbin_srcpad(src_pad: &gst::Pad, sink: &gst::Element) -> Result<(), Error> { fn connect_rtpbin_srcpad(src_pad: &gst::Pad, sink: &gst::Element) -> Result<(), Error> {
let name = src_pad.get_name(); let name = src_pad.name();
let split_name = name.split('_'); let split_name = name.split('_');
let split_name = split_name.collect::<Vec<&str>>(); let split_name = split_name.collect::<Vec<&str>>();
let pt = split_name[5].parse::<u32>()?; let pt = split_name[5].parse::<u32>()?;
@ -242,7 +242,7 @@ fn example_main() -> Result<(), Error> {
filter.set_property("caps", &video_caps)?; filter.set_property("caps", &video_caps)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
pipeline pipeline
@ -261,18 +261,18 @@ fn example_main() -> Result<(), Error> {
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }
MessageView::StateChanged(s) => { MessageView::StateChanged(s) => {
if let Some(element) = msg.get_src() { if let Some(element) = msg.src() {
if element == pipeline && s.get_current() == gst::State::Playing { if element == pipeline && s.current() == gst::State::Playing {
eprintln!("PLAYING"); eprintln!("PLAYING");
gst::debug_bin_to_dot_file( gst::debug_bin_to_dot_file(
&pipeline, &pipeline,

View file

@ -44,7 +44,7 @@ fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst:
match element.get_static_pad(pad_name) { match element.get_static_pad(pad_name) {
Some(pad) => Ok(pad), Some(pad) => Ok(pad),
None => { None => {
let element_name = element.get_name(); let element_name = element.name();
Err(Error::from(NoSuchPad(pad_name, element_name.to_string()))) Err(Error::from(NoSuchPad(pad_name, element_name.to_string())))
} }
} }
@ -54,7 +54,7 @@ fn get_request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst
match element.get_request_pad(pad_name) { match element.get_request_pad(pad_name) {
Some(pad) => Ok(pad), Some(pad) => Ok(pad),
None => { None => {
let element_name = element.get_name(); let element_name = element.name();
Err(Error::from(NoSuchPad(pad_name, element_name.to_string()))) Err(Error::from(NoSuchPad(pad_name, element_name.to_string())))
} }
} }
@ -163,7 +163,7 @@ fn example_main() -> Result<(), Error> {
src.set_property("uri", &uri)?; src.set_property("uri", &uri)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
pipeline pipeline
@ -182,18 +182,18 @@ fn example_main() -> Result<(), Error> {
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }
MessageView::StateChanged(s) => { MessageView::StateChanged(s) => {
if let Some(element) = msg.get_src() { if let Some(element) = msg.src() {
if element == pipeline && s.get_current() == gst::State::Playing { if element == pipeline && s.current() == gst::State::Playing {
eprintln!("PLAYING"); eprintln!("PLAYING");
gst::debug_bin_to_dot_file( gst::debug_bin_to_dot_file(
&pipeline, &pipeline,

View file

@ -39,7 +39,7 @@ fn main_loop() -> Result<(), Error> {
// provide or take different streams. Here, we ask our server to give // provide or take different streams. Here, we ask our server to give
// us a reference to its list of endpoints, so we can add our // us a reference to its list of endpoints, so we can add our
// test endpoint. // test endpoint.
let mounts = server.get_mount_points().ok_or(NoMountPoints)?; let mounts = server.mount_points().ok_or(NoMountPoints)?;
// Next, we create a factory for the endpoint we want to create. // Next, we create a factory for the endpoint we want to create.
// The job of the factory is to create a new pipeline for each client that // The job of the factory is to create a new pipeline for each client that
// connects, or (if configured to do so) to reuse an existing pipeline. // connects, or (if configured to do so) to reuse an existing pipeline.
@ -134,7 +134,7 @@ fn main_loop() -> Result<(), Error> {
println!( println!(
"Stream ready at rtsps://127.0.0.1:{}/test", "Stream ready at rtsps://127.0.0.1:{}/test",
server.get_bound_port() server.bound_port()
); );
// Start the mainloop. From this point on, the server will start to take // Start the mainloop. From this point on, the server will start to take

View file

@ -30,7 +30,7 @@ fn main_loop() -> Result<(), Error> {
// provide different streams. Here, we ask our server to give // provide different streams. Here, we ask our server to give
// us a reference to his list of endpoints, so we can add our // us a reference to his list of endpoints, so we can add our
// test endpoint, providing the pipeline from the cli. // test endpoint, providing the pipeline from the cli.
let mounts = server.get_mount_points().ok_or(NoMountPoints)?; let mounts = server.mount_points().ok_or(NoMountPoints)?;
// Next, we create our custom factory for the endpoint we want to create. // Next, we create our custom factory for the endpoint we want to create.
// The job of the factory is to create a new pipeline for each client that // The job of the factory is to create a new pipeline for each client that
@ -62,7 +62,7 @@ fn main_loop() -> Result<(), Error> {
println!( println!(
"Stream ready at rtsp://127.0.0.1:{}/test", "Stream ready at rtsp://127.0.0.1:{}/test",
server.get_bound_port() server.bound_port()
); );
// Start the mainloop. From this point on, the server will start to serve // Start the mainloop. From this point on, the server will start to serve
@ -247,10 +247,10 @@ mod server {
let client = super::client::Client::default(); let client = super::client::Client::default();
// Duplicated from the default implementation // Duplicated from the default implementation
client.set_session_pool(server.get_session_pool().as_ref()); client.set_session_pool(server.session_pool().as_ref());
client.set_mount_points(server.get_mount_points().as_ref()); client.set_mount_points(server.mount_points().as_ref());
client.set_auth(server.get_auth().as_ref()); client.set_auth(server.auth().as_ref());
client.set_thread_pool(server.get_thread_pool().as_ref()); client.set_thread_pool(server.thread_pool().as_ref());
Some(client.upcast()) Some(client.upcast())
} }

View file

@ -34,7 +34,7 @@ fn main_loop() -> Result<(), Error> {
// provide different streams. Here, we ask our server to give // provide different streams. Here, we ask our server to give
// us a reference to his list of endpoints, so we can add our // us a reference to his list of endpoints, so we can add our
// test endpoint, providing the pipeline from the cli. // test endpoint, providing the pipeline from the cli.
let mounts = server.get_mount_points().ok_or(NoMountPoints)?; let mounts = server.mount_points().ok_or(NoMountPoints)?;
// Next, we create a factory for the endpoint we want to create. // Next, we create a factory for the endpoint we want to create.
// The job of the factory is to create a new pipeline for each client that // The job of the factory is to create a new pipeline for each client that
@ -70,7 +70,7 @@ fn main_loop() -> Result<(), Error> {
println!( println!(
"Stream ready at rtsp://127.0.0.1:{}/test", "Stream ready at rtsp://127.0.0.1:{}/test",
server.get_bound_port() server.bound_port()
); );
// Start the mainloop. From this point on, the server will start to serve // Start the mainloop. From this point on, the server will start to serve

View file

@ -313,7 +313,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
@ -325,12 +325,12 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
pipeline.set_state(gst::State::Null)?; pipeline.set_state(gst::State::Null)?;
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }

View file

@ -53,7 +53,7 @@ fn example_main() -> Result<(), Error> {
Ok(pipeline) => pipeline, Ok(pipeline) => pipeline,
Err(err) => { Err(err) => {
if let Some(gst::ParseError::NoSuchElement) = err.kind::<gst::ParseError>() { if let Some(gst::ParseError::NoSuchElement) = err.kind::<gst::ParseError>() {
return Err(MissingElement(context.get_missing_elements().join(",")).into()); return Err(MissingElement(context.missing_elements().join(",")).into());
} else { } else {
return Err(err.into()); return Err(err.into());
} }
@ -81,7 +81,7 @@ fn example_main() -> Result<(), Error> {
// if there already is one. // if there already is one.
tagsetter.add::<gst::tags::Title>(&"Special randomized white-noise", gst::TagMergeMode::Append); tagsetter.add::<gst::tags::Title>(&"Special randomized white-noise", gst::TagMergeMode::Append);
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
@ -93,13 +93,13 @@ fn example_main() -> Result<(), Error> {
MessageView::Error(err) => { MessageView::Error(err) => {
return Err(ErrorMessage { return Err(ErrorMessage {
src: err src: err
.get_src() .src()
.map(|s| s.get_path_string()) .map(|s| s.path_string())
.unwrap_or_else(|| "None".into()) .unwrap_or_else(|| "None".into())
.to_string(), .to_string(),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }

View file

@ -68,7 +68,7 @@ fn create_pipeline(uri: String, out_path: std::path::PathBuf) -> Result<gst::Pip
.new_sample(move |appsink| { .new_sample(move |appsink| {
// Pull the sample in question out of the appsink's buffer. // Pull the sample in question out of the appsink's buffer.
let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?; let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?;
let buffer = sample.get_buffer().ok_or_else(|| { let buffer = sample.buffer().ok_or_else(|| {
element_error!( element_error!(
appsink, appsink,
gst::ResourceError::Failed, gst::ResourceError::Failed,
@ -78,7 +78,7 @@ fn create_pipeline(uri: String, out_path: std::path::PathBuf) -> Result<gst::Pip
gst::FlowError::Error gst::FlowError::Error
})?; })?;
let caps = sample.get_caps().expect("Sample without caps"); let caps = sample.caps().expect("Sample without caps");
let info = gst_video::VideoInfo::from_caps(&caps).expect("Failed to parse caps"); let info = gst_video::VideoInfo::from_caps(&caps).expect("Failed to parse caps");
// Make sure that we only get a single buffer // Make sure that we only get a single buffer
@ -156,7 +156,7 @@ fn main_loop(pipeline: gst::Pipeline, position: u64) -> Result<(), Error> {
pipeline.set_state(gst::State::Paused)?; pipeline.set_state(gst::State::Paused)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
let mut seeked = false; let mut seeked = false;
@ -194,12 +194,12 @@ fn main_loop(pipeline: gst::Pipeline, position: u64) -> Result<(), Error> {
pipeline.set_state(gst::State::Null)?; pipeline.set_state(gst::State::Null)?;
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }

View file

@ -80,7 +80,7 @@ fn example_main() {
.set_state(gst::State::Paused) .set_state(gst::State::Paused)
.expect("Unable to set the pipeline to the `Paused` state"); .expect("Unable to set the pipeline to the `Paused` state");
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
// Instead of using a main loop (like GLib's), we manually iterate over // Instead of using a main loop (like GLib's), we manually iterate over
// GStreamer's bus messages in this example. We don't need any special // GStreamer's bus messages in this example. We don't need any special
@ -95,23 +95,19 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }
MessageView::Toc(msg_toc) => { MessageView::Toc(msg_toc) => {
// Some element found a ToC in the current media stream and told // Some element found a ToC in the current media stream and told
// us by posting a message to GStreamer's bus. // us by posting a message to GStreamer's bus.
let (toc, updated) = msg_toc.get_toc(); let (toc, updated) = msg_toc.toc();
println!( println!("\nReceived toc: {:?} - updated: {}", toc.scope(), updated);
"\nReceived toc: {:?} - updated: {}",
toc.get_scope(),
updated
);
// Get a list of tags that are ToC specific. // Get a list of tags that are ToC specific.
if let Some(tags) = toc.get_tags() { if let Some(tags) = toc.tags() {
println!("- tags: {}", tags.to_string()); println!("- tags: {}", tags.to_string());
} }
// ToCs do not have a fixed structure. Depending on the format that // ToCs do not have a fixed structure. Depending on the format that
@ -121,34 +117,30 @@ fn example_main() {
// interpreting the ToC manually. // interpreting the ToC manually.
// In this example, we simply want to print the ToC structure, so // In this example, we simply want to print the ToC structure, so
// we iterate everything and don't try to interpret anything. // we iterate everything and don't try to interpret anything.
for toc_entry in toc.get_entries() { for toc_entry in toc.entries() {
// Every entry in a ToC has its own type. One type could for // Every entry in a ToC has its own type. One type could for
// example be Chapter. // example be Chapter.
println!( println!("\t{:?} - {}", toc_entry.entry_type(), toc_entry.uid());
"\t{:?} - {}",
toc_entry.get_entry_type(),
toc_entry.get_uid()
);
// Every ToC entry can have a set of timestamps (start, stop). // Every ToC entry can have a set of timestamps (start, stop).
if let Some((start, stop)) = toc_entry.get_start_stop_times() { if let Some((start, stop)) = toc_entry.start_stop_times() {
println!("\t- start: {}, stop: {}", start, stop); println!("\t- start: {}, stop: {}", start, stop);
} }
// Every ToC entry can have tags to it. // Every ToC entry can have tags to it.
if let Some(tags) = toc_entry.get_tags() { if let Some(tags) = toc_entry.tags() {
println!("\t- tags: {}", tags.to_string()); println!("\t- tags: {}", tags.to_string());
} }
// Every ToC entry can have a set of child entries. // Every ToC entry can have a set of child entries.
// With this structure, you can create trees of arbitrary depth. // With this structure, you can create trees of arbitrary depth.
for toc_sub_entry in toc_entry.get_sub_entries() { for toc_sub_entry in toc_entry.sub_entries() {
println!( println!(
"\n\t\t{:?} - {}", "\n\t\t{:?} - {}",
toc_sub_entry.get_entry_type(), toc_sub_entry.entry_type(),
toc_sub_entry.get_uid() toc_sub_entry.uid()
); );
if let Some((start, stop)) = toc_sub_entry.get_start_stop_times() { if let Some((start, stop)) = toc_sub_entry.start_stop_times() {
println!("\t\t- start: {}, stop: {}", start, stop); println!("\t\t- start: {}, stop: {}", start, stop);
} }
if let Some(tags) = toc_sub_entry.get_tags() { if let Some(tags) = toc_sub_entry.tags() {
println!("\t\t- tags: {:?}", tags.to_string()); println!("\t\t- tags: {:?}", tags.to_string());
} }
} }

View file

@ -105,7 +105,7 @@ fn example_main() -> Result<(), Error> {
let format_name = caps let format_name = caps
.get_structure(0) .get_structure(0)
.expect("Failed to get format name") .expect("Failed to get format name")
.get_name(); .name();
let demuxer = match format_name { let demuxer = match format_name {
"video/x-matroska" | "video/webm" => { "video/x-matroska" | "video/webm" => {
@ -147,7 +147,7 @@ fn example_main() -> Result<(), Error> {
pipeline.set_state(gst::State::Playing)?; pipeline.set_state(gst::State::Playing)?;
let bus = pipeline let bus = pipeline
.get_bus() .bus()
.expect("Pipeline without bus. Shouldn't happen!"); .expect("Pipeline without bus. Shouldn't happen!");
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
@ -160,22 +160,22 @@ fn example_main() -> Result<(), Error> {
return Err(ErrorMessage { return Err(ErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into()); .into());
} }
MessageView::StateChanged(s) => { MessageView::StateChanged(s) => {
println!( println!(
"State changed from {:?}: {:?} -> {:?} ({:?})", "State changed from {:?}: {:?} -> {:?} ({:?})",
s.get_src().map(|s| s.get_path_string()), s.src().map(|s| s.path_string()),
s.get_old(), s.old(),
s.get_current(), s.current(),
s.get_pending() s.pending()
); );
} }
_ => (), _ => (),

View file

@ -51,7 +51,7 @@ fn example_main() {
/* Iterate messages on the bus until an error or EOS occurs, /* Iterate messages on the bus until an error or EOS occurs,
* although in this example the only error we'll hopefully * although in this example the only error we'll hopefully
* get is if the user closes the output window */ * get is if the user closes the output window */
let bus = pipeline.get_bus().unwrap(); let bus = pipeline.bus().unwrap();
for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) {
use gst::MessageView; use gst::MessageView;
@ -64,9 +64,9 @@ fn example_main() {
MessageView::Error(err) => { MessageView::Error(err) => {
println!( println!(
"Error from {:?}: {} ({:?})", "Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()), err.src().map(|s| s.path_string()),
err.get_error(), err.error(),
err.get_debug() err.debug()
); );
break; break;
} }

View file

@ -286,7 +286,7 @@ impl AppSrc {
} }
} }
pub fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime) { pub fn latency(&self) -> (gst::ClockTime, gst::ClockTime) {
unsafe { unsafe {
let mut min = mem::MaybeUninit::uninit(); let mut min = mem::MaybeUninit::uninit();
let mut max = mem::MaybeUninit::uninit(); let mut max = mem::MaybeUninit::uninit();
@ -356,8 +356,8 @@ impl Sink<gst::Sample> for AppSrcSink {
None => return Poll::Ready(Err(gst::FlowError::Eos)), None => return Poll::Ready(Err(gst::FlowError::Eos)),
}; };
let current_level_bytes = app_src.get_current_level_bytes(); let current_level_bytes = app_src.current_level_bytes();
let max_bytes = app_src.get_max_bytes(); let max_bytes = app_src.max_bytes();
if current_level_bytes >= max_bytes && max_bytes != 0 { if current_level_bytes >= max_bytes && max_bytes != 0 {
waker.replace(context.waker().to_owned()); waker.replace(context.waker().to_owned());
@ -417,7 +417,7 @@ mod tests {
appsrc.link(&fakesink).unwrap(); appsrc.link(&fakesink).unwrap();
let mut bus_stream = pipeline.get_bus().unwrap().stream(); let mut bus_stream = pipeline.bus().unwrap().stream();
let mut app_src_sink = appsrc.dynamic_cast::<AppSrc>().unwrap().sink(); let mut app_src_sink = appsrc.dynamic_cast::<AppSrc>().unwrap().sink();
let sample_quantity = 5; let sample_quantity = 5;

View file

@ -45,7 +45,7 @@ impl convert::TryFrom<gst::Structure> for AudioConverterConfig {
fn try_from(v: gst::Structure) -> Result<AudioConverterConfig, Self::Error> { fn try_from(v: gst::Structure) -> Result<AudioConverterConfig, Self::Error> {
skip_assert_initialized!(); skip_assert_initialized!();
if v.get_name() == "GstAudioConverter" { if v.name() == "GstAudioConverter" {
Ok(AudioConverterConfig(v)) Ok(AudioConverterConfig(v))
} else { } else {
Err(glib::bool_error!("Structure is no AudioConverterConfig")) Err(glib::bool_error!("Structure is no AudioConverterConfig"))
@ -78,7 +78,7 @@ impl AudioConverterConfig {
self.0.set("GstAudioConverter.dither-method", &v); self.0.set("GstAudioConverter.dither-method", &v);
} }
pub fn get_dither_method(&self) -> crate::AudioDitherMethod { pub fn dither_method(&self) -> crate::AudioDitherMethod {
self.0 self.0
.get_optional("GstAudioConverter.dither-method") .get_optional("GstAudioConverter.dither-method")
.expect("Wrong type") .expect("Wrong type")
@ -89,7 +89,7 @@ impl AudioConverterConfig {
self.0.set("GstAudioConverter.noise-shaping-method", &v); self.0.set("GstAudioConverter.noise-shaping-method", &v);
} }
pub fn get_noise_shaping_method(&self) -> crate::AudioNoiseShapingMethod { pub fn noise_shaping_method(&self) -> crate::AudioNoiseShapingMethod {
self.0 self.0
.get_optional("GstAudioConverter.noise-shaping-method") .get_optional("GstAudioConverter.noise-shaping-method")
.expect("Wrong type") .expect("Wrong type")
@ -100,7 +100,7 @@ impl AudioConverterConfig {
self.0.set("GstAudioConverter.quantization", &v); self.0.set("GstAudioConverter.quantization", &v);
} }
pub fn get_quantization(&self) -> u32 { pub fn quantization(&self) -> u32 {
self.0 self.0
.get_optional("GstAudioConverter.quantization") .get_optional("GstAudioConverter.quantization")
.expect("Wrong type") .expect("Wrong type")
@ -115,7 +115,7 @@ impl AudioConverterConfig {
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
pub fn get_resampler_method(&self) -> crate::AudioResamplerMethod { pub fn resampler_method(&self) -> crate::AudioResamplerMethod {
self.0 self.0
.get_optional("GstAudioConverter.resampler-method") .get_optional("GstAudioConverter.resampler-method")
.expect("Wrong type") .expect("Wrong type")
@ -141,7 +141,7 @@ impl AudioConverterConfig {
self.0.set("GstAudioConverter.mix-matrix", &array); self.0.set("GstAudioConverter.mix-matrix", &array);
} }
pub fn get_mix_matrix(&self) -> Vec<Vec<f32>> { pub fn mix_matrix(&self) -> Vec<Vec<f32>> {
self.0 self.0
.get_optional::<gst::Array>("GstAudioConverter.mix-matrix") .get_optional::<gst::Array>("GstAudioConverter.mix-matrix")
.expect("Wrong type") .expect("Wrong type")
@ -180,7 +180,7 @@ mod tests {
let mut config = AudioConverterConfig::new(); let mut config = AudioConverterConfig::new();
config.set_mix_matrix(MATRIX); config.set_mix_matrix(MATRIX);
let matrix = config.get_mix_matrix(); let matrix = config.mix_matrix();
assert_eq!(matrix, MATRIX); assert_eq!(matrix, MATRIX);
config.set_mix_matrix(&matrix); config.set_mix_matrix(&matrix);

View file

@ -43,7 +43,7 @@ pub trait AudioDecoderExtManual: 'static {
fn set_output_format(&self, info: &AudioInfo) -> Result<(), gst::FlowError>; fn set_output_format(&self, info: &AudioInfo) -> Result<(), gst::FlowError>;
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
fn error<T: gst::MessageErrorDomain>( fn error<T: gst::MessageErrorDomain>(
@ -132,7 +132,7 @@ impl<O: IsA<AudioDecoder>> AudioDecoderExtManual for O {
} }
} }
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) { fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe { unsafe {
let mut allocator = ptr::null_mut(); let mut allocator = ptr::null_mut();
let mut params = mem::zeroed(); let mut params = mem::zeroed();

View file

@ -17,9 +17,9 @@ pub trait AudioEncoderExtManual: 'static {
fn set_output_format(&self, caps: &gst::Caps) -> Result<(), gst::FlowError>; fn set_output_format(&self, caps: &gst::Caps) -> Result<(), gst::FlowError>;
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime); fn latency(&self) -> (gst::ClockTime, gst::ClockTime);
} }
impl<O: IsA<AudioEncoder>> AudioEncoderExtManual for O { impl<O: IsA<AudioEncoder>> AudioEncoderExtManual for O {
@ -65,7 +65,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExtManual for O {
} }
} }
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) { fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe { unsafe {
let mut allocator = ptr::null_mut(); let mut allocator = ptr::null_mut();
let mut params = mem::zeroed(); let mut params = mem::zeroed();
@ -78,7 +78,7 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExtManual for O {
} }
} }
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime) { fn latency(&self) -> (gst::ClockTime, gst::ClockTime) {
unsafe { unsafe {
let mut min = mem::MaybeUninit::uninit(); let mut min = mem::MaybeUninit::uninit();
let mut max = mem::MaybeUninit::uninit(); let mut max = mem::MaybeUninit::uninit();

View file

@ -181,7 +181,7 @@ impl AudioInfo {
let mut dest_val = mem::MaybeUninit::uninit(); let mut dest_val = mem::MaybeUninit::uninit();
if from_glib(ffi::gst_audio_info_convert( if from_glib(ffi::gst_audio_info_convert(
&self.0, &self.0,
src_val.get_format().to_glib(), src_val.format().to_glib(),
src_val.to_raw_value(), src_val.to_raw_value(),
U::get_default_format().to_glib(), U::get_default_format().to_glib(),
dest_val.as_mut_ptr(), dest_val.as_mut_ptr(),
@ -205,7 +205,7 @@ impl AudioInfo {
let mut dest_val = mem::MaybeUninit::uninit(); let mut dest_val = mem::MaybeUninit::uninit();
if from_glib(ffi::gst_audio_info_convert( if from_glib(ffi::gst_audio_info_convert(
&self.0, &self.0,
src_val.get_format().to_glib(), src_val.format().to_glib(),
src_val.to_raw_value(), src_val.to_raw_value(),
dest_fmt.to_glib(), dest_fmt.to_glib(),
dest_val.as_mut_ptr(), dest_val.as_mut_ptr(),

View file

@ -29,24 +29,24 @@ impl AudioClippingMeta {
skip_assert_initialized!(); skip_assert_initialized!();
let start = start.into(); let start = start.into();
let end = end.into(); let end = end.into();
assert_eq!(start.get_format(), end.get_format()); assert_eq!(start.format(), end.format());
unsafe { unsafe {
let meta = ffi::gst_buffer_add_audio_clipping_meta( let meta = ffi::gst_buffer_add_audio_clipping_meta(
buffer.as_mut_ptr(), buffer.as_mut_ptr(),
start.get_format().to_glib(), start.format().to_glib(),
start.get_value() as u64, start.value() as u64,
end.get_value() as u64, end.value() as u64,
); );
Self::from_mut_ptr(buffer, meta) Self::from_mut_ptr(buffer, meta)
} }
} }
pub fn get_start(&self) -> gst::GenericFormattedValue { pub fn start(&self) -> gst::GenericFormattedValue {
unsafe { gst::GenericFormattedValue::new(from_glib(self.0.format), self.0.start as i64) } unsafe { gst::GenericFormattedValue::new(from_glib(self.0.format), self.0.start as i64) }
} }
pub fn get_end(&self) -> gst::GenericFormattedValue { pub fn end(&self) -> gst::GenericFormattedValue {
unsafe { gst::GenericFormattedValue::new(from_glib(self.0.format), self.0.end as i64) } unsafe { gst::GenericFormattedValue::new(from_glib(self.0.format), self.0.end as i64) }
} }
} }
@ -62,8 +62,8 @@ unsafe impl MetaAPI for AudioClippingMeta {
impl fmt::Debug for AudioClippingMeta { impl fmt::Debug for AudioClippingMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("AudioClippingMeta") f.debug_struct("AudioClippingMeta")
.field("start", &self.get_start()) .field("start", &self.start())
.field("end", &self.get_end()) .field("end", &self.end())
.finish() .finish()
} }
} }
@ -144,8 +144,8 @@ impl AudioMeta {
max_offset.unwrap() max_offset.unwrap()
}; };
if max_offset + plane_size > buffer.get_size() { if max_offset + plane_size > buffer.size() {
return Err(glib::bool_error!("Audio channel offsets out of bounds: max offset {} with plane size {} and buffer size {}", max_offset, plane_size, buffer.get_size())); return Err(glib::bool_error!("Audio channel offsets out of bounds: max offset {} with plane size {} and buffer size {}", max_offset, plane_size, buffer.size()));
} }
} }
@ -169,15 +169,15 @@ impl AudioMeta {
} }
} }
pub fn get_info(&self) -> crate::AudioInfo { pub fn info(&self) -> crate::AudioInfo {
unsafe { from_glib_none(&self.0.info as *const _ as *mut ffi::GstAudioInfo) } unsafe { from_glib_none(&self.0.info as *const _ as *mut ffi::GstAudioInfo) }
} }
pub fn get_samples(&self) -> usize { pub fn samples(&self) -> usize {
self.0.samples self.0.samples
} }
pub fn get_offsets(&self) -> &[usize] { pub fn offsets(&self) -> &[usize] {
if self.0.offsets.is_null() || self.0.info.channels < 1 { if self.0.offsets.is_null() || self.0.info.channels < 1 {
return &[]; return &[];
} }
@ -201,9 +201,9 @@ unsafe impl MetaAPI for AudioMeta {
impl fmt::Debug for AudioMeta { impl fmt::Debug for AudioMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("AudioMeta") f.debug_struct("AudioMeta")
.field("info", &self.get_info()) .field("info", &self.info())
.field("samples", &self.get_samples()) .field("samples", &self.samples())
.field("offsets", &self.get_offsets()) .field("offsets", &self.offsets())
.finish() .finish()
} }
} }
@ -226,26 +226,14 @@ mod tests {
gst::format::Default(Some(1)), gst::format::Default(Some(1)),
gst::format::Default(Some(2)), gst::format::Default(Some(2)),
); );
assert_eq!( assert_eq!(cmeta.start().try_into(), Ok(gst::format::Default(Some(1))));
cmeta.get_start().try_into(), assert_eq!(cmeta.end().try_into(), Ok(gst::format::Default(Some(2))));
Ok(gst::format::Default(Some(1)))
);
assert_eq!(
cmeta.get_end().try_into(),
Ok(gst::format::Default(Some(2)))
);
} }
{ {
let cmeta = buffer.get_meta::<AudioClippingMeta>().unwrap(); let cmeta = buffer.get_meta::<AudioClippingMeta>().unwrap();
assert_eq!( assert_eq!(cmeta.start().try_into(), Ok(gst::format::Default(Some(1))));
cmeta.get_start().try_into(), assert_eq!(cmeta.end().try_into(), Ok(gst::format::Default(Some(2))));
Ok(gst::format::Default(Some(1)))
);
assert_eq!(
cmeta.get_end().try_into(),
Ok(gst::format::Default(Some(2)))
);
} }
} }
} }

View file

@ -13,7 +13,7 @@ use std::fmt;
pub struct AudioRingBufferSpec(pub(crate) GstAudioRingBufferSpec); pub struct AudioRingBufferSpec(pub(crate) GstAudioRingBufferSpec);
impl AudioRingBufferSpec { impl AudioRingBufferSpec {
pub fn get_type(&self) -> AudioRingBufferFormatType { pub fn type_(&self) -> AudioRingBufferFormatType {
unsafe { AudioRingBufferFormatType::from_glib(self.0.type_) } unsafe { AudioRingBufferFormatType::from_glib(self.0.type_) }
} }
@ -21,15 +21,15 @@ impl AudioRingBufferSpec {
self.0.type_ = value.to_glib(); self.0.type_ = value.to_glib();
} }
pub fn get_caps(&self) -> Caps { pub fn caps(&self) -> Caps {
unsafe { Caps::from_glib_none(self.0.caps) } unsafe { Caps::from_glib_none(self.0.caps) }
} }
pub fn get_audio_info(&self) -> AudioInfo { pub fn audio_info(&self) -> AudioInfo {
unsafe { AudioInfo::from_glib_none(mut_override(&self.0.info)) } unsafe { AudioInfo::from_glib_none(mut_override(&self.0.info)) }
} }
pub fn get_latency_time(&self) -> u64 { pub fn latency_time(&self) -> u64 {
self.0.latency_time self.0.latency_time
} }
@ -37,7 +37,7 @@ impl AudioRingBufferSpec {
self.0.latency_time = value; self.0.latency_time = value;
} }
pub fn get_buffer_time(&self) -> u64 { pub fn buffer_time(&self) -> u64 {
self.0.buffer_time self.0.buffer_time
} }
@ -45,7 +45,7 @@ impl AudioRingBufferSpec {
self.0.buffer_time = value; self.0.buffer_time = value;
} }
pub fn get_segsize(&self) -> i32 { pub fn segsize(&self) -> i32 {
self.0.segsize self.0.segsize
} }
@ -53,7 +53,7 @@ impl AudioRingBufferSpec {
self.0.segsize = value; self.0.segsize = value;
} }
pub fn get_segtotal(&self) -> i32 { pub fn segtotal(&self) -> i32 {
self.0.segtotal self.0.segtotal
} }
@ -61,7 +61,7 @@ impl AudioRingBufferSpec {
self.0.segtotal = value; self.0.segtotal = value;
} }
pub fn get_seglatency(&self) -> i32 { pub fn seglatency(&self) -> i32 {
self.0.seglatency self.0.seglatency
} }
@ -95,14 +95,14 @@ unsafe impl Sync for AudioRingBufferSpec {}
impl fmt::Debug for AudioRingBufferSpec { impl fmt::Debug for AudioRingBufferSpec {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("AudioRingBufferSpec") f.debug_struct("AudioRingBufferSpec")
.field("type", &self.get_type()) .field("type", &self.type_())
.field("caps", &self.get_caps()) .field("caps", &self.caps())
.field("audio_info", &self.get_audio_info()) .field("audio_info", &self.audio_info())
.field("latency_time", &self.get_latency_time()) .field("latency_time", &self.latency_time())
.field("buffer_time", &self.get_buffer_time()) .field("buffer_time", &self.buffer_time())
.field("segsize", &self.get_segsize()) .field("segsize", &self.segsize())
.field("segtotal", &self.get_segtotal()) .field("segtotal", &self.segtotal())
.field("seglatency", &self.get_seglatency()) .field("seglatency", &self.seglatency())
.finish() .finish()
} }
} }

View file

@ -166,7 +166,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.open .open
.map(|f| { .map(|f| {
@ -190,7 +190,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.close .close
.map(|f| { .map(|f| {
@ -214,7 +214,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -238,7 +238,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -266,7 +266,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.set_format .set_format
.map(|f| { .map(|f| {
@ -290,7 +290,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
) -> Result<(u32, u32), gst::FlowError> { ) -> Result<(u32, u32), gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.parse .parse
.map(|f| { .map(|f| {
@ -325,7 +325,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.handle_frame .handle_frame
.map(|f| { .map(|f| {
@ -348,7 +348,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
) -> Result<Option<gst::Buffer>, gst::FlowError> { ) -> Result<Option<gst::Buffer>, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
if let Some(f) = (*parent_class).pre_push { if let Some(f) = (*parent_class).pre_push {
let mut buffer = buffer.into_ptr(); let mut buffer = buffer.into_ptr();
match gst::FlowReturn::from_glib(f( match gst::FlowReturn::from_glib(f(
@ -369,7 +369,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_flush(&self, element: &Self::Type, hard: bool) { fn parent_flush(&self, element: &Self::Type, hard: bool) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.flush .flush
.map(|f| { .map(|f| {
@ -385,7 +385,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
.map(|f| { .map(|f| {
@ -402,7 +402,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.getcaps .getcaps
.map(|f| { .map(|f| {
@ -422,7 +422,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
.expect("Missing parent function `sink_event`"); .expect("Missing parent function `sink_event`");
@ -436,7 +436,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
.expect("Missing parent function `sink_query`"); .expect("Missing parent function `sink_query`");
@ -450,7 +450,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
.expect("Missing parent function `src_event`"); .expect("Missing parent function `src_event`");
@ -464,7 +464,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
.expect("Missing parent function `src_query`"); .expect("Missing parent function `src_query`");
@ -482,7 +482,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.propose_allocation .propose_allocation
.map(|f| { .map(|f| {
@ -509,7 +509,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.decide_allocation .decide_allocation
.map(|f| { .map(|f| {
@ -562,7 +562,7 @@ unsafe extern "C" fn audio_decoder_open<T: AudioDecoderImpl>(
ptr: *mut ffi::GstAudioDecoder, ptr: *mut ffi::GstAudioDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -581,7 +581,7 @@ unsafe extern "C" fn audio_decoder_close<T: AudioDecoderImpl>(
ptr: *mut ffi::GstAudioDecoder, ptr: *mut ffi::GstAudioDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -600,7 +600,7 @@ unsafe extern "C" fn audio_decoder_start<T: AudioDecoderImpl>(
ptr: *mut ffi::GstAudioDecoder, ptr: *mut ffi::GstAudioDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -619,7 +619,7 @@ unsafe extern "C" fn audio_decoder_stop<T: AudioDecoderImpl>(
ptr: *mut ffi::GstAudioDecoder, ptr: *mut ffi::GstAudioDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -639,7 +639,7 @@ unsafe extern "C" fn audio_decoder_set_format<T: AudioDecoderImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -661,7 +661,7 @@ unsafe extern "C" fn audio_decoder_parse<T: AudioDecoderImpl>(
len: *mut i32, len: *mut i32,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -687,7 +687,7 @@ unsafe extern "C" fn audio_decoder_handle_frame<T: AudioDecoderImpl>(
// FIXME: Misgenerated in gstreamer-audio-sys // FIXME: Misgenerated in gstreamer-audio-sys
let buffer = buffer as *mut gst::ffi::GstBuffer; let buffer = buffer as *mut gst::ffi::GstBuffer;
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -705,7 +705,7 @@ unsafe extern "C" fn audio_decoder_pre_push<T: AudioDecoderImpl>(
buffer: *mut *mut gst::ffi::GstBuffer, buffer: *mut *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -730,7 +730,7 @@ unsafe extern "C" fn audio_decoder_flush<T: AudioDecoderImpl>(
hard: glib::ffi::gboolean, hard: glib::ffi::gboolean,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), (), { gst::panic_to_error!(&wrap, &imp.panicked(), (), {
@ -742,7 +742,7 @@ unsafe extern "C" fn audio_decoder_negotiate<T: AudioDecoderImpl>(
ptr: *mut ffi::GstAudioDecoder, ptr: *mut ffi::GstAudioDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -762,7 +762,7 @@ unsafe extern "C" fn audio_decoder_getcaps<T: AudioDecoderImpl>(
filter: *mut gst::ffi::GstCaps, filter: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), { gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), {
@ -782,7 +782,7 @@ unsafe extern "C" fn audio_decoder_sink_event<T: AudioDecoderImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -796,7 +796,7 @@ unsafe extern "C" fn audio_decoder_sink_query<T: AudioDecoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -810,7 +810,7 @@ unsafe extern "C" fn audio_decoder_src_event<T: AudioDecoderImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -824,7 +824,7 @@ unsafe extern "C" fn audio_decoder_src_query<T: AudioDecoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -838,7 +838,7 @@ unsafe extern "C" fn audio_decoder_propose_allocation<T: AudioDecoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query); let query = gst::QueryRef::from_mut_ptr(query);
@ -859,7 +859,7 @@ unsafe extern "C" fn audio_decoder_decide_allocation<T: AudioDecoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioDecoder> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query); let query = gst::QueryRef::from_mut_ptr(query);

View file

@ -152,7 +152,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.open .open
.map(|f| { .map(|f| {
@ -176,7 +176,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.close .close
.map(|f| { .map(|f| {
@ -200,7 +200,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -224,7 +224,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -252,7 +252,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.set_format .set_format
.map(|f| { .map(|f| {
@ -276,7 +276,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.handle_frame .handle_frame
.map(|f| { .map(|f| {
@ -299,7 +299,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
) -> Result<Option<gst::Buffer>, gst::FlowError> { ) -> Result<Option<gst::Buffer>, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
if let Some(f) = (*parent_class).pre_push { if let Some(f) = (*parent_class).pre_push {
let mut buffer = buffer.into_ptr(); let mut buffer = buffer.into_ptr();
match gst::FlowReturn::from_glib(f( match gst::FlowReturn::from_glib(f(
@ -320,7 +320,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_flush(&self, element: &Self::Type) { fn parent_flush(&self, element: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.flush .flush
.map(|f| f(element.unsafe_cast_ref::<AudioEncoder>().to_glib_none().0)) .map(|f| f(element.unsafe_cast_ref::<AudioEncoder>().to_glib_none().0))
@ -331,7 +331,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
.map(|f| { .map(|f| {
@ -348,7 +348,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.getcaps .getcaps
.map(|f| { .map(|f| {
@ -368,7 +368,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
.expect("Missing parent function `sink_event`"); .expect("Missing parent function `sink_event`");
@ -382,7 +382,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
.expect("Missing parent function `sink_query`"); .expect("Missing parent function `sink_query`");
@ -396,7 +396,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
.expect("Missing parent function `src_event`"); .expect("Missing parent function `src_event`");
@ -410,7 +410,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
.expect("Missing parent function `src_query`"); .expect("Missing parent function `src_query`");
@ -428,7 +428,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.propose_allocation .propose_allocation
.map(|f| { .map(|f| {
@ -455,7 +455,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.decide_allocation .decide_allocation
.map(|f| { .map(|f| {
@ -507,7 +507,7 @@ unsafe extern "C" fn audio_encoder_open<T: AudioEncoderImpl>(
ptr: *mut ffi::GstAudioEncoder, ptr: *mut ffi::GstAudioEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -526,7 +526,7 @@ unsafe extern "C" fn audio_encoder_close<T: AudioEncoderImpl>(
ptr: *mut ffi::GstAudioEncoder, ptr: *mut ffi::GstAudioEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -545,7 +545,7 @@ unsafe extern "C" fn audio_encoder_start<T: AudioEncoderImpl>(
ptr: *mut ffi::GstAudioEncoder, ptr: *mut ffi::GstAudioEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -564,7 +564,7 @@ unsafe extern "C" fn audio_encoder_stop<T: AudioEncoderImpl>(
ptr: *mut ffi::GstAudioEncoder, ptr: *mut ffi::GstAudioEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -584,7 +584,7 @@ unsafe extern "C" fn audio_encoder_set_format<T: AudioEncoderImpl>(
info: *mut ffi::GstAudioInfo, info: *mut ffi::GstAudioInfo,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -606,7 +606,7 @@ unsafe extern "C" fn audio_encoder_handle_frame<T: AudioEncoderImpl>(
// FIXME: Misgenerated in gstreamer-audio-sys // FIXME: Misgenerated in gstreamer-audio-sys
let buffer = buffer as *mut gst::ffi::GstBuffer; let buffer = buffer as *mut gst::ffi::GstBuffer;
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -624,7 +624,7 @@ unsafe extern "C" fn audio_encoder_pre_push<T: AudioEncoderImpl>(
buffer: *mut *mut gst::ffi::GstBuffer, buffer: *mut *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -646,7 +646,7 @@ unsafe extern "C" fn audio_encoder_pre_push<T: AudioEncoderImpl>(
unsafe extern "C" fn audio_encoder_flush<T: AudioEncoderImpl>(ptr: *mut ffi::GstAudioEncoder) { unsafe extern "C" fn audio_encoder_flush<T: AudioEncoderImpl>(ptr: *mut ffi::GstAudioEncoder) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), (), { gst::panic_to_error!(&wrap, &imp.panicked(), (), {
@ -658,7 +658,7 @@ unsafe extern "C" fn audio_encoder_negotiate<T: AudioEncoderImpl>(
ptr: *mut ffi::GstAudioEncoder, ptr: *mut ffi::GstAudioEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -678,7 +678,7 @@ unsafe extern "C" fn audio_encoder_getcaps<T: AudioEncoderImpl>(
filter: *mut gst::ffi::GstCaps, filter: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), { gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), {
@ -698,7 +698,7 @@ unsafe extern "C" fn audio_encoder_sink_event<T: AudioEncoderImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -712,7 +712,7 @@ unsafe extern "C" fn audio_encoder_sink_query<T: AudioEncoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -726,7 +726,7 @@ unsafe extern "C" fn audio_encoder_src_event<T: AudioEncoderImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -740,7 +740,7 @@ unsafe extern "C" fn audio_encoder_src_query<T: AudioEncoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -754,7 +754,7 @@ unsafe extern "C" fn audio_encoder_propose_allocation<T: AudioEncoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query); let query = gst::QueryRef::from_mut_ptr(query);
@ -775,7 +775,7 @@ unsafe extern "C" fn audio_encoder_decide_allocation<T: AudioEncoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<AudioEncoder> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query); let query = gst::QueryRef::from_mut_ptr(query);

View file

@ -62,7 +62,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_close(&self, sink: &Self::Type) -> Result<(), LoggableError> { fn parent_close(&self, sink: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).close { let f = match (*parent_class).close {
None => return Ok(()), None => return Ok(()),
Some(f) => f, Some(f) => f,
@ -78,7 +78,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_delay(&self, sink: &Self::Type) -> u32 { fn parent_delay(&self, sink: &Self::Type) -> u32 {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).delay { let f = match (*parent_class).delay {
Some(f) => f, Some(f) => f,
None => return 0, None => return 0,
@ -90,7 +90,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_open(&self, sink: &Self::Type) -> Result<(), LoggableError> { fn parent_open(&self, sink: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).open { let f = match (*parent_class).open {
Some(f) => f, Some(f) => f,
None => return Ok(()), None => return Ok(()),
@ -110,7 +110,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).prepare { let f = match (*parent_class).prepare {
Some(f) => f, Some(f) => f,
None => return Ok(()), None => return Ok(()),
@ -129,7 +129,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_unprepare(&self, sink: &Self::Type) -> Result<(), LoggableError> { fn parent_unprepare(&self, sink: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).unprepare { let f = match (*parent_class).unprepare {
Some(f) => f, Some(f) => f,
None => { None => {
@ -150,7 +150,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_write(&self, sink: &Self::Type, buffer: &[u8]) -> Result<i32, LoggableError> { fn parent_write(&self, sink: &Self::Type, buffer: &[u8]) -> Result<i32, LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).write { let f = match (*parent_class).write {
Some(f) => f, Some(f) => f,
None => return Ok(-1), None => return Ok(-1),
@ -175,7 +175,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_reset(&self, sink: &Self::Type) { fn parent_reset(&self, sink: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
if let Some(f) = (*parent_class).reset { if let Some(f) = (*parent_class).reset {
f(sink.unsafe_cast_ref::<AudioSink>().to_glib_none().0) f(sink.unsafe_cast_ref::<AudioSink>().to_glib_none().0)
} }
@ -205,7 +205,7 @@ unsafe extern "C" fn audiosink_close<T: AudioSinkImpl>(
ptr: *mut ffi::GstAudioSink, ptr: *mut ffi::GstAudioSink,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -222,7 +222,7 @@ unsafe extern "C" fn audiosink_close<T: AudioSinkImpl>(
unsafe extern "C" fn audiosink_delay<T: AudioSinkImpl>(ptr: *mut ffi::GstAudioSink) -> u32 { unsafe extern "C" fn audiosink_delay<T: AudioSinkImpl>(ptr: *mut ffi::GstAudioSink) -> u32 {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), 0, { gst::panic_to_error!(&wrap, &imp.panicked(), 0, {
@ -234,7 +234,7 @@ unsafe extern "C" fn audiosink_open<T: AudioSinkImpl>(
ptr: *mut ffi::GstAudioSink, ptr: *mut ffi::GstAudioSink,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -254,7 +254,7 @@ unsafe extern "C" fn audiosink_prepare<T: AudioSinkImpl>(
spec: *mut ffi::GstAudioRingBufferSpec, spec: *mut ffi::GstAudioRingBufferSpec,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr);
let spec = &mut *(spec as *mut AudioRingBufferSpec); let spec = &mut *(spec as *mut AudioRingBufferSpec);
@ -275,7 +275,7 @@ unsafe extern "C" fn audiosink_unprepare<T: AudioSinkImpl>(
ptr: *mut ffi::GstAudioSink, ptr: *mut ffi::GstAudioSink,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -296,7 +296,7 @@ unsafe extern "C" fn audiosink_write<T: AudioSinkImpl>(
length: u32, length: u32,
) -> i32 { ) -> i32 {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr);
let data_slice = std::slice::from_raw_parts(data as *const u8, length as usize); let data_slice = std::slice::from_raw_parts(data as *const u8, length as usize);
@ -307,7 +307,7 @@ unsafe extern "C" fn audiosink_write<T: AudioSinkImpl>(
unsafe extern "C" fn audiosink_reset<T: AudioSinkImpl>(ptr: *mut ffi::GstAudioSink) { unsafe extern "C" fn audiosink_reset<T: AudioSinkImpl>(ptr: *mut ffi::GstAudioSink) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), (), { gst::panic_to_error!(&wrap, &imp.panicked(), (), {

View file

@ -72,7 +72,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_close(&self, src: &Self::Type) -> Result<(), LoggableError> { fn parent_close(&self, src: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).close { let f = match (*parent_class).close {
None => return Ok(()), None => return Ok(()),
Some(f) => f, Some(f) => f,
@ -88,7 +88,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_delay(&self, src: &Self::Type) -> u32 { fn parent_delay(&self, src: &Self::Type) -> u32 {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).delay { let f = match (*parent_class).delay {
Some(f) => f, Some(f) => f,
None => return 0, None => return 0,
@ -100,7 +100,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_open(&self, src: &Self::Type) -> Result<(), LoggableError> { fn parent_open(&self, src: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).open { let f = match (*parent_class).open {
Some(f) => f, Some(f) => f,
None => return Ok(()), None => return Ok(()),
@ -120,7 +120,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).prepare { let f = match (*parent_class).prepare {
Some(f) => f, Some(f) => f,
None => return Ok(()), None => return Ok(()),
@ -139,7 +139,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_unprepare(&self, src: &Self::Type) -> Result<(), LoggableError> { fn parent_unprepare(&self, src: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).unprepare { let f = match (*parent_class).unprepare {
Some(f) => f, Some(f) => f,
None => { None => {
@ -164,7 +164,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
) -> Result<(u32, gst::ClockTime), LoggableError> { ) -> Result<(u32, gst::ClockTime), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).read { let f = match (*parent_class).read {
Some(f) => f, Some(f) => f,
None => return Ok((0, gst::CLOCK_TIME_NONE)), None => return Ok((0, gst::CLOCK_TIME_NONE)),
@ -191,7 +191,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_reset(&self, src: &Self::Type) { fn parent_reset(&self, src: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
if let Some(f) = (*parent_class).reset { if let Some(f) = (*parent_class).reset {
f(src.unsafe_cast_ref::<AudioSrc>().to_glib_none().0) f(src.unsafe_cast_ref::<AudioSrc>().to_glib_none().0)
} }
@ -221,7 +221,7 @@ unsafe extern "C" fn audiosrc_close<T: AudioSrcImpl>(
ptr: *mut ffi::GstAudioSrc, ptr: *mut ffi::GstAudioSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -238,7 +238,7 @@ unsafe extern "C" fn audiosrc_close<T: AudioSrcImpl>(
unsafe extern "C" fn audiosrc_delay<T: AudioSrcImpl>(ptr: *mut ffi::GstAudioSrc) -> u32 { unsafe extern "C" fn audiosrc_delay<T: AudioSrcImpl>(ptr: *mut ffi::GstAudioSrc) -> u32 {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), 0, { gst::panic_to_error!(&wrap, &imp.panicked(), 0, {
@ -250,7 +250,7 @@ unsafe extern "C" fn audiosrc_open<T: AudioSrcImpl>(
ptr: *mut ffi::GstAudioSrc, ptr: *mut ffi::GstAudioSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -270,7 +270,7 @@ unsafe extern "C" fn audiosrc_prepare<T: AudioSrcImpl>(
spec: *mut ffi::GstAudioRingBufferSpec, spec: *mut ffi::GstAudioRingBufferSpec,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr);
let spec = &mut *(spec as *mut AudioRingBufferSpec); let spec = &mut *(spec as *mut AudioRingBufferSpec);
@ -291,7 +291,7 @@ unsafe extern "C" fn audiosrc_unprepare<T: AudioSrcImpl>(
ptr: *mut ffi::GstAudioSrc, ptr: *mut ffi::GstAudioSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -313,7 +313,7 @@ unsafe extern "C" fn audiosrc_read<T: AudioSrcImpl>(
timestamp: *mut gst::ffi::GstClockTime, timestamp: *mut gst::ffi::GstClockTime,
) -> u32 { ) -> u32 {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr);
let data_slice = std::slice::from_raw_parts_mut(data as *mut u8, length as usize); let data_slice = std::slice::from_raw_parts_mut(data as *mut u8, length as usize);
@ -329,7 +329,7 @@ unsafe extern "C" fn audiosrc_read<T: AudioSrcImpl>(
unsafe extern "C" fn audiosrc_reset<T: AudioSrcImpl>(ptr: *mut ffi::GstAudioSrc) { unsafe extern "C" fn audiosrc_reset<T: AudioSrcImpl>(ptr: *mut ffi::GstAudioSrc) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr); let wrap: Borrowed<AudioSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), (), { gst::panic_to_error!(&wrap, &imp.panicked(), (), {

View file

@ -22,7 +22,7 @@ use std::mem::transmute;
use std::ptr; use std::ptr;
pub trait AggregatorExtManual: 'static { pub trait AggregatorExtManual: 'static {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn finish_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError>; fn finish_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError>;
@ -35,7 +35,7 @@ pub trait AggregatorExtManual: 'static {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_property_min_upstream_latency(&self) -> gst::ClockTime; fn property_min_upstream_latency(&self) -> gst::ClockTime;
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
@ -84,7 +84,7 @@ pub trait AggregatorExtManual: 'static {
} }
impl<O: IsA<Aggregator>> AggregatorExtManual for O { impl<O: IsA<Aggregator>> AggregatorExtManual for O {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) { fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe { unsafe {
let mut allocator = ptr::null_mut(); let mut allocator = ptr::null_mut();
let mut params = mem::zeroed(); let mut params = mem::zeroed();
@ -124,7 +124,7 @@ impl<O: IsA<Aggregator>> AggregatorExtManual for O {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_property_min_upstream_latency(&self) -> gst::ClockTime { fn property_min_upstream_latency(&self) -> gst::ClockTime {
unsafe { unsafe {
let mut value = Value::from_type(<gst::ClockTime as StaticType>::static_type()); let mut value = Value::from_type(<gst::ClockTime as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property( glib::gobject_ffi::g_object_get_property(

View file

@ -5,11 +5,11 @@ use glib::object::IsA;
use glib::translate::*; use glib::translate::*;
pub trait AggregatorPadExtManual: 'static { pub trait AggregatorPadExtManual: 'static {
fn get_segment(&self) -> gst::Segment; fn segment(&self) -> gst::Segment;
} }
impl<O: IsA<AggregatorPad>> AggregatorPadExtManual for O { impl<O: IsA<AggregatorPad>> AggregatorPadExtManual for O {
fn get_segment(&self) -> gst::Segment { fn segment(&self) -> gst::Segment {
unsafe { unsafe {
let ptr: &ffi::GstAggregatorPad = &*(self.as_ptr() as *const _); let ptr: &ffi::GstAggregatorPad = &*(self.as_ptr() as *const _);
let _guard = crate::utils::MutexGuard::lock(&ptr.parent.object.lock); let _guard = crate::utils::MutexGuard::lock(&ptr.parent.object.lock);

View file

@ -9,8 +9,8 @@ use std::convert::TryFrom;
use std::mem; use std::mem;
pub trait BaseParseExtManual: 'static { pub trait BaseParseExtManual: 'static {
fn get_sink_pad(&self) -> gst::Pad; fn sink_pad(&self) -> gst::Pad;
fn get_src_pad(&self) -> gst::Pad; fn src_pad(&self) -> gst::Pad;
fn set_duration<V: Into<gst::GenericFormattedValue>>(&self, duration: V, interval: u32); fn set_duration<V: Into<gst::GenericFormattedValue>>(&self, duration: V, interval: u32);
fn set_frame_rate(&self, fps: gst::Fraction, lead_in: u32, lead_out: u32); fn set_frame_rate(&self, fps: gst::Fraction, lead_in: u32, lead_out: u32);
@ -33,14 +33,14 @@ pub trait BaseParseExtManual: 'static {
} }
impl<O: IsA<BaseParse>> BaseParseExtManual for O { impl<O: IsA<BaseParse>> BaseParseExtManual for O {
fn get_sink_pad(&self) -> gst::Pad { fn sink_pad(&self) -> gst::Pad {
unsafe { unsafe {
let elt: &ffi::GstBaseParse = &*(self.as_ptr() as *const _); let elt: &ffi::GstBaseParse = &*(self.as_ptr() as *const _);
from_glib_none(elt.sinkpad) from_glib_none(elt.sinkpad)
} }
} }
fn get_src_pad(&self) -> gst::Pad { fn src_pad(&self) -> gst::Pad {
unsafe { unsafe {
let elt: &ffi::GstBaseParse = &*(self.as_ptr() as *const _); let elt: &ffi::GstBaseParse = &*(self.as_ptr() as *const _);
from_glib_none(elt.srcpad) from_glib_none(elt.srcpad)
@ -52,8 +52,8 @@ impl<O: IsA<BaseParse>> BaseParseExtManual for O {
unsafe { unsafe {
ffi::gst_base_parse_set_duration( ffi::gst_base_parse_set_duration(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
duration.get_format().to_glib(), duration.format().to_glib(),
duration.get_value(), duration.value(),
interval as i32, interval as i32,
); );
} }
@ -81,7 +81,7 @@ impl<O: IsA<BaseParse>> BaseParseExtManual for O {
let mut dest_val = mem::MaybeUninit::uninit(); let mut dest_val = mem::MaybeUninit::uninit();
let ret = from_glib(ffi::gst_base_parse_convert_default( let ret = from_glib(ffi::gst_base_parse_convert_default(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
src_val.get_format().to_glib(), src_val.format().to_glib(),
src_val.to_raw_value(), src_val.to_raw_value(),
U::get_default_format().to_glib(), U::get_default_format().to_glib(),
dest_val.as_mut_ptr(), dest_val.as_mut_ptr(),
@ -104,7 +104,7 @@ impl<O: IsA<BaseParse>> BaseParseExtManual for O {
let mut dest_val = mem::MaybeUninit::uninit(); let mut dest_val = mem::MaybeUninit::uninit();
let ret = from_glib(ffi::gst_base_parse_convert_default( let ret = from_glib(ffi::gst_base_parse_convert_default(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
src_val.get_format().to_glib(), src_val.format().to_glib(),
src_val.to_raw_value(), src_val.to_raw_value(),
dest_format.to_glib(), dest_format.to_glib(),
dest_val.as_mut_ptr(), dest_val.as_mut_ptr(),

View file

@ -67,11 +67,11 @@ impl<'a> fmt::Debug for BaseParseFrame<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut b = f.debug_struct("BaseParseFrame"); let mut b = f.debug_struct("BaseParseFrame");
b.field("buffer", &self.get_buffer()) b.field("buffer", &self.buffer())
.field("output_buffer", &self.get_output_buffer()) .field("output_buffer", &self.output_buffer())
.field("flags", &self.get_flags()) .field("flags", &self.flags())
.field("offset", &self.get_offset()) .field("offset", &self.offset())
.field("overhead", &self.get_overhead()); .field("overhead", &self.overhead());
b.finish() b.finish()
} }
@ -87,7 +87,7 @@ impl<'a> BaseParseFrame<'a> {
BaseParseFrame(ptr::NonNull::new_unchecked(frame), PhantomData) BaseParseFrame(ptr::NonNull::new_unchecked(frame), PhantomData)
} }
pub fn get_buffer(&self) -> Option<&gst::BufferRef> { pub fn buffer(&self) -> Option<&gst::BufferRef> {
unsafe { unsafe {
let ptr = (*self.to_glib_none().0).buffer; let ptr = (*self.to_glib_none().0).buffer;
if ptr.is_null() { if ptr.is_null() {
@ -98,7 +98,7 @@ impl<'a> BaseParseFrame<'a> {
} }
} }
pub fn get_buffer_mut(&mut self) -> Option<&mut gst::BufferRef> { pub fn buffer_mut(&mut self) -> Option<&mut gst::BufferRef> {
unsafe { unsafe {
let ptr = (*self.to_glib_none().0).buffer; let ptr = (*self.to_glib_none().0).buffer;
if ptr.is_null() { if ptr.is_null() {
@ -114,7 +114,7 @@ impl<'a> BaseParseFrame<'a> {
} }
} }
pub fn get_output_buffer(&self) -> Option<&gst::BufferRef> { pub fn output_buffer(&self) -> Option<&gst::BufferRef> {
unsafe { unsafe {
let ptr = (*self.to_glib_none().0).out_buffer; let ptr = (*self.to_glib_none().0).out_buffer;
if ptr.is_null() { if ptr.is_null() {
@ -125,7 +125,7 @@ impl<'a> BaseParseFrame<'a> {
} }
} }
pub fn get_output_buffer_mut(&mut self) -> Option<&mut gst::BufferRef> { pub fn output_buffer_mut(&mut self) -> Option<&mut gst::BufferRef> {
unsafe { unsafe {
let ptr = (*self.to_glib_none().0).out_buffer; let ptr = (*self.to_glib_none().0).out_buffer;
if ptr.is_null() { if ptr.is_null() {
@ -159,7 +159,7 @@ impl<'a> BaseParseFrame<'a> {
} }
} }
pub fn get_flags(&self) -> BaseParseFrameFlags { pub fn flags(&self) -> BaseParseFrameFlags {
let flags = unsafe { (*self.to_glib_none().0).flags }; let flags = unsafe { (*self.to_glib_none().0).flags };
BaseParseFrameFlags::from_bits_truncate(flags) BaseParseFrameFlags::from_bits_truncate(flags)
} }
@ -172,11 +172,11 @@ impl<'a> BaseParseFrame<'a> {
unsafe { (*self.to_glib_none().0).flags &= !flags.bits() } unsafe { (*self.to_glib_none().0).flags &= !flags.bits() }
} }
pub fn get_offset(&self) -> u64 { pub fn offset(&self) -> u64 {
unsafe { (*self.to_glib_none().0).offset } unsafe { (*self.to_glib_none().0).offset }
} }
pub fn get_overhead(&self) -> Overhead { pub fn overhead(&self) -> Overhead {
unsafe { from_glib((*self.to_glib_none().0).overhead) } unsafe { from_glib((*self.to_glib_none().0).overhead) }
} }

View file

@ -6,7 +6,7 @@ use glib::translate::*;
use std::mem; use std::mem;
pub trait BaseSinkExtManual: 'static { pub trait BaseSinkExtManual: 'static {
fn get_segment(&self) -> gst::Segment; fn segment(&self) -> gst::Segment;
fn wait( fn wait(
&self, &self,
@ -28,7 +28,7 @@ pub trait BaseSinkExtManual: 'static {
} }
impl<O: IsA<BaseSink>> BaseSinkExtManual for O { impl<O: IsA<BaseSink>> BaseSinkExtManual for O {
fn get_segment(&self) -> gst::Segment { fn segment(&self) -> gst::Segment {
unsafe { unsafe {
let sink: &ffi::GstBaseSink = &*(self.as_ptr() as *const _); let sink: &ffi::GstBaseSink = &*(self.as_ptr() as *const _);
let _guard = crate::utils::MutexGuard::lock(&sink.element.object.lock); let _guard = crate::utils::MutexGuard::lock(&sink.element.object.lock);

View file

@ -8,9 +8,9 @@ use std::ptr;
use crate::BaseSrc; use crate::BaseSrc;
pub trait BaseSrcExtManual: 'static { pub trait BaseSrcExtManual: 'static {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn get_segment(&self) -> gst::Segment; fn segment(&self) -> gst::Segment;
fn start_complete(&self, ret: Result<gst::FlowSuccess, gst::FlowError>); fn start_complete(&self, ret: Result<gst::FlowSuccess, gst::FlowError>);
@ -26,7 +26,7 @@ pub trait BaseSrcExtManual: 'static {
} }
impl<O: IsA<BaseSrc>> BaseSrcExtManual for O { impl<O: IsA<BaseSrc>> BaseSrcExtManual for O {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) { fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe { unsafe {
let mut allocator = ptr::null_mut(); let mut allocator = ptr::null_mut();
let mut params = mem::zeroed(); let mut params = mem::zeroed();
@ -39,7 +39,7 @@ impl<O: IsA<BaseSrc>> BaseSrcExtManual for O {
} }
} }
fn get_segment(&self) -> gst::Segment { fn segment(&self) -> gst::Segment {
unsafe { unsafe {
let src: &ffi::GstBaseSrc = &*(self.as_ptr() as *const _); let src: &ffi::GstBaseSrc = &*(self.as_ptr() as *const _);
let _guard = crate::utils::MutexGuard::lock(&src.element.object.lock); let _guard = crate::utils::MutexGuard::lock(&src.element.object.lock);

View file

@ -7,13 +7,13 @@ use std::mem;
use std::ptr; use std::ptr;
pub trait BaseTransformExtManual: 'static { pub trait BaseTransformExtManual: 'static {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn get_segment(&self) -> gst::Segment; fn segment(&self) -> gst::Segment;
} }
impl<O: IsA<BaseTransform>> BaseTransformExtManual for O { impl<O: IsA<BaseTransform>> BaseTransformExtManual for O {
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) { fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe { unsafe {
let mut allocator = ptr::null_mut(); let mut allocator = ptr::null_mut();
let mut params = mem::zeroed(); let mut params = mem::zeroed();
@ -26,7 +26,7 @@ impl<O: IsA<BaseTransform>> BaseTransformExtManual for O {
} }
} }
fn get_segment(&self) -> gst::Segment { fn segment(&self) -> gst::Segment {
unsafe { unsafe {
let trans: &ffi::GstBaseTransform = &*(self.as_ptr() as *const _); let trans: &ffi::GstBaseTransform = &*(self.as_ptr() as *const _);
let _guard = crate::utils::MutexGuard::lock(&trans.element.object.lock); let _guard = crate::utils::MutexGuard::lock(&trans.element.object.lock);

View file

@ -285,7 +285,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_flush(&self, aggregator: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_flush(&self, aggregator: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.flush .flush
.map(|f| { .map(|f| {
@ -307,7 +307,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Option<gst::Buffer> { ) -> Option<gst::Buffer> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
match (*parent_class).clip { match (*parent_class).clip {
None => Some(buffer), None => Some(buffer),
Some(ref func) => from_glib_full(func( Some(ref func) => from_glib_full(func(
@ -326,7 +326,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.finish_buffer .finish_buffer
.expect("Missing parent function `finish_buffer`"); .expect("Missing parent function `finish_buffer`");
@ -347,7 +347,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.finish_buffer_list .finish_buffer_list
.expect("Missing parent function `finish_buffer_list`"); .expect("Missing parent function `finish_buffer_list`");
@ -367,7 +367,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
.expect("Missing parent function `sink_event`"); .expect("Missing parent function `sink_event`");
@ -389,7 +389,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event_pre_queue .sink_event_pre_queue
.expect("Missing parent function `sink_event_pre_queue`"); .expect("Missing parent function `sink_event_pre_queue`");
@ -410,7 +410,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
.expect("Missing parent function `sink_query`"); .expect("Missing parent function `sink_query`");
@ -432,7 +432,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query_pre_queue .sink_query_pre_queue
.expect("Missing parent function `sink_query`"); .expect("Missing parent function `sink_query`");
@ -447,7 +447,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_src_event(&self, aggregator: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, aggregator: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
.expect("Missing parent function `src_event`"); .expect("Missing parent function `src_event`");
@ -461,7 +461,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_src_query(&self, aggregator: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, aggregator: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
.expect("Missing parent function `src_query`"); .expect("Missing parent function `src_query`");
@ -480,7 +480,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
match (*parent_class).src_activate { match (*parent_class).src_activate {
None => Ok(()), None => Ok(()),
Some(f) => gst::result_from_gboolean!( Some(f) => gst::result_from_gboolean!(
@ -503,7 +503,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.aggregate .aggregate
.expect("Missing parent function `aggregate`"); .expect("Missing parent function `aggregate`");
@ -518,7 +518,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_start(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -542,7 +542,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_stop(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -566,7 +566,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_get_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime { fn parent_get_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.get_next_time .get_next_time
.map(|f| { .map(|f| {
@ -588,7 +588,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Option<AggregatorPad> { ) -> Option<AggregatorPad> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.create_new_pad .create_new_pad
.expect("Missing parent function `create_new_pad`"); .expect("Missing parent function `create_new_pad`");
@ -608,7 +608,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<gst::Caps, gst::FlowError> { ) -> Result<gst::Caps, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.update_src_caps .update_src_caps
.expect("Missing parent function `update_src_caps`"); .expect("Missing parent function `update_src_caps`");
@ -626,7 +626,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_fixate_src_caps(&self, aggregator: &Self::Type, caps: gst::Caps) -> gst::Caps { fn parent_fixate_src_caps(&self, aggregator: &Self::Type, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.fixate_src_caps .fixate_src_caps
@ -645,7 +645,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.negotiated_src_caps .negotiated_src_caps
.map(|f| { .map(|f| {
@ -667,7 +667,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_negotiate(&self, aggregator: &Self::Type) -> bool { fn parent_negotiate(&self, aggregator: &Self::Type) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
.map(|f| { .map(|f| {
@ -689,7 +689,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
) -> Option<gst::Sample> { ) -> Option<gst::Sample> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.peek_next_sample .peek_next_sample
.map(|f| { .map(|f| {
@ -742,7 +742,7 @@ unsafe extern "C" fn aggregator_flush<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator, ptr: *mut ffi::GstAggregator,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -757,7 +757,7 @@ unsafe extern "C" fn aggregator_clip<T: AggregatorImpl>(
buffer: *mut gst::ffi::GstBuffer, buffer: *mut gst::ffi::GstBuffer,
) -> *mut gst::ffi::GstBuffer { ) -> *mut gst::ffi::GstBuffer {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
let ret = gst::panic_to_error!(&wrap, &imp.panicked(), None, { let ret = gst::panic_to_error!(&wrap, &imp.panicked(), None, {
@ -776,7 +776,7 @@ unsafe extern "C" fn aggregator_finish_buffer<T: AggregatorImpl>(
buffer: *mut gst::ffi::GstBuffer, buffer: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -793,7 +793,7 @@ unsafe extern "C" fn aggregator_finish_buffer_list<T: AggregatorImpl>(
buffer_list: *mut gst::ffi::GstBufferList, buffer_list: *mut gst::ffi::GstBufferList,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -809,7 +809,7 @@ unsafe extern "C" fn aggregator_sink_event<T: AggregatorImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(wrap, &imp.panicked(), false, { gst::panic_to_error!(wrap, &imp.panicked(), false, {
@ -830,7 +830,7 @@ unsafe extern "C" fn aggregator_sink_event_pre_queue<T: AggregatorImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -850,7 +850,7 @@ unsafe extern "C" fn aggregator_sink_query<T: AggregatorImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -871,7 +871,7 @@ unsafe extern "C" fn aggregator_sink_query_pre_queue<T: AggregatorImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -889,7 +889,7 @@ unsafe extern "C" fn aggregator_src_event<T: AggregatorImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -903,7 +903,7 @@ unsafe extern "C" fn aggregator_src_query<T: AggregatorImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -918,7 +918,7 @@ unsafe extern "C" fn aggregator_src_activate<T: AggregatorImpl>(
active: glib::ffi::gboolean, active: glib::ffi::gboolean,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -938,7 +938,7 @@ unsafe extern "C" fn aggregator_aggregate<T: AggregatorImpl>(
timeout: glib::ffi::gboolean, timeout: glib::ffi::gboolean,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -952,7 +952,7 @@ unsafe extern "C" fn aggregator_start<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator, ptr: *mut ffi::GstAggregator,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -971,7 +971,7 @@ unsafe extern "C" fn aggregator_stop<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator, ptr: *mut ffi::GstAggregator,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -990,7 +990,7 @@ unsafe extern "C" fn aggregator_get_next_time<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator, ptr: *mut ffi::GstAggregator,
) -> gst::ffi::GstClockTime { ) -> gst::ffi::GstClockTime {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::CLOCK_TIME_NONE, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::CLOCK_TIME_NONE, {
@ -1006,7 +1006,7 @@ unsafe extern "C" fn aggregator_create_new_pad<T: AggregatorImpl>(
caps: *const gst::ffi::GstCaps, caps: *const gst::ffi::GstCaps,
) -> *mut ffi::GstAggregatorPad { ) -> *mut ffi::GstAggregatorPad {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), None, { gst::panic_to_error!(&wrap, &imp.panicked(), None, {
@ -1030,7 +1030,7 @@ unsafe extern "C" fn aggregator_update_src_caps<T: AggregatorImpl>(
res: *mut *mut gst::ffi::GstCaps, res: *mut *mut gst::ffi::GstCaps,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
*res = ptr::null_mut(); *res = ptr::null_mut();
@ -1052,7 +1052,7 @@ unsafe extern "C" fn aggregator_fixate_src_caps<T: AggregatorImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), { gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), {
@ -1066,7 +1066,7 @@ unsafe extern "C" fn aggregator_negotiated_src_caps<T: AggregatorImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1087,7 +1087,7 @@ unsafe extern "C" fn aggregator_negotiate<T: AggregatorImpl>(
ptr: *mut ffi::GstAggregator, ptr: *mut ffi::GstAggregator,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1103,7 +1103,7 @@ unsafe extern "C" fn aggregator_peek_next_sample<T: AggregatorImpl>(
pad: *mut ffi::GstAggregatorPad, pad: *mut ffi::GstAggregatorPad,
) -> *mut gst::ffi::GstSample { ) -> *mut gst::ffi::GstSample {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), None, { gst::panic_to_error!(&wrap, &imp.panicked(), None, {

View file

@ -51,7 +51,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorPadClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorPadClass;
(*parent_class) (*parent_class)
.flush .flush
.map(|f| { .map(|f| {
@ -76,7 +76,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorPadClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorPadClass;
(*parent_class) (*parent_class)
.skip_buffer .skip_buffer
.map(|f| { .map(|f| {
@ -111,7 +111,7 @@ unsafe extern "C" fn aggregator_pad_flush<T: AggregatorPadImpl>(
aggregator: *mut ffi::GstAggregator, aggregator: *mut ffi::GstAggregator,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AggregatorPad> = from_glib_borrow(ptr); let wrap: Borrowed<AggregatorPad> = from_glib_borrow(ptr);
let res: gst::FlowReturn = imp let res: gst::FlowReturn = imp
@ -126,7 +126,7 @@ unsafe extern "C" fn aggregator_pad_skip_buffer<T: AggregatorPadImpl>(
buffer: *mut gst::ffi::GstBuffer, buffer: *mut gst::ffi::GstBuffer,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<AggregatorPad> = from_glib_borrow(ptr); let wrap: Borrowed<AggregatorPad> = from_glib_borrow(ptr);
imp.skip_buffer( imp.skip_buffer(

View file

@ -77,7 +77,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -97,7 +97,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -121,7 +121,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
(*parent_class) (*parent_class)
.set_sink_caps .set_sink_caps
.map(|f| { .map(|f| {
@ -148,7 +148,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
) -> Result<(gst::FlowSuccess, u32), gst::FlowError> { ) -> Result<(gst::FlowSuccess, u32), gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
let mut skipsize = 0; let mut skipsize = 0;
let res = (*parent_class).handle_frame.map(|f| { let res = (*parent_class).handle_frame.map(|f| {
let res = gst::FlowReturn::from_glib(f( let res = gst::FlowReturn::from_glib(f(
@ -177,14 +177,14 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
) -> Option<gst::GenericFormattedValue> { ) -> Option<gst::GenericFormattedValue> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
let src_val = src_val.into(); let src_val = src_val.into();
let res = (*parent_class).convert.map(|f| { let res = (*parent_class).convert.map(|f| {
let mut dest_val = mem::MaybeUninit::uninit(); let mut dest_val = mem::MaybeUninit::uninit();
let res = from_glib(f( let res = from_glib(f(
element.unsafe_cast_ref::<BaseParse>().to_glib_none().0, element.unsafe_cast_ref::<BaseParse>().to_glib_none().0,
src_val.get_format().to_glib(), src_val.format().to_glib(),
src_val.to_raw_value(), src_val.to_raw_value(),
dest_format.to_glib(), dest_format.to_glib(),
dest_val.as_mut_ptr(), dest_val.as_mut_ptr(),
@ -223,7 +223,7 @@ unsafe extern "C" fn base_parse_start<T: BaseParseImpl>(
ptr: *mut ffi::GstBaseParse, ptr: *mut ffi::GstBaseParse,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr); let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -242,7 +242,7 @@ unsafe extern "C" fn base_parse_stop<T: BaseParseImpl>(
ptr: *mut ffi::GstBaseParse, ptr: *mut ffi::GstBaseParse,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr); let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -262,7 +262,7 @@ unsafe extern "C" fn base_parse_set_sink_caps<T: BaseParseImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr); let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr);
let caps: Borrowed<gst::Caps> = from_glib_borrow(caps); let caps: Borrowed<gst::Caps> = from_glib_borrow(caps);
@ -284,7 +284,7 @@ unsafe extern "C" fn base_parse_handle_frame<T: BaseParseImpl>(
skipsize: *mut i32, skipsize: *mut i32,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr); let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr);
let wrap_frame = BaseParseFrame::new(frame, &wrap); let wrap_frame = BaseParseFrame::new(frame, &wrap);
@ -310,7 +310,7 @@ unsafe extern "C" fn base_parse_convert<T: BaseParseImpl>(
dest_value: *mut i64, dest_value: *mut i64,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr); let wrap: Borrowed<BaseParse> = from_glib_borrow(ptr);
let source = gst::GenericFormattedValue::new(from_glib(source_format), source_value); let source = gst::GenericFormattedValue::new(from_glib(source_format), source_value);

View file

@ -136,7 +136,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -156,7 +156,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -180,7 +180,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.render .render
.map(|f| { .map(|f| {
@ -201,7 +201,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.prepare .prepare
.map(|f| { .map(|f| {
@ -222,7 +222,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.render_list .render_list
.map(|f| { .map(|f| {
@ -248,7 +248,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.prepare_list .prepare_list
.map(|f| { .map(|f| {
@ -270,7 +270,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.query .query
.map(|f| { .map(|f| {
@ -286,7 +286,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.event .event
.map(|f| { .map(|f| {
@ -306,7 +306,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
) -> Option<gst::Caps> { ) -> Option<gst::Caps> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.get_caps .get_caps
@ -327,7 +327,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.set_caps .set_caps
.map(|f| { .map(|f| {
@ -347,7 +347,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_fixate(&self, element: &Self::Type, caps: gst::Caps) -> gst::Caps { fn parent_fixate(&self, element: &Self::Type, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
match (*parent_class).fixate { match (*parent_class).fixate {
Some(fixate) => from_glib_full(fixate( Some(fixate) => from_glib_full(fixate(
@ -362,7 +362,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_unlock(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_unlock(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.unlock .unlock
.map(|f| { .map(|f| {
@ -382,7 +382,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_unlock_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_unlock_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.unlock_stop .unlock_stop
.map(|f| { .map(|f| {
@ -428,7 +428,7 @@ unsafe extern "C" fn base_sink_start<T: BaseSinkImpl>(
ptr: *mut ffi::GstBaseSink, ptr: *mut ffi::GstBaseSink,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -447,7 +447,7 @@ unsafe extern "C" fn base_sink_stop<T: BaseSinkImpl>(
ptr: *mut ffi::GstBaseSink, ptr: *mut ffi::GstBaseSink,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -467,7 +467,7 @@ unsafe extern "C" fn base_sink_render<T: BaseSinkImpl>(
buffer: *mut gst::ffi::GstBuffer, buffer: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
let buffer = from_glib_borrow(buffer); let buffer = from_glib_borrow(buffer);
@ -482,7 +482,7 @@ unsafe extern "C" fn base_sink_prepare<T: BaseSinkImpl>(
buffer: *mut gst::ffi::GstBuffer, buffer: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
let buffer = from_glib_borrow(buffer); let buffer = from_glib_borrow(buffer);
@ -497,7 +497,7 @@ unsafe extern "C" fn base_sink_render_list<T: BaseSinkImpl>(
list: *mut gst::ffi::GstBufferList, list: *mut gst::ffi::GstBufferList,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
let list = from_glib_borrow(list); let list = from_glib_borrow(list);
@ -512,7 +512,7 @@ unsafe extern "C" fn base_sink_prepare_list<T: BaseSinkImpl>(
list: *mut gst::ffi::GstBufferList, list: *mut gst::ffi::GstBufferList,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
let list = from_glib_borrow(list); let list = from_glib_borrow(list);
@ -527,7 +527,7 @@ unsafe extern "C" fn base_sink_query<T: BaseSinkImpl>(
query_ptr: *mut gst::ffi::GstQuery, query_ptr: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query_ptr); let query = gst::QueryRef::from_mut_ptr(query_ptr);
@ -542,7 +542,7 @@ unsafe extern "C" fn base_sink_event<T: BaseSinkImpl>(
event_ptr: *mut gst::ffi::GstEvent, event_ptr: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -556,7 +556,7 @@ unsafe extern "C" fn base_sink_get_caps<T: BaseSinkImpl>(
filter: *mut gst::ffi::GstCaps, filter: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
let filter = Option::<gst::Caps>::from_glib_borrow(filter); let filter = Option::<gst::Caps>::from_glib_borrow(filter);
@ -572,7 +572,7 @@ unsafe extern "C" fn base_sink_set_caps<T: BaseSinkImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
let caps = from_glib_borrow(caps); let caps = from_glib_borrow(caps);
@ -593,7 +593,7 @@ unsafe extern "C" fn base_sink_fixate<T: BaseSinkImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
let caps = from_glib_full(caps); let caps = from_glib_full(caps);
@ -607,7 +607,7 @@ unsafe extern "C" fn base_sink_unlock<T: BaseSinkImpl>(
ptr: *mut ffi::GstBaseSink, ptr: *mut ffi::GstBaseSink,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -626,7 +626,7 @@ unsafe extern "C" fn base_sink_unlock_stop<T: BaseSinkImpl>(
ptr: *mut ffi::GstBaseSink, ptr: *mut ffi::GstBaseSink,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSink> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {

View file

@ -178,7 +178,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -198,7 +198,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -218,7 +218,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_is_seekable(&self, element: &Self::Type) -> bool { fn parent_is_seekable(&self, element: &Self::Type) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.is_seekable .is_seekable
.map(|f| from_glib(f(element.unsafe_cast_ref::<BaseSrc>().to_glib_none().0))) .map(|f| from_glib(f(element.unsafe_cast_ref::<BaseSrc>().to_glib_none().0)))
@ -229,7 +229,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_get_size(&self, element: &Self::Type) -> Option<u64> { fn parent_get_size(&self, element: &Self::Type) -> Option<u64> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.get_size .get_size
.map(|f| { .map(|f| {
@ -254,7 +254,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
) -> (gst::ClockTime, gst::ClockTime) { ) -> (gst::ClockTime, gst::ClockTime) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.get_times .get_times
.map(|f| { .map(|f| {
@ -284,7 +284,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.fill .fill
.map(|f| { .map(|f| {
@ -308,7 +308,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
) -> Result<gst::Buffer, gst::FlowError> { ) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.alloc .alloc
.map(|f| { .map(|f| {
@ -339,7 +339,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
) -> Result<CreateSuccess, gst::FlowError> { ) -> Result<CreateSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.create .create
.map(|f| { .map(|f| {
@ -417,7 +417,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_do_seek(&self, element: &Self::Type, segment: &mut gst::Segment) -> bool { fn parent_do_seek(&self, element: &Self::Type, segment: &mut gst::Segment) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.do_seek .do_seek
.map(|f| { .map(|f| {
@ -433,7 +433,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.query .query
.map(|f| { .map(|f| {
@ -449,7 +449,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_event(&self, element: &Self::Type, event: &gst::Event) -> bool { fn parent_event(&self, element: &Self::Type, event: &gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.event .event
.map(|f| { .map(|f| {
@ -469,7 +469,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
) -> Option<gst::Caps> { ) -> Option<gst::Caps> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.get_caps .get_caps
@ -486,7 +486,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
.map(|f| { .map(|f| {
@ -507,7 +507,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.set_caps .set_caps
.map(|f| { .map(|f| {
@ -527,7 +527,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_fixate(&self, element: &Self::Type, caps: gst::Caps) -> gst::Caps { fn parent_fixate(&self, element: &Self::Type, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
match (*parent_class).fixate { match (*parent_class).fixate {
Some(fixate) => from_glib_full(fixate( Some(fixate) => from_glib_full(fixate(
@ -542,7 +542,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_unlock(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_unlock(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.unlock .unlock
.map(|f| { .map(|f| {
@ -562,7 +562,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_unlock_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_unlock_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.unlock_stop .unlock_stop
.map(|f| { .map(|f| {
@ -612,7 +612,7 @@ unsafe extern "C" fn base_src_start<T: BaseSrcImpl>(
ptr: *mut ffi::GstBaseSrc, ptr: *mut ffi::GstBaseSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -631,7 +631,7 @@ unsafe extern "C" fn base_src_stop<T: BaseSrcImpl>(
ptr: *mut ffi::GstBaseSrc, ptr: *mut ffi::GstBaseSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -650,7 +650,7 @@ unsafe extern "C" fn base_src_is_seekable<T: BaseSrcImpl>(
ptr: *mut ffi::GstBaseSrc, ptr: *mut ffi::GstBaseSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -664,7 +664,7 @@ unsafe extern "C" fn base_src_get_size<T: BaseSrcImpl>(
size: *mut u64, size: *mut u64,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -686,7 +686,7 @@ unsafe extern "C" fn base_src_get_times<T: BaseSrcImpl>(
stop: *mut gst::ffi::GstClockTime, stop: *mut gst::ffi::GstClockTime,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
let buffer = gst::BufferRef::from_ptr(buffer); let buffer = gst::BufferRef::from_ptr(buffer);
@ -707,7 +707,7 @@ unsafe extern "C" fn base_src_fill<T: BaseSrcImpl>(
buffer: *mut gst::ffi::GstBuffer, buffer: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
let buffer = gst::BufferRef::from_mut_ptr(buffer); let buffer = gst::BufferRef::from_mut_ptr(buffer);
@ -725,7 +725,7 @@ unsafe extern "C" fn base_src_alloc<T: BaseSrcImpl>(
buffer_ptr: *mut gst::ffi::GstBuffer, buffer_ptr: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
// FIXME: Wrong signature in -sys bindings // FIXME: Wrong signature in -sys bindings
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3 // https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3
@ -750,7 +750,7 @@ unsafe extern "C" fn base_src_create<T: BaseSrcImpl>(
buffer_ptr: *mut gst::ffi::GstBuffer, buffer_ptr: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
// FIXME: Wrong signature in -sys bindings // FIXME: Wrong signature in -sys bindings
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3 // https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3
@ -834,7 +834,7 @@ unsafe extern "C" fn base_src_do_seek<T: BaseSrcImpl>(
segment: *mut gst::ffi::GstSegment, segment: *mut gst::ffi::GstSegment,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -852,7 +852,7 @@ unsafe extern "C" fn base_src_query<T: BaseSrcImpl>(
query_ptr: *mut gst::ffi::GstQuery, query_ptr: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query_ptr); let query = gst::QueryRef::from_mut_ptr(query_ptr);
@ -867,7 +867,7 @@ unsafe extern "C" fn base_src_event<T: BaseSrcImpl>(
event_ptr: *mut gst::ffi::GstEvent, event_ptr: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -881,7 +881,7 @@ unsafe extern "C" fn base_src_get_caps<T: BaseSrcImpl>(
filter: *mut gst::ffi::GstCaps, filter: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
let filter = Option::<gst::Caps>::from_glib_borrow(filter); let filter = Option::<gst::Caps>::from_glib_borrow(filter);
@ -896,7 +896,7 @@ unsafe extern "C" fn base_src_negotiate<T: BaseSrcImpl>(
ptr: *mut ffi::GstBaseSrc, ptr: *mut ffi::GstBaseSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -916,7 +916,7 @@ unsafe extern "C" fn base_src_set_caps<T: BaseSrcImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
let caps = from_glib_borrow(caps); let caps = from_glib_borrow(caps);
@ -937,7 +937,7 @@ unsafe extern "C" fn base_src_fixate<T: BaseSrcImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
let caps = from_glib_full(caps); let caps = from_glib_full(caps);
@ -951,7 +951,7 @@ unsafe extern "C" fn base_src_unlock<T: BaseSrcImpl>(
ptr: *mut ffi::GstBaseSrc, ptr: *mut ffi::GstBaseSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -970,7 +970,7 @@ unsafe extern "C" fn base_src_unlock_stop<T: BaseSrcImpl>(
ptr: *mut ffi::GstBaseSrc, ptr: *mut ffi::GstBaseSrc,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {

View file

@ -292,7 +292,7 @@ pub trait BaseTransformImplExt: ObjectSubclass {
Self: ObjectSubclass, Self: ObjectSubclass,
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>; <Self as ObjectSubclass>::ParentType: IsA<BaseTransform>;
fn get_queued_buffer(&self) -> Option<gst::Buffer> fn queued_buffer(&self) -> Option<gst::Buffer>
where where
Self: ObjectSubclass, Self: ObjectSubclass,
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>; <Self as ObjectSubclass>::ParentType: IsA<BaseTransform>;
@ -302,7 +302,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -326,7 +326,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -356,7 +356,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Option<gst::Caps> { ) -> Option<gst::Caps> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.transform_caps .transform_caps
.map(|f| { .map(|f| {
@ -380,7 +380,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> gst::Caps { ) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
match (*parent_class).fixate_caps { match (*parent_class).fixate_caps {
Some(f) => from_glib_full(f( Some(f) => from_glib_full(f(
element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0, element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0,
@ -401,7 +401,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.set_caps .set_caps
.map(|f| { .map(|f| {
@ -427,7 +427,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.accept_caps .accept_caps
.map(|f| { .map(|f| {
@ -449,7 +449,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.query .query
.map(|f| { .map(|f| {
@ -473,7 +473,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Option<usize> { ) -> Option<usize> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.transform_size .transform_size
.map(|f| { .map(|f| {
@ -499,7 +499,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_get_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option<usize> { fn parent_get_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option<usize> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).get_unit_size.unwrap_or_else(|| { let f = (*parent_class).get_unit_size.unwrap_or_else(|| {
if !element.unsafe_cast_ref::<BaseTransform>().is_in_place() { if !element.unsafe_cast_ref::<BaseTransform>().is_in_place() {
unimplemented!(concat!( unimplemented!(concat!(
@ -530,7 +530,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.sink_event .sink_event
.map(|f| { .map(|f| {
@ -546,7 +546,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.src_event .src_event
.map(|f| { .map(|f| {
@ -566,7 +566,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Result<PrepareOutputBufferSuccess, gst::FlowError> { ) -> Result<PrepareOutputBufferSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.prepare_output_buffer .prepare_output_buffer
.map(|f| { .map(|f| {
@ -601,7 +601,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.transform .transform
.map(|f| { .map(|f| {
@ -632,7 +632,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).transform_ip.unwrap_or_else(|| { let f = (*parent_class).transform_ip.unwrap_or_else(|| {
if element.unsafe_cast_ref::<BaseTransform>().is_in_place() { if element.unsafe_cast_ref::<BaseTransform>().is_in_place() {
panic!(concat!( panic!(concat!(
@ -662,7 +662,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).transform_ip.unwrap_or_else(|| { let f = (*parent_class).transform_ip.unwrap_or_else(|| {
if element.unsafe_cast_ref::<BaseTransform>().is_in_place() { if element.unsafe_cast_ref::<BaseTransform>().is_in_place() {
panic!(concat!( panic!(concat!(
@ -695,7 +695,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
if let Some(ref f) = (*parent_class).copy_metadata { if let Some(ref f) = (*parent_class).copy_metadata {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f( f(
@ -721,7 +721,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.transform_meta .transform_meta
.map(|f| { .map(|f| {
@ -739,7 +739,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_before_transform(&self, element: &Self::Type, inbuf: &gst::BufferRef) { fn parent_before_transform(&self, element: &Self::Type, inbuf: &gst::BufferRef) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
if let Some(ref f) = (*parent_class).before_transform { if let Some(ref f) = (*parent_class).before_transform {
f( f(
element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0, element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0,
@ -757,7 +757,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class) let f = (*parent_class)
.submit_input_buffer .submit_input_buffer
.expect("Missing parent function `submit_input_buffer`"); .expect("Missing parent function `submit_input_buffer`");
@ -777,7 +777,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
) -> Result<GenerateOutputSuccess, gst::FlowError> { ) -> Result<GenerateOutputSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class) let f = (*parent_class)
.generate_output .generate_output
.expect("Missing parent function `generate_output`"); .expect("Missing parent function `generate_output`");
@ -806,7 +806,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>, <Self as ObjectSubclass>::ParentType: IsA<BaseTransform>,
{ {
unsafe { unsafe {
let element = self.get_instance(); let element = self.instance();
let ptr: *mut ffi::GstBaseTransform = let ptr: *mut ffi::GstBaseTransform =
element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0; element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0;
let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad); let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad);
@ -817,13 +817,13 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
} }
} }
fn get_queued_buffer(&self) -> Option<gst::Buffer> fn queued_buffer(&self) -> Option<gst::Buffer>
where where
Self: ObjectSubclass, Self: ObjectSubclass,
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>, <Self as ObjectSubclass>::ParentType: IsA<BaseTransform>,
{ {
unsafe { unsafe {
let element = self.get_instance(); let element = self.instance();
let ptr: *mut ffi::GstBaseTransform = let ptr: *mut ffi::GstBaseTransform =
element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0; element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0;
let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad); let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad);
@ -897,7 +897,7 @@ unsafe extern "C" fn base_transform_start<T: BaseTransformImpl>(
ptr: *mut ffi::GstBaseTransform, ptr: *mut ffi::GstBaseTransform,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -916,7 +916,7 @@ unsafe extern "C" fn base_transform_stop<T: BaseTransformImpl>(
ptr: *mut ffi::GstBaseTransform, ptr: *mut ffi::GstBaseTransform,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -938,7 +938,7 @@ unsafe extern "C" fn base_transform_transform_caps<T: BaseTransformImpl>(
filter: *mut gst::ffi::GstCaps, filter: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), None, { gst::panic_to_error!(&wrap, &imp.panicked(), None, {
@ -962,7 +962,7 @@ unsafe extern "C" fn base_transform_fixate_caps<T: BaseTransformImpl>(
othercaps: *mut gst::ffi::GstCaps, othercaps: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), { gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), {
@ -982,7 +982,7 @@ unsafe extern "C" fn base_transform_set_caps<T: BaseTransformImpl>(
outcaps: *mut gst::ffi::GstCaps, outcaps: *mut gst::ffi::GstCaps,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1007,7 +1007,7 @@ unsafe extern "C" fn base_transform_accept_caps<T: BaseTransformImpl>(
caps: *mut gst::ffi::GstCaps, caps: *mut gst::ffi::GstCaps,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1026,7 +1026,7 @@ unsafe extern "C" fn base_transform_query<T: BaseTransformImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1049,7 +1049,7 @@ unsafe extern "C" fn base_transform_transform_size<T: BaseTransformImpl>(
othersize: *mut usize, othersize: *mut usize,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1076,7 +1076,7 @@ unsafe extern "C" fn base_transform_get_unit_size<T: BaseTransformImpl>(
size: *mut usize, size: *mut usize,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1097,7 +1097,7 @@ unsafe extern "C" fn base_transform_prepare_output_buffer<T: BaseTransformImpl>(
outbuf: *mut gst::ffi::GstBuffer, outbuf: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
// FIXME: Wrong signature in FFI // FIXME: Wrong signature in FFI
@ -1124,7 +1124,7 @@ unsafe extern "C" fn base_transform_sink_event<T: BaseTransformImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1138,7 +1138,7 @@ unsafe extern "C" fn base_transform_src_event<T: BaseTransformImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -1153,7 +1153,7 @@ unsafe extern "C" fn base_transform_transform<T: BaseTransformImpl>(
outbuf: *mut gst::ffi::GstBuffer, outbuf: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -1172,7 +1172,7 @@ unsafe extern "C" fn base_transform_transform_ip<T: BaseTransformImpl>(
buf: *mut *mut gst::ffi::GstBuffer, buf: *mut *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
// FIXME: Wrong signature in FFI // FIXME: Wrong signature in FFI
@ -1197,7 +1197,7 @@ unsafe extern "C" fn base_transform_transform_meta<T: BaseTransformImpl>(
inbuf: *mut gst::ffi::GstBuffer, inbuf: *mut gst::ffi::GstBuffer,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
let inbuf = gst::BufferRef::from_ptr(inbuf); let inbuf = gst::BufferRef::from_ptr(inbuf);
@ -1219,7 +1219,7 @@ unsafe extern "C" fn base_transform_copy_metadata<T: BaseTransformImpl>(
outbuf: *mut gst::ffi::GstBuffer, outbuf: *mut gst::ffi::GstBuffer,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
if gst::ffi::gst_mini_object_is_writable(outbuf as *mut _) == glib::ffi::GFALSE { if gst::ffi::gst_mini_object_is_writable(outbuf as *mut _) == glib::ffi::GFALSE {
@ -1253,7 +1253,7 @@ unsafe extern "C" fn base_transform_before_transform<T: BaseTransformImpl>(
inbuf: *mut gst::ffi::GstBuffer, inbuf: *mut gst::ffi::GstBuffer,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), (), { gst::panic_to_error!(&wrap, &imp.panicked(), (), {
@ -1267,7 +1267,7 @@ unsafe extern "C" fn base_transform_submit_input_buffer<T: BaseTransformImpl>(
buf: *mut gst::ffi::GstBuffer, buf: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -1286,7 +1286,7 @@ unsafe extern "C" fn base_transform_generate_output<T: BaseTransformImpl>(
buf: *mut *mut gst::ffi::GstBuffer, buf: *mut *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr); let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
*buf = ptr::null_mut(); *buf = ptr::null_mut();

View file

@ -47,7 +47,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstPushSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass;
(*parent_class) (*parent_class)
.fill .fill
.map(|f| { .map(|f| {
@ -64,7 +64,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
fn parent_alloc(&self, element: &Self::Type) -> Result<gst::Buffer, gst::FlowError> { fn parent_alloc(&self, element: &Self::Type) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstPushSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass;
(*parent_class) (*parent_class)
.alloc .alloc
.map(|f| { .map(|f| {
@ -87,7 +87,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
fn parent_create(&self, element: &Self::Type) -> Result<gst::Buffer, gst::FlowError> { fn parent_create(&self, element: &Self::Type) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstPushSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass;
(*parent_class) (*parent_class)
.create .create
.map(|f| { .map(|f| {
@ -127,7 +127,7 @@ unsafe extern "C" fn push_src_fill<T: PushSrcImpl>(
buffer: *mut gst::ffi::GstBuffer, buffer: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<PushSrc> = from_glib_borrow(ptr); let wrap: Borrowed<PushSrc> = from_glib_borrow(ptr);
let buffer = gst::BufferRef::from_mut_ptr(buffer); let buffer = gst::BufferRef::from_mut_ptr(buffer);
@ -142,7 +142,7 @@ unsafe extern "C" fn push_src_alloc<T: PushSrcImpl>(
buffer_ptr: *mut gst::ffi::GstBuffer, buffer_ptr: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<PushSrc> = from_glib_borrow(ptr); let wrap: Borrowed<PushSrc> = from_glib_borrow(ptr);
// FIXME: Wrong signature in -sys bindings // FIXME: Wrong signature in -sys bindings
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3 // https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3
@ -165,7 +165,7 @@ unsafe extern "C" fn push_src_create<T: PushSrcImpl>(
buffer_ptr: *mut gst::ffi::GstBuffer, buffer_ptr: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<PushSrc> = from_glib_borrow(ptr); let wrap: Borrowed<PushSrc> = from_glib_borrow(ptr);
// FIXME: Wrong signature in -sys bindings // FIXME: Wrong signature in -sys bindings
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3 // https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3

View file

@ -221,11 +221,11 @@ impl Harness {
// unsafe { TODO: call ffi::gst_harness_get_allocator() } // unsafe { TODO: call ffi::gst_harness_get_allocator() }
//} //}
pub fn get_last_pushed_timestamp(&self) -> gst::ClockTime { pub fn last_pushed_timestamp(&self) -> gst::ClockTime {
unsafe { from_glib(ffi::gst_harness_get_last_pushed_timestamp(self.0.as_ptr())) } unsafe { from_glib(ffi::gst_harness_get_last_pushed_timestamp(self.0.as_ptr())) }
} }
pub fn get_testclock(&self) -> Option<TestClock> { pub fn testclock(&self) -> Option<TestClock> {
unsafe { from_glib_full(ffi::gst_harness_get_testclock(self.0.as_ptr())) } unsafe { from_glib_full(ffi::gst_harness_get_testclock(self.0.as_ptr())) }
} }
@ -628,7 +628,7 @@ impl Harness {
// unsafe { TODO: call ffi::gst_harness_stress_thread_stop() } // unsafe { TODO: call ffi::gst_harness_stress_thread_stop() }
//} //}
pub fn get_element(&self) -> Option<gst::Element> { pub fn element(&self) -> Option<gst::Element> {
unsafe { unsafe {
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31 // Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
let ptr = (*self.0.as_ptr()).element; let ptr = (*self.0.as_ptr()).element;
@ -646,7 +646,7 @@ impl Harness {
} }
} }
pub fn get_sinkpad(&self) -> Option<gst::Pad> { pub fn sinkpad(&self) -> Option<gst::Pad> {
unsafe { unsafe {
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31 // Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
let ptr = (*self.0.as_ptr()).sinkpad; let ptr = (*self.0.as_ptr()).sinkpad;
@ -664,7 +664,7 @@ impl Harness {
} }
} }
pub fn get_srcpad(&self) -> Option<gst::Pad> { pub fn srcpad(&self) -> Option<gst::Pad> {
unsafe { unsafe {
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31 // Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
let ptr = (*self.0.as_ptr()).srcpad; let ptr = (*self.0.as_ptr()).srcpad;
@ -682,7 +682,7 @@ impl Harness {
} }
} }
pub fn get_sink_harness(&self) -> Option<Ref> { pub fn sink_harness(&self) -> Option<Ref> {
unsafe { unsafe {
let sink_harness = (*self.0.as_ptr()).sink_harness; let sink_harness = (*self.0.as_ptr()).sink_harness;
if sink_harness.is_null() { if sink_harness.is_null() {
@ -696,7 +696,7 @@ impl Harness {
} }
} }
pub fn get_src_harness(&self) -> Option<Ref> { pub fn src_harness(&self) -> Option<Ref> {
unsafe { unsafe {
let src_harness = (*self.0.as_ptr()).src_harness; let src_harness = (*self.0.as_ptr()).src_harness;
if src_harness.is_null() { if src_harness.is_null() {
@ -710,7 +710,7 @@ impl Harness {
} }
} }
pub fn get_mut_sink_harness(&mut self) -> Option<RefMut> { pub fn sink_harness_mut(&mut self) -> Option<RefMut> {
unsafe { unsafe {
let sink_harness = (*self.0.as_ptr()).sink_harness; let sink_harness = (*self.0.as_ptr()).sink_harness;
if sink_harness.is_null() { if sink_harness.is_null() {
@ -724,7 +724,7 @@ impl Harness {
} }
} }
pub fn get_mut_src_harness(&mut self) -> Option<RefMut> { pub fn src_harness_mut(&mut self) -> Option<RefMut> {
unsafe { unsafe {
let src_harness = (*self.0.as_ptr()).src_harness; let src_harness = (*self.0.as_ptr()).src_harness;
if src_harness.is_null() { if src_harness.is_null() {

View file

@ -7,12 +7,12 @@ use gst::ContextRef;
use std::ptr; use std::ptr;
pub trait ContextGLExt { pub trait ContextGLExt {
fn get_gl_display(&self) -> Option<GLDisplay>; fn gl_display(&self) -> Option<GLDisplay>;
fn set_gl_display<T: IsA<GLDisplay>>(&self, display: &T); fn set_gl_display<T: IsA<GLDisplay>>(&self, display: &T);
} }
impl ContextGLExt for ContextRef { impl ContextGLExt for ContextRef {
fn get_gl_display(&self) -> Option<GLDisplay> { fn gl_display(&self) -> Option<GLDisplay> {
unsafe { unsafe {
let mut display = ptr::null_mut(); let mut display = ptr::null_mut();
if from_glib(ffi::gst_context_get_gl_display( if from_glib(ffi::gst_context_get_gl_display(

View file

@ -45,13 +45,13 @@ impl GLContext {
} }
pub trait GLContextExtManual: 'static { pub trait GLContextExtManual: 'static {
fn get_gl_context(&self) -> uintptr_t; fn gl_context(&self) -> uintptr_t;
fn get_proc_address(&self, name: &str) -> uintptr_t; fn get_proc_address(&self, name: &str) -> uintptr_t;
} }
impl<O: IsA<GLContext>> GLContextExtManual for O { impl<O: IsA<GLContext>> GLContextExtManual for O {
fn get_gl_context(&self) -> uintptr_t { fn gl_context(&self) -> uintptr_t {
unsafe { ffi::gst_gl_context_get_gl_context(self.as_ref().to_glib_none().0) as uintptr_t } unsafe { ffi::gst_gl_context_get_gl_context(self.as_ref().to_glib_none().0) as uintptr_t }
} }

View file

@ -28,7 +28,7 @@ impl GLSyncMeta {
} }
} }
pub fn get_context(&self) -> GLContext { pub fn context(&self) -> GLContext {
unsafe { from_glib_none(self.0.context) } unsafe { from_glib_none(self.0.context) }
} }
@ -71,7 +71,7 @@ unsafe impl MetaAPI for GLSyncMeta {
impl fmt::Debug for GLSyncMeta { impl fmt::Debug for GLSyncMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("GLSyncMeta") f.debug_struct("GLSyncMeta")
.field("context", &self.get_context()) .field("context", &self.context())
.finish() .finish()
} }
} }

View file

@ -26,7 +26,7 @@ impl NetAddressMeta {
} }
} }
pub fn get_addr(&self) -> gio::SocketAddress { pub fn addr(&self) -> gio::SocketAddress {
unsafe { from_glib_none(self.0.addr) } unsafe { from_glib_none(self.0.addr) }
} }
@ -50,7 +50,7 @@ unsafe impl MetaAPI for NetAddressMeta {
impl fmt::Debug for NetAddressMeta { impl fmt::Debug for NetAddressMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("NetAddressMeta") f.debug_struct("NetAddressMeta")
.field("addr", &self.get_addr()) .field("addr", &self.addr())
.finish() .finish()
} }
} }
@ -71,7 +71,7 @@ mod tests {
let expected_addr = &gio::InetSocketAddress::new(&inet_addr, port); let expected_addr = &gio::InetSocketAddress::new(&inet_addr, port);
let expected_inet_addr = expected_addr.get_address(); let expected_inet_addr = expected_addr.address();
{ {
let meta = NetAddressMeta::add( let meta = NetAddressMeta::add(
@ -79,28 +79,22 @@ mod tests {
&gio::InetSocketAddress::new(&inet_addr, port), &gio::InetSocketAddress::new(&inet_addr, port),
); );
let actual_addr = meta let actual_addr = meta.addr().downcast::<gio::InetSocketAddress>().unwrap();
.get_addr()
.downcast::<gio::InetSocketAddress>()
.unwrap();
assert_eq!(actual_addr.get_port(), expected_addr.get_port()); assert_eq!(actual_addr.port(), expected_addr.port());
let actual_inet_addr = actual_addr.get_address(); let actual_inet_addr = actual_addr.address();
assert!(actual_inet_addr.equal(&expected_inet_addr)); assert!(actual_inet_addr.equal(&expected_inet_addr));
} }
{ {
let meta = buffer.get_meta::<NetAddressMeta>().unwrap(); let meta = buffer.get_meta::<NetAddressMeta>().unwrap();
let actual_addr = meta let actual_addr = meta.addr().downcast::<gio::InetSocketAddress>().unwrap();
.get_addr()
.downcast::<gio::InetSocketAddress>()
.unwrap();
assert_eq!(actual_addr.get_port(), expected_addr.get_port()); assert_eq!(actual_addr.port(), expected_addr.port());
let actual_inet_addr = actual_addr.get_address(); let actual_inet_addr = actual_addr.address();
assert!(actual_inet_addr.equal(&expected_inet_addr)); assert!(actual_inet_addr.equal(&expected_inet_addr));
} }

View file

@ -23,7 +23,7 @@ impl Discoverer {
} }
} }
pub fn get_property_timeout(&self) -> gst::ClockTime { pub fn property_timeout(&self) -> gst::ClockTime {
let mut value = Value::from(&0u64); let mut value = Value::from(&0u64);
unsafe { unsafe {
glib::gobject_ffi::g_object_get_property( glib::gobject_ffi::g_object_get_property(

View file

@ -18,9 +18,9 @@ impl Iterator for Iter {
Some(ref c) => { Some(ref c) => {
// Decide on the direction // Decide on the direction
if self.direction_forward { if self.direction_forward {
c.get_next() c.next()
} else { } else {
c.get_previous() c.previous()
} }
} }
None => None, None => None,
@ -32,14 +32,14 @@ impl Iterator for Iter {
impl DiscovererStreamInfo { impl DiscovererStreamInfo {
pub fn next_iter(&self) -> Iter { pub fn next_iter(&self) -> Iter {
Iter { Iter {
stream_info: self.get_next(), stream_info: self.next(),
direction_forward: true, direction_forward: true,
} }
} }
pub fn previous_iter(&self) -> Iter { pub fn previous_iter(&self) -> Iter {
Iter { Iter {
stream_info: self.get_previous(), stream_info: self.previous(),
direction_forward: false, direction_forward: false,
} }
} }

View file

@ -5,7 +5,7 @@ use crate::DiscovererVideoInfo;
use glib::translate::*; use glib::translate::*;
impl DiscovererVideoInfo { impl DiscovererVideoInfo {
pub fn get_framerate(&self) -> gst::Fraction { pub fn framerate(&self) -> gst::Fraction {
unsafe { unsafe {
gst::Fraction::new( gst::Fraction::new(
ffi::gst_discoverer_video_info_get_framerate_num(self.to_glib_none().0) as i32, ffi::gst_discoverer_video_info_get_framerate_num(self.to_glib_none().0) as i32,
@ -14,7 +14,7 @@ impl DiscovererVideoInfo {
} }
} }
pub fn get_par(&self) -> gst::Fraction { pub fn par(&self) -> gst::Fraction {
unsafe { unsafe {
gst::Fraction::new( gst::Fraction::new(
ffi::gst_discoverer_video_info_get_par_num(self.to_glib_none().0) as i32, ffi::gst_discoverer_video_info_get_par_num(self.to_glib_none().0) as i32,

View file

@ -103,7 +103,7 @@ trait EncodingProfileHasRestrictionSetter {
} }
pub trait EncodingProfileHasRestrictionGetter { pub trait EncodingProfileHasRestrictionGetter {
fn get_restriction(&self) -> Option<gst::Caps>; fn restriction(&self) -> Option<gst::Caps>;
} }
macro_rules! declare_encoding_profile_has_restriction( macro_rules! declare_encoding_profile_has_restriction(
@ -127,7 +127,7 @@ macro_rules! declare_encoding_profile_has_restriction(
} }
impl EncodingProfileHasRestrictionGetter for $name { impl EncodingProfileHasRestrictionGetter for $name {
fn get_restriction(&self) -> Option<gst::Caps> { fn restriction(&self) -> Option<gst::Caps> {
let profile: &EncodingProfile = glib::object::Cast::upcast_ref(self); let profile: &EncodingProfile = glib::object::Cast::upcast_ref(self);
unsafe { unsafe {
@ -529,25 +529,22 @@ mod tests {
.build() .build()
.unwrap(); .unwrap();
assert_eq!(audio_profile.get_name().unwrap(), AUDIO_PROFILE_NAME); assert_eq!(audio_profile.name().unwrap(), AUDIO_PROFILE_NAME);
assert_eq!( assert_eq!(
audio_profile.get_description().unwrap(), audio_profile.description().unwrap(),
AUDIO_PROFILE_DESCRIPTION AUDIO_PROFILE_DESCRIPTION
); );
assert_eq!(audio_profile.get_format(), caps); assert_eq!(audio_profile.format(), caps);
assert_eq!(audio_profile.get_preset().unwrap(), PRESET); assert_eq!(audio_profile.preset().unwrap(), PRESET);
assert_eq!(audio_profile.get_preset_name().unwrap(), PRESET_NAME); assert_eq!(audio_profile.preset_name().unwrap(), PRESET_NAME);
assert_eq!(audio_profile.get_restriction().unwrap(), restriction); assert_eq!(audio_profile.restriction().unwrap(), restriction);
assert_eq!(audio_profile.get_presence(), PRESENCE); assert_eq!(audio_profile.presence(), PRESENCE);
assert_eq!( assert_eq!(audio_profile.allows_dynamic_output(), ALLOW_DYNAMIC_OUTPUT);
audio_profile.get_allow_dynamic_output(),
ALLOW_DYNAMIC_OUTPUT
);
assert_eq!(audio_profile.is_enabled(), ENABLED); assert_eq!(audio_profile.is_enabled(), ENABLED);
let restriction = gst::Caps::new_simple("audio/x-raw", &[("format", &"S32BE")]); let restriction = gst::Caps::new_simple("audio/x-raw", &[("format", &"S32BE")]);
audio_profile.set_restriction(Some(&restriction)); audio_profile.set_restriction(Some(&restriction));
assert_eq!(audio_profile.get_restriction().unwrap(), restriction); assert_eq!(audio_profile.restriction().unwrap(), restriction);
} }
#[test] #[test]
@ -573,30 +570,27 @@ mod tests {
.build() .build()
.unwrap(); .unwrap();
assert_eq!(video_profile.get_name().unwrap(), VIDEO_PROFILE_NAME); assert_eq!(video_profile.name().unwrap(), VIDEO_PROFILE_NAME);
assert_eq!( assert_eq!(
video_profile.get_description().unwrap(), video_profile.description().unwrap(),
VIDEO_PROFILE_DESCRIPTION VIDEO_PROFILE_DESCRIPTION
); );
assert_eq!(video_profile.get_format(), caps); assert_eq!(video_profile.format(), caps);
assert_eq!(video_profile.get_preset().unwrap(), PRESET); assert_eq!(video_profile.preset().unwrap(), PRESET);
assert_eq!(video_profile.get_preset_name().unwrap(), PRESET_NAME); assert_eq!(video_profile.preset_name().unwrap(), PRESET_NAME);
assert_eq!(video_profile.get_restriction().unwrap(), restriction); assert_eq!(video_profile.restriction().unwrap(), restriction);
assert_eq!(video_profile.get_presence(), PRESENCE); assert_eq!(video_profile.presence(), PRESENCE);
assert_eq!( assert_eq!(video_profile.allows_dynamic_output(), ALLOW_DYNAMIC_OUTPUT);
video_profile.get_allow_dynamic_output(),
ALLOW_DYNAMIC_OUTPUT
);
assert_eq!(video_profile.is_enabled(), ENABLED); assert_eq!(video_profile.is_enabled(), ENABLED);
let video_profile: EncodingVideoProfile = let video_profile: EncodingVideoProfile =
glib::object::Cast::downcast(video_profile).ok().unwrap(); glib::object::Cast::downcast(video_profile).ok().unwrap();
assert_eq!(video_profile.get_variableframerate(), VARIABLE_FRAMERATE); assert_eq!(video_profile.variableframerate(), VARIABLE_FRAMERATE);
assert_eq!(video_profile.get_pass(), PASS); assert_eq!(video_profile.pass(), PASS);
let restriction = gst::Caps::new_simple("video/x-raw", &[("format", &"NV12")]); let restriction = gst::Caps::new_simple("video/x-raw", &[("format", &"NV12")]);
video_profile.set_restriction(Some(&restriction)); video_profile.set_restriction(Some(&restriction));
assert_eq!(video_profile.get_restriction().unwrap(), restriction); assert_eq!(video_profile.restriction().unwrap(), restriction);
} }
#[test] #[test]
@ -634,16 +628,16 @@ mod tests {
.build() .build()
.unwrap(); .unwrap();
assert_eq!(profile.get_name().unwrap(), CONTAINER_PROFILE_NAME); assert_eq!(profile.name().unwrap(), CONTAINER_PROFILE_NAME);
assert_eq!( assert_eq!(
profile.get_description().unwrap(), profile.description().unwrap(),
CONTAINER_PROFILE_DESCRIPTION CONTAINER_PROFILE_DESCRIPTION
); );
assert_eq!(profile.get_format(), container_caps); assert_eq!(profile.format(), container_caps);
assert_eq!(profile.get_preset().unwrap(), PRESET); assert_eq!(profile.preset().unwrap(), PRESET);
assert_eq!(profile.get_preset_name().unwrap(), PRESET_NAME); assert_eq!(profile.preset_name().unwrap(), PRESET_NAME);
assert_eq!(profile.get_presence(), PRESENCE); assert_eq!(profile.presence(), PRESENCE);
assert_eq!(profile.get_allow_dynamic_output(), ALLOW_DYNAMIC_OUTPUT); assert_eq!(profile.allows_dynamic_output(), ALLOW_DYNAMIC_OUTPUT);
assert_eq!(profile.is_enabled(), ENABLED); assert_eq!(profile.is_enabled(), ENABLED);
let container_profile: EncodingContainerProfile = let container_profile: EncodingContainerProfile =

View file

@ -35,12 +35,12 @@ impl AsMut<gst::StructureRef> for PlayerConfig {
} }
impl PlayerConfig { impl PlayerConfig {
pub fn get_position_update_interval(&self) -> u32 { pub fn position_update_interval(&self) -> u32 {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { ffi::gst_player_config_get_position_update_interval(self.0.to_glib_none().0) } unsafe { ffi::gst_player_config_get_position_update_interval(self.0.to_glib_none().0) }
} }
pub fn get_seek_accurate(&self) -> bool { pub fn is_seek_accurate(&self) -> bool {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib(ffi::gst_player_config_get_seek_accurate( from_glib(ffi::gst_player_config_get_seek_accurate(
@ -49,7 +49,7 @@ impl PlayerConfig {
} }
} }
pub fn get_user_agent(&self) -> Option<String> { pub fn user_agent(&self) -> Option<String> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_full(ffi::gst_player_config_get_user_agent( from_glib_full(ffi::gst_player_config_get_user_agent(

View file

@ -29,7 +29,7 @@ impl Player {
} }
} }
pub fn get_config(&self) -> crate::PlayerConfig { pub fn config(&self) -> crate::PlayerConfig {
unsafe { from_glib_full(ffi::gst_player_get_config(self.to_glib_none().0)) } unsafe { from_glib_full(ffi::gst_player_get_config(self.to_glib_none().0)) }
} }

View file

@ -5,7 +5,7 @@ use glib::translate::*;
use std::mem; use std::mem;
impl PlayerVideoInfo { impl PlayerVideoInfo {
pub fn get_framerate(&self) -> gst::Fraction { pub fn framerate(&self) -> gst::Fraction {
unsafe { unsafe {
let mut fps_n = mem::MaybeUninit::uninit(); let mut fps_n = mem::MaybeUninit::uninit();
let mut fps_d = mem::MaybeUninit::uninit(); let mut fps_d = mem::MaybeUninit::uninit();
@ -18,7 +18,7 @@ impl PlayerVideoInfo {
} }
} }
pub fn get_pixel_aspect_ratio(&self) -> gst::Fraction { pub fn pixel_aspect_ratio(&self) -> gst::Fraction {
unsafe { unsafe {
let mut par_n = mem::MaybeUninit::uninit(); let mut par_n = mem::MaybeUninit::uninit();
let mut par_d = mem::MaybeUninit::uninit(); let mut par_d = mem::MaybeUninit::uninit();

View file

@ -40,7 +40,7 @@ impl PlayerVideoOverlayVideoRenderer {
} }
} }
pub unsafe fn get_window_handle(&self) -> uintptr_t { pub unsafe fn window_handle(&self) -> uintptr_t {
ffi::gst_player_video_overlay_video_renderer_get_window_handle(self.to_glib_none().0) ffi::gst_player_video_overlay_video_renderer_get_window_handle(self.to_glib_none().0)
as uintptr_t as uintptr_t
} }

View file

@ -65,7 +65,7 @@ unsafe extern "C" fn video_renderer_create_video_sink<T: PlayerVideoRendererImpl
Lazy::new(|| glib::Quark::from_string("gstreamer-rs-player-video-sink")); Lazy::new(|| glib::Quark::from_string("gstreamer-rs-player-video-sink"));
let instance = &*(video_renderer as *mut T::Instance); let instance = &*(video_renderer as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let sink = imp.create_video_sink( let sink = imp.create_video_sink(
from_glib_borrow::<_, PlayerVideoRenderer>(video_renderer).unsafe_cast_ref(), from_glib_borrow::<_, PlayerVideoRenderer>(video_renderer).unsafe_cast_ref(),

View file

@ -174,28 +174,28 @@ impl<'a> RTPBuffer<'a, Writable> {
} }
impl<'a, T> RTPBuffer<'a, T> { impl<'a, T> RTPBuffer<'a, T> {
pub fn get_seq(&self) -> u16 { pub fn seq(&self) -> u16 {
unsafe { ffi::gst_rtp_buffer_get_seq(glib::translate::mut_override(&self.rtp_buffer)) } unsafe { ffi::gst_rtp_buffer_get_seq(glib::translate::mut_override(&self.rtp_buffer)) }
} }
pub fn get_payload_type(&self) -> u8 { pub fn payload_type(&self) -> u8 {
unsafe { unsafe {
ffi::gst_rtp_buffer_get_payload_type(glib::translate::mut_override(&self.rtp_buffer)) ffi::gst_rtp_buffer_get_payload_type(glib::translate::mut_override(&self.rtp_buffer))
} }
} }
pub fn get_ssrc(&self) -> u32 { pub fn ssrc(&self) -> u32 {
unsafe { ffi::gst_rtp_buffer_get_ssrc(glib::translate::mut_override(&self.rtp_buffer)) } unsafe { ffi::gst_rtp_buffer_get_ssrc(glib::translate::mut_override(&self.rtp_buffer)) }
} }
pub fn get_timestamp(&self) -> u32 { pub fn timestamp(&self) -> u32 {
unsafe { unsafe {
ffi::gst_rtp_buffer_get_timestamp(glib::translate::mut_override(&self.rtp_buffer)) ffi::gst_rtp_buffer_get_timestamp(glib::translate::mut_override(&self.rtp_buffer))
} }
} }
pub fn get_csrc(&self, idx: u8) -> Option<u32> { pub fn get_csrc(&self, idx: u8) -> Option<u32> {
if idx < self.get_csrc_count() { if idx < self.csrc_count() {
unsafe { unsafe {
Some(ffi::gst_rtp_buffer_get_csrc( Some(ffi::gst_rtp_buffer_get_csrc(
glib::translate::mut_override(&self.rtp_buffer), glib::translate::mut_override(&self.rtp_buffer),
@ -207,13 +207,13 @@ impl<'a, T> RTPBuffer<'a, T> {
} }
} }
pub fn get_csrc_count(&self) -> u8 { pub fn csrc_count(&self) -> u8 {
unsafe { unsafe {
ffi::gst_rtp_buffer_get_csrc_count(glib::translate::mut_override(&self.rtp_buffer)) ffi::gst_rtp_buffer_get_csrc_count(glib::translate::mut_override(&self.rtp_buffer))
} }
} }
pub fn get_marker(&self) -> bool { pub fn is_marker(&self) -> bool {
unsafe { unsafe {
from_glib(ffi::gst_rtp_buffer_get_marker( from_glib(ffi::gst_rtp_buffer_get_marker(
glib::translate::mut_override(&self.rtp_buffer), glib::translate::mut_override(&self.rtp_buffer),
@ -221,15 +221,15 @@ impl<'a, T> RTPBuffer<'a, T> {
} }
} }
pub fn get_payload_size(&self) -> u32 { pub fn payload_size(&self) -> u32 {
unsafe { unsafe {
ffi::gst_rtp_buffer_get_payload_len(glib::translate::mut_override(&self.rtp_buffer)) ffi::gst_rtp_buffer_get_payload_len(glib::translate::mut_override(&self.rtp_buffer))
as u32 as u32
} }
} }
pub fn get_payload(&self) -> Result<&[u8], glib::error::BoolError> { pub fn payload(&self) -> Result<&[u8], glib::error::BoolError> {
let size = self.get_payload_size(); let size = self.payload_size();
if size == 0 { if size == 0 {
return Ok(&[]); return Ok(&[]);
} }
@ -244,7 +244,7 @@ impl<'a, T> RTPBuffer<'a, T> {
} }
} }
pub fn get_extension(&self) -> bool { pub fn is_extension(&self) -> bool {
unsafe { unsafe {
from_glib(ffi::gst_rtp_buffer_get_extension( from_glib(ffi::gst_rtp_buffer_get_extension(
glib::translate::mut_override(&self.rtp_buffer), glib::translate::mut_override(&self.rtp_buffer),
@ -252,7 +252,7 @@ impl<'a, T> RTPBuffer<'a, T> {
} }
} }
pub fn get_extension_bytes(&self) -> Option<(u16, glib::Bytes)> { pub fn extension_bytes(&self) -> Option<(u16, glib::Bytes)> {
unsafe { unsafe {
let mut bits: u16 = 0; let mut bits: u16 = 0;
match from_glib_full(ffi::gst_rtp_buffer_get_extension_bytes( match from_glib_full(ffi::gst_rtp_buffer_get_extension_bytes(
@ -366,27 +366,27 @@ mod tests {
let mut rtp_buffer = RTPBuffer::from_buffer_writable(&mut buffer).unwrap(); let mut rtp_buffer = RTPBuffer::from_buffer_writable(&mut buffer).unwrap();
rtp_buffer.set_seq(42); rtp_buffer.set_seq(42);
assert_eq!(rtp_buffer.get_seq(), 42); assert_eq!(rtp_buffer.seq(), 42);
rtp_buffer.set_marker(true); rtp_buffer.set_marker(true);
assert!(rtp_buffer.get_marker()); assert!(rtp_buffer.marker());
rtp_buffer.set_payload_type(43); rtp_buffer.set_payload_type(43);
assert_eq!(rtp_buffer.get_payload_type(), 43); assert_eq!(rtp_buffer.payload_type(), 43);
rtp_buffer.set_timestamp(44); rtp_buffer.set_timestamp(44);
assert_eq!(rtp_buffer.get_timestamp(), 44); assert_eq!(rtp_buffer.timestamp(), 44);
rtp_buffer.set_ssrc(45); rtp_buffer.set_ssrc(45);
assert_eq!(rtp_buffer.get_ssrc(), 45); assert_eq!(rtp_buffer.ssrc(), 45);
assert_eq!(rtp_buffer.get_payload_size(), payload_size); assert_eq!(rtp_buffer.payload_size(), payload_size);
let payload = rtp_buffer.get_payload(); let payload = rtp_buffer.payload();
assert!(payload.is_ok()); assert!(payload.is_ok());
let payload = payload.unwrap(); let payload = payload.unwrap();
assert_eq!(payload.len(), payload_size as usize); assert_eq!(payload.len(), payload_size as usize);
assert_eq!(rtp_buffer.get_csrc_count(), csrc_count); assert_eq!(rtp_buffer.csrc_count(), csrc_count);
rtp_buffer.set_csrc(0, 12); rtp_buffer.set_csrc(0, 12);
rtp_buffer.set_csrc(1, 15); rtp_buffer.set_csrc(1, 15);
assert_eq!(rtp_buffer.get_csrc(0).unwrap(), 12); assert_eq!(rtp_buffer.get_csrc(0).unwrap(), 12);
@ -394,9 +394,9 @@ mod tests {
assert!(rtp_buffer.get_csrc(2).is_none()); assert!(rtp_buffer.get_csrc(2).is_none());
rtp_buffer.set_extension(true); rtp_buffer.set_extension(true);
assert_eq!(rtp_buffer.get_extension(), true); assert_eq!(rtp_buffer.extension(), true);
assert_eq!(rtp_buffer.get_extension_bytes(), None); assert_eq!(rtp_buffer.extension_bytes(), None);
} }
#[test] #[test]
@ -408,8 +408,8 @@ mod tests {
let buffer = gst::Buffer::new_rtp_with_sizes(payload_size, 4, csrc_count).unwrap(); let buffer = gst::Buffer::new_rtp_with_sizes(payload_size, 4, csrc_count).unwrap();
let rtp_buffer = RTPBuffer::from_buffer_readable(&buffer).unwrap(); let rtp_buffer = RTPBuffer::from_buffer_readable(&buffer).unwrap();
assert_eq!(rtp_buffer.get_payload_size(), payload_size); assert_eq!(rtp_buffer.payload_size(), payload_size);
let payload = rtp_buffer.get_payload(); let payload = rtp_buffer.payload();
assert!(payload.is_ok()); assert!(payload.is_ok());
assert_eq!(payload.unwrap().len(), payload_size as usize); assert_eq!(payload.unwrap().len(), payload_size as usize);
} }
@ -421,13 +421,13 @@ mod tests {
let mut buffer = gst::Buffer::new_rtp_with_sizes(16, 4, 0).unwrap(); let mut buffer = gst::Buffer::new_rtp_with_sizes(16, 4, 0).unwrap();
let mut rtp_buffer = RTPBuffer::from_buffer_writable(&mut buffer).unwrap(); let mut rtp_buffer = RTPBuffer::from_buffer_writable(&mut buffer).unwrap();
assert_eq!(rtp_buffer.get_extension_bytes(), None); assert_eq!(rtp_buffer.extension_bytes(), None);
let extension_data: [u8; 4] = [100, 101, 102, 103]; let extension_data: [u8; 4] = [100, 101, 102, 103];
let result = rtp_buffer.add_extension_onebyte_header(1, &extension_data); let result = rtp_buffer.add_extension_onebyte_header(1, &extension_data);
assert!(result.is_ok()); assert!(result.is_ok());
let bytes_option = rtp_buffer.get_extension_bytes(); let bytes_option = rtp_buffer.extension_bytes();
assert!(bytes_option.is_some()); assert!(bytes_option.is_some());
let (bits, bytes) = bytes_option.unwrap(); let (bits, bytes) = bytes_option.unwrap();
// 0xBEDE is the onebyte extension header marker: https://tools.ietf.org/html/rfc5285 (4.2) // 0xBEDE is the onebyte extension header marker: https://tools.ietf.org/html/rfc5285 (4.2)
@ -459,7 +459,7 @@ mod tests {
let mut buffer = gst::Buffer::new_rtp_with_sizes(16, 4, 0).unwrap(); let mut buffer = gst::Buffer::new_rtp_with_sizes(16, 4, 0).unwrap();
let mut rtp_buffer = RTPBuffer::from_buffer_writable(&mut buffer).unwrap(); let mut rtp_buffer = RTPBuffer::from_buffer_writable(&mut buffer).unwrap();
assert_eq!(rtp_buffer.get_extension_bytes(), None); assert_eq!(rtp_buffer.extension_bytes(), None);
let extension_data: [u8; 4] = [100, 101, 102, 103]; let extension_data: [u8; 4] = [100, 101, 102, 103];
let appbits = 5; let appbits = 5;
@ -467,7 +467,7 @@ mod tests {
let result = rtp_buffer.add_extension_twobytes_header(appbits, id, &extension_data); let result = rtp_buffer.add_extension_twobytes_header(appbits, id, &extension_data);
assert!(result.is_ok()); assert!(result.is_ok());
let bytes_option = rtp_buffer.get_extension_bytes(); let bytes_option = rtp_buffer.extension_bytes();
assert!(bytes_option.is_some()); assert!(bytes_option.is_some());
let (bits, bytes) = bytes_option.unwrap(); let (bits, bytes) = bytes_option.unwrap();
// 0x100 + appbits is the twobyte extension header marker: // 0x100 + appbits is the twobyte extension header marker:

View file

@ -21,7 +21,7 @@ impl RTSPToken {
{ {
let token = token.get_mut().unwrap(); let token = token.get_mut().unwrap();
let structure = token.get_mut_structure().unwrap(); let structure = token.structure_mut().unwrap();
for &(f, v) in values { for &(f, v) in values {
structure.set_value(f, v.to_send_value()); structure.set_value(f, v.to_send_value());
@ -42,7 +42,7 @@ impl RTSPTokenRef {
} }
} }
pub fn get_structure(&self) -> Option<gst::Structure> { pub fn structure(&self) -> Option<gst::Structure> {
unsafe { from_glib_none(ffi::gst_rtsp_token_get_structure(self.as_mut_ptr())) } unsafe { from_glib_none(ffi::gst_rtsp_token_get_structure(self.as_mut_ptr())) }
} }
@ -55,7 +55,7 @@ impl RTSPTokenRef {
} }
} }
pub fn get_mut_structure(&mut self) -> Option<&mut gst::StructureRef> { pub fn structure_mut(&mut self) -> Option<&mut gst::StructureRef> {
unsafe { unsafe {
let structure = ffi::gst_rtsp_token_writable_structure(self.as_mut_ptr()); let structure = ffi::gst_rtsp_token_writable_structure(self.as_mut_ptr());
if structure.is_null() { if structure.is_null() {
@ -76,7 +76,7 @@ impl fmt::Debug for RTSPToken {
impl fmt::Debug for RTSPTokenRef { impl fmt::Debug for RTSPTokenRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("RTSPToken") f.debug_struct("RTSPToken")
.field("structure", &self.get_structure()) .field("structure", &self.structure())
.finish() .finish()
} }
} }

View file

@ -348,7 +348,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> Option<gst_sdp::SDPMessage> { ) -> Option<gst_sdp::SDPMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.create_sdp .create_sdp
.expect("No `create_rtpbin` virtual method implementation in parent class"); .expect("No `create_rtpbin` virtual method implementation in parent class");
@ -369,7 +369,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class).configure_client_media.expect( let f = (*parent_class).configure_client_media.expect(
"No `configure_client_media` virtual method implementation in parent class", "No `configure_client_media` virtual method implementation in parent class",
); );
@ -396,7 +396,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPResult { ) -> gst_rtsp::RTSPResult {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.params_set .params_set
.expect("No `params_set` virtual method implementation in parent class"); .expect("No `params_set` virtual method implementation in parent class");
@ -415,7 +415,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPResult { ) -> gst_rtsp::RTSPResult {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.params_get .params_get
.expect("No `params_get` virtual method implementation in parent class"); .expect("No `params_get` virtual method implementation in parent class");
@ -434,7 +434,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.make_path_from_uri .make_path_from_uri
.expect("No `make_path_from_uri` virtual method implementation in parent class"); .expect("No `make_path_from_uri` virtual method implementation in parent class");
@ -449,7 +449,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_closed(&self, client: &Self::Type) { fn parent_closed(&self, client: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).closed { if let Some(f) = (*parent_class).closed {
f(client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0); f(client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0);
} }
@ -459,7 +459,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_new_session(&self, client: &Self::Type, session: &crate::RTSPSession) { fn parent_new_session(&self, client: &Self::Type, session: &crate::RTSPSession) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).new_session { if let Some(f) = (*parent_class).new_session {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -472,7 +472,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_options_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_options_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).options_request { if let Some(f) = (*parent_class).options_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -485,7 +485,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_describe_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_describe_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).describe_request { if let Some(f) = (*parent_class).describe_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -498,7 +498,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_setup_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_setup_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).setup_request { if let Some(f) = (*parent_class).setup_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -511,7 +511,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_play_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_play_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).play_request { if let Some(f) = (*parent_class).play_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -524,7 +524,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_pause_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_pause_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pause_request { if let Some(f) = (*parent_class).pause_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -537,7 +537,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_teardown_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_teardown_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).teardown_request { if let Some(f) = (*parent_class).teardown_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -550,7 +550,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_set_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_set_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).set_parameter_request { if let Some(f) = (*parent_class).set_parameter_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -563,7 +563,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_get_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_get_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).get_parameter_request { if let Some(f) = (*parent_class).get_parameter_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -576,7 +576,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_announce_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_announce_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).announce_request { if let Some(f) = (*parent_class).announce_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -589,7 +589,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_record_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_record_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).record_request { if let Some(f) = (*parent_class).record_request {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -602,7 +602,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_handle_response(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_handle_response(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).handle_response { if let Some(f) = (*parent_class).handle_response {
f( f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -624,7 +624,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.handle_sdp .handle_sdp
.expect("No `handle_sdp` virtual method implementation in parent class"); .expect("No `handle_sdp` virtual method implementation in parent class");
@ -650,7 +650,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).check_requirements { if let Some(f) = (*parent_class).check_requirements {
from_glib_full(f( from_glib_full(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -670,7 +670,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_options_request { if let Some(f) = (*parent_class).pre_options_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -689,7 +689,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_describe_request { if let Some(f) = (*parent_class).pre_describe_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -708,7 +708,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_setup_request { if let Some(f) = (*parent_class).pre_setup_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -727,7 +727,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_play_request { if let Some(f) = (*parent_class).pre_play_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -746,7 +746,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_pause_request { if let Some(f) = (*parent_class).pre_pause_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -765,7 +765,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_teardown_request { if let Some(f) = (*parent_class).pre_teardown_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -784,7 +784,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_set_parameter_request { if let Some(f) = (*parent_class).pre_set_parameter_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -803,7 +803,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_get_parameter_request { if let Some(f) = (*parent_class).pre_get_parameter_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -822,7 +822,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_announce_request { if let Some(f) = (*parent_class).pre_announce_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -841,7 +841,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_record_request { if let Some(f) = (*parent_class).pre_record_request {
from_glib(f( from_glib(f(
client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0, client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
@ -899,7 +899,7 @@ unsafe extern "C" fn client_create_sdp<T: RTSPClientImpl>(
media: *mut ffi::GstRTSPMedia, media: *mut ffi::GstRTSPMedia,
) -> *mut gst_sdp::ffi::GstSDPMessage { ) -> *mut gst_sdp::ffi::GstSDPMessage {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
let sdp = let sdp =
@ -916,7 +916,7 @@ unsafe extern "C" fn client_configure_client_media<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
match imp.configure_client_media( match imp.configure_client_media(
@ -938,7 +938,7 @@ unsafe extern "C" fn client_params_set<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPResult { ) -> gst_rtsp::ffi::GstRTSPResult {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.params_set(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.params_set(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -950,7 +950,7 @@ unsafe extern "C" fn client_params_get<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPResult { ) -> gst_rtsp::ffi::GstRTSPResult {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.params_get(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.params_get(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -962,7 +962,7 @@ unsafe extern "C" fn client_make_path_from_uri<T: RTSPClientImpl>(
url: *const gst_rtsp::ffi::GstRTSPUrl, url: *const gst_rtsp::ffi::GstRTSPUrl,
) -> *mut std::os::raw::c_char { ) -> *mut std::os::raw::c_char {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.make_path_from_uri(wrap.unsafe_cast_ref(), &from_glib_borrow(url)) imp.make_path_from_uri(wrap.unsafe_cast_ref(), &from_glib_borrow(url))
@ -971,7 +971,7 @@ unsafe extern "C" fn client_make_path_from_uri<T: RTSPClientImpl>(
unsafe extern "C" fn client_closed<T: RTSPClientImpl>(ptr: *mut ffi::GstRTSPClient) { unsafe extern "C" fn client_closed<T: RTSPClientImpl>(ptr: *mut ffi::GstRTSPClient) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.closed(wrap.unsafe_cast_ref()); imp.closed(wrap.unsafe_cast_ref());
@ -982,7 +982,7 @@ unsafe extern "C" fn client_new_session<T: RTSPClientImpl>(
session: *mut ffi::GstRTSPSession, session: *mut ffi::GstRTSPSession,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.new_session(wrap.unsafe_cast_ref(), &from_glib_borrow(session)); imp.new_session(wrap.unsafe_cast_ref(), &from_glib_borrow(session));
@ -993,7 +993,7 @@ unsafe extern "C" fn client_options_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.options_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.options_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1004,7 +1004,7 @@ unsafe extern "C" fn client_describe_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.describe_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.describe_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1015,7 +1015,7 @@ unsafe extern "C" fn client_setup_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.setup_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.setup_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1026,7 +1026,7 @@ unsafe extern "C" fn client_play_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.play_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.play_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1037,7 +1037,7 @@ unsafe extern "C" fn client_pause_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pause_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.pause_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1048,7 +1048,7 @@ unsafe extern "C" fn client_teardown_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.teardown_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.teardown_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1059,7 +1059,7 @@ unsafe extern "C" fn client_set_parameter_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.set_parameter_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.set_parameter_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1070,7 +1070,7 @@ unsafe extern "C" fn client_get_parameter_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.get_parameter_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.get_parameter_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1081,7 +1081,7 @@ unsafe extern "C" fn client_announce_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.announce_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.announce_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1092,7 +1092,7 @@ unsafe extern "C" fn client_record_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.record_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.record_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1103,7 +1103,7 @@ unsafe extern "C" fn client_handle_response<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.handle_response(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)); imp.handle_response(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx));
@ -1116,7 +1116,7 @@ unsafe extern "C" fn client_handle_sdp<T: RTSPClientImpl>(
sdp: *mut gst_sdp::ffi::GstSDPMessage, sdp: *mut gst_sdp::ffi::GstSDPMessage,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
match imp.handle_sdp( match imp.handle_sdp(
@ -1139,7 +1139,7 @@ unsafe extern "C" fn client_check_requirements<T: RTSPClientImpl>(
arr: *mut *mut std::os::raw::c_char, arr: *mut *mut std::os::raw::c_char,
) -> *mut std::os::raw::c_char { ) -> *mut std::os::raw::c_char {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.check_requirements( imp.check_requirements(
@ -1155,7 +1155,7 @@ unsafe extern "C" fn client_pre_options_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_options_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_options_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1167,7 +1167,7 @@ unsafe extern "C" fn client_pre_describe_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_describe_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_describe_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1179,7 +1179,7 @@ unsafe extern "C" fn client_pre_setup_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_setup_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_setup_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1191,7 +1191,7 @@ unsafe extern "C" fn client_pre_play_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_play_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_play_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1203,7 +1203,7 @@ unsafe extern "C" fn client_pre_pause_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_pause_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_pause_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1215,7 +1215,7 @@ unsafe extern "C" fn client_pre_teardown_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_teardown_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_teardown_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1227,7 +1227,7 @@ unsafe extern "C" fn client_pre_set_parameter_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_set_parameter_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_set_parameter_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1239,7 +1239,7 @@ unsafe extern "C" fn client_pre_get_parameter_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_get_parameter_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_get_parameter_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1251,7 +1251,7 @@ unsafe extern "C" fn client_pre_announce_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_announce_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_announce_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))
@ -1263,7 +1263,7 @@ unsafe extern "C" fn client_pre_record_request<T: RTSPClientImpl>(
ctx: *mut ffi::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
) -> gst_rtsp::ffi::GstRTSPStatusCode { ) -> gst_rtsp::ffi::GstRTSPStatusCode {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
imp.pre_record_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx)) imp.pre_record_request(wrap.unsafe_cast_ref(), &from_glib_borrow(ctx))

View file

@ -153,7 +153,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_handle_message(&self, media: &Self::Type, message: &gst::MessageRef) -> bool { fn parent_handle_message(&self, media: &Self::Type, message: &gst::MessageRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).handle_message { if let Some(f) = (*parent_class).handle_message {
from_glib(f( from_glib(f(
media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0, media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
@ -172,7 +172,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).prepare { if let Some(f) = (*parent_class).prepare {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f( f(
@ -191,7 +191,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_unprepare(&self, media: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_unprepare(&self, media: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepare { if let Some(f) = (*parent_class).unprepare {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0), f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
@ -207,7 +207,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_suspend(&self, media: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_suspend(&self, media: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).suspend { if let Some(f) = (*parent_class).suspend {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0), f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
@ -223,7 +223,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_unsuspend(&self, media: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_unsuspend(&self, media: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unsuspend { if let Some(f) = (*parent_class).unsuspend {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0), f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
@ -243,7 +243,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
use std::mem; use std::mem;
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).query_position { if let Some(f) = (*parent_class).query_position {
let mut position = mem::MaybeUninit::uninit(); let mut position = mem::MaybeUninit::uninit();
if f( if f(
@ -266,7 +266,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
use std::mem; use std::mem;
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).query_stop { if let Some(f) = (*parent_class).query_stop {
let mut stop = mem::MaybeUninit::uninit(); let mut stop = mem::MaybeUninit::uninit();
if f( if f(
@ -287,7 +287,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_create_rtpbin(&self, media: &Self::Type) -> Option<gst::Element> { fn parent_create_rtpbin(&self, media: &Self::Type) -> Option<gst::Element> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
.create_rtpbin .create_rtpbin
.expect("No `create_rtpbin` virtual method implementation in parent class"); .expect("No `create_rtpbin` virtual method implementation in parent class");
@ -303,7 +303,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).setup_rtpbin { if let Some(f) = (*parent_class).setup_rtpbin {
let ptr = rtpbin.to_glib_none().0; let ptr = rtpbin.to_glib_none().0;
@ -338,7 +338,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
.setup_sdp .setup_sdp
.expect("No `setup_sdp` virtual method implementation in parent class"); .expect("No `setup_sdp` virtual method implementation in parent class");
@ -358,7 +358,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_new_stream(&self, media: &Self::Type, stream: &crate::RTSPStream) { fn parent_new_stream(&self, media: &Self::Type, stream: &crate::RTSPStream) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_stream { if let Some(f) = (*parent_class).new_stream {
f( f(
media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0, media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
@ -371,7 +371,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_removed_stream(&self, media: &Self::Type, stream: &crate::RTSPStream) { fn parent_removed_stream(&self, media: &Self::Type, stream: &crate::RTSPStream) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).removed_stream { if let Some(f) = (*parent_class).removed_stream {
f( f(
media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0, media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
@ -384,7 +384,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_prepared(&self, media: &Self::Type) { fn parent_prepared(&self, media: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).prepared { if let Some(f) = (*parent_class).prepared {
f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0); f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0);
} }
@ -394,7 +394,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_unprepared(&self, media: &Self::Type) { fn parent_unprepared(&self, media: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepared { if let Some(f) = (*parent_class).unprepared {
f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0); f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0);
} }
@ -404,7 +404,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_target_state(&self, media: &Self::Type, state: gst::State) { fn parent_target_state(&self, media: &Self::Type, state: gst::State) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).target_state { if let Some(f) = (*parent_class).target_state {
f( f(
media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0, media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
@ -417,7 +417,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_new_state(&self, media: &Self::Type, state: gst::State) { fn parent_new_state(&self, media: &Self::Type, state: gst::State) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_state { if let Some(f) = (*parent_class).new_state {
f( f(
media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0, media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
@ -434,7 +434,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
.handle_sdp .handle_sdp
.expect("No `handle_sdp` virtual method implementation in parent class"); .expect("No `handle_sdp` virtual method implementation in parent class");
@ -483,7 +483,7 @@ unsafe extern "C" fn media_handle_message<T: RTSPMediaImpl>(
message: *mut gst::ffi::GstMessage, message: *mut gst::ffi::GstMessage,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
imp.handle_message(wrap.unsafe_cast_ref(), gst::MessageRef::from_ptr(message)) imp.handle_message(wrap.unsafe_cast_ref(), gst::MessageRef::from_ptr(message))
@ -495,7 +495,7 @@ unsafe extern "C" fn media_prepare<T: RTSPMediaImpl>(
thread: *mut ffi::GstRTSPThread, thread: *mut ffi::GstRTSPThread,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
match imp.prepare(wrap.unsafe_cast_ref(), &from_glib_borrow(thread)) { match imp.prepare(wrap.unsafe_cast_ref(), &from_glib_borrow(thread)) {
@ -511,7 +511,7 @@ unsafe extern "C" fn media_unprepare<T: RTSPMediaImpl>(
ptr: *mut ffi::GstRTSPMedia, ptr: *mut ffi::GstRTSPMedia,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
match imp.unprepare(wrap.unsafe_cast_ref()) { match imp.unprepare(wrap.unsafe_cast_ref()) {
@ -527,7 +527,7 @@ unsafe extern "C" fn media_suspend<T: RTSPMediaImpl>(
ptr: *mut ffi::GstRTSPMedia, ptr: *mut ffi::GstRTSPMedia,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
match imp.suspend(wrap.unsafe_cast_ref()) { match imp.suspend(wrap.unsafe_cast_ref()) {
@ -543,7 +543,7 @@ unsafe extern "C" fn media_unsuspend<T: RTSPMediaImpl>(
ptr: *mut ffi::GstRTSPMedia, ptr: *mut ffi::GstRTSPMedia,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
match imp.unsuspend(wrap.unsafe_cast_ref()) { match imp.unsuspend(wrap.unsafe_cast_ref()) {
@ -560,7 +560,7 @@ unsafe extern "C" fn media_query_position<T: RTSPMediaImpl>(
position: *mut i64, position: *mut i64,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
match imp.query_position(wrap.unsafe_cast_ref()) { match imp.query_position(wrap.unsafe_cast_ref()) {
@ -577,7 +577,7 @@ unsafe extern "C" fn media_query_stop<T: RTSPMediaImpl>(
stop: *mut i64, stop: *mut i64,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
match imp.query_stop(wrap.unsafe_cast_ref()) { match imp.query_stop(wrap.unsafe_cast_ref()) {
@ -593,7 +593,7 @@ unsafe extern "C" fn media_create_rtpbin<T: RTSPMediaImpl>(
ptr: *mut ffi::GstRTSPMedia, ptr: *mut ffi::GstRTSPMedia,
) -> *mut gst::ffi::GstElement { ) -> *mut gst::ffi::GstElement {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
let res: *mut gst::ffi::GstElement = imp.create_rtpbin(wrap.unsafe_cast_ref()).to_glib_full(); let res: *mut gst::ffi::GstElement = imp.create_rtpbin(wrap.unsafe_cast_ref()).to_glib_full();
@ -610,7 +610,7 @@ unsafe extern "C" fn media_setup_rtpbin<T: RTSPMediaImpl>(
rtpbin: *mut gst::ffi::GstElement, rtpbin: *mut gst::ffi::GstElement,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
// If the rtpbin was floating before make sure it is not anymore for now so // If the rtpbin was floating before make sure it is not anymore for now so
@ -639,7 +639,7 @@ unsafe extern "C" fn media_setup_sdp<T: RTSPMediaImpl>(
info: *mut ffi::GstSDPInfo, info: *mut ffi::GstSDPInfo,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
match imp.setup_sdp( match imp.setup_sdp(
@ -660,7 +660,7 @@ unsafe extern "C" fn media_new_stream<T: RTSPMediaImpl>(
stream: *mut ffi::GstRTSPStream, stream: *mut ffi::GstRTSPStream,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
imp.new_stream(wrap.unsafe_cast_ref(), &from_glib_borrow(stream)); imp.new_stream(wrap.unsafe_cast_ref(), &from_glib_borrow(stream));
@ -671,7 +671,7 @@ unsafe extern "C" fn media_removed_stream<T: RTSPMediaImpl>(
stream: *mut ffi::GstRTSPStream, stream: *mut ffi::GstRTSPStream,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
imp.removed_stream(wrap.unsafe_cast_ref(), &from_glib_borrow(stream)); imp.removed_stream(wrap.unsafe_cast_ref(), &from_glib_borrow(stream));
@ -679,7 +679,7 @@ unsafe extern "C" fn media_removed_stream<T: RTSPMediaImpl>(
unsafe extern "C" fn media_prepared<T: RTSPMediaImpl>(ptr: *mut ffi::GstRTSPMedia) { unsafe extern "C" fn media_prepared<T: RTSPMediaImpl>(ptr: *mut ffi::GstRTSPMedia) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
imp.prepared(wrap.unsafe_cast_ref()); imp.prepared(wrap.unsafe_cast_ref());
@ -687,7 +687,7 @@ unsafe extern "C" fn media_prepared<T: RTSPMediaImpl>(ptr: *mut ffi::GstRTSPMedi
unsafe extern "C" fn media_unprepared<T: RTSPMediaImpl>(ptr: *mut ffi::GstRTSPMedia) { unsafe extern "C" fn media_unprepared<T: RTSPMediaImpl>(ptr: *mut ffi::GstRTSPMedia) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
imp.unprepared(wrap.unsafe_cast_ref()); imp.unprepared(wrap.unsafe_cast_ref());
@ -698,7 +698,7 @@ unsafe extern "C" fn media_target_state<T: RTSPMediaImpl>(
state: gst::ffi::GstState, state: gst::ffi::GstState,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
imp.target_state(wrap.unsafe_cast_ref(), from_glib(state)); imp.target_state(wrap.unsafe_cast_ref(), from_glib(state));
@ -709,7 +709,7 @@ unsafe extern "C" fn media_new_state<T: RTSPMediaImpl>(
state: gst::ffi::GstState, state: gst::ffi::GstState,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
imp.new_state(wrap.unsafe_cast_ref(), from_glib(state)); imp.new_state(wrap.unsafe_cast_ref(), from_glib(state));
@ -720,7 +720,7 @@ unsafe extern "C" fn media_handle_sdp<T: RTSPMediaImpl>(
sdp: *mut gst_sdp::ffi::GstSDPMessage, sdp: *mut gst_sdp::ffi::GstSDPMessage,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
match imp.handle_sdp( match imp.handle_sdp(

View file

@ -85,8 +85,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
.gen_key .gen_key
.map(|f| { .map(|f| {
@ -109,8 +108,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
) -> Option<gst::Element> { ) -> Option<gst::Element> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
.create_element .create_element
.map(|f| { .map(|f| {
@ -133,8 +131,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
) -> Option<crate::RTSPMedia> { ) -> Option<crate::RTSPMedia> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
.construct .construct
.map(|f| { .map(|f| {
@ -157,8 +154,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
) -> Option<gst::Pipeline> { ) -> Option<gst::Pipeline> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
.create_pipeline .create_pipeline
.map(|f| { .map(|f| {
@ -183,8 +179,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
fn parent_configure(&self, factory: &Self::Type, media: &crate::RTSPMedia) { fn parent_configure(&self, factory: &Self::Type, media: &crate::RTSPMedia) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).configure { if let Some(f) = (*parent_class).configure {
f( f(
factory factory
@ -200,8 +195,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
fn parent_media_constructed(&self, factory: &Self::Type, media: &crate::RTSPMedia) { fn parent_media_constructed(&self, factory: &Self::Type, media: &crate::RTSPMedia) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).media_constructed { if let Some(f) = (*parent_class).media_constructed {
f( f(
factory factory
@ -217,8 +211,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
fn parent_media_configure(&self, factory: &Self::Type, media: &crate::RTSPMedia) { fn parent_media_configure(&self, factory: &Self::Type, media: &crate::RTSPMedia) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
data.as_ref().get_parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).media_configure { if let Some(f) = (*parent_class).media_configure {
f( f(
factory factory
@ -254,7 +247,7 @@ unsafe extern "C" fn factory_gen_key<T: RTSPMediaFactoryImpl>(
url: *const gst_rtsp::ffi::GstRTSPUrl, url: *const gst_rtsp::ffi::GstRTSPUrl,
) -> *mut std::os::raw::c_char { ) -> *mut std::os::raw::c_char {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
imp.gen_key(wrap.unsafe_cast_ref(), &from_glib_borrow(url)) imp.gen_key(wrap.unsafe_cast_ref(), &from_glib_borrow(url))
@ -266,7 +259,7 @@ unsafe extern "C" fn factory_create_element<T: RTSPMediaFactoryImpl>(
url: *const gst_rtsp::ffi::GstRTSPUrl, url: *const gst_rtsp::ffi::GstRTSPUrl,
) -> *mut gst::ffi::GstElement { ) -> *mut gst::ffi::GstElement {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
let element = imp let element = imp
@ -281,7 +274,7 @@ unsafe extern "C" fn factory_construct<T: RTSPMediaFactoryImpl>(
url: *const gst_rtsp::ffi::GstRTSPUrl, url: *const gst_rtsp::ffi::GstRTSPUrl,
) -> *mut ffi::GstRTSPMedia { ) -> *mut ffi::GstRTSPMedia {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
imp.construct(wrap.unsafe_cast_ref(), &from_glib_borrow(url)) imp.construct(wrap.unsafe_cast_ref(), &from_glib_borrow(url))
@ -298,7 +291,7 @@ unsafe extern "C" fn factory_create_pipeline<T: RTSPMediaFactoryImpl>(
Lazy::new(|| glib::Quark::from_string("gstreamer-rs-rtsp-media-pipeline")); Lazy::new(|| glib::Quark::from_string("gstreamer-rs-rtsp-media-pipeline"));
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
let pipeline: *mut gst::ffi::GstPipeline = imp let pipeline: *mut gst::ffi::GstPipeline = imp
@ -323,7 +316,7 @@ unsafe extern "C" fn factory_configure<T: RTSPMediaFactoryImpl>(
media: *mut ffi::GstRTSPMedia, media: *mut ffi::GstRTSPMedia,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
imp.configure(wrap.unsafe_cast_ref(), &from_glib_borrow(media)); imp.configure(wrap.unsafe_cast_ref(), &from_glib_borrow(media));
@ -334,7 +327,7 @@ unsafe extern "C" fn factory_media_constructed<T: RTSPMediaFactoryImpl>(
media: *mut ffi::GstRTSPMedia, media: *mut ffi::GstRTSPMedia,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
imp.media_constructed(wrap.unsafe_cast_ref(), &from_glib_borrow(media)); imp.media_constructed(wrap.unsafe_cast_ref(), &from_glib_borrow(media));
@ -345,7 +338,7 @@ unsafe extern "C" fn factory_media_configure<T: RTSPMediaFactoryImpl>(
media: *mut ffi::GstRTSPMedia, media: *mut ffi::GstRTSPMedia,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
imp.media_configure(wrap.unsafe_cast_ref(), &from_glib_borrow(media)); imp.media_configure(wrap.unsafe_cast_ref(), &from_glib_borrow(media));

View file

@ -26,7 +26,7 @@ impl<T: RTSPServerImpl> RTSPServerImplExt for T {
fn parent_create_client(&self, server: &Self::Type) -> Option<crate::RTSPClient> { fn parent_create_client(&self, server: &Self::Type) -> Option<crate::RTSPClient> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPServerClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPServerClass;
let f = (*parent_class) let f = (*parent_class)
.create_client .create_client
.expect("No `create_client` virtual method implementation in parent class"); .expect("No `create_client` virtual method implementation in parent class");
@ -37,7 +37,7 @@ impl<T: RTSPServerImpl> RTSPServerImplExt for T {
fn parent_client_connected(&self, server: &Self::Type, client: &crate::RTSPClient) { fn parent_client_connected(&self, server: &Self::Type, client: &crate::RTSPClient) {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstRTSPServerClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPServerClass;
if let Some(f) = (*parent_class).client_connected { if let Some(f) = (*parent_class).client_connected {
f( f(
server.unsafe_cast_ref::<RTSPServer>().to_glib_none().0, server.unsafe_cast_ref::<RTSPServer>().to_glib_none().0,
@ -64,7 +64,7 @@ unsafe extern "C" fn server_create_client<T: RTSPServerImpl>(
ptr: *mut ffi::GstRTSPServer, ptr: *mut ffi::GstRTSPServer,
) -> *mut ffi::GstRTSPClient { ) -> *mut ffi::GstRTSPClient {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPServer> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPServer> = from_glib_borrow(ptr);
imp.create_client(wrap.unsafe_cast_ref()).to_glib_full() imp.create_client(wrap.unsafe_cast_ref()).to_glib_full()
@ -75,7 +75,7 @@ unsafe extern "C" fn server_client_connected<T: RTSPServerImpl>(
client: *mut ffi::GstRTSPClient, client: *mut ffi::GstRTSPClient,
) { ) {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<RTSPServer> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPServer> = from_glib_borrow(ptr);
imp.client_connected(wrap.unsafe_cast_ref(), &from_glib_borrow(client)); imp.client_connected(wrap.unsafe_cast_ref(), &from_glib_borrow(client));

View file

@ -98,12 +98,12 @@ impl fmt::Debug for SDPMediaRef {
.field("connections", &DebugIter(RefCell::new(self.connections()))) .field("connections", &DebugIter(RefCell::new(self.connections())))
.field("bandwidths", &DebugIter(RefCell::new(self.bandwidths()))) .field("bandwidths", &DebugIter(RefCell::new(self.bandwidths())))
.field("attributes", &DebugIter(RefCell::new(self.attributes()))) .field("attributes", &DebugIter(RefCell::new(self.attributes())))
.field("information", &self.get_information()) .field("information", &self.information())
.field("key", &self.get_key()) .field("key", &self.key())
.field("media", &self.get_media()) .field("media", &self.media())
.field("port", &self.get_port()) .field("port", &self.port())
.field("num-ports", &self.get_num_ports()) .field("num-ports", &self.num_ports())
.field("proto", &self.get_proto()) .field("proto", &self.proto())
.finish() .finish()
} }
} }
@ -293,7 +293,7 @@ impl SDPMediaRef {
} }
} }
pub fn get_information(&self) -> Option<&str> { pub fn information(&self) -> Option<&str> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_media_get_information(&self.0); let ptr = ffi::gst_sdp_media_get_information(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -304,7 +304,7 @@ impl SDPMediaRef {
} }
} }
pub fn get_key(&self) -> Option<&SDPKey> { pub fn key(&self) -> Option<&SDPKey> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_media_get_key(&self.0); let ptr = ffi::gst_sdp_media_get_key(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -315,7 +315,7 @@ impl SDPMediaRef {
} }
} }
pub fn get_media(&self) -> Option<&str> { pub fn media(&self) -> Option<&str> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_media_get_media(&self.0); let ptr = ffi::gst_sdp_media_get_media(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -326,15 +326,15 @@ impl SDPMediaRef {
} }
} }
pub fn get_num_ports(&self) -> u32 { pub fn num_ports(&self) -> u32 {
unsafe { ffi::gst_sdp_media_get_num_ports(&self.0) } unsafe { ffi::gst_sdp_media_get_num_ports(&self.0) }
} }
pub fn get_port(&self) -> u32 { pub fn port(&self) -> u32 {
unsafe { ffi::gst_sdp_media_get_port(&self.0) } unsafe { ffi::gst_sdp_media_get_port(&self.0) }
} }
pub fn get_proto(&self) -> Option<&str> { pub fn proto(&self) -> Option<&str> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_media_get_proto(&self.0); let ptr = ffi::gst_sdp_media_get_proto(&self.0);
if ptr.is_null() { if ptr.is_null() {

View file

@ -131,13 +131,13 @@ impl fmt::Debug for SDPMessageRef {
} }
f.debug_struct("SDPMessage") f.debug_struct("SDPMessage")
.field("connection", &self.get_connection()) .field("connection", &self.connection())
.field("information", &self.get_information()) .field("information", &self.information())
.field("key", &self.get_key()) .field("key", &self.key())
.field("origin", &self.get_origin()) .field("origin", &self.origin())
.field("session-name", &self.get_session_name()) .field("session-name", &self.session_name())
.field("uri", &self.get_uri()) .field("uri", &self.uri())
.field("version", &self.get_version()) .field("version", &self.version())
.field("attributes", &DebugIter(RefCell::new(self.attributes()))) .field("attributes", &DebugIter(RefCell::new(self.attributes())))
.field("bandwidths", &DebugIter(RefCell::new(self.bandwidths()))) .field("bandwidths", &DebugIter(RefCell::new(self.bandwidths())))
.field("emails", &DebugIter(RefCell::new(self.emails()))) .field("emails", &DebugIter(RefCell::new(self.emails())))
@ -297,7 +297,7 @@ impl SDPMessageRef {
} }
} }
pub fn get_connection(&self) -> Option<&SDPConnection> { pub fn connection(&self) -> Option<&SDPConnection> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_message_get_connection(&self.0); let ptr = ffi::gst_sdp_message_get_connection(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -323,7 +323,7 @@ impl SDPMessageRef {
} }
} }
pub fn get_information(&self) -> Option<&str> { pub fn information(&self) -> Option<&str> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_message_get_information(&self.0); let ptr = ffi::gst_sdp_message_get_information(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -334,7 +334,7 @@ impl SDPMessageRef {
} }
} }
pub fn get_key(&self) -> Option<&SDPKey> { pub fn key(&self) -> Option<&SDPKey> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_message_get_key(&self.0); let ptr = ffi::gst_sdp_message_get_key(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -375,7 +375,7 @@ impl SDPMessageRef {
} }
} }
pub fn get_origin(&self) -> Option<&SDPOrigin> { pub fn origin(&self) -> Option<&SDPOrigin> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_message_get_origin(&self.0); let ptr = ffi::gst_sdp_message_get_origin(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -401,7 +401,7 @@ impl SDPMessageRef {
} }
} }
pub fn get_session_name(&self) -> Option<&str> { pub fn session_name(&self) -> Option<&str> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_message_get_session_name(&self.0); let ptr = ffi::gst_sdp_message_get_session_name(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -427,7 +427,7 @@ impl SDPMessageRef {
} }
} }
pub fn get_uri(&self) -> Option<&str> { pub fn uri(&self) -> Option<&str> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_message_get_uri(&self.0); let ptr = ffi::gst_sdp_message_get_uri(&self.0);
if ptr.is_null() { if ptr.is_null() {
@ -438,7 +438,7 @@ impl SDPMessageRef {
} }
} }
pub fn get_version(&self) -> Option<&str> { pub fn version(&self) -> Option<&str> {
unsafe { unsafe {
let ptr = ffi::gst_sdp_message_get_version(&self.0); let ptr = ffi::gst_sdp_message_get_version(&self.0);
if ptr.is_null() { if ptr.is_null() {

View file

@ -263,9 +263,9 @@ mod tests {
let res = res_store.lock().unwrap().take().unwrap(); let res = res_store.lock().unwrap().take().unwrap();
let res = res.unwrap(); let res = res.unwrap();
let converted_out_caps = res.get_caps().unwrap(); let converted_out_caps = res.caps().unwrap();
assert_eq!(out_caps.as_ref(), converted_out_caps); assert_eq!(out_caps.as_ref(), converted_out_caps);
let out_buffer = res.get_buffer().unwrap(); let out_buffer = res.buffer().unwrap();
{ {
let data = out_buffer.map_readable().unwrap(); let data = out_buffer.map_readable().unwrap();

View file

@ -171,7 +171,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.open .open
.map(|f| { .map(|f| {
@ -195,7 +195,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.close .close
.map(|f| { .map(|f| {
@ -219,7 +219,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -243,7 +243,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -267,7 +267,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_finish(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_finish(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.finish .finish
.map(|f| { .map(|f| {
@ -284,7 +284,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_drain(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_drain(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.drain .drain
.map(|f| { .map(|f| {
@ -305,7 +305,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.set_format .set_format
.map(|f| { .map(|f| {
@ -331,7 +331,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.parse .parse
.map(|f| { .map(|f| {
@ -354,7 +354,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.handle_frame .handle_frame
.map(|f| { .map(|f| {
@ -371,7 +371,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_flush(&self, element: &Self::Type) -> bool { fn parent_flush(&self, element: &Self::Type) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.flush .flush
.map(|f| { .map(|f| {
@ -387,7 +387,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
.map(|f| { .map(|f| {
@ -404,7 +404,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.getcaps .getcaps
.map(|f| { .map(|f| {
@ -424,7 +424,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
.expect("Missing parent function `sink_event`"); .expect("Missing parent function `sink_event`");
@ -438,7 +438,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
.expect("Missing parent function `sink_query`"); .expect("Missing parent function `sink_query`");
@ -452,7 +452,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
.expect("Missing parent function `src_event`"); .expect("Missing parent function `src_event`");
@ -466,7 +466,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
.expect("Missing parent function `src_query`"); .expect("Missing parent function `src_query`");
@ -484,7 +484,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.propose_allocation .propose_allocation
.map(|f| { .map(|f| {
@ -511,7 +511,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.decide_allocation .decide_allocation
.map(|f| { .map(|f| {
@ -565,7 +565,7 @@ unsafe extern "C" fn video_decoder_open<T: VideoDecoderImpl>(
ptr: *mut ffi::GstVideoDecoder, ptr: *mut ffi::GstVideoDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -584,7 +584,7 @@ unsafe extern "C" fn video_decoder_close<T: VideoDecoderImpl>(
ptr: *mut ffi::GstVideoDecoder, ptr: *mut ffi::GstVideoDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -603,7 +603,7 @@ unsafe extern "C" fn video_decoder_start<T: VideoDecoderImpl>(
ptr: *mut ffi::GstVideoDecoder, ptr: *mut ffi::GstVideoDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -622,7 +622,7 @@ unsafe extern "C" fn video_decoder_stop<T: VideoDecoderImpl>(
ptr: *mut ffi::GstVideoDecoder, ptr: *mut ffi::GstVideoDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -641,7 +641,7 @@ unsafe extern "C" fn video_decoder_finish<T: VideoDecoderImpl>(
ptr: *mut ffi::GstVideoDecoder, ptr: *mut ffi::GstVideoDecoder,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -654,7 +654,7 @@ unsafe extern "C" fn video_decoder_drain<T: VideoDecoderImpl>(
ptr: *mut ffi::GstVideoDecoder, ptr: *mut ffi::GstVideoDecoder,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -668,7 +668,7 @@ unsafe extern "C" fn video_decoder_set_format<T: VideoDecoderImpl>(
state: *mut ffi::GstVideoCodecState, state: *mut ffi::GstVideoCodecState,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
ffi::gst_video_codec_state_ref(state); ffi::gst_video_codec_state_ref(state);
let wrap_state = VideoCodecState::<Readable>::new(state); let wrap_state = VideoCodecState::<Readable>::new(state);
@ -692,7 +692,7 @@ unsafe extern "C" fn video_decoder_parse<T: VideoDecoderImpl>(
at_eos: glib::ffi::gboolean, at_eos: glib::ffi::gboolean,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
ffi::gst_video_codec_frame_ref(frame); ffi::gst_video_codec_frame_ref(frame);
let wrap_frame = VideoCodecFrame::new(frame, &*wrap); let wrap_frame = VideoCodecFrame::new(frame, &*wrap);
@ -711,7 +711,7 @@ unsafe extern "C" fn video_decoder_handle_frame<T: VideoDecoderImpl>(
frame: *mut ffi::GstVideoCodecFrame, frame: *mut ffi::GstVideoCodecFrame,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
let wrap_frame = VideoCodecFrame::new(frame, &*wrap); let wrap_frame = VideoCodecFrame::new(frame, &*wrap);
@ -725,7 +725,7 @@ unsafe extern "C" fn video_decoder_flush<T: VideoDecoderImpl>(
ptr: *mut ffi::GstVideoDecoder, ptr: *mut ffi::GstVideoDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -738,7 +738,7 @@ unsafe extern "C" fn video_decoder_negotiate<T: VideoDecoderImpl>(
ptr: *mut ffi::GstVideoDecoder, ptr: *mut ffi::GstVideoDecoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -758,7 +758,7 @@ unsafe extern "C" fn video_decoder_getcaps<T: VideoDecoderImpl>(
filter: *mut gst::ffi::GstCaps, filter: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), { gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), {
@ -778,7 +778,7 @@ unsafe extern "C" fn video_decoder_sink_event<T: VideoDecoderImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -792,7 +792,7 @@ unsafe extern "C" fn video_decoder_sink_query<T: VideoDecoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -806,7 +806,7 @@ unsafe extern "C" fn video_decoder_src_event<T: VideoDecoderImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -820,7 +820,7 @@ unsafe extern "C" fn video_decoder_src_query<T: VideoDecoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -834,7 +834,7 @@ unsafe extern "C" fn video_decoder_propose_allocation<T: VideoDecoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query); let query = gst::QueryRef::from_mut_ptr(query);
@ -855,7 +855,7 @@ unsafe extern "C" fn video_decoder_decide_allocation<T: VideoDecoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoDecoder> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query); let query = gst::QueryRef::from_mut_ptr(query);

View file

@ -147,7 +147,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.open .open
.map(|f| { .map(|f| {
@ -171,7 +171,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.close .close
.map(|f| { .map(|f| {
@ -195,7 +195,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.start .start
.map(|f| { .map(|f| {
@ -219,7 +219,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.stop .stop
.map(|f| { .map(|f| {
@ -243,7 +243,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_finish(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_finish(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.finish .finish
.map(|f| { .map(|f| {
@ -264,7 +264,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.set_format .set_format
.map(|f| { .map(|f| {
@ -288,7 +288,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.handle_frame .handle_frame
.map(|f| { .map(|f| {
@ -305,7 +305,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_flush(&self, element: &Self::Type) -> bool { fn parent_flush(&self, element: &Self::Type) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.flush .flush
.map(|f| { .map(|f| {
@ -321,7 +321,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
.map(|f| { .map(|f| {
@ -338,7 +338,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_get_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.getcaps .getcaps
.map(|f| { .map(|f| {
@ -358,7 +358,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
.expect("Missing parent function `sink_event`"); .expect("Missing parent function `sink_event`");
@ -372,7 +372,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
.expect("Missing parent function `sink_query`"); .expect("Missing parent function `sink_query`");
@ -386,7 +386,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
.expect("Missing parent function `src_event`"); .expect("Missing parent function `src_event`");
@ -400,7 +400,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
.expect("Missing parent function `src_query`"); .expect("Missing parent function `src_query`");
@ -418,7 +418,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.propose_allocation .propose_allocation
.map(|f| { .map(|f| {
@ -445,7 +445,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.decide_allocation .decide_allocation
.map(|f| { .map(|f| {
@ -497,7 +497,7 @@ unsafe extern "C" fn video_encoder_open<T: VideoEncoderImpl>(
ptr: *mut ffi::GstVideoEncoder, ptr: *mut ffi::GstVideoEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -516,7 +516,7 @@ unsafe extern "C" fn video_encoder_close<T: VideoEncoderImpl>(
ptr: *mut ffi::GstVideoEncoder, ptr: *mut ffi::GstVideoEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -535,7 +535,7 @@ unsafe extern "C" fn video_encoder_start<T: VideoEncoderImpl>(
ptr: *mut ffi::GstVideoEncoder, ptr: *mut ffi::GstVideoEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -554,7 +554,7 @@ unsafe extern "C" fn video_encoder_stop<T: VideoEncoderImpl>(
ptr: *mut ffi::GstVideoEncoder, ptr: *mut ffi::GstVideoEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -573,7 +573,7 @@ unsafe extern "C" fn video_encoder_finish<T: VideoEncoderImpl>(
ptr: *mut ffi::GstVideoEncoder, ptr: *mut ffi::GstVideoEncoder,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, { gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
@ -587,7 +587,7 @@ unsafe extern "C" fn video_encoder_set_format<T: VideoEncoderImpl>(
state: *mut ffi::GstVideoCodecState, state: *mut ffi::GstVideoCodecState,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
ffi::gst_video_codec_state_ref(state); ffi::gst_video_codec_state_ref(state);
let wrap_state = VideoCodecState::<Readable>::new(state); let wrap_state = VideoCodecState::<Readable>::new(state);
@ -609,7 +609,7 @@ unsafe extern "C" fn video_encoder_handle_frame<T: VideoEncoderImpl>(
frame: *mut ffi::GstVideoCodecFrame, frame: *mut ffi::GstVideoCodecFrame,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
let wrap_frame = VideoCodecFrame::new(frame, &*wrap); let wrap_frame = VideoCodecFrame::new(frame, &*wrap);
@ -623,7 +623,7 @@ unsafe extern "C" fn video_encoder_flush<T: VideoEncoderImpl>(
ptr: *mut ffi::GstVideoEncoder, ptr: *mut ffi::GstVideoEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -636,7 +636,7 @@ unsafe extern "C" fn video_encoder_negotiate<T: VideoEncoderImpl>(
ptr: *mut ffi::GstVideoEncoder, ptr: *mut ffi::GstVideoEncoder,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -656,7 +656,7 @@ unsafe extern "C" fn video_encoder_getcaps<T: VideoEncoderImpl>(
filter: *mut gst::ffi::GstCaps, filter: *mut gst::ffi::GstCaps,
) -> *mut gst::ffi::GstCaps { ) -> *mut gst::ffi::GstCaps {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), { gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), {
@ -676,7 +676,7 @@ unsafe extern "C" fn video_encoder_sink_event<T: VideoEncoderImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -690,7 +690,7 @@ unsafe extern "C" fn video_encoder_sink_query<T: VideoEncoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -704,7 +704,7 @@ unsafe extern "C" fn video_encoder_src_event<T: VideoEncoderImpl>(
event: *mut gst::ffi::GstEvent, event: *mut gst::ffi::GstEvent,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -718,7 +718,7 @@ unsafe extern "C" fn video_encoder_src_query<T: VideoEncoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
gst::panic_to_error!(&wrap, &imp.panicked(), false, { gst::panic_to_error!(&wrap, &imp.panicked(), false, {
@ -732,7 +732,7 @@ unsafe extern "C" fn video_encoder_propose_allocation<T: VideoEncoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query); let query = gst::QueryRef::from_mut_ptr(query);
@ -753,7 +753,7 @@ unsafe extern "C" fn video_encoder_decide_allocation<T: VideoEncoderImpl>(
query: *mut gst::ffi::GstQuery, query: *mut gst::ffi::GstQuery,
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr); let wrap: Borrowed<VideoEncoder> = from_glib_borrow(ptr);
let query = gst::QueryRef::from_mut_ptr(query); let query = gst::QueryRef::from_mut_ptr(query);

View file

@ -35,7 +35,7 @@ impl<T: VideoSinkImpl> VideoSinkImplExt for T {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstVideoSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoSinkClass;
(*parent_class) (*parent_class)
.show_frame .show_frame
.map(|f| { .map(|f| {
@ -67,7 +67,7 @@ unsafe extern "C" fn video_sink_show_frame<T: VideoSinkImpl>(
buffer: *mut gst::ffi::GstBuffer, buffer: *mut gst::ffi::GstBuffer,
) -> gst::ffi::GstFlowReturn { ) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.impl_();
let wrap: Borrowed<VideoSink> = from_glib_borrow(ptr); let wrap: Borrowed<VideoSink> = from_glib_borrow(ptr);
let buffer = from_glib_borrow(buffer); let buffer = from_glib_borrow(buffer);

View file

@ -1,6 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
pub trait HasStreamLock { pub trait HasStreamLock {
fn get_stream_lock(&self) -> *mut glib::ffi::GRecMutex; fn stream_lock(&self) -> *mut glib::ffi::GRecMutex;
fn get_element_as_ptr(&self) -> *const gst::ffi::GstElement; fn element_as_ptr(&self) -> *const gst::ffi::GstElement;
} }

View file

@ -34,19 +34,19 @@ pub static BUFFER_POOL_OPTION_VIDEO_META: Lazy<&'static str> = Lazy::new(|| unsa
pub struct VideoAlignment(pub(crate) ffi::GstVideoAlignment); pub struct VideoAlignment(pub(crate) ffi::GstVideoAlignment);
impl VideoAlignment { impl VideoAlignment {
pub fn get_padding_top(&self) -> u32 { pub fn padding_top(&self) -> u32 {
self.0.padding_top self.0.padding_top
} }
pub fn get_padding_bottom(&self) -> u32 { pub fn padding_bottom(&self) -> u32 {
self.0.padding_bottom self.0.padding_bottom
} }
pub fn get_padding_left(&self) -> u32 { pub fn padding_left(&self) -> u32 {
self.0.padding_left self.0.padding_left
} }
pub fn get_padding_right(&self) -> u32 { pub fn padding_right(&self) -> u32 {
self.0.padding_right self.0.padding_right
} }
pub fn get_stride_align(&self) -> &[u32; ffi::GST_VIDEO_MAX_PLANES as usize] { pub fn stride_align(&self) -> &[u32; ffi::GST_VIDEO_MAX_PLANES as usize] {
&self.0.stride_align &self.0.stride_align
} }
@ -73,24 +73,24 @@ impl VideoAlignment {
impl PartialEq for VideoAlignment { impl PartialEq for VideoAlignment {
fn eq(&self, other: &VideoAlignment) -> bool { fn eq(&self, other: &VideoAlignment) -> bool {
self.get_padding_top() == other.get_padding_top() self.padding_top() == other.padding_top()
&& self.get_padding_bottom() == other.get_padding_bottom() && self.padding_bottom() == other.padding_bottom()
&& self.get_padding_left() == other.get_padding_left() && self.padding_left() == other.padding_left()
&& self.get_padding_right() == other.get_padding_right() && self.padding_right() == other.padding_right()
&& self.get_stride_align() == other.get_stride_align() && self.stride_align() == other.stride_align()
} }
} }
impl Eq for VideoAlignment {} impl Eq for VideoAlignment {}
pub trait VideoBufferPoolConfig { pub trait VideoBufferPoolConfig {
fn get_video_alignment(&self) -> Option<VideoAlignment>; fn video_alignment(&self) -> Option<VideoAlignment>;
fn set_video_alignment(&mut self, align: &VideoAlignment); fn set_video_alignment(&mut self, align: &VideoAlignment);
} }
impl VideoBufferPoolConfig for gst::BufferPoolConfig { impl VideoBufferPoolConfig for gst::BufferPoolConfig {
fn get_video_alignment(&self) -> Option<VideoAlignment> { fn video_alignment(&self) -> Option<VideoAlignment> {
unsafe { unsafe {
let mut alignment = mem::MaybeUninit::zeroed(); let mut alignment = mem::MaybeUninit::zeroed();
let ret = from_glib(ffi::gst_buffer_pool_config_get_video_alignment( let ret = from_glib(ffi::gst_buffer_pool_config_get_video_alignment(

View file

@ -30,20 +30,20 @@ impl<'a> fmt::Debug for VideoCodecFrame<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut b = f.debug_struct("VideoCodecFrame"); let mut b = f.debug_struct("VideoCodecFrame");
b.field("flags", &self.get_flags()) b.field("flags", &self.flags())
.field("system_frame_number", &self.get_system_frame_number()) .field("system_frame_number", &self.system_frame_number())
.field("decode_frame_number", &self.get_decode_frame_number()) .field("decode_frame_number", &self.decode_frame_number())
.field( .field(
"presentation_frame_number", "presentation_frame_number",
&self.get_presentation_frame_number(), &self.presentation_frame_number(),
) )
.field("dts", &self.get_dts()) .field("dts", &self.dts())
.field("pts", &self.get_pts()) .field("pts", &self.pts())
.field("duration", &self.get_duration()) .field("duration", &self.duration())
.field("distance_from_sync", &self.get_distance_from_sync()) .field("distance_from_sync", &self.distance_from_sync())
.field("input_buffer", &self.get_input_buffer()) .field("input_buffer", &self.input_buffer())
.field("output_buffer", &self.get_output_buffer()) .field("output_buffer", &self.output_buffer())
.field("deadline", &self.get_deadline()); .field("deadline", &self.deadline());
b.finish() b.finish()
} }
@ -56,12 +56,12 @@ impl<'a> VideoCodecFrame<'a> {
element: &'a T, element: &'a T,
) -> Self { ) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
let stream_lock = element.get_stream_lock(); let stream_lock = element.stream_lock();
glib::ffi::g_rec_mutex_lock(stream_lock); glib::ffi::g_rec_mutex_lock(stream_lock);
Self { frame, element } Self { frame, element }
} }
pub fn get_flags(&self) -> VideoCodecFrameFlags { pub fn flags(&self) -> VideoCodecFrameFlags {
let flags = unsafe { (*self.to_glib_none().0).flags }; let flags = unsafe { (*self.to_glib_none().0).flags };
VideoCodecFrameFlags::from_bits_truncate(flags) VideoCodecFrameFlags::from_bits_truncate(flags)
} }
@ -74,19 +74,19 @@ impl<'a> VideoCodecFrame<'a> {
unsafe { (*self.to_glib_none().0).flags &= !flags.bits() } unsafe { (*self.to_glib_none().0).flags &= !flags.bits() }
} }
pub fn get_system_frame_number(&self) -> u32 { pub fn system_frame_number(&self) -> u32 {
unsafe { (*self.to_glib_none().0).system_frame_number } unsafe { (*self.to_glib_none().0).system_frame_number }
} }
pub fn get_decode_frame_number(&self) -> u32 { pub fn decode_frame_number(&self) -> u32 {
unsafe { (*self.to_glib_none().0).decode_frame_number } unsafe { (*self.to_glib_none().0).decode_frame_number }
} }
pub fn get_presentation_frame_number(&self) -> u32 { pub fn presentation_frame_number(&self) -> u32 {
unsafe { (*self.to_glib_none().0).presentation_frame_number } unsafe { (*self.to_glib_none().0).presentation_frame_number }
} }
pub fn get_dts(&self) -> gst::ClockTime { pub fn dts(&self) -> gst::ClockTime {
unsafe { from_glib((*self.to_glib_none().0).dts) } unsafe { from_glib((*self.to_glib_none().0).dts) }
} }
@ -96,7 +96,7 @@ impl<'a> VideoCodecFrame<'a> {
} }
} }
pub fn get_pts(&self) -> gst::ClockTime { pub fn pts(&self) -> gst::ClockTime {
unsafe { from_glib((*self.to_glib_none().0).pts) } unsafe { from_glib((*self.to_glib_none().0).pts) }
} }
@ -106,7 +106,7 @@ impl<'a> VideoCodecFrame<'a> {
} }
} }
pub fn get_duration(&self) -> gst::ClockTime { pub fn duration(&self) -> gst::ClockTime {
unsafe { from_glib((*self.to_glib_none().0).duration) } unsafe { from_glib((*self.to_glib_none().0).duration) }
} }
@ -116,11 +116,11 @@ impl<'a> VideoCodecFrame<'a> {
} }
} }
pub fn get_distance_from_sync(&self) -> i32 { pub fn distance_from_sync(&self) -> i32 {
unsafe { (*self.to_glib_none().0).distance_from_sync } unsafe { (*self.to_glib_none().0).distance_from_sync }
} }
pub fn get_input_buffer(&self) -> Option<&gst::BufferRef> { pub fn input_buffer(&self) -> Option<&gst::BufferRef> {
unsafe { unsafe {
let ptr = (*self.to_glib_none().0).input_buffer; let ptr = (*self.to_glib_none().0).input_buffer;
if ptr.is_null() { if ptr.is_null() {
@ -131,7 +131,7 @@ impl<'a> VideoCodecFrame<'a> {
} }
} }
pub fn get_output_buffer(&self) -> Option<&gst::BufferRef> { pub fn output_buffer(&self) -> Option<&gst::BufferRef> {
unsafe { unsafe {
let ptr = (*self.to_glib_none().0).output_buffer; let ptr = (*self.to_glib_none().0).output_buffer;
if ptr.is_null() { if ptr.is_null() {
@ -142,7 +142,7 @@ impl<'a> VideoCodecFrame<'a> {
} }
} }
pub fn get_output_buffer_mut(&mut self) -> Option<&mut gst::BufferRef> { pub fn output_buffer_mut(&mut self) -> Option<&mut gst::BufferRef> {
unsafe { unsafe {
let ptr = (*self.to_glib_none().0).output_buffer; let ptr = (*self.to_glib_none().0).output_buffer;
if ptr.is_null() { if ptr.is_null() {
@ -176,13 +176,13 @@ impl<'a> VideoCodecFrame<'a> {
} }
} }
pub fn get_deadline(&self) -> gst::ClockTime { pub fn deadline(&self) -> gst::ClockTime {
unsafe { from_glib((*self.to_glib_none().0).deadline) } unsafe { from_glib((*self.to_glib_none().0).deadline) }
} }
#[doc(hidden)] #[doc(hidden)]
pub unsafe fn into_ptr(self) -> *mut ffi::GstVideoCodecFrame { pub unsafe fn into_ptr(self) -> *mut ffi::GstVideoCodecFrame {
let stream_lock = self.element.get_stream_lock(); let stream_lock = self.element.stream_lock();
glib::ffi::g_rec_mutex_unlock(stream_lock); glib::ffi::g_rec_mutex_unlock(stream_lock);
let s = mem::ManuallyDrop::new(self); let s = mem::ManuallyDrop::new(self);
@ -193,7 +193,7 @@ impl<'a> VideoCodecFrame<'a> {
impl<'a> Drop for VideoCodecFrame<'a> { impl<'a> Drop for VideoCodecFrame<'a> {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
let stream_lock = self.element.get_stream_lock(); let stream_lock = self.element.stream_lock();
glib::ffi::g_rec_mutex_unlock(stream_lock); glib::ffi::g_rec_mutex_unlock(stream_lock);
ffi::gst_video_codec_frame_unref(self.frame); ffi::gst_video_codec_frame_unref(self.frame);

View file

@ -9,8 +9,8 @@ use std::ptr;
use crate::video_info::VideoInfo; use crate::video_info::VideoInfo;
pub trait VideoCodecStateContext<'a> { pub trait VideoCodecStateContext<'a> {
fn get_element(&self) -> Option<&'a dyn HasStreamLock>; fn element(&self) -> Option<&'a dyn HasStreamLock>;
fn get_element_as_ptr(&self) -> *const gst::ffi::GstElement; fn element_as_ptr(&self) -> *const gst::ffi::GstElement;
} }
pub struct InNegotiation<'a> { pub struct InNegotiation<'a> {
@ -21,21 +21,21 @@ pub struct InNegotiation<'a> {
pub struct Readable {} pub struct Readable {}
impl<'a> VideoCodecStateContext<'a> for InNegotiation<'a> { impl<'a> VideoCodecStateContext<'a> for InNegotiation<'a> {
fn get_element(&self) -> Option<&'a dyn HasStreamLock> { fn element(&self) -> Option<&'a dyn HasStreamLock> {
Some(self.element) Some(self.element)
} }
fn get_element_as_ptr(&self) -> *const gst::ffi::GstElement { fn element_as_ptr(&self) -> *const gst::ffi::GstElement {
self.element.get_element_as_ptr() self.element.element_as_ptr()
} }
} }
impl<'a> VideoCodecStateContext<'a> for Readable { impl<'a> VideoCodecStateContext<'a> for Readable {
fn get_element(&self) -> Option<&'a dyn HasStreamLock> { fn element(&self) -> Option<&'a dyn HasStreamLock> {
None None
} }
fn get_element_as_ptr(&self) -> *const gst::ffi::GstElement { fn element_as_ptr(&self) -> *const gst::ffi::GstElement {
ptr::null() ptr::null()
} }
} }
@ -49,10 +49,10 @@ pub struct VideoCodecState<'a, T: VideoCodecStateContext<'a>> {
impl<'a, T: VideoCodecStateContext<'a>> fmt::Debug for VideoCodecState<'a, T> { impl<'a, T: VideoCodecStateContext<'a>> fmt::Debug for VideoCodecState<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoCodecState") f.debug_struct("VideoCodecState")
.field("info", &self.get_info()) .field("info", &self.info())
.field("caps", &self.get_caps()) .field("caps", &self.caps())
.field("codec_data", &self.get_codec_data()) .field("codec_data", &self.codec_data())
.field("allocation_caps", &self.get_allocation_caps()) .field("allocation_caps", &self.allocation_caps())
.finish() .finish()
} }
} }
@ -76,7 +76,7 @@ impl<'a> VideoCodecState<'a, InNegotiation<'a>> {
element: &'a T, element: &'a T,
) -> Self { ) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
let stream_lock = element.get_stream_lock(); let stream_lock = element.stream_lock();
glib::ffi::g_rec_mutex_lock(stream_lock); glib::ffi::g_rec_mutex_lock(stream_lock);
Self { Self {
state, state,
@ -87,14 +87,14 @@ impl<'a> VideoCodecState<'a, InNegotiation<'a>> {
} }
impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> { impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> {
pub fn get_info(&self) -> VideoInfo { pub fn info(&self) -> VideoInfo {
unsafe { unsafe {
let ptr = &((*self.as_mut_ptr()).info) as *const _ as usize as *mut _; let ptr = &((*self.as_mut_ptr()).info) as *const _ as usize as *mut _;
VideoInfo::from_glib_none(ptr) VideoInfo::from_glib_none(ptr)
} }
} }
pub fn get_caps(&self) -> Option<&gst::CapsRef> { pub fn caps(&self) -> Option<&gst::CapsRef> {
unsafe { unsafe {
let ptr = (*self.as_mut_ptr()).caps; let ptr = (*self.as_mut_ptr()).caps;
@ -106,7 +106,7 @@ impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> {
} }
} }
pub fn get_codec_data(&self) -> Option<&gst::BufferRef> { pub fn codec_data(&self) -> Option<&gst::BufferRef> {
unsafe { unsafe {
let ptr = (*self.as_mut_ptr()).codec_data; let ptr = (*self.as_mut_ptr()).codec_data;
@ -118,7 +118,7 @@ impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> {
} }
} }
pub fn get_allocation_caps(&self) -> Option<&gst::CapsRef> { pub fn allocation_caps(&self) -> Option<&gst::CapsRef> {
unsafe { unsafe {
let ptr = (*self.as_mut_ptr()).allocation_caps; let ptr = (*self.as_mut_ptr()).allocation_caps;
@ -138,8 +138,8 @@ impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> {
impl<'a, T: VideoCodecStateContext<'a>> Drop for VideoCodecState<'a, T> { impl<'a, T: VideoCodecStateContext<'a>> Drop for VideoCodecState<'a, T> {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
if let Some(element) = self.context.get_element() { if let Some(element) = self.context.element() {
let stream_lock = element.get_stream_lock(); let stream_lock = element.stream_lock();
glib::ffi::g_rec_mutex_unlock(stream_lock); glib::ffi::g_rec_mutex_unlock(stream_lock);
} }
ffi::gst_video_codec_state_unref(self.state); ffi::gst_video_codec_state_unref(self.state);

View file

@ -5,7 +5,7 @@ use std::mem;
use glib::translate::ToGlib; use glib::translate::ToGlib;
impl crate::VideoColorMatrix { impl crate::VideoColorMatrix {
pub fn get_kr_kb(&self) -> Result<(f64, f64), glib::BoolError> { pub fn kr_kb(&self) -> Result<(f64, f64), glib::BoolError> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
let mut kr = mem::MaybeUninit::uninit(); let mut kr = mem::MaybeUninit::uninit();

View file

@ -49,7 +49,7 @@ impl VideoConverter {
} }
} }
pub fn get_config(&self) -> VideoConverterConfig { pub fn config(&self) -> VideoConverterConfig {
unsafe { unsafe {
VideoConverterConfig( VideoConverterConfig(
gst::StructureRef::from_glib_borrow(ffi::gst_video_converter_get_config( gst::StructureRef::from_glib_borrow(ffi::gst_video_converter_get_config(
@ -127,7 +127,7 @@ impl convert::TryFrom<gst::Structure> for VideoConverterConfig {
fn try_from(v: gst::Structure) -> Result<VideoConverterConfig, Self::Error> { fn try_from(v: gst::Structure) -> Result<VideoConverterConfig, Self::Error> {
skip_assert_initialized!(); skip_assert_initialized!();
if v.get_name() == "GstVideoConverter" { if v.name() == "GstVideoConverter" {
Ok(VideoConverterConfig(v)) Ok(VideoConverterConfig(v))
} else { } else {
Err(glib::bool_error!("Structure is no VideoConverterConfig")) Err(glib::bool_error!("Structure is no VideoConverterConfig"))
@ -160,7 +160,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.resampler-method", &v); self.0.set("GstVideoConverter.resampler-method", &v);
} }
pub fn get_resampler_method(&self) -> crate::VideoResamplerMethod { pub fn resampler_method(&self) -> crate::VideoResamplerMethod {
self.0 self.0
.get_optional("GstVideoConverter.resampler-method") .get_optional("GstVideoConverter.resampler-method")
.expect("Wrong type") .expect("Wrong type")
@ -171,7 +171,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.chroma-resampler-method", &v); self.0.set("GstVideoConverter.chroma-resampler-method", &v);
} }
pub fn get_chroma_resampler_method(&self) -> crate::VideoResamplerMethod { pub fn chroma_resampler_method(&self) -> crate::VideoResamplerMethod {
self.0 self.0
.get_optional("GstVideoConverter.chroma-resampler-method") .get_optional("GstVideoConverter.chroma-resampler-method")
.expect("Wrong type") .expect("Wrong type")
@ -182,7 +182,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.resampler-taps", &v); self.0.set("GstVideoConverter.resampler-taps", &v);
} }
pub fn get_resampler_taps(&self) -> u32 { pub fn resampler_taps(&self) -> u32 {
self.0 self.0
.get_optional("GstVideoConverter.resampler-taps") .get_optional("GstVideoConverter.resampler-taps")
.expect("Wrong type") .expect("Wrong type")
@ -193,7 +193,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.dither-method", &v); self.0.set("GstVideoConverter.dither-method", &v);
} }
pub fn get_dither_method(&self) -> crate::VideoDitherMethod { pub fn dither_method(&self) -> crate::VideoDitherMethod {
self.0 self.0
.get_optional("GstVideoConverter.dither-method") .get_optional("GstVideoConverter.dither-method")
.expect("Wrong type") .expect("Wrong type")
@ -204,7 +204,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.dither-quantization", &v); self.0.set("GstVideoConverter.dither-quantization", &v);
} }
pub fn get_dither_quantization(&self) -> u32 { pub fn dither_quantization(&self) -> u32 {
self.0 self.0
.get_optional("GstVideoConverter.dither-quantization") .get_optional("GstVideoConverter.dither-quantization")
.expect("Wrong type") .expect("Wrong type")
@ -215,7 +215,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.src-x", &v); self.0.set("GstVideoConverter.src-x", &v);
} }
pub fn get_src_x(&self) -> i32 { pub fn src_x(&self) -> i32 {
self.0 self.0
.get_optional("GstVideoConverter.src-x") .get_optional("GstVideoConverter.src-x")
.expect("Wrong type") .expect("Wrong type")
@ -226,7 +226,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.src-y", &v); self.0.set("GstVideoConverter.src-y", &v);
} }
pub fn get_src_y(&self) -> i32 { pub fn src_y(&self) -> i32 {
self.0 self.0
.get_optional("GstVideoConverter.src-y") .get_optional("GstVideoConverter.src-y")
.expect("Wrong type") .expect("Wrong type")
@ -241,7 +241,7 @@ impl VideoConverterConfig {
} }
} }
pub fn get_src_width(&self) -> Option<i32> { pub fn src_width(&self) -> Option<i32> {
self.0 self.0
.get_optional("GstVideoConverter.src-width") .get_optional("GstVideoConverter.src-width")
.expect("Wrong type") .expect("Wrong type")
@ -255,7 +255,7 @@ impl VideoConverterConfig {
} }
} }
pub fn get_src_height(&self) -> Option<i32> { pub fn src_height(&self) -> Option<i32> {
self.0 self.0
.get_optional("GstVideoConverter.src-height") .get_optional("GstVideoConverter.src-height")
.expect("Wrong type") .expect("Wrong type")
@ -265,7 +265,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.dest-x", &v); self.0.set("GstVideoConverter.dest-x", &v);
} }
pub fn get_dest_x(&self) -> i32 { pub fn dest_x(&self) -> i32 {
self.0 self.0
.get_optional("GstVideoConverter.dest-x") .get_optional("GstVideoConverter.dest-x")
.expect("Wrong type") .expect("Wrong type")
@ -276,7 +276,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.dest-y", &v); self.0.set("GstVideoConverter.dest-y", &v);
} }
pub fn get_dest_y(&self) -> i32 { pub fn dest_y(&self) -> i32 {
self.0 self.0
.get_optional("GstVideoConverter.dest-y") .get_optional("GstVideoConverter.dest-y")
.expect("Wrong type") .expect("Wrong type")
@ -291,7 +291,7 @@ impl VideoConverterConfig {
} }
} }
pub fn get_dest_width(&self) -> Option<i32> { pub fn dest_width(&self) -> Option<i32> {
self.0 self.0
.get_optional("GstVideoConverter.dest-width") .get_optional("GstVideoConverter.dest-width")
.expect("Wrong type") .expect("Wrong type")
@ -305,7 +305,7 @@ impl VideoConverterConfig {
} }
} }
pub fn get_dest_height(&self) -> Option<i32> { pub fn dest_height(&self) -> Option<i32> {
self.0 self.0
.get_optional("GstVideoConverter.dest-height") .get_optional("GstVideoConverter.dest-height")
.expect("Wrong type") .expect("Wrong type")
@ -315,7 +315,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.fill-border", &v); self.0.set("GstVideoConverter.fill-border", &v);
} }
pub fn get_fill_border(&self) -> bool { pub fn fills_border(&self) -> bool {
self.0 self.0
.get_optional("GstVideoConverter.fill-border") .get_optional("GstVideoConverter.fill-border")
.expect("Wrong type") .expect("Wrong type")
@ -326,7 +326,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.alpha-value", &v); self.0.set("GstVideoConverter.alpha-value", &v);
} }
pub fn get_alpha_value(&self) -> f64 { pub fn alpha_value(&self) -> f64 {
self.0 self.0
.get_optional("GstVideoConverter.alpha-value") .get_optional("GstVideoConverter.alpha-value")
.expect("Wrong type") .expect("Wrong type")
@ -337,7 +337,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.alpha-mode", &v); self.0.set("GstVideoConverter.alpha-mode", &v);
} }
pub fn get_alpha_mode(&self) -> crate::VideoAlphaMode { pub fn alpha_mode(&self) -> crate::VideoAlphaMode {
self.0 self.0
.get_optional("GstVideoConverter.alpha-mode") .get_optional("GstVideoConverter.alpha-mode")
.expect("Wrong type") .expect("Wrong type")
@ -348,7 +348,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.border-argb", &v); self.0.set("GstVideoConverter.border-argb", &v);
} }
pub fn get_border_argb(&self) -> u32 { pub fn border_argb(&self) -> u32 {
self.0 self.0
.get_optional("GstVideoConverter.border-argb") .get_optional("GstVideoConverter.border-argb")
.expect("Wrong type") .expect("Wrong type")
@ -359,7 +359,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.chroma-mode", &v); self.0.set("GstVideoConverter.chroma-mode", &v);
} }
pub fn get_chroma_mode(&self) -> crate::VideoChromaMode { pub fn chroma_mode(&self) -> crate::VideoChromaMode {
self.0 self.0
.get_optional("GstVideoConverter.chroma-mode") .get_optional("GstVideoConverter.chroma-mode")
.expect("Wrong type") .expect("Wrong type")
@ -370,7 +370,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.matrix-mode", &v); self.0.set("GstVideoConverter.matrix-mode", &v);
} }
pub fn get_matrix_mode(&self) -> crate::VideoMatrixMode { pub fn matrix_mode(&self) -> crate::VideoMatrixMode {
self.0 self.0
.get_optional("GstVideoConverter.matrix-mode") .get_optional("GstVideoConverter.matrix-mode")
.expect("Wrong type") .expect("Wrong type")
@ -381,7 +381,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.gamma-mode", &v); self.0.set("GstVideoConverter.gamma-mode", &v);
} }
pub fn get_gamma_mode(&self) -> crate::VideoGammaMode { pub fn gamma_mode(&self) -> crate::VideoGammaMode {
self.0 self.0
.get_optional("GstVideoConverter.gamma-mode") .get_optional("GstVideoConverter.gamma-mode")
.expect("Wrong type") .expect("Wrong type")
@ -392,7 +392,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.primaries-mode", &v); self.0.set("GstVideoConverter.primaries-mode", &v);
} }
pub fn get_primaries_mode(&self) -> crate::VideoPrimariesMode { pub fn primaries_mode(&self) -> crate::VideoPrimariesMode {
self.0 self.0
.get_optional("GstVideoConverter.primaries-mode") .get_optional("GstVideoConverter.primaries-mode")
.expect("Wrong type") .expect("Wrong type")
@ -403,7 +403,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.threads", &v); self.0.set("GstVideoConverter.threads", &v);
} }
pub fn get_threads(&self) -> u32 { pub fn threads(&self) -> u32 {
self.0 self.0
.get_optional("GstVideoConverter.threads") .get_optional("GstVideoConverter.threads")
.expect("Wrong type") .expect("Wrong type")

View file

@ -37,20 +37,20 @@ pub trait VideoDecoderExtManual: 'static {
) -> Result<gst::FlowSuccess, gst::FlowError>; ) -> Result<gst::FlowSuccess, gst::FlowError>;
fn get_frame(&self, frame_number: i32) -> Option<VideoCodecFrame>; fn get_frame(&self, frame_number: i32) -> Option<VideoCodecFrame>;
fn get_frames(&self) -> Vec<VideoCodecFrame>; fn frames(&self) -> Vec<VideoCodecFrame>;
fn get_oldest_frame(&self) -> Option<VideoCodecFrame>; fn oldest_frame(&self) -> Option<VideoCodecFrame>;
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError>; fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError>;
fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>; fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
fn release_frame(&self, frame: VideoCodecFrame); fn release_frame(&self, frame: VideoCodecFrame);
fn drop_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>; fn drop_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime); fn latency(&self) -> (gst::ClockTime, gst::ClockTime);
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime); fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime);
fn get_output_state(&self) -> Option<VideoCodecState<'static, Readable>>; fn output_state(&self) -> Option<VideoCodecState<'static, Readable>>;
fn set_output_state( fn set_output_state(
&self, &self,
fmt: VideoFormat, fmt: VideoFormat,
@ -106,7 +106,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
ret.into_result() ret.into_result()
} }
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) { fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe { unsafe {
let mut allocator = ptr::null_mut(); let mut allocator = ptr::null_mut();
let mut params = mem::zeroed(); let mut params = mem::zeroed();
@ -154,7 +154,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
ret.into_result() ret.into_result()
} }
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime) { fn latency(&self) -> (gst::ClockTime, gst::ClockTime) {
let mut min_latency = gst::ffi::GST_CLOCK_TIME_NONE; let mut min_latency = gst::ffi::GST_CLOCK_TIME_NONE;
let mut max_latency = gst::ffi::GST_CLOCK_TIME_NONE; let mut max_latency = gst::ffi::GST_CLOCK_TIME_NONE;
@ -191,7 +191,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
} }
} }
fn get_frames(&self) -> Vec<VideoCodecFrame> { fn frames(&self) -> Vec<VideoCodecFrame> {
unsafe { unsafe {
let frames = ffi::gst_video_decoder_get_frames(self.as_ref().to_glib_none().0); let frames = ffi::gst_video_decoder_get_frames(self.as_ref().to_glib_none().0);
let mut iter: *const glib::ffi::GList = frames; let mut iter: *const glib::ffi::GList = frames;
@ -210,7 +210,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
} }
} }
fn get_oldest_frame(&self) -> Option<VideoCodecFrame> { fn oldest_frame(&self) -> Option<VideoCodecFrame> {
let frame = let frame =
unsafe { ffi::gst_video_decoder_get_oldest_frame(self.as_ref().to_glib_none().0) }; unsafe { ffi::gst_video_decoder_get_oldest_frame(self.as_ref().to_glib_none().0) };
@ -221,7 +221,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
} }
} }
fn get_output_state(&self) -> Option<VideoCodecState<'static, Readable>> { fn output_state(&self) -> Option<VideoCodecState<'static, Readable>> {
let state = let state =
unsafe { ffi::gst_video_decoder_get_output_state(self.as_ref().to_glib_none().0) }; unsafe { ffi::gst_video_decoder_get_output_state(self.as_ref().to_glib_none().0) };
@ -298,7 +298,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
) -> Result<(), gst::FlowError> { ) -> Result<(), gst::FlowError> {
// Consume output_state so user won't be able to modify it anymore // Consume output_state so user won't be able to modify it anymore
let self_ptr = self.to_glib_none().0 as *const gst::ffi::GstElement; let self_ptr = self.to_glib_none().0 as *const gst::ffi::GstElement;
assert_eq!(output_state.context.get_element_as_ptr(), self_ptr); assert_eq!(output_state.context.element_as_ptr(), self_ptr);
let ret = unsafe { let ret = unsafe {
from_glib(ffi::gst_video_decoder_negotiate( from_glib(ffi::gst_video_decoder_negotiate(
@ -339,12 +339,12 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
} }
impl HasStreamLock for VideoDecoder { impl HasStreamLock for VideoDecoder {
fn get_stream_lock(&self) -> *mut glib::ffi::GRecMutex { fn stream_lock(&self) -> *mut glib::ffi::GRecMutex {
let decoder_sys: *const ffi::GstVideoDecoder = self.to_glib_none().0; let decoder_sys: *const ffi::GstVideoDecoder = self.to_glib_none().0;
unsafe { &(*decoder_sys).stream_lock as *const _ as usize as *mut _ } unsafe { &(*decoder_sys).stream_lock as *const _ as usize as *mut _ }
} }
fn get_element_as_ptr(&self) -> *const gst::ffi::GstElement { fn element_as_ptr(&self) -> *const gst::ffi::GstElement {
let decoder_sys: *const ffi::GstVideoDecoder = self.to_glib_none().0; let decoder_sys: *const ffi::GstVideoDecoder = self.to_glib_none().0;
decoder_sys as *const gst::ffi::GstElement decoder_sys as *const gst::ffi::GstElement
} }

View file

@ -19,10 +19,10 @@ pub trait VideoEncoderExtManual: 'static {
) -> Result<gst::FlowSuccess, gst::FlowError>; ) -> Result<gst::FlowSuccess, gst::FlowError>;
fn get_frame(&self, frame_number: i32) -> Option<VideoCodecFrame>; fn get_frame(&self, frame_number: i32) -> Option<VideoCodecFrame>;
fn get_frames(&self) -> Vec<VideoCodecFrame>; fn frames(&self) -> Vec<VideoCodecFrame>;
fn get_oldest_frame(&self) -> Option<VideoCodecFrame>; fn oldest_frame(&self) -> Option<VideoCodecFrame>;
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn finish_frame( fn finish_frame(
&self, &self,
@ -33,10 +33,10 @@ pub trait VideoEncoderExtManual: 'static {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>; fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime); fn latency(&self) -> (gst::ClockTime, gst::ClockTime);
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime); fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime);
fn get_output_state(&self) -> Option<VideoCodecState<'static, Readable>>; fn output_state(&self) -> Option<VideoCodecState<'static, Readable>>;
fn set_output_state( fn set_output_state(
&self, &self,
caps: gst::Caps, caps: gst::Caps,
@ -67,7 +67,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
ret.into_result() ret.into_result()
} }
fn get_allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) { fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
unsafe { unsafe {
let mut allocator = ptr::null_mut(); let mut allocator = ptr::null_mut();
let mut params = mem::zeroed(); let mut params = mem::zeroed();
@ -105,7 +105,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
ret.into_result() ret.into_result()
} }
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime) { fn latency(&self) -> (gst::ClockTime, gst::ClockTime) {
let mut min_latency = gst::ffi::GST_CLOCK_TIME_NONE; let mut min_latency = gst::ffi::GST_CLOCK_TIME_NONE;
let mut max_latency = gst::ffi::GST_CLOCK_TIME_NONE; let mut max_latency = gst::ffi::GST_CLOCK_TIME_NONE;
@ -142,7 +142,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
} }
} }
fn get_frames(&self) -> Vec<VideoCodecFrame> { fn frames(&self) -> Vec<VideoCodecFrame> {
unsafe { unsafe {
let frames = ffi::gst_video_encoder_get_frames(self.as_ref().to_glib_none().0); let frames = ffi::gst_video_encoder_get_frames(self.as_ref().to_glib_none().0);
let mut iter: *const glib::ffi::GList = frames; let mut iter: *const glib::ffi::GList = frames;
@ -161,7 +161,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
} }
} }
fn get_oldest_frame(&self) -> Option<VideoCodecFrame> { fn oldest_frame(&self) -> Option<VideoCodecFrame> {
let frame = let frame =
unsafe { ffi::gst_video_encoder_get_oldest_frame(self.as_ref().to_glib_none().0) }; unsafe { ffi::gst_video_encoder_get_oldest_frame(self.as_ref().to_glib_none().0) };
@ -172,7 +172,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
} }
} }
fn get_output_state(&self) -> Option<VideoCodecState<'static, Readable>> { fn output_state(&self) -> Option<VideoCodecState<'static, Readable>> {
let state = let state =
unsafe { ffi::gst_video_encoder_get_output_state(self.as_ref().to_glib_none().0) }; unsafe { ffi::gst_video_encoder_get_output_state(self.as_ref().to_glib_none().0) };
@ -213,7 +213,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
) -> Result<(), gst::FlowError> { ) -> Result<(), gst::FlowError> {
// Consume output_state so user won't be able to modify it anymore // Consume output_state so user won't be able to modify it anymore
let self_ptr = self.to_glib_none().0 as *const gst::ffi::GstElement; let self_ptr = self.to_glib_none().0 as *const gst::ffi::GstElement;
assert_eq!(output_state.context.get_element_as_ptr(), self_ptr); assert_eq!(output_state.context.element_as_ptr(), self_ptr);
let ret = unsafe { let ret = unsafe {
from_glib(ffi::gst_video_encoder_negotiate( from_glib(ffi::gst_video_encoder_negotiate(
@ -229,12 +229,12 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
} }
impl HasStreamLock for VideoEncoder { impl HasStreamLock for VideoEncoder {
fn get_stream_lock(&self) -> *mut glib::ffi::GRecMutex { fn stream_lock(&self) -> *mut glib::ffi::GRecMutex {
let encoder_sys: *const ffi::GstVideoEncoder = self.to_glib_none().0; let encoder_sys: *const ffi::GstVideoEncoder = self.to_glib_none().0;
unsafe { &(*encoder_sys).stream_lock as *const _ as usize as *mut _ } unsafe { &(*encoder_sys).stream_lock as *const _ as usize as *mut _ }
} }
fn get_element_as_ptr(&self) -> *const gst::ffi::GstElement { fn element_as_ptr(&self) -> *const gst::ffi::GstElement {
let encoder_sys: *const ffi::GstVideoEncoder = self.to_glib_none().0; let encoder_sys: *const ffi::GstVideoEncoder = self.to_glib_none().0;
encoder_sys as *const gst::ffi::GstElement encoder_sys as *const gst::ffi::GstElement
} }

View file

@ -804,13 +804,13 @@ impl<T> Drop for VideoFrameRef<T> {
} }
pub trait VideoBufferExt { pub trait VideoBufferExt {
fn get_video_flags(&self) -> crate::VideoBufferFlags; fn video_flags(&self) -> crate::VideoBufferFlags;
fn set_video_flags(&mut self, flags: crate::VideoBufferFlags); fn set_video_flags(&mut self, flags: crate::VideoBufferFlags);
fn unset_video_flags(&mut self, flags: crate::VideoBufferFlags); fn unset_video_flags(&mut self, flags: crate::VideoBufferFlags);
} }
impl VideoBufferExt for gst::BufferRef { impl VideoBufferExt for gst::BufferRef {
fn get_video_flags(&self) -> crate::VideoBufferFlags { fn video_flags(&self) -> crate::VideoBufferFlags {
unsafe { unsafe {
let ptr = self.as_mut_ptr(); let ptr = self.as_mut_ptr();
crate::VideoBufferFlags::from_bits_truncate((*ptr).mini_object.flags) crate::VideoBufferFlags::from_bits_truncate((*ptr).mini_object.flags)

View file

@ -749,7 +749,7 @@ impl VideoInfo {
let mut dest_val = mem::MaybeUninit::uninit(); let mut dest_val = mem::MaybeUninit::uninit();
if from_glib(ffi::gst_video_info_convert( if from_glib(ffi::gst_video_info_convert(
&self.0 as *const _ as *mut _, &self.0 as *const _ as *mut _,
src_val.get_format().to_glib(), src_val.format().to_glib(),
src_val.to_raw_value(), src_val.to_raw_value(),
U::get_default_format().to_glib(), U::get_default_format().to_glib(),
dest_val.as_mut_ptr(), dest_val.as_mut_ptr(),
@ -773,7 +773,7 @@ impl VideoInfo {
let mut dest_val = mem::MaybeUninit::uninit(); let mut dest_val = mem::MaybeUninit::uninit();
if from_glib(ffi::gst_video_info_convert( if from_glib(ffi::gst_video_info_convert(
&self.0 as *const _ as *mut _, &self.0 as *const _ as *mut _,
src_val.get_format().to_glib(), src_val.format().to_glib(),
src_val.to_raw_value(), src_val.to_raw_value(),
dest_fmt.to_glib(), dest_fmt.to_glib(),
dest_val.as_mut_ptr(), dest_val.as_mut_ptr(),

View file

@ -32,10 +32,10 @@ impl VideoMeta {
return Err(glib::bool_error!("Invalid video info")); return Err(glib::bool_error!("Invalid video info"));
} }
if buffer.get_size() < info.size() { if buffer.size() < info.size() {
return Err(glib::bool_error!( return Err(glib::bool_error!(
"Buffer smaller than required frame size ({} < {})", "Buffer smaller than required frame size ({} < {})",
buffer.get_size(), buffer.size(),
info.size() info.size()
)); ));
} }
@ -82,10 +82,10 @@ impl VideoMeta {
return Err(glib::bool_error!("Invalid video info")); return Err(glib::bool_error!("Invalid video info"));
} }
if buffer.get_size() < info.size() { if buffer.size() < info.size() {
return Err(glib::bool_error!( return Err(glib::bool_error!(
"Buffer smaller than required frame size ({} < {})", "Buffer smaller than required frame size ({} < {})",
buffer.get_size(), buffer.size(),
info.size() info.size()
)); ));
} }
@ -110,41 +110,41 @@ impl VideoMeta {
} }
} }
pub fn get_flags(&self) -> crate::VideoFrameFlags { pub fn flags(&self) -> crate::VideoFrameFlags {
unsafe { from_glib(self.0.flags) } unsafe { from_glib(self.0.flags) }
} }
pub fn get_format(&self) -> crate::VideoFormat { pub fn format(&self) -> crate::VideoFormat {
unsafe { from_glib(self.0.format) } unsafe { from_glib(self.0.format) }
} }
pub fn get_id(&self) -> i32 { pub fn id(&self) -> i32 {
self.0.id self.0.id
} }
pub fn get_width(&self) -> u32 { pub fn width(&self) -> u32 {
self.0.width self.0.width
} }
pub fn get_height(&self) -> u32 { pub fn height(&self) -> u32 {
self.0.height self.0.height
} }
pub fn get_n_planes(&self) -> u32 { pub fn n_planes(&self) -> u32 {
self.0.n_planes self.0.n_planes
} }
pub fn get_offset(&self) -> &[usize] { pub fn offset(&self) -> &[usize] {
&self.0.offset[0..(self.0.n_planes as usize)] &self.0.offset[0..(self.0.n_planes as usize)]
} }
pub fn get_stride(&self) -> &[i32] { pub fn stride(&self) -> &[i32] {
&self.0.stride[0..(self.0.n_planes as usize)] &self.0.stride[0..(self.0.n_planes as usize)]
} }
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
pub fn get_alignment(&self) -> crate::VideoAlignment { pub fn alignment(&self) -> crate::VideoAlignment {
crate::VideoAlignment::new( crate::VideoAlignment::new(
self.0.alignment.padding_top, self.0.alignment.padding_top,
self.0.alignment.padding_bottom, self.0.alignment.padding_bottom,
@ -156,7 +156,7 @@ impl VideoMeta {
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
pub fn get_plane_size(&self) -> Result<[usize; crate::VIDEO_MAX_PLANES], glib::BoolError> { pub fn plane_size(&self) -> Result<[usize; crate::VIDEO_MAX_PLANES], glib::BoolError> {
let mut plane_size = [0; crate::VIDEO_MAX_PLANES]; let mut plane_size = [0; crate::VIDEO_MAX_PLANES];
unsafe { unsafe {
@ -174,7 +174,7 @@ impl VideoMeta {
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
pub fn get_plane_height(&self) -> Result<[u32; crate::VIDEO_MAX_PLANES], glib::BoolError> { pub fn plane_height(&self) -> Result<[u32; crate::VIDEO_MAX_PLANES], glib::BoolError> {
let mut plane_height = [0; crate::VIDEO_MAX_PLANES]; let mut plane_height = [0; crate::VIDEO_MAX_PLANES];
unsafe { unsafe {
@ -216,14 +216,14 @@ unsafe impl MetaAPI for VideoMeta {
impl fmt::Debug for VideoMeta { impl fmt::Debug for VideoMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoMeta") f.debug_struct("VideoMeta")
.field("id", &self.get_id()) .field("id", &self.id())
.field("flags", &self.get_flags()) .field("flags", &self.flags())
.field("format", &self.get_format()) .field("format", &self.format())
.field("width", &self.get_width()) .field("width", &self.width())
.field("height", &self.get_height()) .field("height", &self.height())
.field("n_planes", &self.get_n_planes()) .field("n_planes", &self.n_planes())
.field("offset", &self.get_offset()) .field("offset", &self.offset())
.field("stride", &self.get_stride()) .field("stride", &self.stride())
.finish() .finish()
} }
} }
@ -259,7 +259,7 @@ impl VideoCropMeta {
} }
} }
pub fn get_rect(&self) -> (u32, u32, u32, u32) { pub fn rect(&self) -> (u32, u32, u32, u32) {
(self.0.x, self.0.y, self.0.width, self.0.height) (self.0.x, self.0.y, self.0.width, self.0.height)
} }
@ -282,7 +282,7 @@ unsafe impl MetaAPI for VideoCropMeta {
impl fmt::Debug for VideoCropMeta { impl fmt::Debug for VideoCropMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoCropMeta") f.debug_struct("VideoCropMeta")
.field("rect", &self.get_rect()) .field("rect", &self.rect())
.finish() .finish()
} }
} }
@ -314,24 +314,24 @@ impl VideoRegionOfInterestMeta {
} }
} }
pub fn get_rect(&self) -> (u32, u32, u32, u32) { pub fn rect(&self) -> (u32, u32, u32, u32) {
(self.0.x, self.0.y, self.0.w, self.0.h) (self.0.x, self.0.y, self.0.w, self.0.h)
} }
pub fn get_id(&self) -> i32 { pub fn id(&self) -> i32 {
self.0.id self.0.id
} }
pub fn get_parent_id(&self) -> i32 { pub fn parent_id(&self) -> i32 {
self.0.parent_id self.0.parent_id
} }
pub fn get_roi_type<'a>(&self) -> &'a str { pub fn roi_type<'a>(&self) -> &'a str {
unsafe { glib::Quark::from_glib(self.0.roi_type).to_string() } unsafe { glib::Quark::from_glib(self.0.roi_type).to_string() }
} }
#[cfg(feature = "v1_14")] #[cfg(feature = "v1_14")]
pub fn get_params(&self) -> ParamsIter { pub fn params(&self) -> ParamsIter {
ParamsIter { ParamsIter {
_meta: self, _meta: self,
list: self.0.params, list: self.0.params,
@ -340,7 +340,7 @@ impl VideoRegionOfInterestMeta {
#[cfg(feature = "v1_14")] #[cfg(feature = "v1_14")]
pub fn get_param<'b>(&self, name: &'b str) -> Option<&gst::StructureRef> { pub fn get_param<'b>(&self, name: &'b str) -> Option<&gst::StructureRef> {
self.get_params().find(|s| s.get_name() == name) self.params().find(|s| s.name() == name)
} }
pub fn set_rect(&mut self, rect: (u32, u32, u32, u32)) { pub fn set_rect(&mut self, rect: (u32, u32, u32, u32)) {
@ -405,14 +405,14 @@ impl fmt::Debug for VideoRegionOfInterestMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut f = f.debug_struct("VideoRegionOfInterestMeta"); let mut f = f.debug_struct("VideoRegionOfInterestMeta");
f.field("roi_type", &self.get_roi_type()) f.field("roi_type", &self.roi_type())
.field("rect", &self.get_rect()) .field("rect", &self.rect())
.field("id", &self.get_id()) .field("id", &self.id())
.field("parent_id", &self.get_parent_id()); .field("parent_id", &self.parent_id());
#[cfg(feature = "v1_14")] #[cfg(feature = "v1_14")]
{ {
f.field("params", &self.get_params().collect::<Vec<_>>()); f.field("params", &self.params().collect::<Vec<_>>());
} }
f.finish() f.finish()
@ -447,7 +447,7 @@ impl VideoAffineTransformationMeta {
} }
} }
pub fn get_matrix(&self) -> &[f32; 16] { pub fn matrix(&self) -> &[f32; 16] {
&self.0.matrix &self.0.matrix
} }
@ -473,7 +473,7 @@ unsafe impl MetaAPI for VideoAffineTransformationMeta {
impl fmt::Debug for VideoAffineTransformationMeta { impl fmt::Debug for VideoAffineTransformationMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoAffineTransformationMeta") f.debug_struct("VideoAffineTransformationMeta")
.field("matrix", &self.get_matrix()) .field("matrix", &self.matrix())
.finish() .finish()
} }
} }
@ -500,12 +500,12 @@ impl VideoOverlayCompositionMeta {
} }
} }
pub fn get_overlay(&self) -> &crate::VideoOverlayCompositionRef { pub fn overlay(&self) -> &crate::VideoOverlayCompositionRef {
unsafe { crate::VideoOverlayCompositionRef::from_ptr(self.0.overlay) } unsafe { crate::VideoOverlayCompositionRef::from_ptr(self.0.overlay) }
} }
pub fn get_overlay_owned(&self) -> crate::VideoOverlayComposition { pub fn overlay_owned(&self) -> crate::VideoOverlayComposition {
unsafe { from_glib_none(self.get_overlay().as_ptr()) } unsafe { from_glib_none(self.overlay().as_ptr()) }
} }
pub fn set_overlay(&mut self, overlay: &crate::VideoOverlayComposition) { pub fn set_overlay(&mut self, overlay: &crate::VideoOverlayComposition) {
@ -529,7 +529,7 @@ unsafe impl MetaAPI for VideoOverlayCompositionMeta {
impl fmt::Debug for VideoOverlayCompositionMeta { impl fmt::Debug for VideoOverlayCompositionMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoOverlayCompositionMeta") f.debug_struct("VideoOverlayCompositionMeta")
.field("overlay", &self.get_overlay()) .field("overlay", &self.overlay())
.finish() .finish()
} }
} }
@ -568,11 +568,11 @@ impl VideoCaptionMeta {
} }
} }
pub fn get_caption_type(&self) -> crate::VideoCaptionType { pub fn caption_type(&self) -> crate::VideoCaptionType {
unsafe { from_glib(self.0.caption_type) } unsafe { from_glib(self.0.caption_type) }
} }
pub fn get_data(&self) -> &[u8] { pub fn data(&self) -> &[u8] {
unsafe { unsafe {
use std::slice; use std::slice;
@ -596,8 +596,8 @@ unsafe impl MetaAPI for VideoCaptionMeta {
impl fmt::Debug for VideoCaptionMeta { impl fmt::Debug for VideoCaptionMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoCaptionMeta") f.debug_struct("VideoCaptionMeta")
.field("caption_type", &self.get_caption_type()) .field("caption_type", &self.caption_type())
.field("data", &self.get_data()) .field("data", &self.data())
.finish() .finish()
} }
} }
@ -637,15 +637,15 @@ impl VideoAFDMeta {
} }
} }
pub fn get_field(&self) -> u8 { pub fn field(&self) -> u8 {
self.0.field self.0.field
} }
pub fn get_spec(&self) -> crate::VideoAFDSpec { pub fn spec(&self) -> crate::VideoAFDSpec {
unsafe { from_glib(self.0.spec) } unsafe { from_glib(self.0.spec) }
} }
pub fn get_afd(&self) -> crate::VideoAFDValue { pub fn afd(&self) -> crate::VideoAFDValue {
unsafe { from_glib(self.0.afd) } unsafe { from_glib(self.0.afd) }
} }
} }
@ -665,9 +665,9 @@ unsafe impl MetaAPI for VideoAFDMeta {
impl fmt::Debug for VideoAFDMeta { impl fmt::Debug for VideoAFDMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoAFDMeta") f.debug_struct("VideoAFDMeta")
.field("field", &self.get_field()) .field("field", &self.field())
.field("spec", &self.get_spec()) .field("spec", &self.spec())
.field("afd", &self.get_afd()) .field("afd", &self.afd())
.finish() .finish()
} }
} }
@ -709,7 +709,7 @@ impl VideoBarMeta {
} }
} }
pub fn get_field(&self) -> u8 { pub fn field(&self) -> u8 {
self.0.field self.0.field
} }
@ -717,11 +717,11 @@ impl VideoBarMeta {
unsafe { from_glib(self.0.is_letterbox) } unsafe { from_glib(self.0.is_letterbox) }
} }
pub fn get_bar_data1(&self) -> u32 { pub fn bar_data1(&self) -> u32 {
self.0.bar_data1 self.0.bar_data1
} }
pub fn get_bar_data2(&self) -> u32 { pub fn bar_data2(&self) -> u32 {
self.0.bar_data2 self.0.bar_data2
} }
} }
@ -741,10 +741,10 @@ unsafe impl MetaAPI for VideoBarMeta {
impl fmt::Debug for VideoBarMeta { impl fmt::Debug for VideoBarMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoBarMeta") f.debug_struct("VideoBarMeta")
.field("field", &self.get_field()) .field("field", &self.field())
.field("is_letterbox", &self.is_letterbox()) .field("is_letterbox", &self.is_letterbox())
.field("bar_data1", &self.get_bar_data1()) .field("bar_data1", &self.bar_data1())
.field("bar_data2", &self.get_bar_data2()) .field("bar_data2", &self.bar_data2())
.finish() .finish()
} }
} }
@ -767,26 +767,26 @@ mod tests {
240, 240,
) )
.unwrap(); .unwrap();
assert_eq!(meta.get_id(), 0); assert_eq!(meta.id(), 0);
assert_eq!(meta.get_flags(), crate::VideoFrameFlags::empty()); assert_eq!(meta.flags(), crate::VideoFrameFlags::empty());
assert_eq!(meta.get_format(), crate::VideoFormat::Argb); assert_eq!(meta.format(), crate::VideoFormat::Argb);
assert_eq!(meta.get_width(), 320); assert_eq!(meta.width(), 320);
assert_eq!(meta.get_height(), 240); assert_eq!(meta.height(), 240);
assert_eq!(meta.get_n_planes(), 1); assert_eq!(meta.n_planes(), 1);
assert_eq!(meta.get_offset(), &[0]); assert_eq!(meta.offset(), &[0]);
assert_eq!(meta.get_stride(), &[320 * 4]); assert_eq!(meta.stride(), &[320 * 4]);
} }
{ {
let meta = buffer.get_meta::<VideoMeta>().unwrap(); let meta = buffer.get_meta::<VideoMeta>().unwrap();
assert_eq!(meta.get_id(), 0); assert_eq!(meta.id(), 0);
assert_eq!(meta.get_flags(), crate::VideoFrameFlags::empty()); assert_eq!(meta.flags(), crate::VideoFrameFlags::empty());
assert_eq!(meta.get_format(), crate::VideoFormat::Argb); assert_eq!(meta.format(), crate::VideoFormat::Argb);
assert_eq!(meta.get_width(), 320); assert_eq!(meta.width(), 320);
assert_eq!(meta.get_height(), 240); assert_eq!(meta.height(), 240);
assert_eq!(meta.get_n_planes(), 1); assert_eq!(meta.n_planes(), 1);
assert_eq!(meta.get_offset(), &[0]); assert_eq!(meta.offset(), &[0]);
assert_eq!(meta.get_stride(), &[320 * 4]); assert_eq!(meta.stride(), &[320 * 4]);
} }
} }
@ -806,26 +806,26 @@ mod tests {
&[320 * 4], &[320 * 4],
) )
.unwrap(); .unwrap();
assert_eq!(meta.get_id(), 0); assert_eq!(meta.id(), 0);
assert_eq!(meta.get_flags(), crate::VideoFrameFlags::empty()); assert_eq!(meta.flags(), crate::VideoFrameFlags::empty());
assert_eq!(meta.get_format(), crate::VideoFormat::Argb); assert_eq!(meta.format(), crate::VideoFormat::Argb);
assert_eq!(meta.get_width(), 320); assert_eq!(meta.width(), 320);
assert_eq!(meta.get_height(), 240); assert_eq!(meta.height(), 240);
assert_eq!(meta.get_n_planes(), 1); assert_eq!(meta.n_planes(), 1);
assert_eq!(meta.get_offset(), &[0]); assert_eq!(meta.offset(), &[0]);
assert_eq!(meta.get_stride(), &[320 * 4]); assert_eq!(meta.stride(), &[320 * 4]);
} }
{ {
let meta = buffer.get_meta::<VideoMeta>().unwrap(); let meta = buffer.get_meta::<VideoMeta>().unwrap();
assert_eq!(meta.get_id(), 0); assert_eq!(meta.id(), 0);
assert_eq!(meta.get_flags(), crate::VideoFrameFlags::empty()); assert_eq!(meta.flags(), crate::VideoFrameFlags::empty());
assert_eq!(meta.get_format(), crate::VideoFormat::Argb); assert_eq!(meta.format(), crate::VideoFormat::Argb);
assert_eq!(meta.get_width(), 320); assert_eq!(meta.width(), 320);
assert_eq!(meta.get_height(), 240); assert_eq!(meta.height(), 240);
assert_eq!(meta.get_n_planes(), 1); assert_eq!(meta.n_planes(), 1);
assert_eq!(meta.get_offset(), &[0]); assert_eq!(meta.offset(), &[0]);
assert_eq!(meta.get_stride(), &[320 * 4]); assert_eq!(meta.stride(), &[320 * 4]);
} }
} }
@ -844,11 +844,11 @@ mod tests {
) )
.unwrap(); .unwrap();
let alig = meta.get_alignment(); let alig = meta.alignment();
assert_eq!(alig, crate::VideoAlignment::new(0, 0, 0, 0, &[0, 0, 0, 0])); assert_eq!(alig, crate::VideoAlignment::new(0, 0, 0, 0, &[0, 0, 0, 0]));
assert_eq!(meta.get_plane_size().unwrap(), [76800, 38400, 0, 0]); assert_eq!(meta.plane_size().unwrap(), [76800, 38400, 0, 0]);
assert_eq!(meta.get_plane_height().unwrap(), [240, 120, 0, 0]); assert_eq!(meta.plane_height().unwrap(), [240, 120, 0, 0]);
/* horizontal padding */ /* horizontal padding */
let mut info = crate::VideoInfo::builder(crate::VideoFormat::Nv12, 320, 240) let mut info = crate::VideoInfo::builder(crate::VideoFormat::Nv12, 320, 240)
@ -869,11 +869,11 @@ mod tests {
.unwrap(); .unwrap();
meta.set_alignment(&alig).unwrap(); meta.set_alignment(&alig).unwrap();
let alig = meta.get_alignment(); let alig = meta.alignment();
assert_eq!(alig, crate::VideoAlignment::new(0, 0, 2, 6, &[0, 0, 0, 0])); assert_eq!(alig, crate::VideoAlignment::new(0, 0, 2, 6, &[0, 0, 0, 0]));
assert_eq!(meta.get_plane_size().unwrap(), [78720, 39360, 0, 0]); assert_eq!(meta.plane_size().unwrap(), [78720, 39360, 0, 0]);
assert_eq!(meta.get_plane_height().unwrap(), [240, 120, 0, 0]); assert_eq!(meta.plane_height().unwrap(), [240, 120, 0, 0]);
/* vertical alignment */ /* vertical alignment */
let mut info = crate::VideoInfo::builder(crate::VideoFormat::Nv12, 320, 240) let mut info = crate::VideoInfo::builder(crate::VideoFormat::Nv12, 320, 240)
@ -894,10 +894,10 @@ mod tests {
.unwrap(); .unwrap();
meta.set_alignment(&alig).unwrap(); meta.set_alignment(&alig).unwrap();
let alig = meta.get_alignment(); let alig = meta.alignment();
assert_eq!(alig, crate::VideoAlignment::new(2, 6, 0, 0, &[0, 0, 0, 0])); assert_eq!(alig, crate::VideoAlignment::new(2, 6, 0, 0, &[0, 0, 0, 0]));
assert_eq!(meta.get_plane_size().unwrap(), [79360, 39680, 0, 0]); assert_eq!(meta.plane_size().unwrap(), [79360, 39680, 0, 0]);
assert_eq!(meta.get_plane_height().unwrap(), [248, 124, 0, 0]); assert_eq!(meta.plane_height().unwrap(), [248, 124, 0, 0]);
} }
} }

View file

@ -21,9 +21,9 @@ impl fmt::Debug for VideoOverlayRectangle {
impl fmt::Debug for VideoOverlayRectangleRef { impl fmt::Debug for VideoOverlayRectangleRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoOverlayRectangle") f.debug_struct("VideoOverlayRectangle")
.field("flags", &self.get_flags()) .field("flags", &self.flags())
.field("global_alpha", &self.get_global_alpha()) .field("global_alpha", &self.global_alpha())
.field("render_rectangle", &self.get_render_rectangle()) .field("render_rectangle", &self.render_rectangle())
.finish() .finish()
} }
} }
@ -53,7 +53,7 @@ impl VideoOverlayRectangle {
} }
impl VideoOverlayRectangleRef { impl VideoOverlayRectangleRef {
pub fn get_flags(&self) -> crate::VideoOverlayFormatFlags { pub fn flags(&self) -> crate::VideoOverlayFormatFlags {
unsafe { unsafe {
from_glib(ffi::gst_video_overlay_rectangle_get_flags( from_glib(ffi::gst_video_overlay_rectangle_get_flags(
self.as_mut_ptr(), self.as_mut_ptr(),
@ -61,7 +61,7 @@ impl VideoOverlayRectangleRef {
} }
} }
pub fn get_global_alpha(&self) -> f32 { pub fn global_alpha(&self) -> f32 {
unsafe { ffi::gst_video_overlay_rectangle_get_global_alpha(self.as_mut_ptr()) } unsafe { ffi::gst_video_overlay_rectangle_get_global_alpha(self.as_mut_ptr()) }
} }
@ -69,11 +69,11 @@ impl VideoOverlayRectangleRef {
unsafe { ffi::gst_video_overlay_rectangle_set_global_alpha(self.as_mut_ptr(), alpha) } unsafe { ffi::gst_video_overlay_rectangle_set_global_alpha(self.as_mut_ptr(), alpha) }
} }
pub fn get_seqnum(&self) -> u32 { pub fn seqnum(&self) -> u32 {
unsafe { ffi::gst_video_overlay_rectangle_get_seqnum(self.as_mut_ptr()) } unsafe { ffi::gst_video_overlay_rectangle_get_seqnum(self.as_mut_ptr()) }
} }
pub fn get_render_rectangle(&self) -> (i32, i32, u32, u32) { pub fn render_rectangle(&self) -> (i32, i32, u32, u32) {
unsafe { unsafe {
let mut render_x = mem::MaybeUninit::uninit(); let mut render_x = mem::MaybeUninit::uninit();
let mut render_y = mem::MaybeUninit::uninit(); let mut render_y = mem::MaybeUninit::uninit();
@ -242,7 +242,7 @@ impl VideoOverlayCompositionRef {
} }
} }
pub fn get_seqnum(&self) -> u32 { pub fn seqnum(&self) -> u32 {
unsafe { ffi::gst_video_overlay_composition_get_seqnum(self.as_mut_ptr()) } unsafe { ffi::gst_video_overlay_composition_get_seqnum(self.as_mut_ptr()) }
} }

View file

@ -242,35 +242,35 @@ impl ValidVideoTimeCode {
macro_rules! generic_impl { macro_rules! generic_impl {
($name:ident) => { ($name:ident) => {
impl $name { impl $name {
pub fn get_hours(&self) -> u32 { pub fn hours(&self) -> u32 {
self.0.hours self.0.hours
} }
pub fn get_minutes(&self) -> u32 { pub fn minutes(&self) -> u32 {
self.0.minutes self.0.minutes
} }
pub fn get_seconds(&self) -> u32 { pub fn seconds(&self) -> u32 {
self.0.seconds self.0.seconds
} }
pub fn get_frames(&self) -> u32 { pub fn frames(&self) -> u32 {
self.0.frames self.0.frames
} }
pub fn get_field_count(&self) -> u32 { pub fn field_count(&self) -> u32 {
self.0.field_count self.0.field_count
} }
pub fn get_fps(&self) -> gst::Fraction { pub fn fps(&self) -> gst::Fraction {
(self.0.config.fps_n as i32, self.0.config.fps_d as i32).into() (self.0.config.fps_n as i32, self.0.config.fps_d as i32).into()
} }
pub fn get_flags(&self) -> VideoTimeCodeFlags { pub fn flags(&self) -> VideoTimeCodeFlags {
unsafe { from_glib(self.0.config.flags) } unsafe { from_glib(self.0.config.flags) }
} }
pub fn get_latest_daily_jam(&self) -> Option<glib::DateTime> { pub fn latest_daily_jam(&self) -> Option<glib::DateTime> {
unsafe { from_glib_none(self.0.config.latest_daily_jam) } unsafe { from_glib_none(self.0.config.latest_daily_jam) }
} }
@ -311,14 +311,14 @@ macro_rules! generic_impl {
impl fmt::Debug for $name { impl fmt::Debug for $name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct(stringify!($name)) f.debug_struct(stringify!($name))
.field("fps", &self.get_fps()) .field("fps", &self.fps())
.field("flags", &self.get_flags()) .field("flags", &self.flags())
.field("latest_daily_jam", &self.get_latest_daily_jam()) .field("latest_daily_jam", &self.latest_daily_jam())
.field("hours", &self.get_hours()) .field("hours", &self.hours())
.field("minutes", &self.get_minutes()) .field("minutes", &self.minutes())
.field("seconds", &self.get_seconds()) .field("seconds", &self.seconds())
.field("frames", &self.get_frames()) .field("frames", &self.frames())
.field("field_count", &self.get_field_count()) .field("field_count", &self.field_count())
.finish() .finish()
} }
} }
@ -537,7 +537,7 @@ impl VideoTimeCodeMeta {
} }
} }
pub fn get_tc(&self) -> ValidVideoTimeCode { pub fn tc(&self) -> ValidVideoTimeCode {
unsafe { ValidVideoTimeCode::from_glib_none(&self.0.tc as *const _) } unsafe { ValidVideoTimeCode::from_glib_none(&self.0.tc as *const _) }
} }
@ -565,7 +565,7 @@ unsafe impl MetaAPI for VideoTimeCodeMeta {
impl fmt::Debug for VideoTimeCodeMeta { impl fmt::Debug for VideoTimeCodeMeta {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoTimeCodeMeta") f.debug_struct("VideoTimeCodeMeta")
.field("tc", &self.get_tc()) .field("tc", &self.tc())
.finish() .finish()
} }
} }
@ -610,15 +610,15 @@ mod tests {
) )
.expect("invalid timecode"); .expect("invalid timecode");
assert_eq!(meta.get_tc(), time_code_2); assert_eq!(meta.tc(), time_code_2);
time_code_2.increment_frame(); time_code_2.increment_frame();
assert_eq!(meta.get_tc().get_frames() + 1, time_code_2.get_frames()); assert_eq!(meta.tc().frames() + 1, time_code_2.frames());
meta.set_tc(time_code_2.clone()); meta.set_tc(time_code_2.clone());
assert_eq!(meta.get_tc(), time_code_2); assert_eq!(meta.tc(), time_code_2);
} }
} }
} }

View file

@ -22,7 +22,7 @@ impl VideoTimeCodeInterval {
} }
} }
pub fn get_hours(&self) -> u32 { pub fn hours(&self) -> u32 {
self.0.hours self.0.hours
} }
@ -30,7 +30,7 @@ impl VideoTimeCodeInterval {
self.0.hours = hours self.0.hours = hours
} }
pub fn get_minutes(&self) -> u32 { pub fn minutes(&self) -> u32 {
self.0.minutes self.0.minutes
} }
@ -39,7 +39,7 @@ impl VideoTimeCodeInterval {
self.0.minutes = minutes self.0.minutes = minutes
} }
pub fn get_seconds(&self) -> u32 { pub fn seconds(&self) -> u32 {
self.0.seconds self.0.seconds
} }
@ -48,7 +48,7 @@ impl VideoTimeCodeInterval {
self.0.seconds = seconds self.0.seconds = seconds
} }
pub fn get_frames(&self) -> u32 { pub fn frames(&self) -> u32 {
self.0.frames self.0.frames
} }

View file

@ -17,11 +17,11 @@ impl WebRTCSessionDescription {
} }
} }
pub fn get_type(&self) -> crate::WebRTCSDPType { pub fn type_(&self) -> crate::WebRTCSDPType {
unsafe { from_glib((*self.to_glib_none().0).type_) } unsafe { from_glib((*self.to_glib_none().0).type_) }
} }
pub fn get_sdp(&self) -> gst_sdp::SDPMessage { pub fn sdp(&self) -> gst_sdp::SDPMessage {
unsafe { from_glib_none((*self.to_glib_none().0).sdp) } unsafe { from_glib_none((*self.to_glib_none().0).sdp) }
} }
} }

Some files were not shown because too many files have changed in this diff Show more