mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Passed along suggestedBufferSize to ExoPlayer
This commit is contained in:
parent
43b8a9b336
commit
09485cbed1
3 changed files with 9 additions and 1 deletions
|
|
@ -231,6 +231,10 @@ public class AviExtractor implements Extractor {
|
||||||
}
|
}
|
||||||
final Format.Builder builder = new Format.Builder();
|
final Format.Builder builder = new Format.Builder();
|
||||||
builder.setId(streamId);
|
builder.setId(streamId);
|
||||||
|
final int suggestedBufferSize = streamHeader.getSuggestedBufferSize();
|
||||||
|
if (suggestedBufferSize != 0) {
|
||||||
|
builder.setMaxInputSize(suggestedBufferSize);
|
||||||
|
}
|
||||||
final StreamNameBox streamName = streamList.getChild(StreamNameBox.class);
|
final StreamNameBox streamName = streamList.getChild(StreamNameBox.class);
|
||||||
if (streamName != null) {
|
if (streamName != null) {
|
||||||
builder.setLabel(streamName.getName());
|
builder.setLabel(streamName.getName());
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,10 @@ public class StreamHeaderBox extends ResidentBox {
|
||||||
public long getLength() {
|
public long getLength() {
|
||||||
return byteBuffer.getInt(32) & AviExtractor.UINT_MASK;
|
return byteBuffer.getInt(32) & AviExtractor.UINT_MASK;
|
||||||
}
|
}
|
||||||
//36 - dwSuggestedBufferSize
|
|
||||||
|
public int getSuggestedBufferSize() {
|
||||||
|
return byteBuffer.getInt(36);
|
||||||
|
}
|
||||||
//40 - dwQuality
|
//40 - dwQuality
|
||||||
//44 - dwSampleSize
|
//44 - dwSampleSize
|
||||||
// public int getSampleSize() {
|
// public int getSampleSize() {
|
||||||
|
|
|
||||||
|
|
@ -25,5 +25,6 @@ public class StreamHeaderBoxTest {
|
||||||
Assert.assertEquals(US_SAMPLE24FPS, streamHeaderBox.getUsPerSample());
|
Assert.assertEquals(US_SAMPLE24FPS, streamHeaderBox.getUsPerSample());
|
||||||
Assert.assertEquals(MimeTypes.VIDEO_MP4V, streamHeaderBox.getMimeType());
|
Assert.assertEquals(MimeTypes.VIDEO_MP4V, streamHeaderBox.getMimeType());
|
||||||
Assert.assertEquals(11805L, streamHeaderBox.getLength());
|
Assert.assertEquals(11805L, streamHeaderBox.getLength());
|
||||||
|
Assert.assertEquals(0, streamHeaderBox.getSuggestedBufferSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue