use of org.geotoolkit.wps.xml.v200.Format in project ExoPlayer by google.
the class DashManifestParser method buildRepresentation.
protected Representation buildRepresentation(RepresentationInfo representationInfo, String contentId, ArrayList<SchemeData> extraDrmSchemeDatas, ArrayList<SchemeValuePair> extraInbandEventStreams) {
Format format = representationInfo.format;
ArrayList<SchemeData> drmSchemeDatas = representationInfo.drmSchemeDatas;
drmSchemeDatas.addAll(extraDrmSchemeDatas);
if (!drmSchemeDatas.isEmpty()) {
format = format.copyWithDrmInitData(new DrmInitData(drmSchemeDatas));
}
ArrayList<SchemeValuePair> inbandEventStremas = representationInfo.inbandEventStreams;
inbandEventStremas.addAll(extraInbandEventStreams);
return Representation.newInstance(contentId, Representation.REVISION_ID_DEFAULT, format, representationInfo.baseUrl, representationInfo.segmentBase, inbandEventStremas);
}
use of org.geotoolkit.wps.xml.v200.Format in project ExoPlayer by google.
the class DashMediaPeriod method buildTrackGroups.
// Internal methods.
private static Pair<TrackGroupArray, EmbeddedTrackInfo[]> buildTrackGroups(List<AdaptationSet> adaptationSets) {
int adaptationSetCount = adaptationSets.size();
int embeddedTrackCount = getEmbeddedTrackCount(adaptationSets);
TrackGroup[] trackGroupArray = new TrackGroup[adaptationSetCount + embeddedTrackCount];
EmbeddedTrackInfo[] embeddedTrackInfos = new EmbeddedTrackInfo[embeddedTrackCount];
int embeddedTrackIndex = 0;
for (int i = 0; i < adaptationSetCount; i++) {
AdaptationSet adaptationSet = adaptationSets.get(i);
List<Representation> representations = adaptationSet.representations;
Format[] formats = new Format[representations.size()];
for (int j = 0; j < formats.length; j++) {
formats[j] = representations.get(j).format;
}
trackGroupArray[i] = new TrackGroup(formats);
if (hasEventMessageTrack(adaptationSet)) {
Format format = Format.createSampleFormat(adaptationSet.id + ":emsg", MimeTypes.APPLICATION_EMSG, null, Format.NO_VALUE, null);
trackGroupArray[adaptationSetCount + embeddedTrackIndex] = new TrackGroup(format);
embeddedTrackInfos[embeddedTrackIndex++] = new EmbeddedTrackInfo(i, C.TRACK_TYPE_METADATA);
}
if (hasCea608Track(adaptationSet)) {
Format format = Format.createTextSampleFormat(adaptationSet.id + ":cea608", MimeTypes.APPLICATION_CEA608, null, Format.NO_VALUE, 0, null, null);
trackGroupArray[adaptationSetCount + embeddedTrackIndex] = new TrackGroup(format);
embeddedTrackInfos[embeddedTrackIndex++] = new EmbeddedTrackInfo(i, C.TRACK_TYPE_TEXT);
}
}
return Pair.create(new TrackGroupArray(trackGroupArray), embeddedTrackInfos);
}
use of org.geotoolkit.wps.xml.v200.Format in project AntennaPod by AntennaPod.
the class ExoPlayerWrapper method getAudioTracks.
@Override
public List<String> getAudioTracks() {
List<String> trackNames = new ArrayList<>();
TrackNameProvider trackNameProvider = new DefaultTrackNameProvider(context.getResources());
for (Format format : getFormats()) {
trackNames.add(trackNameProvider.getTrackName(format));
}
return trackNames;
}
use of org.geotoolkit.wps.xml.v200.Format in project AntennaPod by AntennaPod.
the class ExoPlayerWrapper method getFormats.
private List<Format> getFormats() {
List<Format> formats = new ArrayList<>();
MappingTrackSelector.MappedTrackInfo trackInfo = trackSelector.getCurrentMappedTrackInfo();
if (trackInfo == null) {
return Collections.emptyList();
}
TrackGroupArray trackGroups = trackInfo.getTrackGroups(getAudioRendererIndex());
for (int i = 0; i < trackGroups.length; i++) {
formats.add(trackGroups.get(i).getFormat(0));
}
return formats;
}
use of org.geotoolkit.wps.xml.v200.Format in project ExoPlayer by google.
the class MetadataRenderer method decodeWrappedMetadata.
/**
* Iterates through {@code metadata.entries} and checks each one to see if contains wrapped
* metadata. If it does, then we recursively decode the wrapped metadata. If it doesn't (recursion
* base-case), we add the {@link Metadata.Entry} to {@code decodedEntries} (output parameter).
*/
private void decodeWrappedMetadata(Metadata metadata, List<Metadata.Entry> decodedEntries) {
for (int i = 0; i < metadata.length(); i++) {
@Nullable Format wrappedMetadataFormat = metadata.get(i).getWrappedMetadataFormat();
if (wrappedMetadataFormat != null && decoderFactory.supportsFormat(wrappedMetadataFormat)) {
MetadataDecoder wrappedMetadataDecoder = decoderFactory.createDecoder(wrappedMetadataFormat);
// wrappedMetadataFormat != null so wrappedMetadataBytes must be non-null too.
byte[] wrappedMetadataBytes = Assertions.checkNotNull(metadata.get(i).getWrappedMetadataBytes());
buffer.clear();
buffer.ensureSpaceForWrite(wrappedMetadataBytes.length);
castNonNull(buffer.data).put(wrappedMetadataBytes);
buffer.flip();
@Nullable Metadata innerMetadata = wrappedMetadataDecoder.decode(buffer);
if (innerMetadata != null) {
// The decoding succeeded, so we'll try another level of unwrapping.
decodeWrappedMetadata(innerMetadata, decodedEntries);
}
} else {
// Entry doesn't contain any wrapped metadata, so output it directly.
decodedEntries.add(metadata.get(i));
}
}
}
Aggregations