Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

WIP - Import mediasource code #81

Closed
wants to merge 1 commit into from
Closed

Conversation

ferjm
Copy link
Contributor

@ferjm ferjm commented Nov 17, 2017

This is the initial work required to stand up MSE in gecko-media. It is importing most of the code from dom/media/mediasource.

The sources that required modifications are obviously the ones implementing the DOM objects for this API: MediaSource, SourceBuffer and SourceBufferList. I removed all the JS and DOM bindings related code from them and left the remainings, but they'll likely need significant changes.

In addition to the DOM implementation, I moved a slightly modified version of SourceBufferResource.h and TrackBuffersManager.cpp to gecko/glue/ because of missing headers in m-c. I proposed a fix upstream and filed #82 so I don't forget to pull them back to its proper location on the next update after the fix lands.

@ferjm ferjm changed the title WIP - Import mediasource code Import mediasource code Nov 17, 2017
@ferjm
Copy link
Contributor Author

ferjm commented Nov 17, 2017

I'd like to write some tests for this before merging.

@cpearce
Copy link
Contributor

cpearce commented Nov 20, 2017

I'd expect you'd need to rewrite MediaSource, SourceBuffer and SourceBufferList in Servo in Rust, and we'd need some kind of API to expose from gecko-media that the Rust implementations of the DOM bindings would call. The Gecko implementations of the DOM bindings will have lots of hooks into Gecko's DOM code that we don't want to import.


namespace mozilla {

// TODO (gecko-media) class AbstractThread;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we have AbstractThread in gecko-media already. Why was it disabled in this header?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Gecko gets it from the global object and I need to figure out what that means for us :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, as @cpearce mentioned above I need to rewrite MediaSource, so I'm not sure how much of this code will be left.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream Gecko gets the Abstract MainThread from the script global object so that that runnables dispatched to the thread can be dispatched in the correct order when Gecko has multiple threads which correspond to the gecko "main" thread. There's more details here, but since in gecko-media we're aiming to have a single thread that thinks it's the Gecko main thread, we can just use AbstractThread::MainThread(), as we've already done in a few places where we need an AbstractThread representation of the main thread.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thanks for the explanation!

@ferjm ferjm changed the title Import mediasource code WIP - Import mediasource code Nov 21, 2017
@bors-servo
Copy link
Collaborator

☔ The latest upstream changes (presumably #88) made this pull request unmergeable. Please resolve the merge conflicts.

@ferjm ferjm closed this Nov 28, 2017
@ferjm ferjm deleted the mediasource branch November 28, 2017 17:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants