Replace WebRtcVideoEncoderFactory::VideoCodec with cricket::VideoCodec

This CL introduces two new functions to the WebRtcVideoEncoderFactory
interface based on cricket::VideoFormat instead of
WebRtcVideoEncoderFactory::VideoCodec. The functions are:
WebRtcVideoEncoderFactory::CreateVideoEncoder() and
WebRtcVideoEncoderFactory::supported_codecs(). In order to make a smooth
transition to the new interface, the old functions are kept, and default
implementations are provided for both the old and new functions so that
external clients can switch from the old to the new functions in peace.
The default implementations will just convert between
cricket::VideoFormat and WebRtcVideoEncoderFactory::VideoCodec. Once all
external clients have updated their code, the plan is to remove the old
functions and all default implementations to make
WebRtcVideoEncoderFactory a pure interface again.

BUG=webrtc:6402,webrtc:6337

Review-Url: https://codereview.webrtc.org/2449993003
Cr-Commit-Position: refs/heads/master@{#14826}
diff --git a/webrtc/api/android/jni/androidmediaencoder_jni.h b/webrtc/api/android/jni/androidmediaencoder_jni.h
index 460eac3..74442dd 100644
--- a/webrtc/api/android/jni/androidmediaencoder_jni.h
+++ b/webrtc/api/android/jni/androidmediaencoder_jni.h
@@ -28,16 +28,20 @@
   void SetEGLContext(JNIEnv* jni, jobject egl_context);
 
   // WebRtcVideoEncoderFactory implementation.
-  webrtc::VideoEncoder* CreateVideoEncoder(webrtc::VideoCodecType type)
-      override;
-  const std::vector<VideoCodec>& codecs() const override;
+  webrtc::VideoEncoder* CreateVideoEncoder(
+      const cricket::VideoCodec& codec) override;
+  const std::vector<cricket::VideoCodec>& supported_codecs() const override;
   void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override;
 
  private:
+  // Disable overloaded virtual function warning. TODO(magjed): Remove once
+  // http://crbug/webrtc/6402 is fixed.
+  using cricket::WebRtcVideoEncoderFactory::CreateVideoEncoder;
+
   jobject egl_context_;
 
   // Empty if platform support is lacking, const after ctor returns.
-  std::vector<VideoCodec> supported_codecs_;
+  std::vector<cricket::VideoCodec> supported_codecs_;
 };
 
 }  // namespace webrtc_jni