blob: d7908b4dfa800b203f09473e05fa72fcae1d9365 [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_ANDROIDMEDIAENCODER_JNI_H_
12#define WEBRTC_API_JAVA_JNI_ANDROIDMEDIAENCODER_JNI_H_
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000013
14#include <vector>
15
Henrik Kjellander15583c12016-02-10 10:53:12 +010016#include "webrtc/api/java/jni/eglbase_jni.h"
kjellandera96e2d72016-02-04 23:52:28 -080017#include "webrtc/media/webrtc/webrtcvideoencoderfactory.h"
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000018
19namespace webrtc_jni {
20
21// Implementation of Android MediaCodec based encoder factory.
22class MediaCodecVideoEncoderFactory
23 : public cricket::WebRtcVideoEncoderFactory {
24 public:
25 MediaCodecVideoEncoderFactory();
26 virtual ~MediaCodecVideoEncoderFactory();
27
perkj30e91822015-11-20 01:31:25 -080028 void SetEGLContext(JNIEnv* jni, jobject render_egl_context);
29
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000030 // WebRtcVideoEncoderFactory implementation.
31 webrtc::VideoEncoder* CreateVideoEncoder(webrtc::VideoCodecType type)
32 override;
33 const std::vector<VideoCodec>& codecs() const override;
34 void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override;
35
36 private:
Perec2922f2016-01-27 15:25:46 +010037 EglBase egl_base_;
38
glaznev@webrtc.org18c92472015-02-18 18:42:55 +000039 // Empty if platform support is lacking, const after ctor returns.
40 std::vector<VideoCodec> supported_codecs_;
41};
42
43} // namespace webrtc_jni
44
Henrik Kjellander15583c12016-02-10 10:53:12 +010045#endif // WEBRTC_API_JAVA_JNI_ANDROIDMEDIAENCODER_JNI_H_