blob: f8e8fa6abd6da3e63a511ca7bf8c05321e1ad217 [file] [log] [blame]
glaznev@webrtc.org18c92472015-02-18 18:42:55 +00001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
glaznev@webrtc.org18c92472015-02-18 18:42:55 +00003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
glaznev@webrtc.org18c92472015-02-18 18:42:55 +00009 */
10
Henrik Kjellander15583c12016-02-10 10:53:12 +010011#ifndef WEBRTC_API_JAVA_JNI_ANDROIDMEDIADECODER_JNI_H_
12#define WEBRTC_API_JAVA_JNI_ANDROIDMEDIADECODER_JNI_H_
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000013
sakald34a7112016-07-01 05:10:51 -070014#include "webrtc/api/android/jni/jni_helpers.h"
kjellander@webrtc.org5ad12972016-02-12 06:39:40 +010015#include "webrtc/media/engine/webrtcvideodecoderfactory.h"
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000016
17namespace webrtc_jni {
18
19// Implementation of Android MediaCodec based decoder factory.
20class MediaCodecVideoDecoderFactory
21 : public cricket::WebRtcVideoDecoderFactory {
22 public:
23 MediaCodecVideoDecoderFactory();
24 virtual ~MediaCodecVideoDecoderFactory();
Alex Glaznev4d2f4d12015-09-01 15:04:13 -070025
26 void SetEGLContext(JNIEnv* jni, jobject render_egl_context);
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000027
28 // WebRtcVideoDecoderFactory implementation.
29 webrtc::VideoDecoder* CreateVideoDecoder(webrtc::VideoCodecType type)
30 override;
31
32 void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) override;
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000033
34 private:
perkj461121c2016-02-15 06:28:36 -080035 jobject egl_context_;
glaznev@webrtc.orgb28474c2015-02-23 17:44:27 +000036 std::vector<webrtc::VideoCodecType> supported_codec_types_;
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000037};
38
39} // namespace webrtc_jni
40
Henrik Kjellander15583c12016-02-10 10:53:12 +010041#endif // WEBRTC_API_JAVA_JNI_ANDROIDMEDIADECODER_JNI_H_