Update for new_with_XXX/new_from_XXX function renaming

This commit is contained in:
Sebastian Dröge 2020-06-16 11:45:12 +03:00
parent 04875f3bff
commit bfde1fd9d5
4 changed files with 10 additions and 16 deletions

View file

@ -58,7 +58,7 @@ fn main_loop() -> Result<(), Error> {
let basic = RTSPAuth::make_basic("user", "password"); let basic = RTSPAuth::make_basic("user", "password");
// For propery authentication, we want to use encryption. And there's no // For propery authentication, we want to use encryption. And there's no
// encryption without a certificate! // encryption without a certificate!
let cert = gio::TlsCertificate::new_from_pem( let cert = gio::TlsCertificate::from_pem(
"-----BEGIN CERTIFICATE-----\ "-----BEGIN CERTIFICATE-----\
MIICJjCCAY+gAwIBAgIBBzANBgkqhkiG9w0BAQUFADCBhjETMBEGCgmSJomT8ixk\ MIICJjCCAY+gAwIBAgIBBzANBgkqhkiG9w0BAQUFADCBhjETMBEGCgmSJomT8ixk\
ARkWA0NPTTEXMBUGCgmSJomT8ixkARkWB0VYQU1QTEUxHjAcBgNVBAsTFUNlcnRp\ ARkWA0NPTTEXMBUGCgmSJomT8ixkARkWB0VYQU1QTEUxHjAcBgNVBAsTFUNlcnRp\

View file

@ -69,7 +69,7 @@ mod tests {
let mut buffer = gst::Buffer::new(); let mut buffer = gst::Buffer::new();
let port = 5000; let port = 5000;
let inet_addr = gio::InetAddress::new_from_string("127.0.0.1"); let inet_addr = gio::InetAddress::from_string("127.0.0.1");
let expected_addr = &gio::InetSocketAddress::new(&inet_addr, port); let expected_addr = &gio::InetSocketAddress::new(&inet_addr, port);

View file

@ -607,7 +607,7 @@ mod tests {
glib_object_subclass!(); glib_object_subclass!();
fn new_with_class(klass: &subclass::simple::ClassStruct<Self>) -> Self { fn with_class(klass: &subclass::simple::ClassStruct<Self>) -> Self {
let templ = klass.get_pad_template("sink").unwrap(); let templ = klass.get_pad_template("sink").unwrap();
let sinkpad = ::Pad::from_template(&templ, Some("sink")); let sinkpad = ::Pad::from_template(&templ, Some("sink"));
let templ = klass.get_pad_template("src").unwrap(); let templ = klass.get_pad_template("src").unwrap();

View file

@ -112,10 +112,8 @@ mod tutorial5 {
Inhibit(false) Inhibit(false)
}); });
let play_button = gtk::Button::new_from_icon_name( let play_button =
Some("media-playback-start"), gtk::Button::from_icon_name(Some("media-playback-start"), gtk::IconSize::SmallToolbar);
gtk::IconSize::SmallToolbar,
);
let pipeline = playbin.clone(); let pipeline = playbin.clone();
play_button.connect_clicked(move |_| { play_button.connect_clicked(move |_| {
let pipeline = &pipeline; let pipeline = &pipeline;
@ -124,10 +122,8 @@ mod tutorial5 {
.expect("Unable to set the pipeline to the `Playing` state"); .expect("Unable to set the pipeline to the `Playing` state");
}); });
let pause_button = gtk::Button::new_from_icon_name( let pause_button =
Some("media-playback-pause"), gtk::Button::from_icon_name(Some("media-playback-pause"), gtk::IconSize::SmallToolbar);
gtk::IconSize::SmallToolbar,
);
let pipeline = playbin.clone(); let pipeline = playbin.clone();
pause_button.connect_clicked(move |_| { pause_button.connect_clicked(move |_| {
let pipeline = &pipeline; let pipeline = &pipeline;
@ -136,10 +132,8 @@ mod tutorial5 {
.expect("Unable to set the pipeline to the `Paused` state"); .expect("Unable to set the pipeline to the `Paused` state");
}); });
let stop_button = gtk::Button::new_from_icon_name( let stop_button =
Some("media-playback-stop"), gtk::Button::from_icon_name(Some("media-playback-stop"), gtk::IconSize::SmallToolbar);
gtk::IconSize::SmallToolbar,
);
let pipeline = playbin.clone(); let pipeline = playbin.clone();
stop_button.connect_clicked(move |_| { stop_button.connect_clicked(move |_| {
let pipeline = &pipeline; let pipeline = &pipeline;
@ -148,7 +142,7 @@ mod tutorial5 {
.expect("Unable to set the pipeline to the `Ready` state"); .expect("Unable to set the pipeline to the `Ready` state");
}); });
let slider = gtk::Scale::new_with_range( let slider = gtk::Scale::with_range(
gtk::Orientation::Horizontal, gtk::Orientation::Horizontal,
0.0 as f64, 0.0 as f64,
100.0 as f64, 100.0 as f64,