mirror of
https://github.com/androidx/media.git
synced 2025-05-09 16:40:55 +08:00
Add the HlsMetadataEntry from the Master playlist to the Hls tracks
PiperOrigin-RevId: 243624081
This commit is contained in:
parent
e9a7d47f62
commit
9ddd39c1c0
@ -1059,12 +1059,18 @@ public final class Format implements Parcelable {
|
||||
@Nullable String label,
|
||||
@Nullable String sampleMimeType,
|
||||
@Nullable String codecs,
|
||||
@Nullable Metadata metadata,
|
||||
int bitrate,
|
||||
int width,
|
||||
int height,
|
||||
int channelCount,
|
||||
@C.SelectionFlags int selectionFlags,
|
||||
@Nullable String language) {
|
||||
|
||||
if (this.metadata != null) {
|
||||
metadata = this.metadata.copyWithAppendedEntriesFrom(metadata);
|
||||
}
|
||||
|
||||
return new Format(
|
||||
id,
|
||||
label,
|
||||
@ -1127,6 +1133,12 @@ public final class Format implements Parcelable {
|
||||
codecs = codecsOfType;
|
||||
}
|
||||
}
|
||||
|
||||
Metadata metadata =
|
||||
this.metadata == null
|
||||
? manifestFormat.metadata
|
||||
: this.metadata.copyWithAppendedEntriesFrom(manifestFormat.metadata);
|
||||
|
||||
float frameRate = this.frameRate;
|
||||
if (frameRate == NO_VALUE && trackType == C.TRACK_TYPE_VIDEO) {
|
||||
frameRate = manifestFormat.frameRate;
|
||||
|
@ -78,6 +78,21 @@ public final class Metadata implements Parcelable {
|
||||
return entries[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a copy of this metadata with the entries of the specified metadata appended. Returns
|
||||
* this instance if {@code other} is null.
|
||||
*
|
||||
* @param other The metadata that holds the entries to append. If null, this methods returns this
|
||||
* instance.
|
||||
* @return The metadata instance with the appended entries.
|
||||
*/
|
||||
public Metadata copyWithAppendedEntriesFrom(@Nullable Metadata other) {
|
||||
if (other == null) {
|
||||
return this;
|
||||
}
|
||||
return copyWithAppendedEntries(other.entries);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a copy of this metadata with the specified entries appended.
|
||||
*
|
||||
|
@ -1126,6 +1126,7 @@ import java.util.Map;
|
||||
playlistFormat.label,
|
||||
mimeType,
|
||||
codecs,
|
||||
playlistFormat.metadata,
|
||||
bitrate,
|
||||
playlistFormat.width,
|
||||
playlistFormat.height,
|
||||
|
Loading…
x
Reference in New Issue
Block a user