mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +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();
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue