Android: Pass VideoCodecInfo instead of String to createDecoder()

This is in line with the new C++ VideoCodecFactory interface.

Bug: webrtc:7925
Change-Id: Ice51cab61b6498fef1b0483ce1bd4835ef550231
Reviewed-on: https://webrtc-review.googlesource.com/88368
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23966}
This commit is contained in:
Magnus Jedvert
2018-07-13 11:18:03 +02:00
committed by Commit Bot
parent e6d7c3e32a
commit 026f27fac1
6 changed files with 33 additions and 17 deletions

View File

@ -31,8 +31,10 @@ VideoDecoderFactoryWrapper::~VideoDecoderFactoryWrapper() = default;
std::unique_ptr<VideoDecoder> VideoDecoderFactoryWrapper::CreateVideoDecoder(
const SdpVideoFormat& format) {
JNIEnv* jni = AttachCurrentThreadIfNeeded();
ScopedJavaLocalRef<jobject> j_codec_info =
SdpVideoFormatToVideoCodecInfo(jni, format);
ScopedJavaLocalRef<jobject> decoder = Java_VideoDecoderFactory_createDecoder(
jni, decoder_factory_, NativeToJavaString(jni, format.name));
jni, decoder_factory_, j_codec_info);
if (!decoder.obj())
return nullptr;
return JavaToNativeVideoDecoder(jni, decoder);