- Make shared EGL context used for HW video decoding member

of decoder factory class.
- Add new Peer connection factory method to initialize shared
EGL context.

This provides an option to use single peer connection factory
in the application and create peer connections from the same
factory and reinitialize shared EGL context for video
decoding HW acceleration.

R=wzh@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9838}
This commit is contained in:
Alex Glaznev
2015-09-01 15:04:13 -07:00
parent c36d4df250
commit 4d2f4d1c69
10 changed files with 129 additions and 90 deletions

View File

@ -40,17 +40,17 @@ class MediaCodecVideoDecoderFactory
public:
MediaCodecVideoDecoderFactory();
virtual ~MediaCodecVideoDecoderFactory();
static int SetAndroidObjects(JNIEnv* jni, jobject render_egl_context);
void SetEGLContext(JNIEnv* jni, jobject render_egl_context);
// WebRtcVideoDecoderFactory implementation.
webrtc::VideoDecoder* CreateVideoDecoder(webrtc::VideoCodecType type)
override;
void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) override;
// Render EGL context.
static jobject render_egl_context_;
private:
jobject render_egl_context_; // Render EGL context.
std::vector<webrtc::VideoCodecType> supported_codec_types_;
};