diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-10-23 23:03:22 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-10-23 23:08:46 +0300 |
commit | 9a68f6e221576f94e153f5f20e499b22745621ec (patch) | |
tree | 776a587d54578bc7dff1fe432bf3008308bffb79 /video/cdg | |
parent | 86776be58c5d7e8607653edcd719ac1f0ba8d992 (diff) |
Move from `imp.instance()` to `imp.obj()`
It's doing the same thing and is shorter.
Diffstat (limited to 'video/cdg')
-rw-r--r-- | video/cdg/src/cdgdec/imp.rs | 8 | ||||
-rw-r--r-- | video/cdg/src/cdgparse/imp.rs | 13 |
2 files changed, 10 insertions, 11 deletions
diff --git a/video/cdg/src/cdgdec/imp.rs b/video/cdg/src/cdgdec/imp.rs index d88212c8d..9d077731c 100644 --- a/video/cdg/src/cdgdec/imp.rs +++ b/video/cdg/src/cdgdec/imp.rs @@ -110,7 +110,7 @@ impl VideoDecoderImpl for CdgDec { { let mut out_info = self.output_info.lock().unwrap(); if out_info.is_none() { - let instance = self.instance(); + let instance = self.obj(); let output_state = instance.set_output_state( gst_video::VideoFormat::Rgba, CDG_WIDTH, @@ -144,7 +144,7 @@ impl VideoDecoderImpl for CdgDec { Some(cmd) => cmd, None => { // Not a CDG command - self.instance().release_frame(frame); + self.obj().release_frame(frame); return Ok(gst::FlowSuccess::Ok); } }; @@ -152,7 +152,7 @@ impl VideoDecoderImpl for CdgDec { let mut cdg_inter = self.cdg_inter.lock().unwrap(); cdg_inter.handle_cmd(cmd); - self.instance().allocate_output_frame(&mut frame, None)?; + self.obj().allocate_output_frame(&mut frame, None)?; { let output = frame.output_buffer_mut().unwrap(); let info = self.output_info.lock().unwrap(); @@ -190,7 +190,7 @@ impl VideoDecoderImpl for CdgDec { gst::debug!(CAT, imp: self, "Finish frame pts={}", frame.pts().display()); - self.instance().finish_frame(frame) + self.obj().finish_frame(frame) } fn decide_allocation( diff --git a/video/cdg/src/cdgparse/imp.rs b/video/cdg/src/cdgparse/imp.rs index 1e036bf42..d80a9bb6f 100644 --- a/video/cdg/src/cdgparse/imp.rs +++ b/video/cdg/src/cdgparse/imp.rs @@ -110,14 +110,14 @@ fn time_to_bytes(time: gst::ClockTime) -> Bytes { impl BaseParseImpl for CdgParse { fn start(&self) -> Result<(), gst::ErrorMessage> { - self.instance().set_min_frame_size(CDG_PACKET_SIZE as u32); + self.obj().set_min_frame_size(CDG_PACKET_SIZE as u32); /* Set duration */ let mut query = gst::query::Duration::new(gst::Format::Bytes); - if self.instance().src_pad().query(&mut query) { + if self.obj().src_pad().query(&mut query) { let size = query.result(); let bytes: Option<Bytes> = size.try_into().unwrap(); - self.instance().set_duration(bytes.map(bytes_to_time), 0); + self.obj().set_duration(bytes.map(bytes_to_time), 0); } Ok(()) @@ -127,7 +127,7 @@ impl BaseParseImpl for CdgParse { &self, mut frame: gst_base::BaseParseFrame, ) -> Result<(gst::FlowSuccess, u32), gst::FlowError> { - if self.instance().src_pad().current_caps().is_none() { + if self.obj().src_pad().current_caps().is_none() { // Set src pad caps let src_caps = gst::Caps::builder("video/x-cdg") .field("width", CDG_WIDTH as i32) @@ -136,7 +136,7 @@ impl BaseParseImpl for CdgParse { .field("parsed", true) .build(); - self.instance() + self.obj() .src_pad() .push_event(gst::event::Caps::new(&src_caps)); } @@ -202,8 +202,7 @@ impl BaseParseImpl for CdgParse { gst::debug!(CAT, imp: self, "Found frame pts={}", pts); - self.instance() - .finish_frame(frame, CDG_PACKET_SIZE as u32)?; + self.obj().finish_frame(frame, CDG_PACKET_SIZE as u32)?; Ok((gst::FlowSuccess::Ok, skip)) } |