text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>amily == null) { fontFamily = ancestor.fontFamily; } if (linethrough == UNSPECIFIED) { linethrough = ancestor.linethrough; } if (underline == UNSPECIFIED) { underline = ancestor.underline; } if (textAlign == null) { textAlign = ancestor.t...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compl<|fim_suffix|>globalStyles, regionMap, imageMap); } @VisibleForTesting /* package */ Map<String, TtmlStyle> getGlobalStyles() { ...
fim
yuliskov/SmartTube
java
<|fim_suffix|> = readSubtitleText(parsableByteArray); if (cueTextString.isEmpty()) { return Tx3gSubtitle.EMPTY; } // Attach default styles. SpannableStringBuilder cueText = new SpannableStringBuilder(cueTextString); attachFontFace(cueText, defaultFontFace, DEFAULT_FONT_FACE, 0, cueText.length(...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open So<|fim_suffix|>ptyList(); } } <|fim_middle|>urce Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www....
fim
yuliskov/SmartTube
java
<|fim_suffix|>t.getPosition(); skipStyleBlock(input); styleInput.reset(input.data, input.getPosition()); styleInput.setPosition(initialInputPosition); List<WebvttCssStyle> styles = new ArrayList<>(); String selector; while ((selector = parseSelector(styleInput, stringBuilder)) != null) { ...
fim
yuliskov/SmartTube
java
<|fim_suffix|>ttSubtitle(resultingCueList); } private static Cue parseVttCueBox(ParsableByteArray sampleData, WebvttCue.Builder builder, int remainingCueBoxBytes) throws SubtitleDecoderException { builder.reset(); while (remainingCueBoxBytes > 0) { if (remainingCueBoxBytes < BOX_HEADER_SIZE) ...
fim
yuliskov/SmartTube
java
<|fim_suffix|>st) { cues = Collections.unmodifiableList(cueList); } @Override public int getNextEventTimeIndex(long timeUs) { return timeUs < 0 ? 0 : C.INDEX_UNSET; } @Override public int getEventTimeCount() { return 1; } @Override public long getEventTime(int index) { Assertions.ch...
fim
yuliskov/SmartTube
java
<|fim_suffix|>to the score. * <li> Universal selector matching scores 1. * </ul> * * @param id The id of the cue if present, {@code null} otherwise. * @param tag Name of the tag, {@code null} if it refers to the entire cue. * @param classes An array containing the classes the tag belongs to. Must not ...
fim
yuliskov/SmartTube
java
<|fim_suffix|> positionAnchor = Cue.ANCHOR_TYPE_START; break; } } return this; } } } <|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with...
fim
yuliskov/SmartTube
java
<|fim_suffix|> } } private static void parsePositionAttribute(String s, WebvttCue.Builder builder) throws NumberFormatException { int commaIndex = s.indexOf(','); if (commaIndex != -1) { builder.setPositionAnchor(parsePositionAnchor(s.substring(commaIndex + 1))); s = s.substring(0, com...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
fim
yuliskov/SmartTube
java
<|fim_suffix|> < values[i].length; j++) { logValues[i][j] = values[i][j] == Format.NO_VALUE ? 0 : Math.log(values[i][j]); } } return logValues; } /** * Returns idealized switch points for each switch between consecutive track selection bitrates. * * @param logBitrates Log bitrates wi...
fim
yuliskov/SmartTube
java
<|fim_suffix|>Set the formats, sorted in order of decreasing bandwidth. formats = new Format[length]; for (int i = 0; i < tracks.length; i++) { formats[i] = group.getFormat(tracks[i]); } Arrays.sort(formats, new DecreasingBandwidthComparator()); // Set the format indices in the same order. ...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>racks within the {@link TrackGroup}. Must not be * null or empty. May be in any order. * @param random A source of random numbers. */ public RandomTrackSelection(TrackGroup group, int[] tracks, Random random) { super(group, tracks); this.random = random; selectedIndex = random.n...
fim
yuliskov/SmartTube
java
<|fim_suffix|>Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is di...
fim
yuliskov/SmartTube
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
fim
yuliskov/SmartTube
java
<|fim_suffix|> selection. */ public @Nullable TrackSelection get(int index) { return trackSelections[index]; } /** Returns the selections in a newly allocated array. */ public @NullableType TrackSelection[] getAll() { return trackSelections.clone(); } @Override public int hashCode() { if ...
fim
yuliskov/SmartTube
java
<|fim_suffix|>ashCode() { int result = 1; // Audio result = 31 * result + (preferredAudioLanguage == null ? 0 : preferredAudioLanguage.hashCode()); // Text result = 31 * result + (preferredTextLanguage == null ? 0 : preferredTextLanguage.hashCode()); result = 31 * result + preferredTextRoleFlags...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>of the renderers for which tracks * are to be selected. * @param trackGroups The available track groups. * @param periodId The {@link MediaPeriodId} of the period for which tracks are to be selected. * @param timeline The {@link Timeline} holding the period for which tracks are to be selec...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless re...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the<|fim_suffix|>? extends MediaChunk> queue, MediaChunkIterator[] iterators, @Nullable int[] bitrates) { if (maxFutureDurationUs > 0 || maxPastDurationUs > 0) { return Trac...
fim
yuliskov/SmartTube
java
<|fim_suffix|>; /** * @param data The array containing the allocated space. * @param offset The offset of the allocated space in {@code data}. */ public Allocation(byte[] data, int offset) { this.data = data; this.offset = offset; } } <|fim_prefix|>/* * Copyright (C) 2016 The Android Open Sour...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>int bytesToRead = bytesRemaining == C.LENGTH_UNSET ? readLength : (int) Math.min(bytesRemaining, readLength); bytesRead = inputStream.read(buffer, offset, bytesToRead); } catch (IOException e) { throw new AssetDataSourceException(e); } if (bytesRead == -1) { if (by...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project <|fim_suffix|>Adds an {@link EventListener}. * * @param eventHandler A handler for events. * @param eventListener A listener of events. */ void addEventListener(Handler eventHandler, EventListener eventListener); /** * Removes an...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * <|fim_suff...
fim
yuliskov/SmartTube
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); <|fim_suffix|>ata), readPosition, buffer, offset, readLength); readPosition += readLength; bytesTransferred(readLength); return readLength; } @Override @Nullabl...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain <|fim_suffix|>of the invocation are cleaned up. * * @param dataSpec Defines the data to...
fim
yuliskov/SmartTube
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
fim
yuliskov/SmartTube
java
<|fim_suffix|>ason of this {@link DataSourceException}. It can only be {@link #POSITION_OUT_OF_RANGE}. */ public final int reason; /** * Constructs a DataSourceException. * * @param reason Reason of the error. It can only be {@link #POSITION_OUT_OF_RANGE}. */ public DataSourceException(int reason)...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
fim
yuliskov/SmartTube
java
<|fim_suffix|>+] = highAllocation; availableAllocations[highIndex--] = lowAllocation; } } } // lowIndex is the index of the first allocation not backed by an initial block. targetAvailableCount = Math.max(targetAvailableCount, lowIndex); if (targetAvailableCount >= ...
fim
yuliskov/SmartTube
java
<|fim_suffix|>}); countryGroupAssignment.put("BO", new int[] {2, 2, 3, 2}); countryGroupAssignment.put("BQ", new int[] {1, 0, 3, 4}); countryGroupAssignment.put("BR", new int[] {2, 3, 3, 2}); countryGroupAssignment.put("BS", new int[] {2, 0, 1, 4}); countryGroupAssignment.put("BT", new int[] {3, 0, ...
fim
yuliskov/SmartTube
java
<|fim_suffix|>istener); } } @Override public void addTransferListener(TransferListener transferListener) { baseDataSource.addTransferListener(transferListener); transferListeners.add(transferListener); maybeAddListenerToDataSource(fileDataSource, transferListener); maybeAddListenerToDataSourc...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * <|fim_suffix|> context A context. * @param userAgent The User-Agent string that should be used. * @param listener An optional listener. */ public DefaultDataSourceFa...
fim
yuliskov/SmartTube
java
<|fim_suffix|>that should be used. * @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the * predicate then a {@link HttpDataSource.InvalidContentTypeException} is thrown from {@link * #open(DataSpec)}. * @param connectTimeoutMillis The connection timeout, i...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|> compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS O...
fim
yuliskov/SmartTube
java
<|fim_suffix|>n(bytesRemaining, readLength)); } catch (IOException e) { throw new FileDataSourceException(e); } if (bytesRead > 0) { bytesRemaining -= bytesRead; bytesTransferred(bytesRead); } return bytesRead; } } @Override public @Nullable Uri getUri(...
fim
yuliskov/SmartTube
java
<|fim_suffix|>blic FileDataSourceFactory(@Nullable TransferListener listener) { this.listener = listener; } @Override public FileDataSource createDataSource() { FileDataSource dataSource = new FileDataSource(); if (listener != null) { dataSource.addTransferListener(listener); } return d...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>back#onLoadError(Loadable, long, long, * IOException, int)}. */ public static final class LoadErrorAction { private final @RetryActionType int type; private final long retryDelayMillis; private LoadErrorAction(@RetryActionType int type, long retryDelayMillis) { this.type = type...
fim
yuliskov/SmartTube
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
fim
yuliskov/SmartTube
java
<|fim_suffix|> type See {@link #type}. * @param parser Parses the object from the response. */ public ParsingLoadable(DataSource dataSource, DataSpec dataSpec, int type, Parser<? extends T> parser) { this.dataSource = new StatsDataSource(dataSource); this.dataSpec = dataSpec; this.type = type;...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>d * limitations under the License. */ package com.google.android.exoplayer2.upstream; import com.google.android.exoplayer2.upstream.DataSource.Factory; import com.google.android.exoplayer2.util.PriorityTaskManager; /** * A {@link DataSource.Factory} that produces {@link PriorityDataSource} instances....
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|> return availableBytes; } @Override public int read(byte[] buffer, int offset, int readLength) throws IOException { int bytesRead = dataSource.read(buffer, offset, readLength); if (bytesRead != C.RESULT_END_OF_INPUT) { this.bytesRead += bytesRead; } return bytesRead; } @...
fim
yuliskov/SmartTube
java
<|fim_suffix|>g open(DataSpec dataSpec) throws IOException { bytesRemaining = upstream.open(dataSpec); if (bytesRemaining == 0) { return 0; } if (dataSpec.length == C.LENGTH_UNSET && bytesRemaining != C.LENGTH_UNSET) { // Reconstruct dataSpec in order to provide the resolved length to the si...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>return 0; } if (packetRemaining == 0) { // We've read all of the data from the current packet. Get another. try { socket.receive(packet); } catch (IOException e) { throw new UdpDataSourceException(e); } packetRemaining = packet.getLength(); byte...
fim
yuliskov/SmartTube
java
<|fim_suffix|>error is encountered. */ @Nullable CacheSpan startReadWriteNonBlocking(String key, long position) throws CacheException; /** * Obtains a cache file into which data can be written. Must only be called when holding a * corresponding hole {@link CacheSpan} obtained from {@link #startReadWrite...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>ache, String key, long position, long length); } <|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License a<|fim_suffix|>me. The returned map is mutable and may be modified *...
fim
yuliskov/SmartTube
java
<|fim_suffix|>c; /** Factory for cache keys. */ public interface CacheKeyFactory { /** * Returns a cache key for the given {@link DataSpec}. * * @param dataSpec The data being cached. */ String buildCacheKey(DataSpec dataSpec); /** * Returns the number of parallel tasks used to download segments...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless re...
fim
yuliskov/SmartTube
java
<|fim_suffix|>(); return result; } @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CachedContent that = (CachedContent) o; return id == that.id && key.equals(that.k...
fim
yuliskov/SmartTube
java
<|fim_suffix|>key); hashCode += hashCachedContent(cachedContent, version); } int fileHashCode = input.readInt(); boolean isEOF = input.read() == -1; if (fileHashCode != hashCode || !isEOF) { return false; } } catch (IOException e) { return false;...
fim
yuliskov/SmartTube
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
fim
yuliskov/SmartTube
java
<|fim_suffix|>directedUri); } } <|fim_prefix|>/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/l...
fim
yuliskov/SmartTube
java
<|fim_suffix|>ntentMetadataMutations set(String name, long value) { return checkAndSet(name, value); } /** * Adds a mutation to set a metadata value. Passing {@code null} as {@code name} or {@code value} * isn't allowed. * * @param name The name of the metadata value. * @param value The value to...
fim
yuliskov/SmartTube
java
<|fim_suffix|> return false; } } return true; } private static Map<String, byte[]> applyMutations( Map<String, byte[]> otherMetadata, ContentMetadataMutations mutations) { HashMap<String, byte[]> metadata = new HashMap<>(otherMetadata); removeValues(metadata, mutations.getRemovedVal...
fim
yuliskov/SmartTube
java
<|fim_suffix|>cache files first. */ public final class LeastRecentlyUsedCacheEvictor implements CacheEvictor, Comparator<CacheSpan> { private final long maxBytes; private final TreeSet<CacheSpan> leastRecentlyUsed; private long currentSize; public LeastRecentlyUsedCacheEvictor(long maxBytes) { this.maxB...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>ex.remove(fileName); } catch (IOException e) { // This will leave a stale entry in the file index. It will be removed next time the cache // is initialized. Log.w(TAG, "Failed to remove file index entry for: " + fileName); } } contentIndex.maybeRemove(cachedCont...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>.google.android.exoplayer2.upstream.crypto; import android.net.Uri; import androidx.annotation.Nullable; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DataSpec; import com.google.android.exoplayer2.upstream....
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>ess required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the ...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>ostcondition.not.satisfied", "return.type.incompatible"}) @EnsuresNonNull({"#1"}) public static <T> T checkNotNull(@Nullable T reference) { if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && reference == null) { throw new NullPointerException(); } return reference; } /** * Throws...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the L<|fim_suffix|>public interface Clock { /** * Default {@link Clock} to us...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_prefix|>/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
fim
yuliskov/SmartTube
java
<|fim_suffix|>xoplayer2.util; /** * An interruptible condition variable whose {@link #open()} and {@link #close()} methods return * whether they resulted in a change of state. */ public final class ConditionVariable { private boolean isOpen; /** * Opens the condition and releases all threads that are block...
fim
yuliskov/SmartTube
java
<|fim_suffix|>EGLDisplay display, EGLConfig config, @SecureMode int secureMode) { int[] glAttributes; if (secureMode == SECURE_MODE_NONE) { glAttributes = new int[] {EGL14.EGL_CONTEXT_CLIENT_VERSION, 2, EGL14.EGL_NONE}; } else { glAttributes = new int[] { EGL14.EGL_CONTEXT_...
fim
yuliskov/SmartTube
java
<|fim_suffix|>error code and a user readable error message. */ Pair<Integer, String> getErrorMessage(T throwable); } <|fim_prefix|>/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with th...
fim
yuliskov/SmartTube
java
<|fim_suffix|>nt); } } private static final class HandlerAndListener<T> { private final Handler handler; private final T listener; private boolean released; public HandlerAndListener(Handler handler, T eventListener) { this.handler = handler; this.listener = eventListener; } ...
fim
yuliskov/SmartTube
java