Deprecate write-only member CodecInfo::is_hardware_accelerated

This member of the CodecInfo struct was set in several places, but not
used for anything. To aid deletion, this cl defines a default implementation
of VideoEncoderFactory::QueryVideoEncoder.

The next step is to delete almost all downstream implementations of that method,
since the only classes that have to implement it are the few factories that
produce "internal source" encoders, e.g., for Chromium remoting.

Bug: None
Change-Id: I1f0dbf0d302933004ebdc779460cb2cb3a894e02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179520
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31844}
This commit is contained in:
Niels Möller
2020-07-16 14:19:41 +02:00
committed by Commit Bot
parent 321396fcd5
commit 2b781bf908
18 changed files with 8 additions and 86 deletions

View File

@ -101,21 +101,6 @@ std::vector<SdpVideoFormat> VideoEncoderFactoryWrapper::GetImplementations()
return implementations_;
}
VideoEncoderFactory::CodecInfo VideoEncoderFactoryWrapper::QueryVideoEncoder(
const SdpVideoFormat& format) const {
JNIEnv* jni = AttachCurrentThreadIfNeeded();
ScopedJavaLocalRef<jobject> j_codec_info =
SdpVideoFormatToVideoCodecInfo(jni, format);
ScopedJavaLocalRef<jobject> encoder = Java_VideoEncoderFactory_createEncoder(
jni, encoder_factory_, j_codec_info);
CodecInfo codec_info;
// Check if this is a wrapped native software encoder implementation.
codec_info.is_hardware_accelerated = IsHardwareVideoEncoder(jni, encoder);
codec_info.has_internal_source = false;
return codec_info;
}
std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>
VideoEncoderFactoryWrapper::GetEncoderSelector() const {
JNIEnv* jni = AttachCurrentThreadIfNeeded();

View File

@ -37,8 +37,6 @@ class VideoEncoderFactoryWrapper : public VideoEncoderFactory {
std::vector<SdpVideoFormat> GetImplementations() const override;
CodecInfo QueryVideoEncoder(const SdpVideoFormat& format) const override;
std::unique_ptr<EncoderSelectorInterface> GetEncoderSelector() const override;
private: