message: add constructor on target types

... and deprecate the `Message::new_*` forms.
This commit is contained in:
François Laignel 2020-06-23 16:56:25 +02:00
parent 2f1b3306de
commit f421d878b6
3 changed files with 700 additions and 14 deletions

View file

@ -340,7 +340,7 @@ mod tests {
BusSyncReply::Pass
});
bus.post(&::Message::new_eos().build()).unwrap();
bus.post(&::message::Eos::new()).unwrap();
let msgs = msgs.lock().unwrap();
assert_eq!(msgs.len(), 1);
@ -357,7 +357,7 @@ mod tests {
let bus = Bus::new();
let bus_stream = bus.stream();
let eos_message = ::Message::new_eos().build();
let eos_message = ::message::Eos::new();
bus.post(&eos_message).unwrap();
let bus_future = bus_stream.into_future();

File diff suppressed because it is too large Load diff

View file

@ -303,8 +303,9 @@ mod tutorial5 {
// We are possibly in a GStreamer working thread, so we notify the main
// thread of this event through a message in the bus
fn post_app_message(playbin: &gst::Element) {
let mbuilder = gst::Message::new_application(gst::Structure::new_empty("tags-changed"));
let _ = playbin.post_message(&mbuilder.build());
let _ = playbin.post_message(&gst::message::Application::new(gst::Structure::new_empty(
"tags-changed",
)));
}
pub fn run() {