Reland "Android: Generate JNI code for VideoSink and VideoEncoder"

This is a reland of ba78b5a905bffa05933a135673996df02328f2a4
Original change's description:
> Android: Generate JNI code for VideoSink and VideoEncoder
> 
> This is the first CL to start generating JNI code. It has updated two of
> the most recent classes to use JNI code generation.
> 
> Bug: webrtc:8278
> Change-Id: I1b19ee78c273346ceeaa0401dbdf8696803f16c7
> Reviewed-on: https://webrtc-review.googlesource.com/3820
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#19994}

Bug: webrtc:8278
Change-Id: Id3e6513736eb87d7c234be3b0d13c5d30435201c
Reviewed-on: https://webrtc-review.googlesource.com/4500
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20548}
This commit is contained in:
Magnus Jedvert
2017-10-31 17:47:06 +01:00
committed by Commit Bot
parent 7797a812aa
commit 56231d07b3
7 changed files with 43 additions and 62 deletions

View File

@ -124,29 +124,35 @@ public interface VideoEncoder {
/**
* Initializes the encoding process. Call before any calls to encode.
*/
VideoCodecStatus initEncode(Settings settings, Callback encodeCallback);
@CalledByNative VideoCodecStatus initEncode(Settings settings, Callback encodeCallback);
/**
* Releases the encoder. No more calls to encode will be made after this call.
*/
VideoCodecStatus release();
@CalledByNative VideoCodecStatus release();
/**
* Requests the encoder to encode a frame.
*/
VideoCodecStatus encode(VideoFrame frame, EncodeInfo info);
@CalledByNative VideoCodecStatus encode(VideoFrame frame, EncodeInfo info);
/**
* Informs the encoder of the packet loss and the round-trip time of the network.
*
* @param packetLoss How many packets are lost on average per 255 packets.
* @param roundTripTimeMs Round-trip time of the network in milliseconds.
*/
VideoCodecStatus setChannelParameters(short packetLoss, long roundTripTimeMs);
@CalledByNative VideoCodecStatus setChannelParameters(short packetLoss, long roundTripTimeMs);
/** Sets the bitrate allocation and the target framerate for the encoder. */
VideoCodecStatus setRateAllocation(BitrateAllocation allocation, int framerate);
@CalledByNative VideoCodecStatus setRateAllocation(BitrateAllocation allocation, int framerate);
/** Any encoder that wants to use WebRTC provided quality scaler must implement this method. */
ScalingSettings getScalingSettings();
@CalledByNative ScalingSettings getScalingSettings();
/**
* Should return a descriptive name for the implementation. Gets called once and cached. May be
* called from arbitrary thread.
*/
String getImplementationName();
@CalledByNative String getImplementationName();
}

View File

@ -19,5 +19,5 @@ public interface VideoSink {
* this function returns. Each call to retain() should be followed by a call to frame.release()
* when the reference is no longer needed.
*/
void onFrame(VideoFrame frame);
@CalledByNative void onFrame(VideoFrame frame);
}