Add ability to scale to arbitrary factors
This CL adds a fallback for the case when no optimized scale factor produces a low enough resolution for what was requested. It also ensures that all resolutions provided by the video adapter are divisible by four. This is required by some hardware implementations. BUG=webrtc:6837 Review-Url: https://codereview.webrtc.org/2555483005 Cr-Commit-Position: refs/heads/master@{#15469}
This commit is contained in:
@ -12,13 +12,19 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace {
|
||||
// MediaCodec wants resolution to be divisible by 2.
|
||||
const int kRequiredResolutionAlignment = 2;
|
||||
}
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
AndroidVideoTrackSource::AndroidVideoTrackSource(rtc::Thread* signaling_thread,
|
||||
JNIEnv* jni,
|
||||
jobject j_egl_context,
|
||||
bool is_screencast)
|
||||
: signaling_thread_(signaling_thread),
|
||||
: AdaptedVideoTrackSource(kRequiredResolutionAlignment),
|
||||
signaling_thread_(signaling_thread),
|
||||
surface_texture_helper_(webrtc_jni::SurfaceTextureHelper::create(
|
||||
jni,
|
||||
"Camera SurfaceTextureHelper",
|
||||
|
||||
Reference in New Issue
Block a user