Enable and fix chromium clang warnings in sdk/android targets.
Targets: base_jni, internal_jni, video_jni, vp8_jni and vp9_jni Bug: webrtc:163 Change-Id: I4aa68c81e6e7cbe5fdf78c90e464b46c55633252 Reviewed-on: https://webrtc-review.googlesource.com/66820 Commit-Queue: Paulina Hensman <phensman@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22744}
This commit is contained in:
committed by
Commit Bot
parent
87c5463dfd
commit
a680a6a4af
@ -61,7 +61,7 @@ class MediaCodecVideoDecoder : public VideoDecoder, public rtc::MessageHandler {
|
||||
public:
|
||||
explicit MediaCodecVideoDecoder(
|
||||
JNIEnv* jni, VideoCodecType codecType, jobject render_egl_context);
|
||||
virtual ~MediaCodecVideoDecoder();
|
||||
~MediaCodecVideoDecoder() override;
|
||||
|
||||
int32_t InitDecode(const VideoCodec* codecSettings, int32_t numberOfCores)
|
||||
override;
|
||||
|
||||
@ -24,7 +24,7 @@ class MediaCodecVideoDecoderFactory
|
||||
: public cricket::WebRtcVideoDecoderFactory {
|
||||
public:
|
||||
MediaCodecVideoDecoderFactory();
|
||||
virtual ~MediaCodecVideoDecoderFactory();
|
||||
~MediaCodecVideoDecoderFactory() override;
|
||||
|
||||
void SetEGLContext(JNIEnv* jni, jobject render_egl_context);
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ namespace {
|
||||
// this is the encoder queue from ViE encoder.
|
||||
class MediaCodecVideoEncoder : public VideoEncoder {
|
||||
public:
|
||||
virtual ~MediaCodecVideoEncoder();
|
||||
~MediaCodecVideoEncoder() override;
|
||||
MediaCodecVideoEncoder(JNIEnv* jni,
|
||||
const cricket::VideoCodec& codec,
|
||||
jobject egl_context);
|
||||
|
||||
@ -24,7 +24,7 @@ class MediaCodecVideoEncoderFactory
|
||||
: public cricket::WebRtcVideoEncoderFactory {
|
||||
public:
|
||||
MediaCodecVideoEncoderFactory();
|
||||
virtual ~MediaCodecVideoEncoderFactory();
|
||||
~MediaCodecVideoEncoderFactory() override;
|
||||
|
||||
void SetEGLContext(JNIEnv* jni, jobject egl_context);
|
||||
|
||||
|
||||
@ -132,8 +132,18 @@ static NetworkInformation GetNetworkInformationFromJava(
|
||||
|
||||
NetworkInformation::NetworkInformation() = default;
|
||||
|
||||
NetworkInformation::NetworkInformation(const NetworkInformation&) = default;
|
||||
|
||||
NetworkInformation::NetworkInformation(NetworkInformation&&) = default;
|
||||
|
||||
NetworkInformation::~NetworkInformation() = default;
|
||||
|
||||
NetworkInformation& NetworkInformation::operator=(const NetworkInformation&) =
|
||||
default;
|
||||
|
||||
NetworkInformation& NetworkInformation::operator=(NetworkInformation&&) =
|
||||
default;
|
||||
|
||||
std::string NetworkInformation::ToString() const {
|
||||
std::stringstream ss;
|
||||
ss << "NetInfo[name " << interface_name << "; handle " << handle << "; type "
|
||||
|
||||
@ -47,7 +47,11 @@ struct NetworkInformation {
|
||||
std::vector<rtc::IPAddress> ip_addresses;
|
||||
|
||||
NetworkInformation();
|
||||
NetworkInformation(const NetworkInformation&);
|
||||
NetworkInformation(NetworkInformation&&);
|
||||
~NetworkInformation();
|
||||
NetworkInformation& operator=(const NetworkInformation&);
|
||||
NetworkInformation& operator=(NetworkInformation&&);
|
||||
|
||||
std::string ToString() const;
|
||||
};
|
||||
|
||||
@ -31,7 +31,7 @@ VideoRotation jintToVideoRotation(jint rotation) {
|
||||
}
|
||||
|
||||
AndroidVideoTrackSource* AndroidVideoTrackSourceFromJavaProxy(jlong j_proxy) {
|
||||
auto proxy_source = reinterpret_cast<VideoTrackSourceProxy*>(j_proxy);
|
||||
auto* proxy_source = reinterpret_cast<VideoTrackSourceProxy*>(j_proxy);
|
||||
return reinterpret_cast<AndroidVideoTrackSource*>(proxy_source->internal());
|
||||
}
|
||||
|
||||
@ -51,6 +51,15 @@ AndroidVideoTrackSource::AndroidVideoTrackSource(
|
||||
RTC_LOG(LS_INFO) << "AndroidVideoTrackSource ctor";
|
||||
camera_thread_checker_.DetachFromThread();
|
||||
}
|
||||
AndroidVideoTrackSource::~AndroidVideoTrackSource() = default;
|
||||
|
||||
bool AndroidVideoTrackSource::is_screencast() const {
|
||||
return is_screencast_;
|
||||
}
|
||||
|
||||
rtc::Optional<bool> AndroidVideoTrackSource::needs_denoising() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AndroidVideoTrackSource::SetState(SourceState state) {
|
||||
if (rtc::Thread::Current() != signaling_thread_) {
|
||||
@ -66,6 +75,14 @@ void AndroidVideoTrackSource::SetState(SourceState state) {
|
||||
}
|
||||
}
|
||||
|
||||
AndroidVideoTrackSource::SourceState AndroidVideoTrackSource::state() const {
|
||||
return state_;
|
||||
}
|
||||
|
||||
bool AndroidVideoTrackSource::remote() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AndroidVideoTrackSource::OnByteBufferFrameCaptured(const void* frame_data,
|
||||
int length,
|
||||
int width,
|
||||
@ -213,6 +230,11 @@ void AndroidVideoTrackSource::OnOutputFormatRequest(int width,
|
||||
video_adapter()->OnOutputFormatRequest(format);
|
||||
}
|
||||
|
||||
rtc::scoped_refptr<SurfaceTextureHelper>
|
||||
AndroidVideoTrackSource::surface_texture_helper() {
|
||||
return surface_texture_helper_;
|
||||
}
|
||||
|
||||
static void JNI_AndroidVideoTrackSourceObserver_OnByteBufferFrameCaptured(
|
||||
JNIEnv* jni,
|
||||
const JavaParamRef<jclass>&,
|
||||
|
||||
@ -32,20 +32,21 @@ class AndroidVideoTrackSource : public rtc::AdaptedVideoTrackSource {
|
||||
JNIEnv* jni,
|
||||
const JavaRef<jobject>& j_surface_texture_helper,
|
||||
bool is_screencast = false);
|
||||
~AndroidVideoTrackSource() override;
|
||||
|
||||
bool is_screencast() const override { return is_screencast_; }
|
||||
bool is_screencast() const override;
|
||||
|
||||
// Indicates that the encoder should denoise video before encoding it.
|
||||
// If it is not set, the default configuration is used which is different
|
||||
// depending on video codec.
|
||||
rtc::Optional<bool> needs_denoising() const override { return false; }
|
||||
rtc::Optional<bool> needs_denoising() const override;
|
||||
|
||||
// Called by the native capture observer
|
||||
void SetState(SourceState state);
|
||||
|
||||
SourceState state() const override { return state_; }
|
||||
SourceState state() const override;
|
||||
|
||||
bool remote() const override { return false; }
|
||||
bool remote() const override;
|
||||
|
||||
void OnByteBufferFrameCaptured(const void* frame_data,
|
||||
int length,
|
||||
@ -69,9 +70,7 @@ class AndroidVideoTrackSource : public rtc::AdaptedVideoTrackSource {
|
||||
|
||||
void OnOutputFormatRequest(int width, int height, int fps);
|
||||
|
||||
rtc::scoped_refptr<SurfaceTextureHelper> surface_texture_helper() {
|
||||
return surface_texture_helper_;
|
||||
}
|
||||
rtc::scoped_refptr<SurfaceTextureHelper> surface_texture_helper();
|
||||
|
||||
private:
|
||||
rtc::Thread* signaling_thread_;
|
||||
|
||||
@ -26,7 +26,7 @@ class JavaVideoRendererWrapper : public rtc::VideoSinkInterface<VideoFrame> {
|
||||
JavaVideoRendererWrapper(JNIEnv* jni, const JavaRef<jobject>& j_callbacks)
|
||||
: j_callbacks_(jni, j_callbacks) {}
|
||||
|
||||
virtual ~JavaVideoRendererWrapper() {}
|
||||
~JavaVideoRendererWrapper() override {}
|
||||
|
||||
void OnFrame(const VideoFrame& video_frame) override {
|
||||
JNIEnv* env = AttachCurrentThreadIfNeeded();
|
||||
|
||||
@ -25,6 +25,7 @@ VideoDecoderFactoryWrapper::VideoDecoderFactoryWrapper(
|
||||
JNIEnv* jni,
|
||||
const JavaRef<jobject>& decoder_factory)
|
||||
: decoder_factory_(jni, decoder_factory) {}
|
||||
VideoDecoderFactoryWrapper::~VideoDecoderFactoryWrapper() = default;
|
||||
|
||||
std::unique_ptr<VideoDecoder> VideoDecoderFactoryWrapper::CreateVideoDecoder(
|
||||
const SdpVideoFormat& format) {
|
||||
|
||||
@ -25,6 +25,7 @@ class VideoDecoderFactoryWrapper : public VideoDecoderFactory {
|
||||
public:
|
||||
VideoDecoderFactoryWrapper(JNIEnv* jni,
|
||||
const JavaRef<jobject>& decoder_factory);
|
||||
~VideoDecoderFactoryWrapper() override;
|
||||
|
||||
std::vector<SdpVideoFormat> GetSupportedFormats() const override;
|
||||
std::unique_ptr<VideoDecoder> CreateVideoDecoder(
|
||||
|
||||
@ -50,6 +50,8 @@ VideoDecoderWrapper::VideoDecoderWrapper(JNIEnv* jni,
|
||||
decoder_thread_checker_.DetachFromThread();
|
||||
}
|
||||
|
||||
VideoDecoderWrapper::~VideoDecoderWrapper() = default;
|
||||
|
||||
int32_t VideoDecoderWrapper::InitDecode(const VideoCodec* codec_settings,
|
||||
int32_t number_of_cores) {
|
||||
RTC_DCHECK_RUN_ON(&decoder_thread_checker_);
|
||||
@ -194,6 +196,11 @@ void VideoDecoderWrapper::OnDecodedFrame(
|
||||
decoder_qp ? decoder_qp : frame_extra_info.qp);
|
||||
}
|
||||
|
||||
VideoDecoderWrapper::FrameExtraInfo::FrameExtraInfo() = default;
|
||||
VideoDecoderWrapper::FrameExtraInfo::FrameExtraInfo(const FrameExtraInfo&) =
|
||||
default;
|
||||
VideoDecoderWrapper::FrameExtraInfo::~FrameExtraInfo() = default;
|
||||
|
||||
int32_t VideoDecoderWrapper::HandleReturnCode(JNIEnv* jni,
|
||||
const JavaRef<jobject>& j_value,
|
||||
const char* method_name) {
|
||||
|
||||
@ -28,6 +28,7 @@ namespace jni {
|
||||
class VideoDecoderWrapper : public VideoDecoder {
|
||||
public:
|
||||
VideoDecoderWrapper(JNIEnv* jni, const JavaRef<jobject>& decoder);
|
||||
~VideoDecoderWrapper() override;
|
||||
|
||||
int32_t InitDecode(const VideoCodec* codec_settings,
|
||||
int32_t number_of_cores) override;
|
||||
@ -67,6 +68,10 @@ class VideoDecoderWrapper : public VideoDecoder {
|
||||
uint32_t timestamp_rtp;
|
||||
int64_t timestamp_ntp;
|
||||
rtc::Optional<uint8_t> qp;
|
||||
|
||||
FrameExtraInfo();
|
||||
FrameExtraInfo(const FrameExtraInfo&);
|
||||
~FrameExtraInfo();
|
||||
};
|
||||
|
||||
int32_t InitDecodeInternal(JNIEnv* jni) RTC_RUN_ON(decoder_thread_checker_);
|
||||
|
||||
@ -31,6 +31,7 @@ VideoEncoderFactoryWrapper::VideoEncoderFactoryWrapper(
|
||||
supported_formats_ = JavaToNativeVector<SdpVideoFormat>(
|
||||
jni, j_supported_codecs, &VideoCodecInfoToSdpVideoFormat);
|
||||
}
|
||||
VideoEncoderFactoryWrapper::~VideoEncoderFactoryWrapper() = default;
|
||||
|
||||
std::unique_ptr<VideoEncoder> VideoEncoderFactoryWrapper::CreateVideoEncoder(
|
||||
const SdpVideoFormat& format) {
|
||||
@ -44,6 +45,11 @@ std::unique_ptr<VideoEncoder> VideoEncoderFactoryWrapper::CreateVideoEncoder(
|
||||
return JavaToNativeVideoEncoder(jni, encoder);
|
||||
}
|
||||
|
||||
std::vector<SdpVideoFormat> VideoEncoderFactoryWrapper::GetSupportedFormats()
|
||||
const {
|
||||
return supported_formats_;
|
||||
}
|
||||
|
||||
VideoEncoderFactory::CodecInfo VideoEncoderFactoryWrapper::QueryVideoEncoder(
|
||||
const SdpVideoFormat& format) const {
|
||||
JNIEnv* jni = AttachCurrentThreadIfNeeded();
|
||||
|
||||
@ -27,14 +27,13 @@ class VideoEncoderFactoryWrapper : public VideoEncoderFactory {
|
||||
public:
|
||||
VideoEncoderFactoryWrapper(JNIEnv* jni,
|
||||
const JavaRef<jobject>& encoder_factory);
|
||||
~VideoEncoderFactoryWrapper() override;
|
||||
|
||||
std::unique_ptr<VideoEncoder> CreateVideoEncoder(
|
||||
const SdpVideoFormat& format) override;
|
||||
|
||||
// Returns a list of supported codecs in order of preference.
|
||||
std::vector<SdpVideoFormat> GetSupportedFormats() const override {
|
||||
return supported_formats_;
|
||||
}
|
||||
std::vector<SdpVideoFormat> GetSupportedFormats() const override;
|
||||
|
||||
CodecInfo QueryVideoEncoder(const SdpVideoFormat& format) const override;
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ VideoEncoderWrapper::VideoEncoderWrapper(JNIEnv* jni,
|
||||
picture_id_ = random.Rand<uint16_t>() & 0x7FFF;
|
||||
tl0_pic_idx_ = random.Rand<uint8_t>();
|
||||
}
|
||||
VideoEncoderWrapper::~VideoEncoderWrapper() = default;
|
||||
|
||||
int32_t VideoEncoderWrapper::InitEncode(const VideoCodec* codec_settings,
|
||||
int32_t number_of_cores,
|
||||
@ -207,6 +208,10 @@ VideoEncoderWrapper::ScalingSettings VideoEncoderWrapper::GetScalingSettings()
|
||||
}
|
||||
}
|
||||
|
||||
bool VideoEncoderWrapper::SupportsNativeHandle() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* VideoEncoderWrapper::ImplementationName() const {
|
||||
return implementation_name_.c_str();
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@ namespace jni {
|
||||
class VideoEncoderWrapper : public VideoEncoder {
|
||||
public:
|
||||
VideoEncoderWrapper(JNIEnv* jni, const JavaRef<jobject>& j_encoder);
|
||||
~VideoEncoderWrapper() override;
|
||||
|
||||
int32_t InitEncode(const VideoCodec* codec_settings,
|
||||
int32_t number_of_cores,
|
||||
@ -51,7 +52,7 @@ class VideoEncoderWrapper : public VideoEncoder {
|
||||
|
||||
ScalingSettings GetScalingSettings() const override;
|
||||
|
||||
bool SupportsNativeHandle() const override { return true; }
|
||||
bool SupportsNativeHandle() const override;
|
||||
|
||||
// Should only be called by JNI.
|
||||
void OnEncodedFrame(JNIEnv* jni,
|
||||
|
||||
@ -49,7 +49,7 @@ class AndroidVideoI420Buffer : public I420BufferInterface {
|
||||
int width,
|
||||
int height,
|
||||
const JavaRef<jobject>& j_video_frame_buffer);
|
||||
~AndroidVideoI420Buffer();
|
||||
~AndroidVideoI420Buffer() override;
|
||||
|
||||
private:
|
||||
const uint8_t* DataY() const override { return data_y_; }
|
||||
|
||||
Reference in New Issue
Block a user