filesrc: Set format as gst::Format::Bytes in basesrc

This commit is contained in:
Sebastian Dröge 2018-12-30 12:02:53 +02:00
parent bab4efb234
commit 7e68f84a43

View file

@ -14,6 +14,7 @@ use gst;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use gst_base; use gst_base;
use gst_base::prelude::*;
use gst_base::subclass::prelude::*; use gst_base::subclass::prelude::*;
use std::fs::File; use std::fs::File;
@ -207,6 +208,13 @@ impl ObjectImpl for FileSrc {
_ => unimplemented!(), _ => unimplemented!(),
} }
} }
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);
let element = obj.downcast_ref::<gst_base::BaseSrc>().unwrap();
element.set_format(gst::Format::Bytes);
}
} }
impl ElementImpl for FileSrc {} impl ElementImpl for FileSrc {}