Minor Rusty blockage

Russel Winder russel at winder.org.uk
Fri Mar 2 17:34:50 UTC 2018


On Fri, 2018-03-02 at 16:21 +0200, Sebastian Dröge wrote:
> Hi Russel,
> 
> On Fri, 2018-03-02 at 12:33 +0000, Russel Winder wrote:
> > 
[…]
> > I tend to use "*" as the version number and update frequently so I
> > should always be on the latest version. Cargo.lock currently
> > reports
> > gstreamer at version 0.10.2, which seems about as up-to-date as it
> > is
> > possible to get using crates.io. I guess I could use the Git
> > repository to be really up to date. :-)
> 
> Not the worst idea if you're prepared to keep up with API changes :)

That is the idea. I'm all for latest good stuff, and I'm not tied to
backward compatibility.

> It might make sense (for applications!) to have the Cargo.lock in GIT
> and you update that manually whenever there are known-good versions.

I've never really understood this, if the idea is to fix a version
shouldn't the version be fixed in the Cargo.toml?

> > > […]
> 
> Here is the solution for the thread-safety issue:
> https://github.com/sdroege/gstreamer-rs/blob/e6265341d56eeeda2f987a29
> c741f51ba5fb55d1/examples/src/bin/gtksink.rs#L71-L91
> 
> Problem is that GApplication is not thread-safe but the bus watch is
> going to be triggered from whatever thread the mainloop runs on.
> Which
> might in theory not be the same one where the GApplication was
> created.
> The compiler can't statically prove that. It would be unsafe to use a
> GApplication in another thread than the one where it was created.

I had assumed it was something of this sort. Thanks for the pointer to
your solution.

> However in your application both are guaranteed to be the same. With
> SendCell you can move the thread-safety checks to runtime instead of
> compile-time. Similar to how RefCell does it with borrowing.
> 
> 
> For the other problem: you're using gstreamer-rs 0.10 but copied the
> message handler from GIT master. The API slightly changed for
> simplification. For 0.10 you need to do the following:
>   https://github.com/sdroege/gstreamer-rs/blob/c7f5b541cc0923a71ccc89
> bf54954e3a03328994/examples/src/bin/gtksink.rs#L89-L95
> 
> That is, in 0.10 you have to get the source from the message itself
> while in GIT master (0.11+) you can also use all the message API from
> the different message views.

Ah, so Mathieu was indeed correct it is a versions problem.

Everything now in place and code compiling.

Now on to dealing with the various source events of the playbin to get
the gtksink overlaid and not creating a new window – assuming the
strategy in C++ is still the right strategy of course :-)

Thanks for the commentary, it makes the code meaningful – I wasn't
really comprehensing some of the code till your comments.

-- 
Russel.
==========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180302/c35e4f31/attachment.sig>


More information about the gstreamer-devel mailing list