mirror of
https://github.com/samsonjs/media.git
synced 2026-04-05 11:15:46 +00:00
Delete dead code and fix javadocs from hls
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146466389
This commit is contained in:
parent
c82319332f
commit
f2d3af7dea
3 changed files with 17 additions and 38 deletions
|
|
@ -112,10 +112,9 @@ import java.util.LinkedList;
|
|||
* @param chunkSource A {@link HlsChunkSource} from which chunks to load are obtained.
|
||||
* @param allocator An {@link Allocator} from which to obtain media buffer allocations.
|
||||
* @param positionUs The position from which to start loading media.
|
||||
* @param muxedAudioFormat If HLS master playlist indicates that the stream contains muxed audio,
|
||||
* this is the audio {@link Format} as defined by the playlist.
|
||||
* @param muxedCaptionFormat If HLS master playlist indicates that the stream contains muxed
|
||||
* captions, this is the audio {@link Format} as defined by the playlist.
|
||||
* @param muxedAudioFormat Optional muxed audio {@link Format} as defined by the master playlist.
|
||||
* @param muxedCaptionFormat Optional muxed closed caption {@link Format} as defined by the master
|
||||
* playlist.
|
||||
* @param minLoadableRetryCount The minimum number of times that the source should retry a load
|
||||
* before propagating an error.
|
||||
* @param eventDispatcher A dispatcher to notify of events.
|
||||
|
|
@ -266,15 +265,6 @@ import java.util.LinkedList;
|
|||
released = true;
|
||||
}
|
||||
|
||||
public long getLargestQueuedTimestampUs() {
|
||||
long largestQueuedTimestampUs = Long.MIN_VALUE;
|
||||
for (int i = 0; i < sampleQueues.size(); i++) {
|
||||
largestQueuedTimestampUs = Math.max(largestQueuedTimestampUs,
|
||||
sampleQueues.valueAt(i).getLargestQueuedTimestampUs());
|
||||
}
|
||||
return largestQueuedTimestampUs;
|
||||
}
|
||||
|
||||
public void setIsTimestampMaster(boolean isTimestampMaster) {
|
||||
chunkSource.setIsTimestampMaster(isTimestampMaster);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,27 +31,18 @@ public final class HlsMasterPlaylist extends HlsPlaylist {
|
|||
*/
|
||||
public static final class HlsUrl {
|
||||
|
||||
public final String name;
|
||||
public final String url;
|
||||
public final Format format;
|
||||
public final Format videoFormat;
|
||||
public final Format audioFormat;
|
||||
public final Format[] textFormats;
|
||||
|
||||
public static HlsUrl createMediaPlaylistHlsUrl(String baseUri) {
|
||||
Format format = Format.createContainerFormat("0", MimeTypes.APPLICATION_M3U8, null, null,
|
||||
Format.NO_VALUE, 0, null);
|
||||
return new HlsUrl(null, baseUri, format, null, null, null);
|
||||
return new HlsUrl(baseUri, format);
|
||||
}
|
||||
|
||||
public HlsUrl(String name, String url, Format format, Format videoFormat, Format audioFormat,
|
||||
Format[] textFormats) {
|
||||
this.name = name;
|
||||
public HlsUrl(String url, Format format) {
|
||||
this.url = url;
|
||||
this.format = format;
|
||||
this.videoFormat = videoFormat;
|
||||
this.audioFormat = audioFormat;
|
||||
this.textFormats = textFormats;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,30 +179,28 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
|
|||
if (line.startsWith(TAG_MEDIA)) {
|
||||
@C.SelectionFlags int selectionFlags = parseSelectionFlags(line);
|
||||
String uri = parseOptionalStringAttr(line, REGEX_URI);
|
||||
String name = parseStringAttr(line, REGEX_NAME);
|
||||
String id = parseStringAttr(line, REGEX_NAME);
|
||||
String language = parseOptionalStringAttr(line, REGEX_LANGUAGE);
|
||||
Format format;
|
||||
switch (parseStringAttr(line, REGEX_TYPE)) {
|
||||
case TYPE_AUDIO:
|
||||
format = Format.createAudioContainerFormat(name, MimeTypes.APPLICATION_M3U8,
|
||||
null, null, Format.NO_VALUE, Format.NO_VALUE, Format.NO_VALUE, null, selectionFlags,
|
||||
language);
|
||||
format = Format.createAudioContainerFormat(id, MimeTypes.APPLICATION_M3U8, null, null,
|
||||
Format.NO_VALUE, Format.NO_VALUE, Format.NO_VALUE, null, selectionFlags, language);
|
||||
if (uri == null) {
|
||||
muxedAudioFormat = format;
|
||||
} else {
|
||||
audios.add(new HlsMasterPlaylist.HlsUrl(name, uri, format, null, format, null));
|
||||
audios.add(new HlsMasterPlaylist.HlsUrl(uri, format));
|
||||
}
|
||||
break;
|
||||
case TYPE_SUBTITLES:
|
||||
format = Format.createTextContainerFormat(name, MimeTypes.APPLICATION_M3U8,
|
||||
format = Format.createTextContainerFormat(id, MimeTypes.APPLICATION_M3U8,
|
||||
MimeTypes.TEXT_VTT, null, Format.NO_VALUE, selectionFlags, language);
|
||||
subtitles.add(new HlsMasterPlaylist.HlsUrl(name, uri, format, null, format, null));
|
||||
subtitles.add(new HlsMasterPlaylist.HlsUrl(uri, format));
|
||||
break;
|
||||
case TYPE_CLOSED_CAPTIONS:
|
||||
if ("CC1".equals(parseOptionalStringAttr(line, REGEX_INSTREAM_ID))) {
|
||||
muxedCaptionFormat = Format.createTextContainerFormat(name,
|
||||
MimeTypes.APPLICATION_M3U8, MimeTypes.APPLICATION_CEA608, null, Format.NO_VALUE,
|
||||
selectionFlags, language);
|
||||
muxedCaptionFormat = Format.createTextContainerFormat(id, MimeTypes.APPLICATION_M3U8,
|
||||
MimeTypes.APPLICATION_CEA608, null, Format.NO_VALUE, selectionFlags, language);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -229,10 +227,10 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
|
|||
height = Format.NO_VALUE;
|
||||
}
|
||||
line = iterator.next();
|
||||
String name = Integer.toString(variants.size());
|
||||
Format format = Format.createVideoContainerFormat(name, MimeTypes.APPLICATION_M3U8, null,
|
||||
codecs, bitrate, width, height, Format.NO_VALUE, null, 0);
|
||||
variants.add(new HlsMasterPlaylist.HlsUrl(name, line, format, null, null, null));
|
||||
Format format = Format.createVideoContainerFormat(Integer.toString(variants.size()),
|
||||
MimeTypes.APPLICATION_M3U8, null, codecs, bitrate, width, height, Format.NO_VALUE, null,
|
||||
0);
|
||||
variants.add(new HlsMasterPlaylist.HlsUrl(line, format));
|
||||
}
|
||||
}
|
||||
return new HlsMasterPlaylist(baseUri, variants, audios, subtitles, muxedAudioFormat,
|
||||
|
|
|
|||
Loading…
Reference in a new issue