Closed Bug 1272553 Opened 8 years ago Closed 8 years ago

Move all access to mTaskQueue from AppleVTDecoder to the parent class

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(3 files)

As bug 1271508.

By separating code about dispatching jobs from code about doing actual decoding jobs, we are able to move all use of mTaskQueue to the parent class (AppleVDADecoder).

This will make it easier for changes to mTaskQueue to get rid of FlushableTaskQueue.
Assignee: nobody → jwwang
Blocks: 1270039
(In reply to JW Wang [:jwwang] from comment #0)
> As bug 1271508.
> 
> By separating code about dispatching jobs from code about doing actual
> decoding jobs, we are able to move all use of mTaskQueue to the parent class
> (AppleVDADecoder).
> 
> This will make it easier for changes to mTaskQueue to get rid of
> FlushableTaskQueue.

Keep in mind, that with the drop of 10.6 to 10.8, we have no need for the VDA decoder anymore and Apple has obsoleted it in favour of VideoToolbox.

So I'm guessing we will want to remove VDA support in the not so far away timeframe...
Somehow AppleVDADecoder::OutputFrame() is also called from AppleVTDecoder. We will need to move some code from AppleVDADecoder to AppleVTDecoder if we want to drop AppleVDADecoder.

I believe the refactoring here will help/ease moving the code in the future.
(In reply to JW Wang [:jwwang] from comment #2)
> Somehow AppleVDADecoder::OutputFrame() is also called from AppleVTDecoder.
> We will need to move some code from AppleVDADecoder to AppleVTDecoder if we
> want to drop AppleVDADecoder.

yes, this is called from the VT decoder callback.
VT and VDA are very similar and the data output by both decoder is identical

> 
> I believe the refactoring here will help/ease moving the code in the future.

that's great to hear
Attachment #8752029 - Flags: review?(jyavenard) → review+
Comment on attachment 8752029 [details]
MozReview Request: Bug 1272553. Part 1 - move code around to be able to extract common code in P2. r=jya.

https://reviewboard.mozilla.org/r/52391/#review49397

::: dom/media/platforms/apple/AppleVTDecoder.cpp:195
(Diff revision 1)
>  nsresult
> -AppleVTDecoder::SubmitFrame(MediaRawData* aSample)
> +AppleVTDecoder::ProcessDecode(MediaRawData* aSample)
>  {
> +#ifdef LOG_MEDIA_SHA1
> +  SHA1Sum hash;
> +  hash.update(aSample->data, aSample->size);

you can get rid of that, ive never used it ever...
Comment on attachment 8752030 [details]
MozReview Request: Bug 1272553. Part 2 - extract common code to the parent class. r=jya.

https://reviewboard.mozilla.org/r/52393/#review49399

great. should have done this a long time ago...
Attachment #8752030 - Flags: review?(jyavenard) → review+
Comment on attachment 8752031 [details]
MozReview Request: Bug 1272553. Part 3 - make mTaskQueue private. r=jya.

https://reviewboard.mozilla.org/r/52395/#review49401

::: dom/media/platforms/apple/AppleVDADecoder.h:141
(Diff revision 1)
>    // Cleared on mTaskQueue in ProcessDrain().
>    Atomic<bool> mIsFlushing;
>    ReorderQueue mReorderQueue;
>  
>  private:
> +  RefPtr<FlushableTaskQueue> mTaskQueue;

can make this const too like the other MediaDataDecoder
Attachment #8752031 - Flags: review?(jyavenard) → review+
Thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: