提交 a7979e4e 编写于 作者: R Romain Vimont

Rename rotation detection method name

The old name checkRotationChanged() did not suggest that the flag was
reset.
上级 38b56f55
......@@ -49,7 +49,7 @@ public class ScreenEncoder implements Device.RotationListener {
rotationChanged.set(true);
}
public boolean checkRotationChanged() {
public boolean consumeRotationChange() {
return rotationChanged.getAndSet(false);
}
......@@ -87,11 +87,11 @@ public class ScreenEncoder implements Device.RotationListener {
byte[] buf = new byte[bitRate / 8]; // may contain up to 1 second of video
boolean eof = false;
MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
while (!checkRotationChanged() && !eof) {
while (!consumeRotationChange() && !eof) {
int outputBufferId = codec.dequeueOutputBuffer(bufferInfo, -1);
eof = (bufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
try {
if (checkRotationChanged()) {
if (consumeRotationChange()) {
// must restart encoding with new size
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册