Adding @SuppressWarnings(NoSynchronizedMethodCheck).
In https://chromium-review.googlesource.com/c/chromium/src/+/750645 Chromium started to use an ErrorProne plugin to discourage synchronized public methods (an encourage the usage of synchronized blocks). In order to unblock the Chromium Roll we can suppress these warnings and decide if we want to align with Chromium on this check or ask them to make it optional. More details in the bug. TBR=magjed@webrtc.org Bug: webrtc:8491 Change-Id: Ie77a324e54aab44a4f59853959549f1d21f884a0 No-Try: True Reviewed-on: https://webrtc-review.googlesource.com/20060 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20569}
This commit is contained in:
committed by
Commit Bot
parent
08a9c372df
commit
12251b6386
@ -180,6 +180,8 @@ class CpuMonitor {
|
|||||||
scheduleCpuUtilizationTask();
|
scheduleCpuUtilizationTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void reset() {
|
public synchronized void reset() {
|
||||||
if (executor != null) {
|
if (executor != null) {
|
||||||
Log.d(TAG, "reset");
|
Log.d(TAG, "reset");
|
||||||
@ -188,14 +190,20 @@ class CpuMonitor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized int getCpuUsageCurrent() {
|
public synchronized int getCpuUsageCurrent() {
|
||||||
return doubleToPercent(userCpuUsage.getCurrent() + systemCpuUsage.getCurrent());
|
return doubleToPercent(userCpuUsage.getCurrent() + systemCpuUsage.getCurrent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized int getCpuUsageAverage() {
|
public synchronized int getCpuUsageAverage() {
|
||||||
return doubleToPercent(userCpuUsage.getAverage() + systemCpuUsage.getAverage());
|
return doubleToPercent(userCpuUsage.getAverage() + systemCpuUsage.getAverage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized int getFrequencyScaleAverage() {
|
public synchronized int getFrequencyScaleAverage() {
|
||||||
return doubleToPercent(frequencyScale.getAverage());
|
return doubleToPercent(frequencyScale.getAverage());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,12 +100,16 @@ public class PeerConnectionClientTest implements PeerConnectionEvents {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Resets render to wait for new amount of video frames.
|
// Resets render to wait for new amount of video frames.
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void reset(int expectedFrames) {
|
public synchronized void reset(int expectedFrames) {
|
||||||
renderFrameCalled = false;
|
renderFrameCalled = false;
|
||||||
doneRendering = new CountDownLatch(expectedFrames);
|
doneRendering = new CountDownLatch(expectedFrames);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void renderFrame(VideoRenderer.I420Frame frame) {
|
public synchronized void renderFrame(VideoRenderer.I420Frame frame) {
|
||||||
if (!renderFrameCalled) {
|
if (!renderFrameCalled) {
|
||||||
if (rendererName != null) {
|
if (rendererName != null) {
|
||||||
@ -143,12 +147,16 @@ public class PeerConnectionClientTest implements PeerConnectionEvents {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Resets render to wait for new amount of video frames.
|
// Resets render to wait for new amount of video frames.
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void reset(int expectedFrames) {
|
public synchronized void reset(int expectedFrames) {
|
||||||
renderFrameCalled = false;
|
renderFrameCalled = false;
|
||||||
doneRendering = new CountDownLatch(expectedFrames);
|
doneRendering = new CountDownLatch(expectedFrames);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onFrame(VideoFrame frame) {
|
public synchronized void onFrame(VideoFrame frame) {
|
||||||
if (!renderFrameCalled) {
|
if (!renderFrameCalled) {
|
||||||
if (rendererName != null) {
|
if (rendererName != null) {
|
||||||
|
|||||||
@ -48,6 +48,8 @@ public class WebRtcAudioManager {
|
|||||||
// specified in WebRtcAudioUtils.BLACKLISTED_OPEN_SL_ES_MODELS.
|
// specified in WebRtcAudioUtils.BLACKLISTED_OPEN_SL_ES_MODELS.
|
||||||
// Allows an app to take control over which devices to exclude from using
|
// Allows an app to take control over which devices to exclude from using
|
||||||
// the OpenSL ES audio output path
|
// the OpenSL ES audio output path
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void setBlacklistDeviceForOpenSLESUsage(boolean enable) {
|
public static synchronized void setBlacklistDeviceForOpenSLESUsage(boolean enable) {
|
||||||
blacklistDeviceForOpenSLESUsageIsOverridden = true;
|
blacklistDeviceForOpenSLESUsageIsOverridden = true;
|
||||||
blacklistDeviceForOpenSLESUsage = enable;
|
blacklistDeviceForOpenSLESUsage = enable;
|
||||||
@ -55,18 +57,28 @@ public class WebRtcAudioManager {
|
|||||||
|
|
||||||
// Call these methods to override the default mono audio modes for the specified direction(s)
|
// Call these methods to override the default mono audio modes for the specified direction(s)
|
||||||
// (input and/or output).
|
// (input and/or output).
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void setStereoOutput(boolean enable) {
|
public static synchronized void setStereoOutput(boolean enable) {
|
||||||
Logging.w(TAG, "Overriding default output behavior: setStereoOutput(" + enable + ')');
|
Logging.w(TAG, "Overriding default output behavior: setStereoOutput(" + enable + ')');
|
||||||
useStereoOutput = enable;
|
useStereoOutput = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void setStereoInput(boolean enable) {
|
public static synchronized void setStereoInput(boolean enable) {
|
||||||
Logging.w(TAG, "Overriding default input behavior: setStereoInput(" + enable + ')');
|
Logging.w(TAG, "Overriding default input behavior: setStereoInput(" + enable + ')');
|
||||||
useStereoInput = enable;
|
useStereoInput = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized boolean getStereoOutput() {
|
public static synchronized boolean getStereoOutput() {
|
||||||
return useStereoOutput;
|
return useStereoOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized boolean getStereoInput() {
|
public static synchronized boolean getStereoInput() {
|
||||||
return useStereoInput;
|
return useStereoInput;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,6 +50,8 @@ public class WebRtcAudioTrack {
|
|||||||
// This method overrides the default usage attribute and allows the user
|
// This method overrides the default usage attribute and allows the user
|
||||||
// to set it to something else than AudioAttributes.USAGE_VOICE_COMMUNICATION.
|
// to set it to something else than AudioAttributes.USAGE_VOICE_COMMUNICATION.
|
||||||
// NOTE: calling this method will most likely break existing VoIP tuning.
|
// NOTE: calling this method will most likely break existing VoIP tuning.
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void setAudioTrackUsageAttribute(int usage) {
|
public static synchronized void setAudioTrackUsageAttribute(int usage) {
|
||||||
Logging.w(TAG, "Default usage attribute is changed from: "
|
Logging.w(TAG, "Default usage attribute is changed from: "
|
||||||
+ DEFAULT_USAGE + " to " + usage);
|
+ DEFAULT_USAGE + " to " + usage);
|
||||||
|
|||||||
@ -60,30 +60,46 @@ public final class WebRtcAudioUtils {
|
|||||||
|
|
||||||
// Call these methods if any hardware based effect shall be replaced by a
|
// Call these methods if any hardware based effect shall be replaced by a
|
||||||
// software based version provided by the WebRTC stack instead.
|
// software based version provided by the WebRTC stack instead.
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void setWebRtcBasedAcousticEchoCanceler(boolean enable) {
|
public static synchronized void setWebRtcBasedAcousticEchoCanceler(boolean enable) {
|
||||||
useWebRtcBasedAcousticEchoCanceler = enable;
|
useWebRtcBasedAcousticEchoCanceler = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void setWebRtcBasedNoiseSuppressor(boolean enable) {
|
public static synchronized void setWebRtcBasedNoiseSuppressor(boolean enable) {
|
||||||
useWebRtcBasedNoiseSuppressor = enable;
|
useWebRtcBasedNoiseSuppressor = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void setWebRtcBasedAutomaticGainControl(boolean enable) {
|
public static synchronized void setWebRtcBasedAutomaticGainControl(boolean enable) {
|
||||||
// TODO(henrika): deprecated; remove when no longer used by any client.
|
// TODO(henrika): deprecated; remove when no longer used by any client.
|
||||||
Logging.w(TAG, "setWebRtcBasedAutomaticGainControl() is deprecated");
|
Logging.w(TAG, "setWebRtcBasedAutomaticGainControl() is deprecated");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized boolean useWebRtcBasedAcousticEchoCanceler() {
|
public static synchronized boolean useWebRtcBasedAcousticEchoCanceler() {
|
||||||
if (useWebRtcBasedAcousticEchoCanceler) {
|
if (useWebRtcBasedAcousticEchoCanceler) {
|
||||||
Logging.w(TAG, "Overriding default behavior; now using WebRTC AEC!");
|
Logging.w(TAG, "Overriding default behavior; now using WebRTC AEC!");
|
||||||
}
|
}
|
||||||
return useWebRtcBasedAcousticEchoCanceler;
|
return useWebRtcBasedAcousticEchoCanceler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized boolean useWebRtcBasedNoiseSuppressor() {
|
public static synchronized boolean useWebRtcBasedNoiseSuppressor() {
|
||||||
if (useWebRtcBasedNoiseSuppressor) {
|
if (useWebRtcBasedNoiseSuppressor) {
|
||||||
Logging.w(TAG, "Overriding default behavior; now using WebRTC NS!");
|
Logging.w(TAG, "Overriding default behavior; now using WebRTC NS!");
|
||||||
}
|
}
|
||||||
return useWebRtcBasedNoiseSuppressor;
|
return useWebRtcBasedNoiseSuppressor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(henrika): deprecated; remove when no longer used by any client.
|
// TODO(henrika): deprecated; remove when no longer used by any client.
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized boolean useWebRtcBasedAutomaticGainControl() {
|
public static synchronized boolean useWebRtcBasedAutomaticGainControl() {
|
||||||
// Always return true here to avoid trying to use any built-in AGC.
|
// Always return true here to avoid trying to use any built-in AGC.
|
||||||
return true;
|
return true;
|
||||||
@ -110,15 +126,21 @@ public final class WebRtcAudioUtils {
|
|||||||
// Call this method if the default handling of querying the native sample
|
// Call this method if the default handling of querying the native sample
|
||||||
// rate shall be overridden. Can be useful on some devices where the
|
// rate shall be overridden. Can be useful on some devices where the
|
||||||
// available Android APIs are known to return invalid results.
|
// available Android APIs are known to return invalid results.
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void setDefaultSampleRateHz(int sampleRateHz) {
|
public static synchronized void setDefaultSampleRateHz(int sampleRateHz) {
|
||||||
isDefaultSampleRateOverridden = true;
|
isDefaultSampleRateOverridden = true;
|
||||||
defaultSampleRateHz = sampleRateHz;
|
defaultSampleRateHz = sampleRateHz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized boolean isDefaultSampleRateOverridden() {
|
public static synchronized boolean isDefaultSampleRateOverridden() {
|
||||||
return isDefaultSampleRateOverridden;
|
return isDefaultSampleRateOverridden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized int getDefaultSampleRateHz() {
|
public static synchronized int getDefaultSampleRateHz() {
|
||||||
return defaultSampleRateHz;
|
return defaultSampleRateHz;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,6 +104,8 @@ public class Logging {
|
|||||||
// Enable diagnostic logging for messages of |severity| to the platform debug
|
// Enable diagnostic logging for messages of |severity| to the platform debug
|
||||||
// output. On Android, the output will be directed to Logcat.
|
// output. On Android, the output will be directed to Logcat.
|
||||||
// Note: this function starts collecting the output of the LOG() macros.
|
// Note: this function starts collecting the output of the LOG() macros.
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public static synchronized void enableLogToDebugOutput(Severity severity) {
|
public static synchronized void enableLogToDebugOutput(Severity severity) {
|
||||||
if (!loadNativeLibrary()) {
|
if (!loadNativeLibrary()) {
|
||||||
fallbackLogger.log(Level.WARNING, "Cannot enable logging because native lib not loaded.");
|
fallbackLogger.log(Level.WARNING, "Cannot enable logging because native lib not loaded.");
|
||||||
|
|||||||
@ -55,11 +55,15 @@ public class EglRenderer implements VideoRenderer.Callbacks, VideoSink {
|
|||||||
private class EglSurfaceCreation implements Runnable {
|
private class EglSurfaceCreation implements Runnable {
|
||||||
private Object surface;
|
private Object surface;
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void setSurface(Object surface) {
|
public synchronized void setSurface(Object surface) {
|
||||||
this.surface = surface;
|
this.surface = surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void run() {
|
public synchronized void run() {
|
||||||
if (surface != null && eglBase != null && !eglBase.hasSurface()) {
|
if (surface != null && eglBase != null && !eglBase.hasSurface()) {
|
||||||
if (surface instanceof Surface) {
|
if (surface instanceof Surface) {
|
||||||
|
|||||||
@ -77,6 +77,8 @@ public class ScreenCapturerAndroid
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void initialize(final SurfaceTextureHelper surfaceTextureHelper,
|
public synchronized void initialize(final SurfaceTextureHelper surfaceTextureHelper,
|
||||||
final Context applicationContext, final VideoCapturer.CapturerObserver capturerObserver) {
|
final Context applicationContext, final VideoCapturer.CapturerObserver capturerObserver) {
|
||||||
checkNotDisposed();
|
checkNotDisposed();
|
||||||
@ -96,6 +98,8 @@ public class ScreenCapturerAndroid
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void startCapture(
|
public synchronized void startCapture(
|
||||||
final int width, final int height, final int ignoredFramerate) {
|
final int width, final int height, final int ignoredFramerate) {
|
||||||
checkNotDisposed();
|
checkNotDisposed();
|
||||||
@ -115,6 +119,8 @@ public class ScreenCapturerAndroid
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void stopCapture() {
|
public synchronized void stopCapture() {
|
||||||
checkNotDisposed();
|
checkNotDisposed();
|
||||||
ThreadUtils.invokeAtFrontUninterruptibly(surfaceTextureHelper.getHandler(), new Runnable() {
|
ThreadUtils.invokeAtFrontUninterruptibly(surfaceTextureHelper.getHandler(), new Runnable() {
|
||||||
@ -140,6 +146,8 @@ public class ScreenCapturerAndroid
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void dispose() {
|
public synchronized void dispose() {
|
||||||
isDisposed = true;
|
isDisposed = true;
|
||||||
}
|
}
|
||||||
@ -153,6 +161,8 @@ public class ScreenCapturerAndroid
|
|||||||
* @param ignoredFramerate ignored
|
* @param ignoredFramerate ignored
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void changeCaptureFormat(
|
public synchronized void changeCaptureFormat(
|
||||||
final int width, final int height, final int ignoredFramerate) {
|
final int width, final int height, final int ignoredFramerate) {
|
||||||
checkNotDisposed();
|
checkNotDisposed();
|
||||||
|
|||||||
@ -70,6 +70,8 @@ public class EglRendererTest {
|
|||||||
Bitmap storedBitmap;
|
Bitmap storedBitmap;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onFrame(Bitmap bitmap) {
|
public synchronized void onFrame(Bitmap bitmap) {
|
||||||
if (bitmapReceived) {
|
if (bitmapReceived) {
|
||||||
fail("Unexpected bitmap was received.");
|
fail("Unexpected bitmap was received.");
|
||||||
@ -80,6 +82,8 @@ public class EglRendererTest {
|
|||||||
notify();
|
notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized boolean waitForBitmap(int timeoutMs) throws InterruptedException {
|
public synchronized boolean waitForBitmap(int timeoutMs) throws InterruptedException {
|
||||||
final long endTimeMs = System.currentTimeMillis() + timeoutMs;
|
final long endTimeMs = System.currentTimeMillis() + timeoutMs;
|
||||||
while (!bitmapReceived) {
|
while (!bitmapReceived) {
|
||||||
@ -92,6 +96,8 @@ public class EglRendererTest {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized Bitmap resetAndGetBitmap() {
|
public synchronized Bitmap resetAndGetBitmap() {
|
||||||
bitmapReceived = false;
|
bitmapReceived = false;
|
||||||
return storedBitmap;
|
return storedBitmap;
|
||||||
|
|||||||
@ -40,6 +40,8 @@ public class FileVideoCapturerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onByteBufferFrameCaptured(
|
public synchronized void onByteBufferFrameCaptured(
|
||||||
byte[] data, int width, int height, int rotation, long timeStamp) {
|
byte[] data, int width, int height, int rotation, long timeStamp) {
|
||||||
// Empty on purpose.
|
// Empty on purpose.
|
||||||
@ -52,11 +54,15 @@ public class FileVideoCapturerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onFrameCaptured(VideoFrame frame) {
|
public synchronized void onFrameCaptured(VideoFrame frame) {
|
||||||
frames.add(frame);
|
frames.add(frame);
|
||||||
notify();
|
notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized ArrayList<VideoFrame> getMinimumFramesBlocking(int minFrames)
|
public synchronized ArrayList<VideoFrame> getMinimumFramesBlocking(int minFrames)
|
||||||
throws InterruptedException {
|
throws InterruptedException {
|
||||||
while (frames.size() < minFrames) {
|
while (frames.size() < minFrames) {
|
||||||
|
|||||||
@ -92,6 +92,8 @@ public class PeerConnectionTest {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void setDataChannel(DataChannel dataChannel) {
|
public synchronized void setDataChannel(DataChannel dataChannel) {
|
||||||
assertNull(this.dataChannel);
|
assertNull(this.dataChannel);
|
||||||
this.dataChannel = dataChannel;
|
this.dataChannel = dataChannel;
|
||||||
@ -99,11 +101,15 @@ public class PeerConnectionTest {
|
|||||||
assertNotNull(this.dataChannel);
|
assertNotNull(this.dataChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectIceCandidates(int count) {
|
public synchronized void expectIceCandidates(int count) {
|
||||||
expectedIceCandidates += count;
|
expectedIceCandidates += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onIceCandidate(IceCandidate candidate) {
|
public synchronized void onIceCandidate(IceCandidate candidate) {
|
||||||
--expectedIceCandidates;
|
--expectedIceCandidates;
|
||||||
|
|
||||||
@ -119,16 +125,22 @@ public class PeerConnectionTest {
|
|||||||
@Override
|
@Override
|
||||||
public void onIceCandidatesRemoved(IceCandidate[] candidates) {}
|
public void onIceCandidatesRemoved(IceCandidate[] candidates) {}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void setExpectedResolution(int width, int height) {
|
public synchronized void setExpectedResolution(int width, int height) {
|
||||||
expectedWidth = width;
|
expectedWidth = width;
|
||||||
expectedHeight = height;
|
expectedHeight = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectFramesDelivered(int count) {
|
public synchronized void expectFramesDelivered(int count) {
|
||||||
expectedFramesDelivered += count;
|
expectedFramesDelivered += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void renderFrame(VideoRenderer.I420Frame frame) {
|
public synchronized void renderFrame(VideoRenderer.I420Frame frame) {
|
||||||
assertTrue(expectedWidth > 0);
|
assertTrue(expectedWidth > 0);
|
||||||
assertTrue(expectedHeight > 0);
|
assertTrue(expectedHeight > 0);
|
||||||
@ -138,20 +150,28 @@ public class PeerConnectionTest {
|
|||||||
VideoRenderer.renderFrameDone(frame);
|
VideoRenderer.renderFrameDone(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectSignalingChange(SignalingState newState) {
|
public synchronized void expectSignalingChange(SignalingState newState) {
|
||||||
expectedSignalingChanges.add(newState);
|
expectedSignalingChanges.add(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onSignalingChange(SignalingState newState) {
|
public synchronized void onSignalingChange(SignalingState newState) {
|
||||||
assertEquals(expectedSignalingChanges.removeFirst(), newState);
|
assertEquals(expectedSignalingChanges.removeFirst(), newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectIceConnectionChange(IceConnectionState newState) {
|
public synchronized void expectIceConnectionChange(IceConnectionState newState) {
|
||||||
expectedIceConnectionChanges.add(newState);
|
expectedIceConnectionChanges.add(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onIceConnectionChange(IceConnectionState newState) {
|
public synchronized void onIceConnectionChange(IceConnectionState newState) {
|
||||||
// TODO(bemasc): remove once delivery of ICECompleted is reliable
|
// TODO(bemasc): remove once delivery of ICECompleted is reliable
|
||||||
// (https://code.google.com/p/webrtc/issues/detail?id=3021).
|
// (https://code.google.com/p/webrtc/issues/detail?id=3021).
|
||||||
@ -168,15 +188,21 @@ public class PeerConnectionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onIceConnectionReceivingChange(boolean receiving) {
|
public synchronized void onIceConnectionReceivingChange(boolean receiving) {
|
||||||
System.out.println(name + "Got an ICE connection receiving change " + receiving);
|
System.out.println(name + "Got an ICE connection receiving change " + receiving);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectIceGatheringChange(IceGatheringState newState) {
|
public synchronized void expectIceGatheringChange(IceGatheringState newState) {
|
||||||
expectedIceGatheringChanges.add(newState);
|
expectedIceGatheringChanges.add(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onIceGatheringChange(IceGatheringState newState) {
|
public synchronized void onIceGatheringChange(IceGatheringState newState) {
|
||||||
// It's fine to get a variable number of GATHERING messages before
|
// It's fine to get a variable number of GATHERING messages before
|
||||||
// COMPLETE fires (depending on how long the test runs) so we don't assert
|
// COMPLETE fires (depending on how long the test runs) so we don't assert
|
||||||
@ -190,11 +216,15 @@ public class PeerConnectionTest {
|
|||||||
assertEquals(expectedIceGatheringChanges.removeFirst(), newState);
|
assertEquals(expectedIceGatheringChanges.removeFirst(), newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectAddStream(String label) {
|
public synchronized void expectAddStream(String label) {
|
||||||
expectedAddStreamLabels.add(label);
|
expectedAddStreamLabels.add(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onAddStream(MediaStream stream) {
|
public synchronized void onAddStream(MediaStream stream) {
|
||||||
assertEquals(expectedAddStreamLabels.removeFirst(), stream.label());
|
assertEquals(expectedAddStreamLabels.removeFirst(), stream.label());
|
||||||
for (AudioTrack track : stream.audioTracks) {
|
for (AudioTrack track : stream.audioTracks) {
|
||||||
@ -209,11 +239,15 @@ public class PeerConnectionTest {
|
|||||||
gotRemoteStreams.add(stream);
|
gotRemoteStreams.add(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectRemoveStream(String label) {
|
public synchronized void expectRemoveStream(String label) {
|
||||||
expectedRemoveStreamLabels.add(label);
|
expectedRemoveStreamLabels.add(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onRemoveStream(MediaStream stream) {
|
public synchronized void onRemoveStream(MediaStream stream) {
|
||||||
assertEquals(expectedRemoveStreamLabels.removeFirst(), stream.label());
|
assertEquals(expectedRemoveStreamLabels.removeFirst(), stream.label());
|
||||||
WeakReference<VideoRenderer> renderer = renderers.remove(stream);
|
WeakReference<VideoRenderer> renderer = renderers.remove(stream);
|
||||||
@ -224,40 +258,56 @@ public class PeerConnectionTest {
|
|||||||
gotRemoteStreams.remove(stream);
|
gotRemoteStreams.remove(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectDataChannel(String label) {
|
public synchronized void expectDataChannel(String label) {
|
||||||
expectedRemoteDataChannelLabels.add(label);
|
expectedRemoteDataChannelLabels.add(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onDataChannel(DataChannel remoteDataChannel) {
|
public synchronized void onDataChannel(DataChannel remoteDataChannel) {
|
||||||
assertEquals(expectedRemoteDataChannelLabels.removeFirst(), remoteDataChannel.label());
|
assertEquals(expectedRemoteDataChannelLabels.removeFirst(), remoteDataChannel.label());
|
||||||
setDataChannel(remoteDataChannel);
|
setDataChannel(remoteDataChannel);
|
||||||
assertEquals(DataChannel.State.CONNECTING, dataChannel.state());
|
assertEquals(DataChannel.State.CONNECTING, dataChannel.state());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectRenegotiationNeeded() {
|
public synchronized void expectRenegotiationNeeded() {
|
||||||
++expectedRenegotiations;
|
++expectedRenegotiations;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onRenegotiationNeeded() {
|
public synchronized void onRenegotiationNeeded() {
|
||||||
assertTrue(--expectedRenegotiations >= 0);
|
assertTrue(--expectedRenegotiations >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectAddTrack(int expectedTracksAdded) {
|
public synchronized void expectAddTrack(int expectedTracksAdded) {
|
||||||
this.expectedTracksAdded = expectedTracksAdded;
|
this.expectedTracksAdded = expectedTracksAdded;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onAddTrack(RtpReceiver receiver, MediaStream[] mediaStreams) {
|
public synchronized void onAddTrack(RtpReceiver receiver, MediaStream[] mediaStreams) {
|
||||||
expectedTracksAdded--;
|
expectedTracksAdded--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectMessage(ByteBuffer expectedBuffer, boolean expectedBinary) {
|
public synchronized void expectMessage(ByteBuffer expectedBuffer, boolean expectedBinary) {
|
||||||
expectedBuffers.add(new DataChannel.Buffer(expectedBuffer, expectedBinary));
|
expectedBuffers.add(new DataChannel.Buffer(expectedBuffer, expectedBinary));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onMessage(DataChannel.Buffer buffer) {
|
public synchronized void onMessage(DataChannel.Buffer buffer) {
|
||||||
DataChannel.Buffer expected = expectedBuffers.removeFirst();
|
DataChannel.Buffer expected = expectedBuffers.removeFirst();
|
||||||
assertEquals(expected.binary, buffer.binary);
|
assertEquals(expected.binary, buffer.binary);
|
||||||
@ -265,21 +315,29 @@ public class PeerConnectionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onBufferedAmountChange(long previousAmount) {
|
public synchronized void onBufferedAmountChange(long previousAmount) {
|
||||||
assertFalse(previousAmount == dataChannel.bufferedAmount());
|
assertFalse(previousAmount == dataChannel.bufferedAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onStateChange() {
|
public synchronized void onStateChange() {
|
||||||
assertEquals(expectedStateChanges.removeFirst(), dataChannel.state());
|
assertEquals(expectedStateChanges.removeFirst(), dataChannel.state());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectStateChange(DataChannel.State state) {
|
public synchronized void expectStateChange(DataChannel.State state) {
|
||||||
expectedStateChanges.add(state);
|
expectedStateChanges.add(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Old getStats callback.
|
// Old getStats callback.
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onComplete(StatsReport[] reports) {
|
public synchronized void onComplete(StatsReport[] reports) {
|
||||||
if (--expectedOldStatsCallbacks < 0) {
|
if (--expectedOldStatsCallbacks < 0) {
|
||||||
throw new RuntimeException("Unexpected stats report: " + Arrays.toString(reports));
|
throw new RuntimeException("Unexpected stats report: " + Arrays.toString(reports));
|
||||||
@ -289,6 +347,8 @@ public class PeerConnectionTest {
|
|||||||
|
|
||||||
// New getStats callback.
|
// New getStats callback.
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onStatsDelivered(RTCStatsReport report) {
|
public synchronized void onStatsDelivered(RTCStatsReport report) {
|
||||||
if (--expectedNewStatsCallbacks < 0) {
|
if (--expectedNewStatsCallbacks < 0) {
|
||||||
throw new RuntimeException("Unexpected stats report: " + report);
|
throw new RuntimeException("Unexpected stats report: " + report);
|
||||||
@ -296,6 +356,8 @@ public class PeerConnectionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onFirstPacketReceived(MediaStreamTrack.MediaType mediaType) {
|
public synchronized void onFirstPacketReceived(MediaStreamTrack.MediaType mediaType) {
|
||||||
if (mediaType == MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO) {
|
if (mediaType == MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO) {
|
||||||
expectedFirstAudioPacket--;
|
expectedFirstAudioPacket--;
|
||||||
@ -307,19 +369,27 @@ public class PeerConnectionTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectFirstPacketReceived() {
|
public synchronized void expectFirstPacketReceived() {
|
||||||
expectedFirstAudioPacket = 1;
|
expectedFirstAudioPacket = 1;
|
||||||
expectedFirstVideoPacket = 1;
|
expectedFirstVideoPacket = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectOldStatsCallback() {
|
public synchronized void expectOldStatsCallback() {
|
||||||
++expectedOldStatsCallbacks;
|
++expectedOldStatsCallbacks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void expectNewStatsCallback() {
|
public synchronized void expectNewStatsCallback() {
|
||||||
++expectedNewStatsCallbacks;
|
++expectedNewStatsCallbacks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized LinkedList<StatsReport[]> takeStatsReports() {
|
public synchronized LinkedList<StatsReport[]> takeStatsReports() {
|
||||||
LinkedList<StatsReport[]> got = gotStatsReports;
|
LinkedList<StatsReport[]> got = gotStatsReports;
|
||||||
gotStatsReports = new LinkedList<StatsReport[]>();
|
gotStatsReports = new LinkedList<StatsReport[]>();
|
||||||
@ -328,6 +398,8 @@ public class PeerConnectionTest {
|
|||||||
|
|
||||||
// Return a set of expectations that haven't been satisfied yet, possibly
|
// Return a set of expectations that haven't been satisfied yet, possibly
|
||||||
// empty if no such expectations exist.
|
// empty if no such expectations exist.
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized TreeSet<String> unsatisfiedExpectations() {
|
public synchronized TreeSet<String> unsatisfiedExpectations() {
|
||||||
TreeSet<String> stillWaitingForExpectations = new TreeSet<String>();
|
TreeSet<String> stillWaitingForExpectations = new TreeSet<String>();
|
||||||
if (expectedIceCandidates > 0) { // See comment in onIceCandidate.
|
if (expectedIceCandidates > 0) { // See comment in onIceCandidate.
|
||||||
@ -447,6 +519,8 @@ public class PeerConnectionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void renderFrame(VideoRenderer.I420Frame frame) {
|
public synchronized void renderFrame(VideoRenderer.I420Frame frame) {
|
||||||
// Because different camera devices (fake & physical) produce different
|
// Because different camera devices (fake & physical) produce different
|
||||||
// resolutions, we only sanity-check the set sizes,
|
// resolutions, we only sanity-check the set sizes,
|
||||||
|
|||||||
@ -48,6 +48,8 @@ public class SurfaceTextureHelperTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onTextureFrameAvailable(
|
public synchronized void onTextureFrameAvailable(
|
||||||
int oesTextureId, float[] transformMatrix, long timestampNs) {
|
int oesTextureId, float[] transformMatrix, long timestampNs) {
|
||||||
if (expectedThread != null && Thread.currentThread() != expectedThread) {
|
if (expectedThread != null && Thread.currentThread() != expectedThread) {
|
||||||
@ -62,6 +64,8 @@ public class SurfaceTextureHelperTest {
|
|||||||
/**
|
/**
|
||||||
* Wait indefinitely for a new frame.
|
* Wait indefinitely for a new frame.
|
||||||
*/
|
*/
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void waitForNewFrame() throws InterruptedException {
|
public synchronized void waitForNewFrame() throws InterruptedException {
|
||||||
while (!hasNewFrame) {
|
while (!hasNewFrame) {
|
||||||
wait();
|
wait();
|
||||||
@ -73,6 +77,8 @@ public class SurfaceTextureHelperTest {
|
|||||||
* Wait for a new frame, or until the specified timeout elapses. Returns true if a new frame was
|
* Wait for a new frame, or until the specified timeout elapses. Returns true if a new frame was
|
||||||
* received before the timeout.
|
* received before the timeout.
|
||||||
*/
|
*/
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized boolean waitForNewFrame(final long timeoutMs) throws InterruptedException {
|
public synchronized boolean waitForNewFrame(final long timeoutMs) throws InterruptedException {
|
||||||
final long startTimeMs = SystemClock.elapsedRealtime();
|
final long startTimeMs = SystemClock.elapsedRealtime();
|
||||||
long timeRemainingMs = timeoutMs;
|
long timeRemainingMs = timeoutMs;
|
||||||
|
|||||||
@ -134,6 +134,8 @@ public class SurfaceViewRendererOnMeasureTest {
|
|||||||
private int frameHeight;
|
private int frameHeight;
|
||||||
private int rotation;
|
private int rotation;
|
||||||
|
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void waitForFrameSize(int frameWidth, int frameHeight, int rotation)
|
public synchronized void waitForFrameSize(int frameWidth, int frameHeight, int rotation)
|
||||||
throws InterruptedException {
|
throws InterruptedException {
|
||||||
while (this.frameWidth != frameWidth || this.frameHeight != frameHeight
|
while (this.frameWidth != frameWidth || this.frameHeight != frameHeight
|
||||||
@ -146,6 +148,8 @@ public class SurfaceViewRendererOnMeasureTest {
|
|||||||
public void onFirstFrameRendered() {}
|
public void onFirstFrameRendered() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
|
||||||
|
@SuppressWarnings("NoSynchronizedMethodCheck")
|
||||||
public synchronized void onFrameResolutionChanged(
|
public synchronized void onFrameResolutionChanged(
|
||||||
int frameWidth, int frameHeight, int rotation) {
|
int frameWidth, int frameHeight, int rotation) {
|
||||||
this.frameWidth = frameWidth;
|
this.frameWidth = frameWidth;
|
||||||
|
|||||||
Reference in New Issue
Block a user