Commit 070ab0de authored by Simeon Anfinrud's avatar Simeon Anfinrud Committed by Commit Bot

[Chromecast] Enable CMA by default on Android.

This allows some Java code to be compiled on CQ that wasn't
previously.

Bug: None
Test: build cast_shell_apk
Change-Id: Icaa97f7fef8a805942355aac14634a270bff57e3
Reviewed-on: https://chromium-review.googlesource.com/1241847Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Simeon Anfinrud <sanfin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594451}
parent 90b1a0d7
...@@ -121,7 +121,7 @@ class AudioSinkAudioTrackImpl { ...@@ -121,7 +121,7 @@ class AudioSinkAudioTrackImpl {
// Additional padding for minimum buffer time, determined experimentally. // Additional padding for minimum buffer time, determined experimentally.
private static final long MIN_BUFFERED_TIME_PADDING_US = ANDROID_AUDIO_PERIOD_SIZE_US; private static final long MIN_BUFFERED_TIME_PADDING_US = ANDROID_AUDIO_PERIOD_SIZE_US;
private static AudioManager sAudioManager = null; private static AudioManager sAudioManager;
private static int sSessionIdMedia = AudioManager.ERROR; private static int sSessionIdMedia = AudioManager.ERROR;
private static int sSessionIdCommunication = AudioManager.ERROR; private static int sSessionIdCommunication = AudioManager.ERROR;
......
...@@ -45,7 +45,7 @@ class VolumeControl { ...@@ -45,7 +45,7 @@ class VolumeControl {
Settings(int streamType) { Settings(int streamType) {
mStreamType = streamType; mStreamType = streamType;
mMaxVolumeIndexAsFloat = (float) mAudioManager.getStreamMaxVolume(mStreamType); mMaxVolumeIndexAsFloat = (float) mAudioManager.getStreamMaxVolume(mStreamType);
mMinVolumeIndex = mAudioManager.getStreamMinVolume(mStreamType); mMinVolumeIndex = getStreamMinVolume(mAudioManager, mStreamType);
refreshVolume(); refreshVolume();
refreshMuteState(); refreshMuteState();
} }
...@@ -261,6 +261,14 @@ class VolumeControl { ...@@ -261,6 +261,14 @@ class VolumeControl {
mSettings.get(castType).setMuted(muted); mSettings.get(castType).setMuted(muted);
} }
@SuppressWarnings("NewApi")
private static int getStreamMinVolume(AudioManager audioManager, int streamType) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
return audioManager.getStreamMinVolume(streamType);
}
return 0;
}
// //
// JNI functions in native land. // JNI functions in native land.
// //
......
...@@ -77,7 +77,8 @@ declare_args() { ...@@ -77,7 +77,8 @@ declare_args() {
enable_hls_sample_aes = proprietary_codecs && is_chromecast enable_hls_sample_aes = proprietary_codecs && is_chromecast
# If true, use cast CMA backend instead of default chromium media pipeline. # If true, use cast CMA backend instead of default chromium media pipeline.
is_cast_using_cma_backend = is_cast_audio_only || !is_android # TODO(sanfin): Remove this flag when all builds enable CMA.
is_cast_using_cma_backend = true
} }
# enable_hls_sample_aes can only be true if enable_mse_mpeg2ts_stream_parser is. # enable_hls_sample_aes can only be true if enable_mse_mpeg2ts_stream_parser is.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment