Android JNI: Clean up AndroidVideoTrackSource and NativeHandleImpl

I'm preparing adding support for Java VideoFrames in
AndroidVideoTrackSource. I split out small unrelated clean-ups into this
CL in order to make the big CL more focused.

Bug: webrtc:7749
Change-Id: Ib261ab8eb055898b39307d4e78935bf60d323820
Reviewed-on: https://chromium-review.googlesource.com/539638
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18660}
This commit is contained in:
Magnus Jedvert
2017-06-19 15:04:19 +02:00
committed by Commit Bot
parent 04f4d126f8
commit 3093ef193e
4 changed files with 27 additions and 29 deletions

View File

@ -169,9 +169,9 @@ int AndroidTextureBuffer::height() const {
}
rtc::scoped_refptr<webrtc::I420BufferInterface> AndroidTextureBuffer::ToI420() {
int uv_width = (width()+7) / 8;
int uv_width = (width() + 7) / 8;
int stride = 8 * uv_width;
int uv_height = (height()+1)/2;
int uv_height = (height() + 1) / 2;
size_t size = stride * (height() + uv_height);
// The data is owned by the frame, and the normal case is that the
// data is deleted by the frame's destructor callback.