Do not transmit MediaCodec flags

Since PTS handling has been fixed, the recorder do not associate a PTS
to a wrong frame anymore, so PTS of "configuration packets" (which never
produce a frame), are never read by the recorder. Therefore, there is no
need to ignore them explicitly, so we can remove the MediaCodec flags
completely.
This commit is contained in:
Romain Vimont 2018-11-11 00:35:53 +01:00
commit 475912a39c
3 changed files with 11 additions and 20 deletions

View file

@ -82,7 +82,7 @@ public class ScreenEncoder implements Device.RotationListener {
private boolean encode(MediaCodec codec, FileDescriptor fd) throws IOException {
boolean eof = false;
MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
ByteBuffer bBuffer = ByteBuffer.allocate(16);
ByteBuffer bBuffer = ByteBuffer.allocate(12);
while (!consumeRotationChange() && !eof) {
int outputBufferId = codec.dequeueOutputBuffer(bufferInfo, -1);
@ -107,7 +107,6 @@ public class ScreenEncoder implements Device.RotationListener {
}
bBuffer.putLong(pts);
bBuffer.putInt(bufferInfo.flags);
bBuffer.putInt(codecBuffer.remaining());
bBuffer.flip();
IO.writeFully(fd, bBuffer);