Conclude VideoFrame emit fieldtrial.

Concludes VideoFrame emit fieldtrial and start producing VideoFrames
by default. Deprecates old onByteBufferFrameCaptured and
onTextureFrameCaptured methods.

Bug: webrtc:8776
Change-Id: Icc224e9f8d89a30f04cf95dd46a498d69cffe9d0
Reviewed-on: https://webrtc-review.googlesource.com/43022
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21866}
This commit is contained in:
Sami Kalliomäki
2018-01-26 11:06:45 +01:00
committed by Commit Bot
parent c22d6a8f9b
commit 682dc619f2
11 changed files with 39 additions and 131 deletions

View File

@ -20,7 +20,7 @@ import java.util.List;
@JNINamespace("webrtc::jni")
public class PeerConnectionFactory {
public static final String TRIAL_ENABLED = "Enabled";
public static final String VIDEO_FRAME_EMIT_TRIAL = "VideoFrameEmit";
@Deprecated public static final String VIDEO_FRAME_EMIT_TRIAL = "VideoFrameEmit";
private static final String TAG = "PeerConnectionFactory";
private static final String VIDEO_CAPTURER_THREAD_NAME = "VideoCapturerThread";

View File

@ -195,8 +195,11 @@ public class ScreenCapturerAndroid
@Override
public void onTextureFrameAvailable(int oesTextureId, float[] transformMatrix, long timestampNs) {
numCapturedFrames++;
capturerObserver.onTextureFrameCaptured(
width, height, oesTextureId, transformMatrix, 0 /* rotation */, timestampNs);
final VideoFrame.Buffer buffer = surfaceTextureHelper.createTextureBuffer(
width, height, RendererCommon.convertMatrixToAndroidGraphicsMatrix(transformMatrix));
final VideoFrame frame = new VideoFrame(buffer, 0 /* rotation */, timestampNs);
capturerObserver.onFrameCaptured(frame);
frame.release();
}
@Override

View File

@ -23,13 +23,19 @@ public interface VideoCapturer {
void onCapturerStopped();
// Delivers a captured frame. Called on a Java thread owned by VideoCapturer.
void onByteBufferFrameCaptured(
byte[] data, int width, int height, int rotation, long timeStamp);
@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 |oesTextureId|. Called on a Java thread
// owned by VideoCapturer.
void onTextureFrameCaptured(int width, int height, int oesTextureId, float[] transformMatrix,
int rotation, long timestamp);
@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.
void onFrameCaptured(VideoFrame frame);