Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] Support configuring maximum number of samples per write to SbPlayer from webapp #3325

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

borongc
Copy link
Contributor

@borongc borongc commented May 22, 2024

The PR (#3271) limits the maximum number of samples per write to SbPlayer with audio write ahead. This PR refactors the existing H5VCC flag from "EnableBatchedSampleWrite" to "AudioBatchedSampleWrite" that allows configuring maximum number of samples per write to SbPlayer from webapp.

  1. When "AudioBatchedSampleWrite=1" or not set, Cobalt uses the default number of samples per write (i.e., 1) to SbPlayer.
  2. When "AudioBatchedSampleWrite=n", where n > 1, Cobalt uses the number of samples per write estimated by GetEstimatedMaxBuffers() to SbPlayer.

This PR also changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on Android TV. Note in case 2, the number of samples per write is in the range of [1, min(SbPlayerGetMaximumNumberOfSamplesPerWrite(), AudioBatchedSampleWrite)]. For other platforms except Android, SbPlayerGetMaximumNumberOfSamplesPerWrite should return 1.

b/227837774

Test-On-Device: true

@borongc borongc force-pushed the android_multiple_write branch 5 times, most recently from 2f3f9fd to acff397 Compare June 11, 2024 22:29
@borongc borongc changed the title [android] Support configuring maximum number of samples per write to SbPlayer from webapp [media] Support configuring maximum number of samples per write to SbPlayer from webapp Jun 11, 2024
@borongc borongc force-pushed the android_multiple_write branch 4 times, most recently from 6eb3b09 to 305ec1a Compare June 12, 2024 19:54
@borongc borongc changed the title [media] Support configuring maximum number of samples per write to SbPlayer from webapp [android] Support configuring maximum number of samples per write to SbPlayer from webapp Jun 12, 2024
@borongc borongc requested a review from xiaomings June 12, 2024 22:11
@borongc borongc force-pushed the android_multiple_write branch 3 times, most recently from ee4ac0a to a52d84d Compare June 13, 2024 17:06
Copy link
Contributor

@sideb0ard sideb0ard left a comment

Choose a reason for hiding this comment

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

minor comments, lgtm!

cobalt/media/base/sbplayer_pipeline.h Outdated Show resolved Hide resolved
cobalt/media/base/sbplayer_pipeline.h Outdated Show resolved Hide resolved
…SbPlayer from webapp

1. Support maximum number of samples per write configuration from the h5vcc setting.
2. Enable this feature by the h5vcc settings of "EnableBatchedSampleWrite" and a positive value for "PlayerConfiguration.SetMaximumNumberOfSamplesPerWrite".

b/227837774
@borongc borongc merged commit ed62b35 into youtube:main Jun 13, 2024
336 of 365 checks passed
@borongc borongc deleted the android_multiple_write branch June 13, 2024 21:33
@borongc borongc added the cp-25.lts.1+ Cherry Pick to the 25.lts.1+ branch label Jun 13, 2024
kaidokert pushed a commit to borongc/cobalt that referenced this pull request Jun 14, 2024
This PR (youtube#3325) changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV, but current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests are not long enough for the modification. Disable the tests and should be re-enabled once it fixes.

b/347097484
borongc added a commit that referenced this pull request Jun 14, 2024
This PR (#3325) changes
SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt
supports multiple samples per write to SbPlayer (b/227837774), but
current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests
are not long enough for the modification. Disable the tests and should
be re-enabled once it fixes.

b/347097484
cobalt-github-releaser-bot pushed a commit that referenced this pull request Jun 14, 2024
This PR (#3325) changes
SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt
supports multiple samples per write to SbPlayer (b/227837774), but
current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests
are not long enough for the modification. Disable the tests and should
be re-enabled once it fixes.

b/347097484

(cherry picked from commit cc76a9c)
borongc added a commit that referenced this pull request Jun 14, 2024
#3567)

Refer to the original PR: #3564

This PR (#3325) changes
SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt
supports multiple samples per write to SbPlayer (b/227837774), but
current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests
are not long enough for the modification. Disable the tests and should
be re-enabled once it fixes.

b/347097484

Co-authored-by: Bo-Rong Chen <[email protected]>
borongc added a commit that referenced this pull request Jun 14, 2024
…SbPlayer from webapp (#3325)

The PR (#3271) limits the maximum
number of samples per write to SbPlayer with audio write ahead. This PR
refactors the existing H5VCC flag from "EnableBatchedSampleWrite" to
"AudioBatchedSampleWrite" that allows configuring maximum number of
samples per write to SbPlayer from webapp.

1. When "AudioBatchedSampleWrite=1" or not set, Cobalt uses the default
number of samples per write (i.e., 1) to SbPlayer.
2. When "AudioBatchedSampleWrite=n", where n > 1, Cobalt uses the number
of samples per write estimated by GetEstimatedMaxBuffers() to SbPlayer.

This PR also changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256
on Android TV. Note in case 2, the number of samples per write is in the
range of [1, min(SbPlayerGetMaximumNumberOfSamplesPerWrite(),
AudioBatchedSampleWrite)]. For other platforms except Android,
SbPlayerGetMaximumNumberOfSamplesPerWrite should return 1.

b/227837774

Test-On-Device: true
(cherry picked from commit ed62b35)
kaidokert pushed a commit that referenced this pull request Jun 14, 2024
… samples per write to SbPlayer from webapp (#3561)

Refer to the original PR: #3325

The PR (#3271) limits the maximum
number of samples per write to SbPlayer with audio write ahead. This PR
refactors the existing H5VCC flag from "EnableBatchedSampleWrite" to
"AudioBatchedSampleWrite" that allows configuring maximum number of
samples per write to SbPlayer from webapp.

1. When "AudioBatchedSampleWrite=1" or not set, Cobalt uses the default
number of samples per write (i.e., 1) to SbPlayer.
2. When "AudioBatchedSampleWrite=n", where n > 1, Cobalt uses the number
of samples per write estimated by GetEstimatedMaxBuffers() to SbPlayer.

This PR also changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256
on Android TV. Note in case 2, the number of samples per write is in the
range of [1, min(SbPlayerGetMaximumNumberOfSamplesPerWrite(),
AudioBatchedSampleWrite)]. For other platforms except Android,
SbPlayerGetMaximumNumberOfSamplesPerWrite should return 1.

b/227837774

Test-On-Device: true

Co-authored-by: Bo-Rong Chen <[email protected]>
borongc added a commit to borongc/cobalt that referenced this pull request Jun 14, 2024
Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR (youtube#3325).

b/227837774
borongc added a commit to borongc/cobalt that referenced this pull request Jun 14, 2024
Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR (youtube#3325).

b/227837774
borongc added a commit to borongc/cobalt that referenced this pull request Jun 15, 2024
Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR (youtube#3325).

b/227837774
borongc added a commit to borongc/cobalt that referenced this pull request Jun 17, 2024
Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR (youtube#3325).

b/227837774
borongc added a commit to borongc/cobalt that referenced this pull request Jun 17, 2024
Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR (youtube#3325).

b/227837774
borongc added a commit to borongc/cobalt that referenced this pull request Jun 17, 2024
Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR (youtube#3325).

b/227837774
borongc added a commit to borongc/cobalt that referenced this pull request Jun 17, 2024
This PR (youtube#3325) changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt supports multiple samples per write to SbPlayer (b/227837774), but current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests are not long enough for the modification.

1. Set upper bounds for WriteSingleBatch tests (15 audio samples per write, 60 video samples per write) when SbPlayerGetMaximumNumberOfSamplesPerWrite() > 1.
2. Revisit the upper bounds when the requirement is changed (b/347728473).

b/347097484

Test-On-Device: true
borongc added a commit to borongc/cobalt that referenced this pull request Jun 17, 2024
This PR (youtube#3325) changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt supports multiple samples per write to SbPlayer (b/227837774), but current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests are not long enough for the modification.

1. Set upper bounds for WriteSingleBatch tests (15 audio samples per write, 60 video samples per write) when SbPlayerGetMaximumNumberOfSamplesPerWrite() > 1.
2. Revisit the upper bounds when the requirement is changed (b/347728473).

b/347097484

Test-On-Device: true
borongc added a commit that referenced this pull request Jun 17, 2024
…#3568)

Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR
(#3325).

b/227837774
cobalt-github-releaser-bot pushed a commit that referenced this pull request Jun 17, 2024
…#3568)

Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR
(#3325).

b/227837774

(cherry picked from commit c5bd482)
borongc added a commit that referenced this pull request Jun 17, 2024
…axAudioSamplesPerWrite (#3585)

Refer to the original PR: #3568

Rename AudioBatchedSampleWrite to MaxAudioSamplesPerWrite followed by PR
(#3325).

b/227837774

Co-authored-by: Bo-Rong Chen <[email protected]>
borongc added a commit to borongc/cobalt that referenced this pull request Jun 17, 2024
This PR (youtube#3325) changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt supports multiple samples per write to SbPlayer (b/227837774), but current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests are not long enough for the modification.

1. Set upper bounds for WriteSingleBatch tests (15 audio samples per write, 60 video samples per write) when SbPlayerGetMaximumNumberOfSamplesPerWrite() > 1.
2. Revisit the upper bounds when the requirement is changed (b/347728473).

b/347097484

Test-On-Device: true
borongc added a commit to borongc/cobalt that referenced this pull request Jun 17, 2024
This PR (youtube#3325) changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt supports multiple samples per write to SbPlayer (b/227837774), but current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests are not long enough for the modification.

1. Set upper bounds for WriteSingleBatch tests (15 audio samples per write, 60 video samples per write) when SbPlayerGetMaximumNumberOfSamplesPerWrite() > 1.
2. Revisit the upper bounds when the requirement is changed (b/347728473).

b/347097484

Test-On-Device: true
borongc added a commit to borongc/cobalt that referenced this pull request Jun 18, 2024
This PR (youtube#3325) changes SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt supports multiple samples per write to SbPlayer (b/227837774), but current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests are not long enough for the modification.

1. Set upper bounds for WriteSingleBatch tests (15 audio samples per write, 60 video samples per write) when SbPlayerGetMaximumNumberOfSamplesPerWrite() > 1.
2. Revisit the upper bounds when the requirement is changed (b/347728473).

b/347097484

Test-On-Device: true
borongc added a commit that referenced this pull request Jun 18, 2024
This PR (#3325) changes
SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt
supports multiple samples per write to SbPlayer (b/227837774), but
current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests
are not long enough for the modification.

1. Set upper bounds for WriteSingleBatch tests (15 audio samples per
write, 60 video samples per write) when
SbPlayerGetMaximumNumberOfSamplesPerWrite() > 1.
2. We should revisit the upper bounds when the requirement is changed
(b/347728473).

b/347097484

Test-On-Device: true
cobalt-github-releaser-bot pushed a commit that referenced this pull request Jun 18, 2024
This PR (#3325) changes
SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt
supports multiple samples per write to SbPlayer (b/227837774), but
current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests
are not long enough for the modification.

1. Set upper bounds for WriteSingleBatch tests (15 audio samples per
write, 60 video samples per write) when
SbPlayerGetMaximumNumberOfSamplesPerWrite() > 1.
2. We should revisit the upper bounds when the requirement is changed
(b/347728473).

b/347097484

Test-On-Device: true
(cherry picked from commit 5115448)
borongc added a commit that referenced this pull request Jun 18, 2024
…3590)

Refer to the original PR: #3584

This PR (#3325) changes
SbPlayerGetMaximumNumberOfSamplesPerWrite() to 256 on ATV as Cobalt
supports multiple samples per write to SbPlayer (b/227837774), but
current testing files for SbPlayerWriteSampleTest.WriteSingleBatch tests
are not long enough for the modification.

1. Set upper bounds for WriteSingleBatch tests (15 audio samples per
write, 60 video samples per write) when
SbPlayerGetMaximumNumberOfSamplesPerWrite() > 1.
2. We should revisit the upper bounds when the requirement is changed
(b/347728473).

b/347097484

Test-On-Device: true

Co-authored-by: Bo-Rong Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cp-25.lts.1+ Cherry Pick to the 25.lts.1+ branch on_device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants