mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Basic streaming working with new-core
This commit is contained in:
parent
a2de98c91a
commit
8e247ad9a6
@ -321,13 +321,16 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
rendererThread.start();
|
rendererThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int dequeueInputBuffer(boolean wait, boolean infiniteWait) {
|
private int dequeueInputBuffer() {
|
||||||
int index;
|
int index = -1;
|
||||||
long startTime, queueTime;
|
long startTime, queueTime;
|
||||||
|
|
||||||
startTime = MediaCodecHelper.getMonotonicMillis();
|
startTime = MediaCodecHelper.getMonotonicMillis();
|
||||||
|
|
||||||
index = videoDecoder.dequeueInputBuffer(wait ? (infiniteWait ? -1 : 3000) : 0);
|
while (!rendererThread.isInterrupted() && index < 0) {
|
||||||
|
index = videoDecoder.dequeueInputBuffer(500);
|
||||||
|
}
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
@ -430,7 +433,12 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
}
|
}
|
||||||
lastTimestampUs = timestampUs;
|
lastTimestampUs = timestampUs;
|
||||||
|
|
||||||
int inputBufferIndex = dequeueInputBuffer(true, false);
|
int inputBufferIndex = dequeueInputBuffer();
|
||||||
|
if (inputBufferIndex < 0) {
|
||||||
|
// We're being torn down now
|
||||||
|
return MoonBridge.DR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
ByteBuffer buf = getEmptyInputBuffer(inputBufferIndex);
|
ByteBuffer buf = getEmptyInputBuffer(inputBufferIndex);
|
||||||
|
|
||||||
int codecFlags = 0;
|
int codecFlags = 0;
|
||||||
@ -582,7 +590,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void replaySps() {
|
private void replaySps() {
|
||||||
int inputIndex = dequeueInputBuffer(true, true);
|
int inputIndex = dequeueInputBuffer();
|
||||||
ByteBuffer inputBuffer = getEmptyInputBuffer(inputIndex);
|
ByteBuffer inputBuffer = getEmptyInputBuffer(inputIndex);
|
||||||
|
|
||||||
// Write the Annex B header
|
// Write the Annex B header
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit bdaed5712289ba1878f646e7b3d5ddd5332dcae6
|
Subproject commit 67d9f52b6d3a72137f7f2fbbc81fa707befa72a5
|
Loading…
x
Reference in New Issue
Block a user