Closed
Bug 1134434
Opened 8 years ago
Closed 8 years ago
[EME] ReadMetadata should be independent from EME keys
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: eflores, Assigned: eflores)
References
Details
Attachments
(2 files, 5 obsolete files)
6.00 KB,
patch
|
Details | Diff | Splinter Review | |
32.33 KB,
patch
|
Details | Diff | Splinter Review |
Yury pointed out that loadedmetadata not firing when we have encrypted media could be confusing for devs, and that proper layout can depend on loadedmetadata firing. The EME spec agrees: "encrypted" event precondition: - The element's readyState is equal to HAVE_METADATA or greater. In ReadMetadata, we might be able to pass a Promise<CDMProxy> into CreateCDMWrapper instead of a CDMProxy* and block decryption on that promise resolving (which should also fire off a "waitingforkey" event, which we don't currently do).
Assignee | ||
Comment 1•8 years ago
|
||
Finally getting around to uploading these. This patch just splits MP4Reader::ReadMetadata into two parts so as to not block the loadedmetadata event from happening. Also makes the HTMLMediaElement responsible for firing the encrypted event.
Attachment #8575750 -
Flags: review?(cpearce)
Assignee | ||
Comment 2•8 years ago
|
||
Remove test_eme_access_control -- only tests CORS on non-MSE EME, which is breaks after the above patch.
Attachment #8575751 -
Flags: review?(cpearce)
Comment 3•8 years ago
|
||
Comment on attachment 8575750 [details] [diff] [review] 1134434.patch Review of attachment 8575750 [details] [diff] [review]: ----------------------------------------------------------------- We should just do FinishDecoderSetup inside a EnsureDecodersSetup() function inside Request*Data(). And I think you should get a MSE person to look over the changes to MSE code. ::: dom/media/MediaDecoderReader.h @@ +161,5 @@ > // Fills aInfo with the latest cached data required to present the media, > // ReadUpdatedMetadata will always be called once ReadMetadata has succeeded. > virtual void ReadUpdatedMetadata(MediaInfo* aInfo) { }; > > + virtual nsresult FinishDecoderSetup() { return NS_OK; }; So now MediaDecoderReader has the following functions related to metadata reading: PreReadMetadata(), ReadMetadata(), ReadUpdatedMetadata(), and now FinishDecoderSetup(). That's rather unfortunate. Can't you just do what MP4Reader::FinishDecoderSetup() does inside the first call to Request*Data() if it's not been done yet? ::: dom/media/MediaDecoderStateMachine.cpp @@ +2261,5 @@ > // Inform the element that we've loaded the metadata. > EnqueueLoadedMetadataEvent(); > } > > + if (mState == DECODER_STATE_DECODING_METADATA && You could merge this into the "if (mState == DECODER_STATE_DECODING_METADATA)" block right below so you don't check mState twice. @@ +2333,5 @@ > DECODER_LOG("DecodeFirstFrame started"); > > + { > + ReentrantMonitorAutoExit mon(mDecoder->GetReentrantMonitor()); > + nsresult res = mReader->FinishDecoderSetup(); You're calling this on the state machine thread, we should try to limit calls the reader on the decode thread if at all possible, especially for non-trivial things like this. All the more reason to do this inside the Request*Data() functions.
Attachment #8575750 -
Flags: review?(cpearce) → review-
Updated•8 years ago
|
Attachment #8575751 -
Flags: review?(cpearce) → review+
Assignee | ||
Comment 4•8 years ago
|
||
(In reply to Chris Pearce (:cpearce) from comment #3) > We should just do FinishDecoderSetup inside a EnsureDecodersSetup() function > inside Request*Data(). Hrm, you're right. That'd be much simpler. New patch soon.
Assignee | ||
Comment 5•8 years ago
|
||
Attachment #8575750 -
Attachment is obsolete: true
Attachment #8576952 -
Flags: review?(cpearce)
Comment 6•8 years ago
|
||
Comment on attachment 8576952 [details] [diff] [review] 1134434.patch v2 Review of attachment 8576952 [details] [diff] [review]: ----------------------------------------------------------------- r+ with nits. ::: dom/media/fmp4/MP4Reader.cpp @@ +446,5 @@ > > +bool > +MP4Reader::EnsureDecodersSetup() > +{ > + MonitorAutoLock mon(mDecoderSetupMonitor); You shouldn't need the monitor, this should only be called on the decode task queue, so just assert that this is only called on the decode task queue: MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn()); ::: dom/media/mediasource/MediaSourceReader.cpp @@ +1011,5 @@ > + aTo.mIsEncrypted = true; > + > + // We assume here that the encryption type will be the same between the two > + // streams. > + aTo.mType = aFrom.mType; You should fail if the type is not the same, with a NS_WARNING at least.
Attachment #8576952 -
Flags: review?(cpearce) → review+
Comment 7•8 years ago
|
||
Rebase of "1134434.patch v2", still needs work as per comment 6.
Attachment #8576952 -
Attachment is obsolete: true
Comment 8•8 years ago
|
||
Rebase of "1134434-fix-test.patch".
Attachment #8575751 -
Attachment is obsolete: true
Comment 10•8 years ago
|
||
Rebased again, previous could not build. *Note* this is probably a dumb rebase, will need more work!
Attachment #8581199 -
Attachment is obsolete: true
Assignee | ||
Comment 11•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7e5ddf82a1a https://hg.mozilla.org/integration/mozilla-inbound/rev/706ee8458ffb
Assignee | ||
Comment 12•8 years ago
|
||
+ Bustage-B-Gone https://hg.mozilla.org/integration/mozilla-inbound/rev/f99eb0b983d6
Comment 13•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b7e5ddf82a1a https://hg.mozilla.org/mozilla-central/rev/706ee8458ffb https://hg.mozilla.org/mozilla-central/rev/f99eb0b983d6
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•