mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
manual fixes remove get prefix round 2
This commit is contained in:
parent
6ab9164dca
commit
1395d773c3
15 changed files with 35 additions and 34 deletions
|
@ -185,7 +185,7 @@ fn example_main() -> Result<(), Error> {
|
|||
// The encodebin will then automatically create an internal pipeline, that encodes
|
||||
// the audio stream in the format we specified in the EncodingProfile.
|
||||
let enc_sink_pad = encodebin
|
||||
.request_pad("audio_%u")
|
||||
.request_pad_simple("audio_%u")
|
||||
.expect("Could not get audio pad from encodebin");
|
||||
let src_pad = resample.static_pad("src").expect("resample has no srcpad");
|
||||
src_pad.link(&enc_sink_pad)?;
|
||||
|
@ -216,7 +216,7 @@ fn example_main() -> Result<(), Error> {
|
|||
// The encodebin will then automatically create an internal pipeline, that encodes
|
||||
// the audio stream in the format we specified in the EncodingProfile.
|
||||
let enc_sink_pad = encodebin
|
||||
.request_pad("video_%u")
|
||||
.request_pad_simple("video_%u")
|
||||
.expect("Could not get video pad from encodebin");
|
||||
let src_pad = scale.static_pad("src").expect("videoscale has no srcpad");
|
||||
src_pad.link(&enc_sink_pad)?;
|
||||
|
|
|
@ -129,7 +129,7 @@ mod mirror {
|
|||
fn gl_start(&self, filter: &Self::Type) -> Result<(), gst::LoggableError> {
|
||||
// Create a shader when GL is started, knowing that the OpenGL context is
|
||||
// available.
|
||||
let context = filter.context().unwrap();
|
||||
let context = GLBaseFilterExt::context(filter).unwrap();
|
||||
self.create_shader(filter, &context)?;
|
||||
self.parent_gl_start(filter)
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad
|
|||
}
|
||||
|
||||
fn request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
|
||||
match element.request_pad(pad_name) {
|
||||
match element.request_pad_simple(pad_name) {
|
||||
Some(pad) => Ok(pad),
|
||||
None => {
|
||||
let element_name = element.name();
|
||||
|
|
|
@ -51,7 +51,7 @@ fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad
|
|||
}
|
||||
|
||||
fn request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
|
||||
match element.request_pad(pad_name) {
|
||||
match element.request_pad_simple(pad_name) {
|
||||
Some(pad) => Ok(pad),
|
||||
None => {
|
||||
let element_name = element.name();
|
||||
|
|
|
@ -195,7 +195,7 @@ fn handle_demux_pad_added(
|
|||
// For that, we need to request a sink pad that fits our needs.
|
||||
let link_to_muxer = || -> Result<(), Error> {
|
||||
let queue_sink_pad = queue
|
||||
.request_pad("sink_%u")
|
||||
.request_pad_simple("sink_%u")
|
||||
.expect("If this happened, something is terribly wrong");
|
||||
demux_src_pad.link(&queue_sink_pad)?;
|
||||
// Now that we requested a sink pad fitting our needs from the multiqueue,
|
||||
|
|
|
@ -190,7 +190,7 @@ impl Gl {
|
|||
}
|
||||
|
||||
fn load(gl_context: &glutin::WindowedContext<glutin::PossiblyCurrent>) -> Gl {
|
||||
let gl = gl::Gl::load_with(|ptr| gl_context.proc_address(ptr) as *const _);
|
||||
let gl = gl::Gl::load_with(|ptr| gl_context.get_proc_address(ptr) as *const _);
|
||||
|
||||
let version = unsafe {
|
||||
let data = CStr::from_ptr(gl.GetString(gl::VERSION) as *const _)
|
||||
|
@ -353,7 +353,7 @@ impl App {
|
|||
use glutin::platform::unix::WindowExtUnix;
|
||||
use glutin::platform::ContextTraitExt;
|
||||
|
||||
let api = App::map_gl_api(windowed_context.api());
|
||||
let api = App::map_gl_api(windowed_context.get_api());
|
||||
|
||||
let (gl_context, gl_display, platform) = match unsafe { windowed_context.raw_handle() }
|
||||
{
|
||||
|
@ -362,7 +362,7 @@ impl App {
|
|||
let mut gl_display = None;
|
||||
|
||||
#[cfg(feature = "gst-gl-egl")]
|
||||
if let Some(display) = unsafe { windowed_context.egl_display() } {
|
||||
if let Some(display) = unsafe { windowed_context.get_egl_display() } {
|
||||
gl_display = Some(
|
||||
unsafe { gst_gl_egl::GLDisplayEGL::with_egl_display(display as usize) }
|
||||
.unwrap()
|
||||
|
@ -625,7 +625,7 @@ pub(crate) fn main_loop(app: App) -> Result<(), Error> {
|
|||
|
||||
println!(
|
||||
"Pixel format of the window's GL context {:?}",
|
||||
app.windowed_context.pixel_format()
|
||||
app.windowed_context.get_pixel_format()
|
||||
);
|
||||
|
||||
let gl = load(&app.windowed_context);
|
||||
|
|
|
@ -606,7 +606,7 @@ macro_rules! define_iter(
|
|||
impl<'a> $name<'a> {
|
||||
fn new(media: &'a SDPMediaRef) -> $name<'a> {
|
||||
skip_assert_initialized!();
|
||||
let len = $len(media);
|
||||
let len = $get_len(media);
|
||||
|
||||
$name {
|
||||
media,
|
||||
|
@ -624,7 +624,7 @@ macro_rules! define_iter(
|
|||
return None;
|
||||
}
|
||||
|
||||
let item = $item(self.media, self.idx)?;
|
||||
let item = $get_item(self.media, self.idx)?;
|
||||
self.idx += 1;
|
||||
Some(item)
|
||||
}
|
||||
|
@ -648,7 +648,7 @@ macro_rules! define_iter(
|
|||
|
||||
self.len -= 1;
|
||||
|
||||
$item(self.media, self.len)
|
||||
$get_item(self.media, self.len)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -927,7 +927,7 @@ macro_rules! define_iter(
|
|||
impl<'a> $name<'a> {
|
||||
fn new(message: &'a SDPMessageRef) -> $name<'a> {
|
||||
skip_assert_initialized!();
|
||||
let len = $len(message);
|
||||
let len = $get_len(message);
|
||||
|
||||
$name {
|
||||
message,
|
||||
|
@ -945,7 +945,7 @@ macro_rules! define_iter(
|
|||
return None;
|
||||
}
|
||||
|
||||
let item = $item(self.message, self.idx)?;
|
||||
let item = $get_item(self.message, self.idx)?;
|
||||
self.idx += 1;
|
||||
Some(item)
|
||||
}
|
||||
|
@ -969,7 +969,7 @@ macro_rules! define_iter(
|
|||
|
||||
self.len -= 1;
|
||||
|
||||
$item(self.message, self.len)
|
||||
$get_item(self.message, self.len)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -989,7 +989,7 @@ macro_rules! define_iter_mut(
|
|||
impl<'a> $name<'a> {
|
||||
fn new(message: &'a mut SDPMessageRef) -> $name<'a> {
|
||||
skip_assert_initialized!();
|
||||
let len = $len(message);
|
||||
let len = $get_len(message);
|
||||
|
||||
$name {
|
||||
message,
|
||||
|
@ -1019,7 +1019,7 @@ macro_rules! define_iter_mut(
|
|||
return None;
|
||||
}
|
||||
|
||||
let item = $item(message, self.idx)?;
|
||||
let item = $get_item(message, self.idx)?;
|
||||
self.idx += 1;
|
||||
Some(item)
|
||||
}
|
||||
|
@ -1046,7 +1046,7 @@ macro_rules! define_iter_mut(
|
|||
|
||||
self.len -= 1;
|
||||
|
||||
$item(message, self.len)
|
||||
$get_item(message, self.len)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -797,7 +797,7 @@ macro_rules! define_iter(
|
|||
|
||||
#[allow(unused_unsafe)]
|
||||
unsafe {
|
||||
let item = $item(self.buffer, self.idx)?;
|
||||
let item = $get_item(self.buffer, self.idx)?;
|
||||
self.idx += 1;
|
||||
Some(item)
|
||||
}
|
||||
|
@ -824,7 +824,7 @@ macro_rules! define_iter(
|
|||
|
||||
#[allow(unused_unsafe)]
|
||||
unsafe {
|
||||
$item(self.buffer, self.n_memory)
|
||||
$get_item(self.buffer, self.n_memory)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,8 @@ impl BufferListRef {
|
|||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
||||
pub fn writable(&mut self, idx: u32) -> Option<&mut BufferRef> {
|
||||
#[doc(alias = "gst_buffer_list_get_writable")]
|
||||
pub fn get_mut(&mut self, idx: u32) -> Option<&mut BufferRef> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_buffer_list_get_writable(self.as_mut_ptr(), idx);
|
||||
if ptr.is_null() {
|
||||
|
@ -218,7 +219,7 @@ macro_rules! define_iter(
|
|||
return None;
|
||||
}
|
||||
|
||||
let item = $item(self.list, self.idx)?;
|
||||
let item = $get_item(self.list, self.idx)?;
|
||||
self.idx += 1;
|
||||
|
||||
Some(item)
|
||||
|
@ -242,7 +243,7 @@ macro_rules! define_iter(
|
|||
}
|
||||
|
||||
self.size -= 1;
|
||||
$item(self.list, self.size)
|
||||
$get_item(self.list, self.size)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ macro_rules! define_iter(
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let item = $item(self.caps, self.idx)?;
|
||||
let item = $get_item(self.caps, self.idx)?;
|
||||
self.idx += 1;
|
||||
Some(item)
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ macro_rules! define_iter(
|
|||
self.n_structures -= 1;
|
||||
|
||||
unsafe {
|
||||
$item(self.caps, self.n_structures)
|
||||
$get_item(self.caps, self.n_structures)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -420,7 +420,7 @@ macro_rules! mini_object_wrapper (
|
|||
|
||||
impl $crate::glib::types::StaticType for $ref_name {
|
||||
fn static_type() -> $crate::glib::types::Type {
|
||||
unsafe { $crate::glib::translate::from_glib($type_()) }
|
||||
unsafe { $crate::glib::translate::from_glib($get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ impl Promise {
|
|||
let promise: Borrowed<Promise> = from_glib_borrow(promise);
|
||||
|
||||
let res = match promise.wait() {
|
||||
PromiseResult::Replied => Ok(promise.reply()),
|
||||
PromiseResult::Replied => Ok(promise.get_reply()),
|
||||
PromiseResult::Interrupted => Err(PromiseError::Interrupted),
|
||||
PromiseResult::Expired => Err(PromiseError::Expired),
|
||||
PromiseResult::Pending => {
|
||||
|
@ -103,7 +103,7 @@ impl Promise {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn reply(&self) -> Option<&StructureRef> {
|
||||
pub fn get_reply(&self) -> Option<&StructureRef> {
|
||||
unsafe {
|
||||
let s = ffi::gst_promise_get_reply(self.to_glib_none().0);
|
||||
if s.is_null() {
|
||||
|
|
|
@ -47,7 +47,7 @@ fn tutorial_main() {
|
|||
gst::Element::link_many(&[&audio_queue, &audio_convert, &audio_resample, &audio_sink]).unwrap();
|
||||
gst::Element::link_many(&[&video_queue, &visual, &video_convert, &video_sink]).unwrap();
|
||||
|
||||
let tee_audio_pad = tee.request_pad("src_%u").unwrap();
|
||||
let tee_audio_pad = tee.request_pad_simple("src_%u").unwrap();
|
||||
println!(
|
||||
"Obtained request pad {} for audio branch",
|
||||
tee_audio_pad.name()
|
||||
|
@ -55,7 +55,7 @@ fn tutorial_main() {
|
|||
let queue_audio_pad = audio_queue.static_pad("sink").unwrap();
|
||||
tee_audio_pad.link(&queue_audio_pad).unwrap();
|
||||
|
||||
let tee_video_pad = tee.request_pad("src_%u").unwrap();
|
||||
let tee_video_pad = tee.request_pad_simple("src_%u").unwrap();
|
||||
println!(
|
||||
"Obtained request pad {} for video branch",
|
||||
tee_video_pad.name()
|
||||
|
|
|
@ -98,7 +98,7 @@ fn main() {
|
|||
.unwrap();
|
||||
gst::Element::link_many(&[&app_queue, &appsink]).unwrap();
|
||||
|
||||
let tee_audio_pad = tee.request_pad("src_%u").unwrap();
|
||||
let tee_audio_pad = tee.request_pad_simple("src_%u").unwrap();
|
||||
println!(
|
||||
"Obtained request pad {} for audio branch",
|
||||
tee_audio_pad.name()
|
||||
|
@ -106,14 +106,14 @@ fn main() {
|
|||
let queue_audio_pad = audio_queue.static_pad("sink").unwrap();
|
||||
tee_audio_pad.link(&queue_audio_pad).unwrap();
|
||||
|
||||
let tee_video_pad = tee.request_pad("src_%u").unwrap();
|
||||
let tee_video_pad = tee.request_pad_simple("src_%u").unwrap();
|
||||
println!(
|
||||
"Obtained request pad {} for video branch",
|
||||
tee_video_pad.name()
|
||||
);
|
||||
let queue_video_pad = video_queue.static_pad("sink").unwrap();
|
||||
tee_video_pad.link(&queue_video_pad).unwrap();
|
||||
let tee_app_pad = tee.request_pad("src_%u").unwrap();
|
||||
let tee_app_pad = tee.request_pad_simple("src_%u").unwrap();
|
||||
let queue_app_pad = app_queue.static_pad("sink").unwrap();
|
||||
tee_app_pad.link(&queue_app_pad).unwrap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue