Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion constants.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
project.ext {
releaseVersion = '1.2.1-dr9'
releaseVersion = '1.2.1-dr10'
releaseVersionCode = 1_002_001_3_00
minSdkVersion = 16
// See https://developer.android.com/training/cars/media/automotive-os#automotive-module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static void maybeSetByteBuffer(MediaFormat format, String key, @Nullable
*/
@SuppressWarnings("InlinedApi")
public static void maybeSetColorInfo(MediaFormat format, @Nullable ColorInfo colorInfo) {
if (!ColorInfo.isEquivalentToAssumedSdrDefault(colorInfo)) {
if (colorInfo != null) {
maybeSetInteger(format, MediaFormat.KEY_COLOR_TRANSFER, colorInfo.colorTransfer);
maybeSetInteger(format, MediaFormat.KEY_COLOR_STANDARD, colorInfo.colorSpace);
maybeSetInteger(format, MediaFormat.KEY_COLOR_RANGE, colorInfo.colorRange);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,4 @@ public void createMediaFormatFromFormat_withCustomPcmEncoding_setsCustomPcmEncod
.isEqualTo(C.ENCODING_PCM_16BIT_BIG_ENDIAN);
assertThat(mediaFormat.containsKey(MediaFormat.KEY_PCM_ENCODING)).isFalse();
}

@Test
public void createMediaFormatFromFormat_withSdrColorInfo_omitsMediaFormatColorInfoKeys() {
Format format = new Format.Builder().setColorInfo(ColorInfo.SDR_BT709_LIMITED).build();

MediaFormat mediaFormat = MediaFormatUtil.createMediaFormatFromFormat(format);

assertThat(mediaFormat.containsKey(MediaFormat.KEY_COLOR_TRANSFER)).isFalse();
assertThat(mediaFormat.containsKey(MediaFormat.KEY_COLOR_RANGE)).isFalse();
assertThat(mediaFormat.containsKey(MediaFormat.KEY_COLOR_STANDARD)).isFalse();
assertThat(mediaFormat.containsKey(MediaFormat.KEY_HDR_STATIC_INFO)).isFalse();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,9 @@ public MediaMetadataCompat getMetadata(Player player) {
player.isCurrentMediaItemDynamic() || player.getDuration() == C.TIME_UNSET
? -1
: player.getDuration());
long activeQueueItemId = mediaController.getPlaybackState().getActiveQueueItemId();
long activeQueueItemId = mediaController.getPlaybackState() == null
? MediaSessionCompat.QueueItem.UNKNOWN_ID
: mediaController.getPlaybackState().getActiveQueueItemId();
if (activeQueueItemId != MediaSessionCompat.QueueItem.UNKNOWN_ID) {
List<MediaSessionCompat.QueueItem> queue = mediaController.getQueue();
for (int i = 0; queue != null && i < queue.size(); i++) {
Expand Down