mirror of
https://github.com/androidx/media.git
synced 2025-05-16 20:19:57 +08:00
Misc cleanup.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122506577
This commit is contained in:
parent
a43144decf
commit
9e65693e91
@ -42,7 +42,6 @@ public final class OpusReaderTest extends InstrumentationTestCase {
|
|||||||
private static final String TEST_FILE = "asset:///ogg/bear.opus";
|
private static final String TEST_FILE = "asset:///ogg/bear.opus";
|
||||||
|
|
||||||
private OggExtractor extractor;
|
private OggExtractor extractor;
|
||||||
private OpusReader opusReader;
|
|
||||||
private FakeExtractorOutput extractorOutput;
|
private FakeExtractorOutput extractorOutput;
|
||||||
private DefaultExtractorInput extractorInput;
|
private DefaultExtractorInput extractorInput;
|
||||||
|
|
||||||
@ -61,8 +60,6 @@ public final class OpusReaderTest extends InstrumentationTestCase {
|
|||||||
assertTrue(extractor.sniff(extractorInput));
|
assertTrue(extractor.sniff(extractorInput));
|
||||||
extractorInput.resetPeekPosition();
|
extractorInput.resetPeekPosition();
|
||||||
|
|
||||||
opusReader = (OpusReader) extractor.getStreamReader();
|
|
||||||
|
|
||||||
extractorOutput = new FakeExtractorOutput();
|
extractorOutput = new FakeExtractorOutput();
|
||||||
extractor.init(extractorOutput);
|
extractor.init(extractorOutput);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ import com.google.android.exoplayer.testutil.TestUtil;
|
|||||||
0x4F, 0x67, 0x67, 0x53, // Oggs.
|
0x4F, 0x67, 0x67, 0x53, // Oggs.
|
||||||
0x00, // Stream revision.
|
0x00, // Stream revision.
|
||||||
headerType,
|
headerType,
|
||||||
(int) (granule >> 0) & 0xFF,
|
(int) (granule) & 0xFF,
|
||||||
(int) (granule >> 8) & 0xFF,
|
(int) (granule >> 8) & 0xFF,
|
||||||
(int) (granule >> 16) & 0xFF,
|
(int) (granule >> 16) & 0xFF,
|
||||||
(int) (granule >> 24) & 0xFF,
|
(int) (granule >> 24) & 0xFF,
|
||||||
@ -46,7 +46,7 @@ import com.google.android.exoplayer.testutil.TestUtil;
|
|||||||
0x10,
|
0x10,
|
||||||
0x00,
|
0x00,
|
||||||
0x00, // MSB of data serial number.
|
0x00, // MSB of data serial number.
|
||||||
(pageSequenceCounter >> 0) & 0xFF,
|
(pageSequenceCounter) & 0xFF,
|
||||||
(pageSequenceCounter >> 8) & 0xFF,
|
(pageSequenceCounter >> 8) & 0xFF,
|
||||||
(pageSequenceCounter >> 16) & 0xFF,
|
(pageSequenceCounter >> 16) & 0xFF,
|
||||||
(pageSequenceCounter >> 24) & 0xFF,
|
(pageSequenceCounter >> 24) & 0xFF,
|
||||||
|
@ -58,7 +58,7 @@ import java.util.regex.Pattern;
|
|||||||
public class MediaPresentationDescriptionParser extends DefaultHandler
|
public class MediaPresentationDescriptionParser extends DefaultHandler
|
||||||
implements UriLoadable.Parser<MediaPresentationDescription> {
|
implements UriLoadable.Parser<MediaPresentationDescription> {
|
||||||
|
|
||||||
private static final String TAG = "MediaPresentationDescriptionParser";
|
private static final String TAG = "MpdParser";
|
||||||
|
|
||||||
private static final Pattern FRAME_RATE_PATTERN = Pattern.compile("(\\d+)(?:/(\\d+))?");
|
private static final Pattern FRAME_RATE_PATTERN = Pattern.compile("(\\d+)(?:/(\\d+))?");
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ public final class FragmentedMp4Extractor implements Extractor {
|
|||||||
LeafAtom child = moovLeafChildren.get(i);
|
LeafAtom child = moovLeafChildren.get(i);
|
||||||
if (child.type == Atom.TYPE_pssh) {
|
if (child.type == Atom.TYPE_pssh) {
|
||||||
if (schemeDatas == null) {
|
if (schemeDatas == null) {
|
||||||
schemeDatas = new ArrayList<SchemeData>();
|
schemeDatas = new ArrayList<>();
|
||||||
}
|
}
|
||||||
byte[] psshData = child.data.data;
|
byte[] psshData = child.data.data;
|
||||||
UUID uuid = PsshAtomUtil.parseUuid(psshData);
|
UUID uuid = PsshAtomUtil.parseUuid(psshData);
|
||||||
|
@ -54,10 +54,8 @@ public class OggExtractor implements Extractor {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (ParserException e) {
|
} catch (ParserException e) {
|
||||||
// does not happen
|
return false;
|
||||||
} finally {
|
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,6 +31,6 @@ public interface SubtitleParser extends
|
|||||||
*
|
*
|
||||||
* @param positionUs The current playback position in microseconds.
|
* @param positionUs The current playback position in microseconds.
|
||||||
*/
|
*/
|
||||||
public void setPositionUs(long positionUs);
|
void setPositionUs(long positionUs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ public final class Eia608Subtitle implements Subtitle {
|
|||||||
@Override
|
@Override
|
||||||
public List<Cue> getCues(long timeUs) {
|
public List<Cue> getCues(long timeUs) {
|
||||||
if (caption == null || caption.isEmpty()) {
|
if (caption == null || caption.isEmpty()) {
|
||||||
return Collections.<Cue>emptyList();
|
return Collections.emptyList();
|
||||||
} else {
|
} else {
|
||||||
return Collections.singletonList(new Cue(caption));
|
return Collections.singletonList(new Cue(caption));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user