Android MediaCodecVideoDecoder: Remove redundant useSurface arguments

This CL should not do any functional changes. It removes some redundant arguments and unnecessary error checking.

BUG=webrtc:4993
R=glaznev@webrtc.org

Review URL: https://codereview.webrtc.org/1338943003 .

Cr-Commit-Position: refs/heads/master@{#9950}
diff --git a/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc b/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
index 6fb06d0..a6f7da3 100644
--- a/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
+++ b/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
@@ -188,7 +188,7 @@
   j_init_decode_method_ = GetMethodID(
       jni, *j_media_codec_video_decoder_class_, "initDecode",
       "(Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;"
-      "IIZLandroid/opengl/EGLContext;)Z");
+      "IILandroid/opengl/EGLContext;)Z");
   j_release_method_ =
       GetMethodID(jni, *j_media_codec_video_decoder_class_, "release", "()V");
   j_dequeue_input_buffer_method_ = GetMethodID(
@@ -199,7 +199,7 @@
       jni, *j_media_codec_video_decoder_class_, "dequeueOutputBuffer",
       "(I)Lorg/webrtc/MediaCodecVideoDecoder$DecoderOutputBufferInfo;");
   j_release_output_buffer_method_ = GetMethodID(
-      jni, *j_media_codec_video_decoder_class_, "releaseOutputBuffer", "(IZ)Z");
+      jni, *j_media_codec_video_decoder_class_, "releaseOutputBuffer", "(I)Z");
 
   j_input_buffers_field_ = GetFieldID(
       jni, *j_media_codec_video_decoder_class_,
@@ -235,7 +235,7 @@
       jni, j_decoder_output_buffer_info_class, "presentationTimestampUs", "J");
 
   CHECK_EXCEPTION(jni) << "MediaCodecVideoDecoder ctor failed";
-  use_surface_ = (render_egl_context_ != NULL) ? true : false;
+  use_surface_ = (render_egl_context_ != NULL);
   ALOGD("MediaCodecVideoDecoder ctor. Use surface: %d", use_surface_);
   memset(&codec_, 0, sizeof(codec_));
   AllowBlockingCalls();
@@ -309,8 +309,7 @@
       j_video_codec_enum,
       codec_.width,
       codec_.height,
-      use_surface_,
-      render_egl_context_);
+      use_surface_ ? render_egl_context_ : nullptr);
   if (CheckException(jni) || !success) {
     ALOGE("Codec initialization error - fallback to SW codec.");
     sw_fallback_required_ = true;
@@ -666,8 +665,7 @@
   bool success = jni->CallBooleanMethod(
       *j_media_codec_video_decoder_,
       j_release_output_buffer_method_,
-      output_buffer_index,
-      use_surface_);
+      output_buffer_index);
   if (CheckException(jni) || !success) {
     ALOGE("releaseOutputBuffer error");
     return false;