mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Implement DefaultVideoSink.render()
PiperOrigin-RevId: 688948682
This commit is contained in:
parent
e5133e78f5
commit
75f29b6997
2 changed files with 10 additions and 10 deletions
|
|
@ -21,6 +21,7 @@ import androidx.media3.common.Effect;
|
|||
import androidx.media3.common.Format;
|
||||
import androidx.media3.common.util.Size;
|
||||
import androidx.media3.common.util.TimestampIterator;
|
||||
import androidx.media3.exoplayer.ExoPlaybackException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
|
|
@ -177,8 +178,12 @@ import java.util.concurrent.Executor;
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(long positionUs, long elapsedRealtimeUs) {
|
||||
throw new UnsupportedOperationException();
|
||||
public void render(long positionUs, long elapsedRealtimeUs) throws VideoSinkException {
|
||||
try {
|
||||
videoFrameRenderControl.render(positionUs, elapsedRealtimeUs);
|
||||
} catch (ExoPlaybackException e) {
|
||||
throw new VideoSinkException(e, inputFormat);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -444,8 +444,8 @@ public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, Video
|
|||
* @param elapsedRealtimeUs {@link android.os.SystemClock#elapsedRealtime()} in microseconds,
|
||||
* taken approximately at the time the playback position was {@code positionUs}.
|
||||
*/
|
||||
private void render(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackException {
|
||||
videoFrameRenderControl.render(positionUs, elapsedRealtimeUs);
|
||||
private void render(long positionUs, long elapsedRealtimeUs) throws VideoSink.VideoSinkException {
|
||||
defaultVideoSink.render(positionUs, elapsedRealtimeUs);
|
||||
}
|
||||
|
||||
private void flush(boolean resetPosition) {
|
||||
|
|
@ -806,12 +806,7 @@ public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, Video
|
|||
|
||||
@Override
|
||||
public void render(long positionUs, long elapsedRealtimeUs) throws VideoSinkException {
|
||||
try {
|
||||
PlaybackVideoGraphWrapper.this.render(positionUs, elapsedRealtimeUs);
|
||||
} catch (ExoPlaybackException e) {
|
||||
throw new VideoSinkException(
|
||||
e, inputFormat != null ? inputFormat : new Format.Builder().build());
|
||||
}
|
||||
PlaybackVideoGraphWrapper.this.render(positionUs, elapsedRealtimeUs);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in a new issue