Android: Remove deprecated CapturerObserver methods
Bug: webrtc:9181 Change-Id: Ibf558102f41bf9fa3fcfa2b4bab7c7675e889bfc Reviewed-on: https://webrtc-review.googlesource.com/77682 Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23521}
This commit is contained in:
committed by
Commit Bot
parent
b6c462d4e4
commit
e4e1ce903b
@ -22,21 +22,6 @@ public interface VideoCapturer {
|
|||||||
void onCapturerStarted(boolean success);
|
void onCapturerStarted(boolean success);
|
||||||
void onCapturerStopped();
|
void onCapturerStopped();
|
||||||
|
|
||||||
// Delivers a captured frame. Called on a Java thread owned by VideoCapturer.
|
|
||||||
@Deprecated
|
|
||||||
default void onByteBufferFrameCaptured(
|
|
||||||
byte[] data, int width, int height, int rotation, long timeStamp) {
|
|
||||||
throw new UnsupportedOperationException("Deprecated and not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delivers a captured frame in a texture with id {@code oesTextureId}. Called on a Java thread
|
|
||||||
// owned by VideoCapturer.
|
|
||||||
@Deprecated
|
|
||||||
default void onTextureFrameCaptured(int width, int height, int oesTextureId,
|
|
||||||
float[] transformMatrix, int rotation, long timestamp) {
|
|
||||||
throw new UnsupportedOperationException("Deprecated and not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delivers a captured frame. Called on a Java thread owned by VideoCapturer.
|
// Delivers a captured frame. Called on a Java thread owned by VideoCapturer.
|
||||||
void onFrameCaptured(VideoFrame frame);
|
void onFrameCaptured(VideoFrame frame);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,32 +44,6 @@ class NativeCapturerObserver implements VideoCapturer.CapturerObserver {
|
|||||||
nativeCapturerStopped(nativeSource);
|
nativeCapturerStopped(nativeSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(bugs.webrtc.org/9181): Remove.
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void onByteBufferFrameCaptured(
|
|
||||||
byte[] data, int width, int height, int rotation, long timestampNs) {
|
|
||||||
// This NV21Buffer is not possible to retain. This is safe only because the native code will
|
|
||||||
// always call cropAndScale() and directly make a deep copy of the buffer.
|
|
||||||
final VideoFrame.Buffer nv21Buffer =
|
|
||||||
new NV21Buffer(data, width, height, null /* releaseCallback */);
|
|
||||||
final VideoFrame frame = new VideoFrame(nv21Buffer, rotation, timestampNs);
|
|
||||||
onFrameCaptured(frame);
|
|
||||||
frame.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(bugs.webrtc.org/9181): Remove.
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void onTextureFrameCaptured(int width, int height, int oesTextureId,
|
|
||||||
float[] transformMatrix, int rotation, long timestampNs) {
|
|
||||||
final VideoFrame.Buffer buffer = surfaceTextureHelper.createTextureBuffer(
|
|
||||||
width, height, RendererCommon.convertMatrixToAndroidGraphicsMatrix(transformMatrix));
|
|
||||||
final VideoFrame frame = new VideoFrame(buffer, rotation, timestampNs);
|
|
||||||
onFrameCaptured(frame);
|
|
||||||
frame.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFrameCaptured(VideoFrame frame) {
|
public void onFrameCaptured(VideoFrame frame) {
|
||||||
nativeOnFrameCaptured(nativeSource, frame.getBuffer().getWidth(), frame.getBuffer().getHeight(),
|
nativeOnFrameCaptured(nativeSource, frame.getBuffer().getWidth(), frame.getBuffer().getHeight(),
|
||||||
|
|||||||
Reference in New Issue
Block a user