Open Bug 1363283 Opened 7 years ago Updated 2 years ago

Reduce ref-counting overhead of MediaFormatReader::HandleDemuxedSamples()

Categories

(Core :: Audio/Video: Playback, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: jwwang, Unassigned)

Details

Attachments

(1 file)

http://searchfox.org/mozilla-central/rev/224cc663d54085994a4871ef464b7662e0721e83/dom/media/MediaFormatReader.cpp#2037

We can reduce one AddRef/Release pair by transferring the ownership of |sample| for it is no longer used and will be removed by |decoder.mQueuedSamples.RemoveElementAt(0)| soon.
Assignee: nobody → jwwang
Priority: -- → P3
Attachment #8865766 - Flags: review?(jyavenard)
Attachment #8865766 - Flags: review?(gsquelart)
Comment on attachment 8865766 [details]
Bug 1363283 - Reduce ref-counting overhead of MediaFormatReader::HandleDemuxedSamples().

https://reviewboard.mozilla.org/r/137386/#review140446

::: dom/media/Benchmark.cpp:308
(Diff revision 1)
>    MOZ_ASSERT(OnThread());
>    if (mFinished || mSampleIndex >= mSamples.Length()) {
>      return;
>    }
>    RefPtr<Benchmark> ref(mMainThreadState);
> -  mDecoder->Decode(mSamples[mSampleIndex])
> +  mDecoder->Decode(mSamples[mSampleIndex].forget())

Hi Gerald,
Can you review the change in Benchmark.cpp to make sure it is safe to transfer the ownership of mSamples[mSampleIndex]?
Comment on attachment 8865766 [details]
Bug 1363283 - Reduce ref-counting overhead of MediaFormatReader::HandleDemuxedSamples().

https://reviewboard.mozilla.org/r/137386/#review140886

I don't like it.

It makes the code much more painful to read, more complicated to maintain for no proven benefit
Attachment #8865766 - Flags: review?(jyavenard)
Comment on attachment 8865766 [details]
Bug 1363283 - Reduce ref-counting overhead of MediaFormatReader::HandleDemuxedSamples().

https://reviewboard.mozilla.org/r/137386/#review140888

I should add, that the aim was to have a shared MediaRawData between the MSE demuxer (that stores all those raw data in an array) and the MediaDataDecoder.

This would no longer be possible with this.
Comment on attachment 8865766 [details]
Bug 1363283 - Reduce ref-counting overhead of MediaFormatReader::HandleDemuxedSamples().

https://reviewboard.mozilla.org/r/137386/#review140934

(Deferring to jya's review)
Attachment #8865766 - Flags: review?(gsquelart)

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: suro001 → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: