Merge remote tracking branch 'upstream-master'

Bug: 153469641
Test: run cuttlefish locally
Change-Id: Ida3bfe62ef5c6549278f4c155a1f690b008e9b9d
This commit is contained in:
Jorge E. Moreira
2020-07-23 13:07:40 -07:00
1236 changed files with 50564 additions and 32463 deletions

View File

@ -18,18 +18,9 @@ import java.util.Arrays;
public class HardwareVideoDecoderFactory extends MediaCodecVideoDecoderFactory {
private final static Predicate<MediaCodecInfo> defaultAllowedPredicate =
new Predicate<MediaCodecInfo>() {
private String[] prefixBlacklist =
Arrays.copyOf(MediaCodecUtils.SOFTWARE_IMPLEMENTATION_PREFIXES,
MediaCodecUtils.SOFTWARE_IMPLEMENTATION_PREFIXES.length);
@Override
public boolean test(MediaCodecInfo arg) {
final String name = arg.getName();
for (String prefix : prefixBlacklist) {
if (name.startsWith(prefix)) {
return false;
}
}
return true;
return MediaCodecUtils.isHardwareAccelerated(arg);
}
};

View File

@ -1,22 +0,0 @@
/*
* Copyright 2018 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;
/**
* Factory for creating webrtc::MediaTransportFactory instances.
*/
public interface MediaTransportFactoryFactory {
/**
* Dynamically allocates a webrtc::MediaTransportFactory instance and returns a pointer to it.
* The caller takes ownership of the object.
*/
public long createNativeMediaTransportFactory();
}

View File

@ -536,18 +536,6 @@ public class PeerConnection {
// Null indicates no change to currently configured value.
@Nullable public Boolean allowCodecSwitching;
/*
* Experimental flag that enables a use of media transport. If this is true, the media transport
* factory MUST be provided to the PeerConnectionFactory.
*/
public boolean useMediaTransport;
/*
* Experimental flag that enables a use of media transport for data channels. If this is true,
* the media transport factory MUST be provided to the PeerConnectionFactory.
*/
public boolean useMediaTransportForDataChannels;
/**
* Defines advanced optional cryptographic settings related to SRTP and
* frame encryption for native WebRTC. Setting this will overwrite any
@ -602,8 +590,6 @@ public class PeerConnection {
networkPreference = AdapterType.UNKNOWN;
sdpSemantics = SdpSemantics.PLAN_B;
activeResetSrtpParams = false;
useMediaTransport = false;
useMediaTransportForDataChannels = false;
cryptoOptions = null;
turnLoggingId = null;
allowCodecSwitching = null;
@ -816,16 +802,6 @@ public class PeerConnection {
return allowCodecSwitching;
}
@CalledByNative("RTCConfiguration")
boolean getUseMediaTransport() {
return useMediaTransport;
}
@CalledByNative("RTCConfiguration")
boolean getUseMediaTransportForDataChannels() {
return useMediaTransportForDataChannels;
}
@Nullable
@CalledByNative("RTCConfiguration")
CryptoOptions getCryptoOptions() {

View File

@ -175,7 +175,6 @@ public class PeerConnectionFactory {
@Nullable private FecControllerFactoryFactoryInterface fecControllerFactoryFactory;
@Nullable private NetworkControllerFactoryFactory networkControllerFactoryFactory;
@Nullable private NetworkStatePredictorFactoryFactory networkStatePredictorFactoryFactory;
@Nullable private MediaTransportFactoryFactory mediaTransportFactoryFactory;
@Nullable private NetEqFactoryFactory neteqFactoryFactory;
private Builder() {}
@ -247,13 +246,6 @@ public class PeerConnectionFactory {
return this;
}
/** Sets a MediaTransportFactoryFactory for a PeerConnectionFactory. */
public Builder setMediaTransportFactoryFactory(
MediaTransportFactoryFactory mediaTransportFactoryFactory) {
this.mediaTransportFactoryFactory = mediaTransportFactoryFactory;
return this;
}
/**
* Sets a NetEqFactoryFactory for the PeerConnectionFactory. When using a
* custom NetEqFactoryFactory, the AudioDecoderFactoryFactory will be set
@ -284,9 +276,6 @@ public class PeerConnectionFactory {
networkStatePredictorFactoryFactory == null
? 0
: networkStatePredictorFactoryFactory.createNativeNetworkStatePredictorFactory(),
mediaTransportFactoryFactory == null
? 0
: mediaTransportFactoryFactory.createNativeMediaTransportFactory(),
neteqFactoryFactory == null ? 0 : neteqFactoryFactory.createNativeNetEqFactory());
}
}
@ -607,7 +596,7 @@ public class PeerConnectionFactory {
long audioDecoderFactory, VideoEncoderFactory encoderFactory,
VideoDecoderFactory decoderFactory, long nativeAudioProcessor,
long nativeFecControllerFactory, long nativeNetworkControllerFactory,
long nativeNetworkStatePredictorFactory, long mediaTransportFactory, long neteqFactory);
long nativeNetworkStatePredictorFactory, long neteqFactory);
private static native long nativeCreatePeerConnection(long factory,
PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver,

View File

@ -21,19 +21,9 @@ public class PlatformSoftwareVideoDecoderFactory extends MediaCodecVideoDecoderF
*/
private static final Predicate<MediaCodecInfo> defaultAllowedPredicate =
new Predicate<MediaCodecInfo>() {
private String[] prefixWhitelist =
Arrays.copyOf(MediaCodecUtils.SOFTWARE_IMPLEMENTATION_PREFIXES,
MediaCodecUtils.SOFTWARE_IMPLEMENTATION_PREFIXES.length);
@Override
public boolean test(MediaCodecInfo arg) {
final String name = arg.getName();
for (String prefix : prefixWhitelist) {
if (name.startsWith(prefix)) {
return true;
}
}
return false;
return MediaCodecUtils.isSoftwareOnly(arg);
}
};

View File

@ -263,6 +263,17 @@ public class SurfaceTextureHelper {
});
}
/**
* Forces a frame to be produced. If no new frame is available, the last frame is sent to the
* listener again.
*/
public void forceFrame() {
handler.post(() -> {
hasPendingTexture = true;
tryDeliverTextureFrame();
});
}
/** Set the rotation of the delivered frames. */
public void setFrameRotation(int rotation) {
handler.post(() -> this.frameRotation = rotation);