Commit f2d3af7d by aquilescanta Committed by Oliver Woodman

Delete dead code and fix javadocs from hls

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146466389
parent c8231933
...@@ -112,10 +112,9 @@ import java.util.LinkedList; ...@@ -112,10 +112,9 @@ import java.util.LinkedList;
* @param chunkSource A {@link HlsChunkSource} from which chunks to load are obtained. * @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 allocator An {@link Allocator} from which to obtain media buffer allocations.
* @param positionUs The position from which to start loading media. * @param positionUs The position from which to start loading media.
* @param muxedAudioFormat If HLS master playlist indicates that the stream contains muxed audio, * @param muxedAudioFormat Optional muxed audio {@link Format} as defined by the master playlist.
* this is the audio {@link Format} as defined by the playlist. * @param muxedCaptionFormat Optional muxed closed caption {@link Format} as defined by the master
* @param muxedCaptionFormat If HLS master playlist indicates that the stream contains muxed * playlist.
* captions, this is the audio {@link Format} as defined by the playlist.
* @param minLoadableRetryCount The minimum number of times that the source should retry a load * @param minLoadableRetryCount The minimum number of times that the source should retry a load
* before propagating an error. * before propagating an error.
* @param eventDispatcher A dispatcher to notify of events. * @param eventDispatcher A dispatcher to notify of events.
...@@ -266,15 +265,6 @@ import java.util.LinkedList; ...@@ -266,15 +265,6 @@ import java.util.LinkedList;
released = true; 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) { public void setIsTimestampMaster(boolean isTimestampMaster) {
chunkSource.setIsTimestampMaster(isTimestampMaster); chunkSource.setIsTimestampMaster(isTimestampMaster);
} }
......
...@@ -31,27 +31,18 @@ public final class HlsMasterPlaylist extends HlsPlaylist { ...@@ -31,27 +31,18 @@ public final class HlsMasterPlaylist extends HlsPlaylist {
*/ */
public static final class HlsUrl { public static final class HlsUrl {
public final String name;
public final String url; public final String url;
public final Format format; public final Format format;
public final Format videoFormat;
public final Format audioFormat;
public final Format[] textFormats;
public static HlsUrl createMediaPlaylistHlsUrl(String baseUri) { public static HlsUrl createMediaPlaylistHlsUrl(String baseUri) {
Format format = Format.createContainerFormat("0", MimeTypes.APPLICATION_M3U8, null, null, Format format = Format.createContainerFormat("0", MimeTypes.APPLICATION_M3U8, null, null,
Format.NO_VALUE, 0, 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, public HlsUrl(String url, Format format) {
Format[] textFormats) {
this.name = name;
this.url = url; this.url = url;
this.format = format; this.format = format;
this.videoFormat = videoFormat;
this.audioFormat = audioFormat;
this.textFormats = textFormats;
} }
} }
......
...@@ -179,30 +179,28 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli ...@@ -179,30 +179,28 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
if (line.startsWith(TAG_MEDIA)) { if (line.startsWith(TAG_MEDIA)) {
@C.SelectionFlags int selectionFlags = parseSelectionFlags(line); @C.SelectionFlags int selectionFlags = parseSelectionFlags(line);
String uri = parseOptionalStringAttr(line, REGEX_URI); String uri = parseOptionalStringAttr(line, REGEX_URI);
String name = parseStringAttr(line, REGEX_NAME); String id = parseStringAttr(line, REGEX_NAME);
String language = parseOptionalStringAttr(line, REGEX_LANGUAGE); String language = parseOptionalStringAttr(line, REGEX_LANGUAGE);
Format format; Format format;
switch (parseStringAttr(line, REGEX_TYPE)) { switch (parseStringAttr(line, REGEX_TYPE)) {
case TYPE_AUDIO: case TYPE_AUDIO:
format = Format.createAudioContainerFormat(name, MimeTypes.APPLICATION_M3U8, format = Format.createAudioContainerFormat(id, MimeTypes.APPLICATION_M3U8, null, null,
null, null, Format.NO_VALUE, Format.NO_VALUE, Format.NO_VALUE, null, selectionFlags, Format.NO_VALUE, Format.NO_VALUE, Format.NO_VALUE, null, selectionFlags, language);
language);
if (uri == null) { if (uri == null) {
muxedAudioFormat = format; muxedAudioFormat = format;
} else { } else {
audios.add(new HlsMasterPlaylist.HlsUrl(name, uri, format, null, format, null)); audios.add(new HlsMasterPlaylist.HlsUrl(uri, format));
} }
break; break;
case TYPE_SUBTITLES: 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); 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; break;
case TYPE_CLOSED_CAPTIONS: case TYPE_CLOSED_CAPTIONS:
if ("CC1".equals(parseOptionalStringAttr(line, REGEX_INSTREAM_ID))) { if ("CC1".equals(parseOptionalStringAttr(line, REGEX_INSTREAM_ID))) {
muxedCaptionFormat = Format.createTextContainerFormat(name, muxedCaptionFormat = Format.createTextContainerFormat(id, MimeTypes.APPLICATION_M3U8,
MimeTypes.APPLICATION_M3U8, MimeTypes.APPLICATION_CEA608, null, Format.NO_VALUE, MimeTypes.APPLICATION_CEA608, null, Format.NO_VALUE, selectionFlags, language);
selectionFlags, language);
} }
break; break;
default: default:
...@@ -229,10 +227,10 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli ...@@ -229,10 +227,10 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
height = Format.NO_VALUE; height = Format.NO_VALUE;
} }
line = iterator.next(); line = iterator.next();
String name = Integer.toString(variants.size()); Format format = Format.createVideoContainerFormat(Integer.toString(variants.size()),
Format format = Format.createVideoContainerFormat(name, MimeTypes.APPLICATION_M3U8, null, MimeTypes.APPLICATION_M3U8, null, codecs, bitrate, width, height, Format.NO_VALUE, null,
codecs, bitrate, width, height, Format.NO_VALUE, null, 0); 0);
variants.add(new HlsMasterPlaylist.HlsUrl(name, line, format, null, null, null)); variants.add(new HlsMasterPlaylist.HlsUrl(line, format));
} }
} }
return new HlsMasterPlaylist(baseUri, variants, audios, subtitles, muxedAudioFormat, return new HlsMasterPlaylist(baseUri, variants, audios, subtitles, muxedAudioFormat,
......
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 sign in to comment