Passed along suggestedBufferSize to ExoPlayer

This commit is contained in:
Dustin 2022-01-23 14:52:53 -07:00
parent 43b8a9b336
commit 09485cbed1
3 changed files with 9 additions and 1 deletions

View file

@ -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());

View file

@ -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() {

View file

@ -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());
}
}