Bug 1208371 - Add a MediaStreamTrackSource interface. r=roc
This lets a MediaStreamTrack communicate with its source/producer on the main thread. It's for now used for stopping a track at the source and retrieving some metadata, but it could also be a link between actual sinks of a track and the source, to for instance let the source optimize by scaling down the resolution when all sinks want lowres-video. MozReview-Commit-ID: D4SJLr0aqhJ
This commit is contained in:
@@ -1905,11 +1905,15 @@ HTMLMediaElement::CaptureStreamInternal(bool aFinishWhenEnded,
|
||||
// Expose the tracks to JS directly.
|
||||
if (HasAudio()) {
|
||||
TrackID audioTrackId = mMediaInfo.mAudio.mTrackId;
|
||||
out->mStream->CreateOwnDOMTrack(audioTrackId, MediaSegment::AUDIO, nsString());
|
||||
RefPtr<MediaStreamTrackSource> trackSource = new BasicUnstoppableTrackSource();
|
||||
out->mStream->CreateOwnDOMTrack(audioTrackId, MediaSegment::AUDIO,
|
||||
nsString(), trackSource);
|
||||
}
|
||||
if (HasVideo()) {
|
||||
TrackID videoTrackId = mMediaInfo.mVideo.mTrackId;
|
||||
out->mStream->CreateOwnDOMTrack(videoTrackId, MediaSegment::VIDEO, nsString());
|
||||
RefPtr<MediaStreamTrackSource> trackSource = new BasicUnstoppableTrackSource();
|
||||
out->mStream->CreateOwnDOMTrack(videoTrackId, MediaSegment::VIDEO,
|
||||
nsString(), trackSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user