Support Java_Buffer_toI420 returning null
Bug: webrtc:12877 Change-Id: Ib9c8c62b350e644b17a3194e4208df6b06a4d9b1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222582 Reviewed-by: Xavier Lepaul <xalep@webrtc.org> Reviewed-by: Evan Shrubsole <eshr@google.com> Reviewed-by: Henrik Boström <hbos@webrtc.org> Commit-Queue: Fabian Bergmark <fabianbergmark@google.com> Cr-Commit-Position: refs/heads/master@{#34296}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
cd430c84d9
commit
c03d6e965e
@ -179,6 +179,10 @@ rtc::scoped_refptr<I420BufferInterface> AndroidVideoBuffer::ToI420() {
|
||||
JNIEnv* jni = AttachCurrentThreadIfNeeded();
|
||||
ScopedJavaLocalRef<jobject> j_i420_buffer =
|
||||
Java_Buffer_toI420(jni, j_video_frame_buffer_);
|
||||
// In case I420 conversion fails, we propagate the nullptr.
|
||||
if (j_i420_buffer.is_null()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// We don't need to retain the buffer because toI420 returns a new object that
|
||||
// we are assumed to take the ownership of.
|
||||
|
||||
Reference in New Issue
Block a user