Comments (2)
Note that the PlanarYCbCrImage struct's Clone impl increments a C++ reference count on the pixel data, and its Drop impl decrements the reference count on the pixel data, which is supposed to ensure the pointer doesn't become dangling.
However, I have since realised that we override the ref count when we shutdown. So if we have a pointer to the planar data held while the Player object shuts down, we could end up deallocating the pixel data Rust code could end up derefing a dangling pointer. Since the compositor and the Player objects can live on different threads, this could potentially be an issue.
We don't see this in the example player, because the shutdown is initiated after the compositor's render loop has exited.
Fixing the lifetimes is complicated by the fact that C++ code will pass over the frame queue to the client multiple times; so we will call update_current_images() several times with the different PlanarYCbCrImage instances which referencing the same FrameIDs. So we have to be careful to allow the pixel data to be shared by multiple frame objects.
We may be able to do this by having the pixel data stored in Vec's allocated by Rust, and have some sort of indirection layer that allows them to be shared between frames and allows the C++ code to refer to them by some sort of handle (i.e. the opposite of what we currently do, which is have the frame's memory allocated by C++ code).
from gecko-media.
This should be resolved by PR 131.
from gecko-media.
Related Issues (19)
- Split 'top' in multiple modules HOT 1
- Make sure GeckoMedia::shutdown doesn't have to start the media stack HOT 1
- Failure on shutting down an internal pthread mutex
- Bindgen can't find stddef.h HOT 10
- Figure out a way to keep gecko/glue/ code in sync with mozillla-central HOT 2
- Move SourceBufferResource.h and TrackBuffersManager.cpp out of glue HOT 2
- Timestamp inconsistencies in the Rust Player impl HOT 1
- GeckoMediaMetadata incomplete implementation
- Segfault running the example player with an mp4 on OSX HOT 2
- Move GeckoMedia* files out of gecko/glue
- Make a new import from Gecko sources
- Fix build dependencies
- Move sample player to separate crate
- Straighten our safety story with regard to PlayerEventSink HOT 1
- Do not panic across FFI boundaries
- Rename undefs.h
- Intermittent "error: Connection to server timed out" on Servo CI HOT 3
- Test player does not render any frame on OSX HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gecko-media.