Closed Bug 1195158 Opened 10 years ago Closed 10 years ago

Remove MediaDecoder::QueueMetadata

Categories

(Core :: Audio/Video: Playback, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(5 files)

Because it doesn't run on the main thread.
Blocks: 1179498
Bug 1194112 allows us to send move-only types to another thread. We will be able to send TimedMetadata to MediaDecoder using MediaEventSource.
Depends on: 1194112
Bug 1195158. Part 1 - Have MediaMetadataManager listen to an event source to receive TimedMetadata events. OggReader will send TimedMetadata events through an event source. This will break OggReader's dependency on AbstractMediaDecoder::QueueMetadata which then can be removed for it is against our goal to run all MediaDecoder's methods on the main thread.
Attachment #8648557 - Flags: review?(cpearce)
Bug 1195158. Part 2 - Have OggReader send TimedMetadata events through a event source instead of direct calls to AbstractMediaDecoder::QueueMetadata.
Attachment #8648558 - Flags: review?(cpearce)
Bug 1195158. Part 3 - connect listeners. a. MediaMetadataManager is connected to MediaDecoderReader::mTimedMetadataEvent to receive TimedMetadata events. b. OggReader publish TimedMetadata events through MediaDecoderReader::mTimedMetadataEvent. c. MDSM calls MediaMetadataManager::DispatchMetadataIfNeeded to publish metadata if playback positoin reaches the publish time. d. MediaDecoder is connected to MediaMetadataManager::mTimedMetadataEvent to receive TimedMetadata events. e. MediaDecoder updates its metadata when TimedMetadata events are received.
Attachment #8648559 - Flags: review?(cpearce)
Bug 1195158. Part 4 - remove unused code.
Attachment #8648560 - Flags: review?(cpearce)
Comment on attachment 8648557 [details] MozReview Request: Bug 1195158. Part 1 - Have MediaMetadataManager listen to an event source to receive TimedMetadata events. OggReader will send TimedMetadata events through an event source. https://reviewboard.mozilla.org/r/16239/#review14581 Ship It!
Attachment #8648557 - Flags: review?(cpearce) → review+
Comment on attachment 8648558 [details] MozReview Request: Bug 1195158. Part 2 - Have OggReader send TimedMetadata events through a event source instead of direct calls to AbstractMediaDecoder::QueueMetadata. r=cpearce. https://reviewboard.mozilla.org/r/16241/#review14583 Ship It! ::: dom/media/ogg/OggReader.cpp:820 (Diff revision 1) > + nsAutoPtr<MetadataTags>(tags), |tags| is already an nsAutoPtr, defined on line 734, so you shouldn't need to wrap it in another MediadataTags constructor here.
Attachment #8648558 - Flags: review?(cpearce) → review+
Attachment #8648559 - Flags: review?(cpearce) → review+
Comment on attachment 8648559 [details] MozReview Request: Bug 1195158. Part 3 - connect listeners. r=cpearce. https://reviewboard.mozilla.org/r/16243/#review14589 Ship It!
Comment on attachment 8648560 [details] MozReview Request: Bug 1195158. Part 4 - remove unused code. r=cpearce. https://reviewboard.mozilla.org/r/16245/#review14591 Ship It!
Attachment #8648560 - Flags: review?(cpearce) → review+
(In reply to Chris Pearce (:cpearce) from comment #8) > ::: dom/media/ogg/OggReader.cpp:820 > (Diff revision 1) > > + nsAutoPtr<MetadataTags>(tags), > > |tags| is already an nsAutoPtr, defined on line 734, so you shouldn't need > to wrap it in another MediadataTags constructor here. Ah, right! Thanks for the review. Will change |nsAutoPtr<MetadataTags>(tags)| to |Move(tags)|.
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/adc449224816 for W(3) failure, at least on Linux opts: PROCESS-CRASH | /media-source/mediasource-multiple-attach.html | application crashed [@ mozilla::MediaEventListener::Disconnect()] W(5) failure, at least on Linux and OSX debug: PROCESS | 1865 | Assertion failure: mRawPtr != 0 (You can't dereference a NULL nsRefPtr with operator->().), at ../../dist/include/mozilla/nsRefPtr.h:286 PROCESS-CRASH | /media-source/mediasource-multiple-attach.html | application crashed [@ nsRefPtr<mozilla::RevocableToken>::operator->() const]
From Nexus 5-L(Be): ../../dist/include/MediaDecoder.h:986:25: error: 'TimedMetadata' has not been declared
Priority: -- → P2
Comment on attachment 8648557 [details] MozReview Request: Bug 1195158. Part 1 - Have MediaMetadataManager listen to an event source to receive TimedMetadata events. OggReader will send TimedMetadata events through an event source. Bug 1195158. Part 1 - Have MediaMetadataManager listen to an event source to receive TimedMetadata events. OggReader will send TimedMetadata events through an event source. This will break OggReader's dependency on AbstractMediaDecoder::QueueMetadata which then can be removed for it is against our goal to run all MediaDecoder's methods on the main thread. r=cpearce.
Comment on attachment 8648558 [details] MozReview Request: Bug 1195158. Part 2 - Have OggReader send TimedMetadata events through a event source instead of direct calls to AbstractMediaDecoder::QueueMetadata. r=cpearce. Bug 1195158. Part 2 - Have OggReader send TimedMetadata events through a event source instead of direct calls to AbstractMediaDecoder::QueueMetadata. r=cpearce.
Attachment #8648558 - Attachment description: MozReview Request: Bug 1195158. Part 2 - Have OggReader send TimedMetadata events through a event source instead of direct calls to AbstractMediaDecoder::QueueMetadata. → MozReview Request: Bug 1195158. Part 2 - Have OggReader send TimedMetadata events through a event source instead of direct calls to AbstractMediaDecoder::QueueMetadata. r=cpearce.
Comment on attachment 8648559 [details] MozReview Request: Bug 1195158. Part 3 - connect listeners. r=cpearce. Bug 1195158. Part 3 - connect listeners. r=cpearce. a. MediaMetadataManager is connected to MediaDecoderReader::mTimedMetadataEvent to receive TimedMetadata events. b. OggReader publish TimedMetadata events through MediaDecoderReader::mTimedMetadataEvent. c. MDSM calls MediaMetadataManager::DispatchMetadataIfNeeded to publish metadata if playback positoin reaches the publish time. d. MediaDecoder is connected to MediaMetadataManager::mTimedMetadataEvent to receive TimedMetadata events. e. MediaDecoder updates its metadata when TimedMetadata events are received.
Attachment #8648559 - Attachment description: MozReview Request: Bug 1195158. Part 3 - connect listeners. → MozReview Request: Bug 1195158. Part 3 - connect listeners. r=cpearce.
Comment on attachment 8648560 [details] MozReview Request: Bug 1195158. Part 4 - remove unused code. r=cpearce. Bug 1195158. Part 4 - remove unused code. r=cpearce.
Attachment #8648560 - Attachment description: MozReview Request: Bug 1195158. Part 4 - remove unused code. → MozReview Request: Bug 1195158. Part 4 - remove unused code. r=cpearce.
Bug 1195158. Part 5 - 1. Fix insufficient includes and sort out include order. 2. Only disconnect |mTimedMetadataListener| when the state machine is created.
Attachment #8652098 - Flags: review?(cpearce)
Patch part 5. Fix insufficient includes in comment 14. Fix the crash in comment 13. MediaDecoder can be shut down without creating the state machine. The listener should only be disconnected when the state machine has been created.
Comment on attachment 8652098 [details] MozReview Request: Bug 1195158. Part 5 - 1. Fix insufficient includes and sort out include order. 2. Only disconnect |mTimedMetadataListener| when the state machine is created. https://reviewboard.mozilla.org/r/17073/#review16449
Attachment #8652098 - Flags: review?(cpearce) → review+
Thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: