mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-07-30 04:38:51 +00:00
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:
parent
27e8a9a79d
commit
475912a39c
3 changed files with 11 additions and 20 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue