Skip to content

media: Enable CobaltInPlaceMediaSourceParser in borrow mode on 3P - #13617

Merged
jasonzhangxx merged 1 commit into
youtube:mainfrom
jasonzhangxx:enable-in-place-mse-parser-on-3p
Oct 26, 2026
Merged

jasonzhangxx merged 1 commit into
youtube:mainfrom
jasonzhangxx:enable-in-place-mse-parser-on-3p

Conversation

@jasonzhangxx

Copy link
Copy Markdown
Contributor

Enable kCobaltInPlaceMediaSourceParser with borrow_mode=true by default on non-Android (3P) platforms.

Bug: 558350763
TAG=agy
CONV=af5995e6-aeff-480f-8031-f5d6b3b58791

Enable kCobaltInPlaceMediaSourceParser with borrow_mode=true by default
on non-Android (3P) platforms.

Bug: 558350763
TAG=agy
CONV=af5995e6-aeff-480f-8031-f5d6b3b58791
@jasonzhangxx
jasonzhangxx requested a review from a team as a code owner October 26, 2026 20:55
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ✅ PASS All checks passed
CI / android ✅ PASS Passed
CI / evergreen ✅ PASS Passed
CI / linux ✅ PASS Passed
CI / tvos ✅ PASS Passed
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


media: Enable in-place media parsing for 3P

Enable kCobaltInPlaceMediaSourceParser with borrow_mode set to true
by default on all platforms except Android. This allows the media
pipeline to parse appended data without making extra copies,
improving memory efficiency on third-party (3P) platforms.

While this deviates from the standard Media Source Extensions
specification regarding buffer reuse, it provides significant
performance benefits for Cobalt's target environments.

Bug: 558350763

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies media/base/media_switches.cc to conditionally configure the kCobaltInPlaceMediaSourceParser feature and its borrow_mode parameter based on whether the target platform is Android. The review feedback correctly points out that embedding preprocessor directives inside macro arguments results in undefined behavior in standard C++. It is recommended to wrap the entire macro invocations within the preprocessor conditional blocks to ensure portability and standard compliance.

Comment thread media/base/media_switches.cc Resolved
Comment thread media/base/media_switches.cc Resolved
@jasonzhangxx
jasonzhangxx merged commit 41496c9 into youtube:main Oct 26, 2026
744 of 747 checks passed
@jasonzhangxx
jasonzhangxx deleted the enable-in-place-mse-parser-on-3p branch October 26, 2026 23:18
briantting pushed a commit that referenced this pull request Oct 26, 2026
…n borrow mode on 3P

Refer to original PR: #13617

Enable kCobaltInPlaceMediaSourceParser with borrow_mode=true by default
on non-Android (3P) platforms.

Bug: 558350763
TAG=agy
CONV=af5995e6-aeff-480f-8031-f5d6b3b58791

(cherry picked from commit 41496c9)
briantting pushed a commit that referenced this pull request Oct 27, 2026
…n borrow mode on 3P

Refer to original PR: #13617

Enable kCobaltInPlaceMediaSourceParser with borrow_mode=true by default
on non-Android (3P) platforms.

Bug: 558350763
TAG=agy
CONV=af5995e6-aeff-480f-8031-f5d6b3b58791

(cherry picked from commit 41496c9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants