Closed
Bug 1199104
Opened 9 years ago
Closed 9 years ago
Create a subclass of MediaSink to wrap DecodedAudioDataSink for audio rendering
Categories
(Core :: Audio/Video: Playback, defect, P2)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: jwwang, Assigned: jwwang)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Step 1 & 2 of bug 1199098.
Assignee | ||
Comment 1•9 years ago
|
||
Assignee | ||
Comment 2•9 years ago
|
||
Updated•9 years ago
|
Priority: -- → P2
Assignee | ||
Comment 3•9 years ago
|
||
Bug 1199104. Part 1 - create MediaSink.
Attachment #8654066 -
Flags: review?(kinetik)
Assignee | ||
Comment 4•9 years ago
|
||
Bug 1199104. Part 2 - create AudioSinkWrapper.
Attachment #8654067 -
Flags: review?(kinetik)
Assignee | ||
Comment 5•9 years ago
|
||
Bug 1199104. Part 3 - use AudioSinkWrapper in MDSM.
Attachment #8654068 -
Flags: review?(kinetik)
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8654066 [details]
MozReview Request: Bug 1199104. Part 1 - create MediaSink. r=kinetik. r?cpearce.
Need more insights to make sure the interface is designed correctly.
Attachment #8654066 -
Flags: review?(cpearce)
Updated•9 years ago
|
Attachment #8654068 -
Flags: review?(kinetik) → review+
Comment 7•9 years ago
|
||
Comment on attachment 8654068 [details]
MozReview Request: Bug 1199104. Part 3 - use AudioSinkWrapper in MDSM. r=kinetik.
https://reviewboard.mozilla.org/r/17601/#review15927
::: dom/media/MediaDecoderStateMachine.cpp:2401
(Diff revision 1)
> - // return an incorrect value due to a null mAudioSink.
> + // return an incorrect value due to mAudioSink is stopped.
"being stopped"?
::: dom/media/MediaDecoderStateMachine.cpp:3040
(Diff revision 1)
> - // "before StartAudioSink" and "after StopAudioSink" where mAudioSink
> + // valid only when playback is in action.
Since we don't null mAudioSink now, we can tell the difference between "never had one/not yet started" and "reached end", and the comment that the audio end time can't be valid outside of playback doesn't feel right to me. Can we change it so that the sink just continues to return a valid end time after it ends? Would that make sense?
Comment 8•9 years ago
|
||
Comment on attachment 8654067 [details]
MozReview Request: Bug 1199104. Part 2 - create AudioSinkWrapper. r=kinetik.
https://reviewboard.mozilla.org/r/17599/#review15929
I think we could just modify the audio sink to behave the way we want it to directly rather than wrapped in, but I'm not sure if you have other plans here.
Attachment #8654067 -
Flags: review?(kinetik) → review+
Comment 9•9 years ago
|
||
Comment on attachment 8654066 [details]
MozReview Request: Bug 1199104. Part 1 - create MediaSink. r=kinetik. r?cpearce.
https://reviewboard.mozilla.org/r/17597/#review15931
::: dom/media/mediasink/MediaSink.h:67
(Diff revision 1)
> + // Must be called after playback starts.
It seems like this could be called in any start, since before playback begins it could return the start time?
Attachment #8654066 -
Flags: review?(kinetik)
Assignee | ||
Comment 10•9 years ago
|
||
https://reviewboard.mozilla.org/r/17601/#review15927
> Since we don't null mAudioSink now, we can tell the difference between "never had one/not yet started" and "reached end", and the comment that the audio end time can't be valid outside of playback doesn't feel right to me. Can we change it so that the sink just continues to return a valid end time after it ends? Would that make sense?
This is a design decision in order to keep the semantics of MediaSink as simple as possible. Should we continue to return a valid end time of last playback session? Or should we return -1 once playback is stopped? Or should GetEndTime() be called only after playback starts as well as GetPosition()? I think 3. is simpler than the previous 2.
Here is the revised design:
GetEndTime() returns the end time of the audio/video data that has been consumed or -1 if no such track. Must be called after playback starts.
There are 3 places in MDSM to call GetEndTime():
1. case DECODER_STATE_COMPLETED: MediaSink is guaranteed to be already started. The revised semantics fits well.
2. UpdateRenderedVideoFrames(): as above
3. GetDecodedAudioDuration() and AudioDecodedUsecs(): GetEndTime() is used to account for audio pushed but not played by the hardware. The value is simply 0 if MedisSink is not Start()ed.
Thought?
Assignee | ||
Comment 11•9 years ago
|
||
https://reviewboard.mozilla.org/r/17597/#review15943
::: dom/media/mediasink/MediaSink.h:67
(Diff revision 1)
> + // Must be called after playback starts.
The start time is provided in Start() and the calculation of playback position depends on the start time. Therefore GetPosition() should only be called after Start()ed.
Assignee | ||
Comment 12•9 years ago
|
||
https://reviewboard.mozilla.org/r/17599/#review15929
This indirection (a wrapper) is to make bug 1199121 easier where we want to handle clock switching (to system clock) if audio ends before video. This is beyond the capability of an AudioSink and therefore I decide to put it in a wrapper. When VideoSink is done by Kilik, this wrapper will be exteneded to include both an AudioSink and a VideoSink to fulfill the spec of MediaSink (A/V sync and audio/video rendering).
Comment 13•9 years ago
|
||
https://reviewboard.mozilla.org/r/17597/#review15943
> The start time is provided in Start() and the calculation of playback position depends on the start time. Therefore GetPosition() should only be called after Start()ed.
Good point -- missed that as the current implementation ignores the start time from Start().
Comment 14•9 years ago
|
||
https://reviewboard.mozilla.org/r/17601/#review15927
> This is a design decision in order to keep the semantics of MediaSink as simple as possible. Should we continue to return a valid end time of last playback session? Or should we return -1 once playback is stopped? Or should GetEndTime() be called only after playback starts as well as GetPosition()? I think 3. is simpler than the previous 2.
>
> Here is the revised design:
> GetEndTime() returns the end time of the audio/video data that has been consumed or -1 if no such track. Must be called after playback starts.
>
> There are 3 places in MDSM to call GetEndTime():
> 1. case DECODER_STATE_COMPLETED: MediaSink is guaranteed to be already started. The revised semantics fits well.
> 2. UpdateRenderedVideoFrames(): as above
> 3. GetDecodedAudioDuration() and AudioDecodedUsecs(): GetEndTime() is used to account for audio pushed but not played by the hardware. The value is simply 0 if MedisSink is not Start()ed.
>
> Thought?
I agree, that sounds good, thanks.
Comment 15•9 years ago
|
||
Comment on attachment 8654066 [details]
MozReview Request: Bug 1199104. Part 1 - create MediaSink. r=kinetik. r?cpearce.
https://reviewboard.mozilla.org/r/17597/#review15953
(not sure why mozreview cancelled my review request in bugzilla, I thought I reviewed this)
Attachment #8654066 -
Flags: review+
Assignee | ||
Comment 16•9 years ago
|
||
Comment on attachment 8654066 [details]
MozReview Request: Bug 1199104. Part 1 - create MediaSink. r=kinetik. r?cpearce.
Bug 1199104. Part 1 - create MediaSink. r=kinetik. r?cpearce.
Attachment #8654066 -
Attachment description: MozReview Request: Bug 1199104. Part 1 - create MediaSink. → MozReview Request: Bug 1199104. Part 1 - create MediaSink. r=kinetik. r?cpearce.
Assignee | ||
Comment 17•9 years ago
|
||
Comment on attachment 8654067 [details]
MozReview Request: Bug 1199104. Part 2 - create AudioSinkWrapper. r=kinetik.
Bug 1199104. Part 2 - create AudioSinkWrapper. r=kinetik.
Attachment #8654067 -
Attachment description: MozReview Request: Bug 1199104. Part 2 - create AudioSinkWrapper. → MozReview Request: Bug 1199104. Part 2 - create AudioSinkWrapper. r=kinetik.
Assignee | ||
Comment 18•9 years ago
|
||
Comment on attachment 8654068 [details]
MozReview Request: Bug 1199104. Part 3 - use AudioSinkWrapper in MDSM. r=kinetik.
Bug 1199104. Part 3 - use AudioSinkWrapper in MDSM. r=kinetik.
Attachment #8654068 -
Attachment description: MozReview Request: Bug 1199104. Part 3 - use AudioSinkWrapper in MDSM. → MozReview Request: Bug 1199104. Part 3 - use AudioSinkWrapper in MDSM. r=kinetik.
Assignee | ||
Comment 19•9 years ago
|
||
Assignee | ||
Comment 20•9 years ago
|
||
Since Chris is on PTO, I will take r+ from kinetik and check it the code.
Comment 21•9 years ago
|
||
Comment 22•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/70fae4852730
https://hg.mozilla.org/mozilla-central/rev/209f45821b75
https://hg.mozilla.org/mozilla-central/rev/0dcb70eb5798
Assignee: nobody → jwwang
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Assignee | ||
Updated•9 years ago
|
Attachment #8654066 -
Flags: review?(cpearce)
You need to log in
before you can comment on or make changes to this bug.
Description
•