mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 21:11:14 +00:00
Use glib::timeout_add_local() instead of removed gtk::timeout_add()
This commit is contained in:
parent
3fef3a607f
commit
4cc6c0d19e
3 changed files with 3 additions and 3 deletions
|
@ -84,7 +84,7 @@ fn create_ui(app: >k::Application) {
|
||||||
// the underlying pipeline, and display it in our gui.
|
// the underlying pipeline, and display it in our gui.
|
||||||
// Since this closure is called by the mainloop thread, we are allowed
|
// Since this closure is called by the mainloop thread, we are allowed
|
||||||
// to modify the gui widgets here.
|
// to modify the gui widgets here.
|
||||||
let timeout_id = gtk::timeout_add(500, move || {
|
let timeout_id = glib::timeout_add_local(500, move || {
|
||||||
// Here we temporarily retrieve a strong reference on the pipeline from the weak one
|
// Here we temporarily retrieve a strong reference on the pipeline from the weak one
|
||||||
// we moved into this callback.
|
// we moved into this callback.
|
||||||
let pipeline = match pipeline_weak.upgrade() {
|
let pipeline = match pipeline_weak.upgrade() {
|
||||||
|
|
|
@ -195,7 +195,7 @@ fn create_ui(app: >k::Application) {
|
||||||
// the underlying pipeline, and display it in our gui.
|
// the underlying pipeline, and display it in our gui.
|
||||||
// Since this closure is called by the mainloop thread, we are allowed
|
// Since this closure is called by the mainloop thread, we are allowed
|
||||||
// to modify the gui widgets here.
|
// to modify the gui widgets here.
|
||||||
let timeout_id = gtk::timeout_add(500, move || {
|
let timeout_id = glib::timeout_add_local(500, move || {
|
||||||
// Here we temporarily retrieve a strong reference on the pipeline from the weak one
|
// Here we temporarily retrieve a strong reference on the pipeline from the weak one
|
||||||
// we moved into this callback.
|
// we moved into this callback.
|
||||||
let pipeline = match pipeline_weak.upgrade() {
|
let pipeline = match pipeline_weak.upgrade() {
|
||||||
|
|
|
@ -167,7 +167,7 @@ mod tutorial5 {
|
||||||
let pipeline = playbin.clone();
|
let pipeline = playbin.clone();
|
||||||
let lslider = slider.clone();
|
let lslider = slider.clone();
|
||||||
// Update the UI (seekbar) every second
|
// Update the UI (seekbar) every second
|
||||||
let timeout_id = gtk::timeout_add_seconds(1, move || {
|
let timeout_id = glib::timeout_add_seconds_local(1, move || {
|
||||||
let pipeline = &pipeline;
|
let pipeline = &pipeline;
|
||||||
let lslider = &lslider;
|
let lslider = &lslider;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue