spotifyaudiosrc: convert to PushSrc

Fixes #252
This commit is contained in:
Nick Steel 2022-09-10 22:33:48 +01:00 committed by Sebastian Dröge
parent 5c89c3db69
commit c6578c8699
3 changed files with 5 additions and 4 deletions

View file

@ -82,7 +82,7 @@ pub struct SpotifyAudioSrc {
impl ObjectSubclass for SpotifyAudioSrc {
const NAME: &'static str = "GstSpotifyAudioSrc";
type Type = super::SpotifyAudioSrc;
type ParentType = gst_base::BaseSrc;
type ParentType = gst_base::PushSrc;
type Interfaces = (gst::URIHandler,);
}
@ -258,12 +258,12 @@ impl BaseSrcImpl for SpotifyAudioSrc {
Ok(())
}
}
impl PushSrcImpl for SpotifyAudioSrc {
fn create(
&self,
_offset: u64,
_buffer: Option<&mut gst::BufferRef>,
_length: u32,
) -> Result<CreateSuccess, gst::FlowError> {
let state = self.state.lock().unwrap();
let state = state.as_ref().unwrap();

View file

@ -12,7 +12,7 @@ use gst::prelude::*;
mod imp;
glib::wrapper! {
pub struct SpotifyAudioSrc(ObjectSubclass<imp::SpotifyAudioSrc>) @extends gst_base::BaseSrc, gst::Element, gst::Object, @implements gst::URIHandler;
pub struct SpotifyAudioSrc(ObjectSubclass<imp::SpotifyAudioSrc>) @extends gst_base::PushSrc, gst_base::BaseSrc, gst::Element, gst::Object, @implements gst::URIHandler;
}
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {

View file

@ -5910,6 +5910,7 @@
"description": "Spotify source",
"hierarchy": [
"GstSpotifyAudioSrc",
"GstPushSrc",
"GstBaseSrc",
"GstElement",
"GstObject",