Files
platform-external-webrtc/sdk/android/api/org/webrtc/VideoEncoderFallback.java
Sami Kalliomäki 6196feb2ed Fix a bug where all wrapped codecs were considered software codecs.
This is not the case for fallback codecs.

Bug: webrtc:7925
Change-Id: I5039d8879923a2db1e7c08bb5640763dd20ea8e7
Reviewed-on: https://webrtc-review.googlesource.com/24863
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20861}
2017-11-24 10:30:59 +00:00

37 lines
1.1 KiB
Java

/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
package org.webrtc;
/**
* A combined video encoder that falls back on a secondary encoder if the primary encoder fails.
*/
public class VideoEncoderFallback extends WrappedNativeVideoEncoder {
private final VideoEncoder fallback;
private final VideoEncoder primary;
public VideoEncoderFallback(VideoEncoder fallback, VideoEncoder primary) {
this.fallback = fallback;
this.primary = primary;
}
@Override
long createNativeEncoder() {
return createNativeEncoder(fallback, primary);
}
@Override
boolean isSoftwareEncoder() {
return isWrappedSoftwareEncoder(primary);
}
private static native long createNativeEncoder(VideoEncoder fallback, VideoEncoder primary);
}