Closed Bug 1362258 Opened 3 years ago Closed 3 years ago

Reduce ref-counting overhead of TrackBuffersManager::AppendData()

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

Details

Attachments

(1 file)

http://searchfox.org/mozilla-central/rev/6580dd9a4eb0224773897388dba2ddf5ed7f4216/dom/media/mediasource/TrackBuffersManager.cpp#127

We can pass already_AddRefed<MediaByteBuffer> to InvokeAsync to avoid unnecessary AddRef/Release pairs.
Comment on attachment 8864717 [details]
Bug 1362258 - Reduce ref-counting overhead of TrackBuffersManager::AppendData().

https://reviewboard.mozilla.org/r/136356/#review139518

::: dom/media/mediasource/TrackBuffersManager.cpp:129
(Diff revision 1)
> +  MSE_DEBUG("Appending %" PRIuSIZE " bytes", data->Length());
>  
>    mEnded = false;
>  
> -  return InvokeAsync<RefPtr<MediaByteBuffer>, SourceBufferAttributes&&>(
> -           GetTaskQueue(), this, __func__,
> +  return InvokeAsync(GetTaskQueue(), this, __func__,
> +    &TrackBuffersManager::DoAppendData, data.forget(), aAttributes);

why don't you pass aData as is?
Attachment #8864717 - Flags: review?(jyavenard) → review+
Comment on attachment 8864717 [details]
Bug 1362258 - Reduce ref-counting overhead of TrackBuffersManager::AppendData().

https://reviewboard.mozilla.org/r/136356/#review139518

> why don't you pass aData as is?

We have aData->Length() at #123.
Thanks for the review!
Assignee: nobody → jwwang
Priority: -- → P3
Pushed by jwwang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0bcfd4faec8c
Reduce ref-counting overhead of TrackBuffersManager::AppendData(). r=jya
https://hg.mozilla.org/mozilla-central/rev/0bcfd4faec8c
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.