Skip to content

Conversation

@johnedocampo
Copy link
Contributor

Bug: 471099187

@github-actions
Copy link

🤖 Gemini Suggested Commit Message


media: Expose incremental parse size to H5Vcc

Introduce an H5Vcc setting to allow runtime configuration of
StreamParser::kMaxPendingBytesPerParse. This enables tuning the
incremental append size used by media source buffers.

Adjusting this value can optimize performance, memory usage, and
playback robustness for various media content and platform
configurations within the Cobalt environment. Previously, this
value was a static constant, limiting experimental adjustments.

Bug: 471099187

💡 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

@johnedocampo johnedocampo force-pushed the experiment_SourceBufferIncrementalAppendSize branch from e095a5a to 3244844 Compare December 23, 2025 23:59
@johnedocampo johnedocampo force-pushed the experiment_SourceBufferIncrementalAppendSize branch from 3244844 to 46a7a99 Compare December 24, 2025 00:04
@johnedocampo johnedocampo changed the title media: Expose kMaxPendingBytesPerParse to H5Vcc media: Expose kMaxPendingBytesPerParse to H5vcc Dec 24, 2025
@johnedocampo
Copy link
Contributor Author

/gemini review

Copy link
Contributor

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

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 exposes media::StreamParser::kMaxPendingBytesPerParse as an H5vcc setting. The implementation is mostly correct, but there's a significant issue where the value from the setting, which is in kilobytes, is not converted to bytes before being used. This would cause the setting to be misinterpreted by a factor of 1024. I've also pointed out a minor style issue regarding vertical whitespace. Please see my detailed comments.

Comment on lines +183 to +185
int experimental_increment_size = *val;
media::StreamParser::SetMaxPendingBytesPerParse(
experimental_increment_size);
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The H5vcc setting Media.SourceBufferIncrementalAppendSizeKb provides a value in kilobytes, as indicated by the Kb suffix in its name. However, the code passes this value directly to SetMaxPendingBytesPerParse, which expects a value in bytes. This will cause the setting to be misinterpreted, using a value 1024 times smaller than intended.

Please convert the value from kilobytes to bytes by multiplying it by 1024. I've also updated the variable name for clarity.

    int experimental_increment_size_kb = *val;
    media::StreamParser::SetMaxPendingBytesPerParse(
        experimental_increment_size_kb * 1024);

#if BUILDFLAG(USE_STARBOARD_MEDIA)
// We drop the use of constexpr here to allow for experimentation.
static int kMaxPendingBytesPerParse;

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Per the Chromium C++ style guide's principle of minimizing vertical whitespace, please remove this blank line. This will also make the code consistent with the surrounding member declarations in this class.

References
  1. The repository style guide requires adherence to the Chromium style guide. The Chromium style guide advises minimizing vertical whitespace and avoiding unnecessary blank lines between member declarations. (link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant