2015-02-18 18:42:55 +00:00
|
|
|
/*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
2015-02-18 18:42:55 +00:00
|
|
|
*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2015-02-18 18:42:55 +00:00
|
|
|
*/
|
|
|
|
|
|
2016-02-10 10:53:12 +01:00
|
|
|
#ifndef WEBRTC_API_JAVA_JNI_ANDROIDMEDIAENCODER_JNI_H_
|
|
|
|
|
#define WEBRTC_API_JAVA_JNI_ANDROIDMEDIAENCODER_JNI_H_
|
2015-02-18 18:42:55 +00:00
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2016-02-15 06:28:36 -08:00
|
|
|
#include "webrtc/api/java/jni/jni_helpers.h"
|
2016-02-12 06:39:40 +01:00
|
|
|
#include "webrtc/media/engine/webrtcvideoencoderfactory.h"
|
2015-02-18 18:42:55 +00:00
|
|
|
|
|
|
|
|
namespace webrtc_jni {
|
|
|
|
|
|
|
|
|
|
// Implementation of Android MediaCodec based encoder factory.
|
|
|
|
|
class MediaCodecVideoEncoderFactory
|
|
|
|
|
: public cricket::WebRtcVideoEncoderFactory {
|
|
|
|
|
public:
|
|
|
|
|
MediaCodecVideoEncoderFactory();
|
|
|
|
|
virtual ~MediaCodecVideoEncoderFactory();
|
|
|
|
|
|
2016-02-15 06:28:36 -08:00
|
|
|
void SetEGLContext(JNIEnv* jni, jobject egl_context);
|
2015-11-20 01:31:25 -08:00
|
|
|
|
2015-02-18 18:42:55 +00:00
|
|
|
// WebRtcVideoEncoderFactory implementation.
|
|
|
|
|
webrtc::VideoEncoder* CreateVideoEncoder(webrtc::VideoCodecType type)
|
|
|
|
|
override;
|
|
|
|
|
const std::vector<VideoCodec>& codecs() const override;
|
|
|
|
|
void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override;
|
|
|
|
|
|
|
|
|
|
private:
|
2016-02-15 06:28:36 -08:00
|
|
|
jobject egl_context_;
|
2016-01-27 15:25:46 +01:00
|
|
|
|
2015-02-18 18:42:55 +00:00
|
|
|
// Empty if platform support is lacking, const after ctor returns.
|
|
|
|
|
std::vector<VideoCodec> supported_codecs_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc_jni
|
|
|
|
|
|
2016-02-10 10:53:12 +01:00
|
|
|
#endif // WEBRTC_API_JAVA_JNI_ANDROIDMEDIAENCODER_JNI_H_
|