Commit 09485cbe by Dustin

Passed along suggestedBufferSize to ExoPlayer

parent 43b8a9b3
......@@ -231,6 +231,10 @@ public class AviExtractor implements Extractor {
}
final Format.Builder builder = new Format.Builder();
builder.setId(streamId);
final int suggestedBufferSize = streamHeader.getSuggestedBufferSize();
if (suggestedBufferSize != 0) {
builder.setMaxInputSize(suggestedBufferSize);
}
final StreamNameBox streamName = streamList.getChild(StreamNameBox.class);
if (streamName != null) {
builder.setLabel(streamName.getName());
......
......@@ -97,7 +97,10 @@ public class StreamHeaderBox extends ResidentBox {
public long getLength() {
return byteBuffer.getInt(32) & AviExtractor.UINT_MASK;
}
//36 - dwSuggestedBufferSize
public int getSuggestedBufferSize() {
return byteBuffer.getInt(36);
}
//40 - dwQuality
//44 - dwSampleSize
// public int getSampleSize() {
......
......@@ -25,5 +25,6 @@ public class StreamHeaderBoxTest {
Assert.assertEquals(US_SAMPLE24FPS, streamHeaderBox.getUsPerSample());
Assert.assertEquals(MimeTypes.VIDEO_MP4V, streamHeaderBox.getMimeType());
Assert.assertEquals(11805L, streamHeaderBox.getLength());
Assert.assertEquals(0, streamHeaderBox.getSuggestedBufferSize());
}
}
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