From e5c55dac67a6e86d2cdb74563d8845847e5ecf18 Mon Sep 17 00:00:00 2001 From: "jiayl@webrtc.org" Date: Thu, 19 Jun 2014 22:04:41 +0000 Subject: Do not call CaptureCursor in ScreenCapturerWinGdi if no MouseShapeObserver. It's wasted work and affects frame rate adaptation in Chrome. BUG= R=sergeyu@chromium.org Review URL: https://webrtc-codereview.appspot.com/19789004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6499 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/desktop_capture/win/screen_capturer_win_gdi.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/desktop_capture/win/screen_capturer_win_gdi.cc b/modules/desktop_capture/win/screen_capturer_win_gdi.cc index 9cb3681f..dc10eceb 100644 --- a/modules/desktop_capture/win/screen_capturer_win_gdi.cc +++ b/modules/desktop_capture/win/screen_capturer_win_gdi.cc @@ -133,7 +133,8 @@ void ScreenCapturerWinGdi::Capture(const DesktopRegion& region) { callback_->OnCaptureCompleted(frame); // Check for cursor shape update. - CaptureCursor(); + if (mouse_shape_observer_) + CaptureCursor(); } void ScreenCapturerWinGdi::SetMouseShapeObserver( @@ -279,6 +280,8 @@ bool ScreenCapturerWinGdi::CaptureImage() { } void ScreenCapturerWinGdi::CaptureCursor() { + assert(mouse_shape_observer_); + CURSORINFO cursor_info; cursor_info.cbSize = sizeof(CURSORINFO); if (!GetCursorInfo(&cursor_info)) { @@ -317,8 +320,7 @@ void ScreenCapturerWinGdi::CaptureCursor() { // Record the last cursor image that we sent to the client. last_cursor_ = *cursor; - if (mouse_shape_observer_) - mouse_shape_observer_->OnCursorShapeChanged(cursor.release()); + mouse_shape_observer_->OnCursorShapeChanged(cursor.release()); } } // namespace webrtc -- cgit v1.2.3 From 8c0544d3b162bc8f517243cd69656cc0a0a31182 Mon Sep 17 00:00:00 2001 From: "braveyao@webrtc.org" Date: Fri, 20 Jun 2014 16:00:30 +0000 Subject: Do not hold the critical section in VideoCaptureAndroid::SetCaptureRotation since it would case possible deadlock with OS Camear thread. BUT=3464 TEST=Manual Test with WebRTCDemo R=glaznev@webrtc.org Review URL: https://webrtc-codereview.appspot.com/21719004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6509 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/video_capture/android/video_capture_android.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'modules') diff --git a/modules/video_capture/android/video_capture_android.cc b/modules/video_capture/android/video_capture_android.cc index c9aa52ce..2f36388e 100644 --- a/modules/video_capture/android/video_capture_android.cc +++ b/modules/video_capture/android/video_capture_android.cc @@ -234,7 +234,6 @@ int32_t VideoCaptureAndroid::CaptureSettings( int32_t VideoCaptureAndroid::SetCaptureRotation( VideoCaptureRotation rotation) { - CriticalSectionScoped cs(&_apiCs); int32_t status = VideoCaptureImpl::SetCaptureRotation(rotation); if (status != 0) return status; -- cgit v1.2.3 From ab52e9a726313a44423fe7a5988f4d1eff75a208 Mon Sep 17 00:00:00 2001 From: "glaznev@webrtc.org" Date: Fri, 20 Jun 2014 20:55:54 +0000 Subject: - Exit from a camera thread lopper loop() method only after all camera release calls are completed. This fixes camera exceptions observed from time to time when calling camera functions on a terminated looper. - Allocate real texture for camera preview. - Add fps and camera frame duration logging. - Get camera frame timestamp in Java code and pass it to jni code so the frame timestamp is assigned as soon as possible. Jni code will not use these timestamps yet until timestamp ntp correction and zeroing in webrtcvideengine.cc will be addressed. R=fischman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/16729004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6513 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../webrtc/videoengine/VideoCaptureAndroid.java | 78 ++++++++++++++++------ .../videoengine/VideoCaptureDeviceInfoAndroid.java | 7 +- .../video_capture/android/video_capture_android.cc | 12 ++-- 3 files changed, 66 insertions(+), 31 deletions(-) (limited to 'modules') diff --git a/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java b/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java index c8abdbe3..2f571d0c 100644 --- a/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java +++ b/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java @@ -11,20 +11,18 @@ package org.webrtc.videoengine; import java.io.IOException; -import java.util.Locale; import java.util.concurrent.Exchanger; -import java.util.concurrent.locks.ReentrantLock; import android.content.Context; import android.graphics.ImageFormat; -import android.graphics.PixelFormat; -import android.graphics.Rect; import android.graphics.SurfaceTexture; -import android.graphics.YuvImage; import android.hardware.Camera.PreviewCallback; import android.hardware.Camera; +import android.opengl.GLES11Ext; +import android.opengl.GLES20; import android.os.Handler; import android.os.Looper; +import android.os.SystemClock; import android.util.Log; import android.view.OrientationEventListener; import android.view.SurfaceHolder.Callback; @@ -50,11 +48,15 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { private final Camera.CameraInfo info; private final OrientationEventListener orientationListener; private final long native_capturer; // |VideoCaptureAndroid*| in C++. - private SurfaceTexture dummySurfaceTexture; + private SurfaceTexture cameraSurfaceTexture; + private int[] cameraGlTextures = null; // Arbitrary queue depth. Higher number means more memory allocated & held, // lower number means more sensitivity to processing time in the client (and // potentially stalling the capturer if it runs out of buffers to write to). private final int numCaptureBuffers = 3; + private double averageDurationMs; + private long lastCaptureTimeMs; + private int frameCount; // Requests future capturers to send their frames to |localPreview| directly. public static void setLocalPreview(SurfaceHolder localPreview) { @@ -114,6 +116,8 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { private synchronized boolean startCapture( final int width, final int height, final int min_mfps, final int max_mfps) { + Log.d(TAG, "startCapture: " + width + "x" + height + "@" + + min_mfps + ":" + max_mfps); if (cameraThread != null || cameraThreadHandler != null) { throw new RuntimeException("Camera thread already started!"); } @@ -121,7 +125,6 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { cameraThread = new CameraThread(handlerExchanger); cameraThread.start(); cameraThreadHandler = exchange(handlerExchanger, null); - orientationListener.enable(); final Exchanger result = new Exchanger(); cameraThreadHandler.post(new Runnable() { @@ -129,14 +132,14 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { startCaptureOnCameraThread(width, height, min_mfps, max_mfps, result); } }); - return exchange(result, false); // |false| is a dummy value here. + boolean startResult = exchange(result, false); // |false| is a dummy value. + orientationListener.enable(); + return startResult; } private void startCaptureOnCameraThread( int width, int height, int min_mfps, int max_mfps, Exchanger result) { - Log.d(TAG, "startCapture: " + width + "x" + height + "@" + - min_mfps + ":" + max_mfps); Throwable error = null; try { camera = Camera.open(id); @@ -150,13 +153,27 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { } else { // No local renderer (we only care about onPreviewFrame() buffers, not a // directly-displayed UI element). Camera won't capture without - // setPreview{Texture,Display}, so we create a dummy SurfaceTexture and - // hand it over to Camera, but never listen for frame-ready callbacks, + // setPreview{Texture,Display}, so we create a SurfaceTexture and hand + // it over to Camera, but never listen for frame-ready callbacks, // and never call updateTexImage on it. try { - // "42" because http://goo.gl/KaEn8 - dummySurfaceTexture = new SurfaceTexture(42); - camera.setPreviewTexture(dummySurfaceTexture); + cameraGlTextures = new int[1]; + // Generate one texture pointer and bind it as an external texture. + GLES20.glGenTextures(1, cameraGlTextures, 0); + GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + cameraGlTextures[0]); + GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR); + GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR); + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); + + cameraSurfaceTexture = new SurfaceTexture(cameraGlTextures[0]); + cameraSurfaceTexture.setOnFrameAvailableListener(null); + camera.setPreviewTexture(cameraSurfaceTexture); } catch (IOException e) { throw new RuntimeException(e); } @@ -178,6 +195,8 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { camera.addCallbackBuffer(new byte[bufSize]); } camera.setPreviewCallbackWithBuffer(this); + frameCount = 0; + averageDurationMs = 1000 / max_mfps; camera.startPreview(); exchange(result, true); return; @@ -198,6 +217,8 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { // Called by native code. Returns true when camera is known to be stopped. private synchronized boolean stopCapture() { + Log.d(TAG, "stopCapture"); + orientationListener.disable(); final Exchanger result = new Exchanger(); cameraThreadHandler.post(new Runnable() { @Override public void run() { @@ -212,14 +233,12 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { } cameraThreadHandler = null; cameraThread = null; - orientationListener.disable(); + Log.d(TAG, "stopCapture done"); return status; } private void stopCaptureOnCameraThread( Exchanger result) { - Log.d(TAG, "stopCapture"); - Looper.myLooper().quit(); if (camera == null) { throw new RuntimeException("Camera is already stopped!"); } @@ -232,10 +251,16 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { camera.setPreviewDisplay(null); } else { camera.setPreviewTexture(null); + cameraSurfaceTexture = null; + if (cameraGlTextures != null) { + GLES20.glDeleteTextures(1, cameraGlTextures, 0); + cameraGlTextures = null; + } } camera.release(); camera = null; exchange(result, true); + Looper.myLooper().quit(); return; } catch (IOException e) { error = e; @@ -244,11 +269,12 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { } Log.e(TAG, "Failed to stop camera", error); exchange(result, false); + Looper.myLooper().quit(); return; } private native void ProvideCameraFrame( - byte[] data, int length, long captureObject); + byte[] data, int length, long timeStamp, long captureObject); // Called on cameraThread so must not "synchronized". @Override @@ -262,7 +288,19 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback { if (camera != callbackCamera) { throw new RuntimeException("Unexpected camera in callback!"); } - ProvideCameraFrame(data, data.length, native_capturer); + frameCount++; + long captureTimeMs = SystemClock.elapsedRealtime(); + if (frameCount > 1) { + double durationMs = captureTimeMs - lastCaptureTimeMs; + averageDurationMs = 0.9 * averageDurationMs + 0.1 * durationMs; + if ((frameCount % 30) == 0) { + Log.d(TAG, "Camera TS " + captureTimeMs + + ". Duration: " + (int)durationMs + " ms. FPS: " + + (int) (1000 / averageDurationMs + 0.5)); + } + } + lastCaptureTimeMs = captureTimeMs; + ProvideCameraFrame(data, data.length, captureTimeMs, native_capturer); camera.addCallbackBuffer(data); } diff --git a/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureDeviceInfoAndroid.java b/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureDeviceInfoAndroid.java index 1d681c06..fe207ca3 100644 --- a/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureDeviceInfoAndroid.java +++ b/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureDeviceInfoAndroid.java @@ -10,14 +10,8 @@ package org.webrtc.videoengine; -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; import java.util.List; -import java.util.Locale; -import android.content.Context; import android.hardware.Camera.CameraInfo; import android.hardware.Camera.Parameters; import android.hardware.Camera.Size; @@ -99,6 +93,7 @@ public class VideoCaptureDeviceInfoAndroid { .put("mfpsRanges", mfpsRanges); } String ret = devices.toString(2); + Log.d(TAG, ret); return ret; } catch (JSONException e) { throw new RuntimeException(e); diff --git a/modules/video_capture/android/video_capture_android.cc b/modules/video_capture/android/video_capture_android.cc index 2f36388e..6f0200e6 100644 --- a/modules/video_capture/android/video_capture_android.cc +++ b/modules/video_capture/android/video_capture_android.cc @@ -15,6 +15,7 @@ #include "webrtc/modules/video_capture/android/device_info_android.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/logcat_trace_context.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/ref_count.h" #include "webrtc/system_wrappers/interface/trace.h" @@ -36,6 +37,7 @@ void JNICALL ProvideCameraFrame( jobject, jbyteArray javaCameraFrame, jint length, + jlong timeStamp, jlong context) { webrtc::videocapturemodule::VideoCaptureAndroid* captureModule = reinterpret_cast( @@ -90,7 +92,7 @@ int32_t SetCaptureAndroidVM(JavaVM* javaVM, jobject context) { "(JI)V", reinterpret_cast(&OnOrientationChanged)}, {"ProvideCameraFrame", - "([BIJ)V", + "([BIJJ)V", reinterpret_cast(&ProvideCameraFrame)}}; if (ats.env()->RegisterNatives(g_java_capturer_class, native_methods, 3) != 0) @@ -146,18 +148,18 @@ int32_t VideoCaptureAndroid::Init(const int32_t id, return -1; // Store the device name + LOG(LS_INFO) << "VideoCaptureAndroid::Init: " << deviceUniqueIdUTF8; + size_t camera_id = 0; + if (!_deviceInfo.FindCameraIndex(deviceUniqueIdUTF8, &camera_id)) + return -1; _deviceUniqueId = new char[nameLength + 1]; memcpy(_deviceUniqueId, deviceUniqueIdUTF8, nameLength + 1); AttachThreadScoped ats(g_jvm); JNIEnv* env = ats.env(); - jmethodID ctor = env->GetMethodID(g_java_capturer_class, "", "(IJ)V"); assert(ctor); jlong j_this = reinterpret_cast(this); - size_t camera_id = 0; - if (!_deviceInfo.FindCameraIndex(deviceUniqueIdUTF8, &camera_id)) - return -1; _jCapturer = env->NewGlobalRef( env->NewObject(g_java_capturer_class, ctor, camera_id, j_this)); assert(_jCapturer); -- cgit v1.2.3 From d474b296ea7e94d1978c19aecba24807123c9ca9 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Sat, 21 Jun 2014 19:30:29 +0000 Subject: Roll chromium_revision 272489:277350 + fix sanitizer options Rolling to this new Chromium revision required us to introduce a sanitizer_options similar to the one in Chromium's base (see https://code.google.com/p/chromium/codesearch#chromium/src/base/base.gyp&l=977 and https://codereview.chromium.org/238123003) in order to get the same defaults for ASan and LSan. Without it compilation will break since LeakSanitizer (LSan) is enabled by default in Clang r209387 that is pulled with this roll. I setup so that we pull in the sanitizer_options.cc and tsan_suppressions.cc files using DEPS, so we don't have to maintain them separately for now. We can still use our own TSan suppressions.txt file as we do today with no changes needed. This roll also brings in http://crrev.com/276676 so we can enable GN build for WebRTC. Overview of changes in Chrome DEPS: $ svn diff http://src.chromium.org/chrome/trunk/src/DEPS -r 272489:277350 which can be compared with the output of: $ svn cat http://webrtc.googlecode.com/svn/trunk/DEPS | grep chromium_deps | sed 's/^ *//' | sort | uniq in a WebRTC checkout, gives the following relevant changes: * third_party/android_tools 6fc0e1:c6e658 * third_party/libjpeg_turbo 263594:272637 * third_party/libyuv 1000:1007 * third_party/nss 271760:277057 * tools/gyp 1921:1927 * tools/swarming_client ae8085:aea506 The following also shows that Clang is upgraded from r206824 to r209387: $ svn diff http://src.chromium.org/chrome/trunk/src/tools/clang/scripts/update.sh -r 272489:277350 BUG=3441 TEST=Trybots are not passing since after the recipe switch, SVN-based try jobs doesn't seem to support auto-detecting that a sync is needed if there's a DEPS change. R=andrew@webrtc.org, pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/12729004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6516 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/audio_coding/neteq/tools/neteq_rtpplay.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'modules') diff --git a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc index 3c5f6b0b..3e3540a8 100644 --- a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc +++ b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc @@ -575,7 +575,6 @@ size_t ReplacePayload(webrtc::test::InputAudioFile* replacement_audio_file, " not supported or unknown." << std::endl; webrtc::Trace::ReturnTrace(); exit(1); - assert(false); } } return payload_len; -- cgit v1.2.3 From e4b41b1285209ac92ecd39f61e1c152ff3fea967 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Mon, 23 Jun 2014 09:14:03 +0000 Subject: Disables tests that breaks Android bots BUG= TBR=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/15859004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6520 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/audio_processing/aec/system_delay_unittest.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/audio_processing/aec/system_delay_unittest.cc b/modules/audio_processing/aec/system_delay_unittest.cc index a13d4762..5fbc5600 100644 --- a/modules/audio_processing/aec/system_delay_unittest.cc +++ b/modules/audio_processing/aec/system_delay_unittest.cc @@ -248,7 +248,8 @@ TEST_F(SystemDelayTest, CorrectDelayAfterUnstableStartup) { } } -TEST_F(SystemDelayTest, CorrectDelayAfterStableBufferBuildUp) { +TEST_F(SystemDelayTest, + DISABLED_ON_ANDROID(CorrectDelayAfterStableBufferBuildUp)) { // In this test we start by establishing the device buffer size during stable // conditions, but with an empty internal far-end buffer. Once that is done we // verify that the system delay is increased correctly until we have reach an @@ -332,7 +333,7 @@ TEST_F(SystemDelayTest, CorrectDelayWhenBufferUnderrun) { } } -TEST_F(SystemDelayTest, CorrectDelayDuringDrift) { +TEST_F(SystemDelayTest, DISABLED_ON_ANDROID(CorrectDelayDuringDrift)) { // This drift test should verify that the system delay is never exceeding the // device buffer. The drift is simulated by decreasing the reported device // buffer size by 1 ms every 100 ms. If the device buffer size goes below 30 @@ -366,7 +367,7 @@ TEST_F(SystemDelayTest, CorrectDelayDuringDrift) { } } -TEST_F(SystemDelayTest, ShouldRecoverAfterGlitch) { +TEST_F(SystemDelayTest, DISABLED_ON_ANDROID(ShouldRecoverAfterGlitch)) { // This glitch test should verify that the system delay recovers if there is // a glitch in data. The data glitch is constructed as 200 ms of buffering // after which the stable procedure continues. The glitch is never reported by -- cgit v1.2.3 From 3610f638d5aa330038475c309151dbd586d828f6 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Mon, 23 Jun 2014 19:21:07 +0000 Subject: GN: Add BUILD.gn files + kjellander to OWNERS This should work as a foundation for all the work that is left to do to make the parts of WebRTC that Chromium uses to build with GN. I implemented some the smaller modules myself in this CL. The remaining work (TODO's in the .gn files) will be distributed to various team members. I'm adding myself to OWNERS files for BUILD.gn files in all the directories where I'm adding a BUILD.gn file. BUG=3441 TEST= Successful compilation of WebRTC as standalone: gn gen out/Default --args="build_with_chromium=false" && ninja -C out/Default gn gen out/Default --args="build_with_chromium=false is_clang=true clang_use_chrome_plugins=false" && ninja -C out/Default I built successfully from a Chromium checkout (with https://codereview.chromium.org/321313006/ applied) using: gn gen out/Default && ninja -C out/Default webrtc R=brettw@chromium.org, niklas.enbom@webrtc.org Review URL: https://webrtc-codereview.appspot.com/13749004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6523 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/audio_coding/BUILD.gn | 13 ++++ modules/audio_coding/OWNERS | 1 + modules/audio_conference_mixer/BUILD.gn | 41 ++++++++++++ modules/audio_conference_mixer/OWNERS | 4 +- modules/audio_device/BUILD.gn | 13 ++++ modules/audio_device/OWNERS | 2 + modules/audio_processing/BUILD.gn | 13 ++++ modules/audio_processing/OWNERS | 2 + modules/bitrate_controller/BUILD.gn | 28 ++++++++ modules/bitrate_controller/OWNERS | 2 + modules/desktop_capture/BUILD.gn | 19 ++++++ modules/desktop_capture/OWNERS | 2 + modules/media_file/BUILD.gn | 41 ++++++++++++ modules/media_file/OWNERS | 4 +- modules/pacing/BUILD.gn | 16 +++++ modules/pacing/OWNERS | 2 + modules/remote_bitrate_estimator/BUILD.gn | 17 +++++ modules/remote_bitrate_estimator/OWNERS | 3 + modules/rtp_rtcp/BUILD.gn | 104 ++++++++++++++++++++++++++++++ modules/rtp_rtcp/OWNERS | 4 +- modules/utility/BUILD.gn | 48 ++++++++++++++ modules/utility/OWNERS | 4 +- modules/video_capture/BUILD.gn | 13 ++++ modules/video_capture/OWNERS | 2 + modules/video_coding/BUILD.gn | 86 ++++++++++++++++++++++++ modules/video_coding/OWNERS | 2 + modules/video_processing/BUILD.gn | 13 ++++ modules/video_processing/OWNERS | 1 + modules/video_render/BUILD.gn | 13 ++++ modules/video_render/OWNERS | 2 + 30 files changed, 511 insertions(+), 4 deletions(-) create mode 100644 modules/audio_coding/BUILD.gn create mode 100644 modules/audio_coding/OWNERS create mode 100644 modules/audio_conference_mixer/BUILD.gn create mode 100644 modules/audio_device/BUILD.gn create mode 100644 modules/audio_processing/BUILD.gn create mode 100644 modules/bitrate_controller/BUILD.gn create mode 100644 modules/desktop_capture/BUILD.gn create mode 100644 modules/media_file/BUILD.gn create mode 100644 modules/pacing/BUILD.gn create mode 100644 modules/remote_bitrate_estimator/BUILD.gn create mode 100644 modules/rtp_rtcp/BUILD.gn create mode 100644 modules/utility/BUILD.gn create mode 100644 modules/video_capture/BUILD.gn create mode 100644 modules/video_coding/BUILD.gn create mode 100644 modules/video_processing/BUILD.gn create mode 100644 modules/video_processing/OWNERS create mode 100644 modules/video_render/BUILD.gn (limited to 'modules') diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn new file mode 100644 index 00000000..e4ad4cb3 --- /dev/null +++ b/modules/audio_coding/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("audio_coding") { + # TODO(andrew): Implement. +} diff --git a/modules/audio_coding/OWNERS b/modules/audio_coding/OWNERS new file mode 100644 index 00000000..d5ae8473 --- /dev/null +++ b/modules/audio_coding/OWNERS @@ -0,0 +1 @@ +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/audio_conference_mixer/BUILD.gn b/modules/audio_conference_mixer/BUILD.gn new file mode 100644 index 00000000..a27bb84c --- /dev/null +++ b/modules/audio_conference_mixer/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2014 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. + +config("internal_config") { + visibility = ":*" # Only targets in this file can depend on this. + include_dirs = [ + "interface", + "../interface", + ] +} + +source_set("audio_conference_mixer") { + sources = [ + "interface/audio_conference_mixer.h", + "interface/audio_conference_mixer_defines.h", + "source/audio_conference_mixer_impl.cc", + "source/audio_conference_mixer_impl.h", + "source/audio_frame_manipulator.cc", + "source/audio_frame_manipulator.h", + "source/level_indicator.cc", + "source/level_indicator.h", + "source/memory_pool.h", + "source/memory_pool_posix.h", + "source/memory_pool_win.h", + "source/time_scheduler.cc", + "source/time_scheduler.h", + ] + + direct_dependent_configs = [ ":internal_config" ] + + deps = [ + "../../system_wrappers", + "../audio_processing", + "../utility", + ] +} diff --git a/modules/audio_conference_mixer/OWNERS b/modules/audio_conference_mixer/OWNERS index 7dc791ef..7d4cc610 100644 --- a/modules/audio_conference_mixer/OWNERS +++ b/modules/audio_conference_mixer/OWNERS @@ -1,3 +1,5 @@ henrike@webrtc.org pwestin@webrtc.org -andrew@webrtc.org \ No newline at end of file +andrew@webrtc.org + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn new file mode 100644 index 00000000..d6481ad5 --- /dev/null +++ b/modules/audio_device/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("audio_device") { + # TODO(henrike): Implement. +} diff --git a/modules/audio_device/OWNERS b/modules/audio_device/OWNERS index 7bb3cd52..1fe45940 100644 --- a/modules/audio_device/OWNERS +++ b/modules/audio_device/OWNERS @@ -9,3 +9,5 @@ per-file *.isolate=kjellander@webrtc.org # structural changes, please get a review from a reviewer in this file. per-file *.gyp=* per-file *.gypi=* + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn new file mode 100644 index 00000000..a727d54b --- /dev/null +++ b/modules/audio_processing/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("audio_processing") { + # TODO(andrew): Implement. +} diff --git a/modules/audio_processing/OWNERS b/modules/audio_processing/OWNERS index 7c1f7881..41a82af2 100644 --- a/modules/audio_processing/OWNERS +++ b/modules/audio_processing/OWNERS @@ -6,3 +6,5 @@ bjornv@webrtc.org # structural changes, please get a review from a reviewer in this file. per-file *.gyp=* per-file *.gypi=* + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/bitrate_controller/BUILD.gn b/modules/bitrate_controller/BUILD.gn new file mode 100644 index 00000000..c3ac28ce --- /dev/null +++ b/modules/bitrate_controller/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("bitrate_controller") { + sources = [ + "bitrate_controller_impl.cc", + "bitrate_controller_impl.h", + "include/bitrate_controller.h", + "send_side_bandwidth_estimation.cc", + "send_side_bandwidth_estimation.h", + ] + + if (is_win) { + cflags = [ + # TODO(jschuh): Bug 1348: fix this warning. + "/wd4267" # size_t to int truncations + ] + } + + deps = [ "../../system_wrappers" ] +} diff --git a/modules/bitrate_controller/OWNERS b/modules/bitrate_controller/OWNERS index cce3a26b..9420ba2e 100644 --- a/modules/bitrate_controller/OWNERS +++ b/modules/bitrate_controller/OWNERS @@ -8,3 +8,5 @@ asapersson@webrtc.org # structural changes, please get a review from a reviewer in this file. per-file *.gyp=* per-file *.gypi=* + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn new file mode 100644 index 00000000..0ccb18a1 --- /dev/null +++ b/modules/desktop_capture/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("desktop_capture") { + # TODO(jiayl): Implement. +} + +if (!is_ios && (cpu_arch == "x86" || cpu_arch == "x64")) { + source_set("desktop_capture_differ_sse2") { + # TODO(jiayl): Implement. + } +} diff --git a/modules/desktop_capture/OWNERS b/modules/desktop_capture/OWNERS index e85861b8..4c0340d6 100644 --- a/modules/desktop_capture/OWNERS +++ b/modules/desktop_capture/OWNERS @@ -6,3 +6,5 @@ wez@chromium.org # structural changes, please get a review from a reviewer in this file. per-file *.gyp=* per-file *.gypi=* + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/media_file/BUILD.gn b/modules/media_file/BUILD.gn new file mode 100644 index 00000000..971a6fa2 --- /dev/null +++ b/modules/media_file/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +config("internal_config") { + visibility = ":*" # Only targets in this file can depend on this. + include_dirs = [ + "interface", + "../interface", + ] +} + +source_set("media_file") { + sources = [ + "interface/media_file.h", + "interface/media_file_defines.h", + "source/avi_file.cc", + "source/avi_file.h", + "source/media_file_impl.cc", + "source/media_file_impl.h", + "source/media_file_utility.cc", + "source/media_file_utility.h", + ] + + if (is_win) { + cflags = [ + # TODO(jschuh): Bug 1348: fix this warning. + "/wd4267", # size_t to int truncations + ] + } + + direct_dependent_configs = [ ":internal_config" ] + + deps = [ "../../system_wrappers" ] +} diff --git a/modules/media_file/OWNERS b/modules/media_file/OWNERS index 2cc47e48..3387ee9e 100644 --- a/modules/media_file/OWNERS +++ b/modules/media_file/OWNERS @@ -1,4 +1,6 @@ pwestin@webrtc.org mflodman@webrtc.org perkj@webrtc.org -niklas.enbom@webrtc.org \ No newline at end of file +niklas.enbom@webrtc.org + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/pacing/BUILD.gn b/modules/pacing/BUILD.gn new file mode 100644 index 00000000..d3eceb35 --- /dev/null +++ b/modules/pacing/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright (c) 2014 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. + +source_set("pacing") { + sources = [ + "include/paced_sender.h", + "paced_sender.cc", + ] + + deps = [ "../../system_wrappers" ] +} diff --git a/modules/pacing/OWNERS b/modules/pacing/OWNERS index 1426abc6..4486a81e 100644 --- a/modules/pacing/OWNERS +++ b/modules/pacing/OWNERS @@ -7,3 +7,5 @@ asapersson@webrtc.org # structural changes, please get a review from a reviewer in this file. per-file *.gyp=* per-file *.gypi=* + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/remote_bitrate_estimator/BUILD.gn b/modules/remote_bitrate_estimator/BUILD.gn new file mode 100644 index 00000000..7ee4c8df --- /dev/null +++ b/modules/remote_bitrate_estimator/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright (c) 2014 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. + +source_set("remote_bitrate_estimator") { + sources = [ + "overuse_detector.cc", + "overuse_detector.h", + "remote_bitrate_estimator_single_stream.cc", + "remote_rate_control.cc", + "remote_rate_control.h", + ] +} diff --git a/modules/remote_bitrate_estimator/OWNERS b/modules/remote_bitrate_estimator/OWNERS index eab2b8e0..49d19429 100644 --- a/modules/remote_bitrate_estimator/OWNERS +++ b/modules/remote_bitrate_estimator/OWNERS @@ -3,7 +3,10 @@ stefan@webrtc.org henrik.lundin@webrtc.org mflodman@webrtc.org asapersson@webrtc.org + # These are for the common case of adding or renaming files. If you're doing # structural changes, please get a review from a reviewer in this file. per-file *.gyp=* per-file *.gypi=* + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/rtp_rtcp/BUILD.gn b/modules/rtp_rtcp/BUILD.gn new file mode 100644 index 00000000..e9a2e8d9 --- /dev/null +++ b/modules/rtp_rtcp/BUILD.gn @@ -0,0 +1,104 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("rtp_rtcp") { + sources = [ + # Common + "interface/fec_receiver.h", + "interface/receive_statistics.h", + "interface/remote_ntp_time_estimator.h", + "interface/rtp_header_parser.h", + "interface/rtp_payload_registry.h", + "interface/rtp_receiver.h", + "interface/rtp_rtcp.h", + "interface/rtp_rtcp_defines.h", + "source/bitrate.cc", + "source/bitrate.h", + "source/byte_io.h", + "source/fec_receiver_impl.cc", + "source/fec_receiver_impl.h", + "source/receive_statistics_impl.cc", + "source/receive_statistics_impl.h", + "source/remote_ntp_time_estimator.cc", + "source/rtp_header_parser.cc", + "source/rtp_rtcp_config.h", + "source/rtp_rtcp_impl.cc", + "source/rtp_rtcp_impl.h", + "source/rtcp_packet.cc", + "source/rtcp_packet.h", + "source/rtcp_receiver.cc", + "source/rtcp_receiver.h", + "source/rtcp_receiver_help.cc", + "source/rtcp_receiver_help.h", + "source/rtcp_sender.cc", + "source/rtcp_sender.h", + "source/rtcp_utility.cc", + "source/rtcp_utility.h", + "source/rtp_header_extension.cc", + "source/rtp_header_extension.h", + "source/rtp_receiver_impl.cc", + "source/rtp_receiver_impl.h", + "source/rtp_sender.cc", + "source/rtp_sender.h", + "source/rtp_utility.cc", + "source/rtp_utility.h", + "source/ssrc_database.cc", + "source/ssrc_database.h", + "source/tmmbr_help.cc", + "source/tmmbr_help.h", + # Audio Files + "source/dtmf_queue.cc", + "source/dtmf_queue.h", + "source/rtp_receiver_audio.cc", + "source/rtp_receiver_audio.h", + "source/rtp_sender_audio.cc", + "source/rtp_sender_audio.h", + # Video Files + "source/fec_private_tables_random.h", + "source/fec_private_tables_bursty.h", + "source/forward_error_correction.cc", + "source/forward_error_correction.h", + "source/forward_error_correction_internal.cc", + "source/forward_error_correction_internal.h", + "source/producer_fec.cc", + "source/producer_fec.h", + "source/rtp_packet_history.cc", + "source/rtp_packet_history.h", + "source/rtp_payload_registry.cc", + "source/rtp_receiver_strategy.cc", + "source/rtp_receiver_strategy.h", + "source/rtp_receiver_video.cc", + "source/rtp_receiver_video.h", + "source/rtp_sender_video.cc", + "source/rtp_sender_video.h", + "source/video_codec_information.h", + "source/rtp_format_vp8.cc", + "source/rtp_format_vp8.h", + "source/rtp_format_video_generic.h", + "source/vp8_partition_aggregator.cc", + "source/vp8_partition_aggregator.h", + # Mocks + "mocks/mock_rtp_rtcp.h", + "source/mock/mock_rtp_payload_strategy.h", + ] + + deps = [ + "../../system_wrappers", + "../pacing", + "../remote_bitrate_estimator", + ] + + if (is_win) { + cflags = [ + # TODO(jschuh): Bug 1348: fix this warning. + "/wd4267", # size_t to int truncations + ] + } +} diff --git a/modules/rtp_rtcp/OWNERS b/modules/rtp_rtcp/OWNERS index c9685642..cafe4c19 100644 --- a/modules/rtp_rtcp/OWNERS +++ b/modules/rtp_rtcp/OWNERS @@ -2,4 +2,6 @@ pwestin@webrtc.org stefan@webrtc.org henrik.lundin@webrtc.org mflodman@webrtc.org -asapersson@webrtc.org \ No newline at end of file +asapersson@webrtc.org + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/utility/BUILD.gn b/modules/utility/BUILD.gn new file mode 100644 index 00000000..82512046 --- /dev/null +++ b/modules/utility/BUILD.gn @@ -0,0 +1,48 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("utility") { + sources = [ + "interface/audio_frame_operations.h", + "interface/file_player.h", + "interface/file_recorder.h", + "interface/helpers_android.h", + "interface/process_thread.h", + "interface/rtp_dump.h", + "source/audio_frame_operations.cc", + "source/coder.cc", + "source/coder.h", + "source/file_player_impl.cc", + "source/file_player_impl.h", + "source/file_recorder_impl.cc", + "source/file_recorder_impl.h", + "source/helpers_android.cc", + "source/process_thread_impl.cc", + "source/process_thread_impl.h", + "source/rtp_dump_impl.cc", + "source/rtp_dump_impl.h", + ] + + deps = [ + "../../common_audio", + "../../system_wrappers", + "../audio_coding", + "../media_file", + ] + if (enable_video) { + sources += [ + "source/frame_scaler.cc", + "source/video_coder.cc", + "source/video_frames_queue.cc", + ] + + deps += [ "../video_coding" ] + } +} diff --git a/modules/utility/OWNERS b/modules/utility/OWNERS index 674c7380..dbdb53e3 100644 --- a/modules/utility/OWNERS +++ b/modules/utility/OWNERS @@ -1,4 +1,6 @@ henrike@webrtc.org pwestin@webrtc.org asapersson@webrtc.org -perkj@webrtc.org \ No newline at end of file +perkj@webrtc.org + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/video_capture/BUILD.gn b/modules/video_capture/BUILD.gn new file mode 100644 index 00000000..fd3fe574 --- /dev/null +++ b/modules/video_capture/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("video_capture") { + # TODO(glaznev): Implement. +} diff --git a/modules/video_capture/OWNERS b/modules/video_capture/OWNERS index fdc2a3ff..ba897650 100644 --- a/modules/video_capture/OWNERS +++ b/modules/video_capture/OWNERS @@ -11,3 +11,5 @@ per-file *.isolate=kjellander@webrtc.org # structural changes, please get a review from a reviewer in this file. per-file *.gyp=* per-file *.gypi=* + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn new file mode 100644 index 00000000..f5a69b18 --- /dev/null +++ b/modules/video_coding/BUILD.gn @@ -0,0 +1,86 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("video_coding") { + sources = [ + "main/interface/video_coding.h", + "main/interface/video_coding_defines.h", + "main/source/codec_database.cc", + "main/source/codec_database.h", + "main/source/codec_timer.cc", + "main/source/codec_timer.h", + "main/source/content_metrics_processing.cc", + "main/source/content_metrics_processing.h", + "main/source/decoding_state.cc", + "main/source/decoding_state.h", + "main/source/encoded_frame.cc", + "main/source/encoded_frame.h", + "main/source/er_tables_xor.h", + "main/source/fec_tables_xor.h", + "main/source/frame_buffer.cc", + "main/source/frame_buffer.h", + "main/source/generic_decoder.cc", + "main/source/generic_decoder.h", + "main/source/generic_encoder.cc", + "main/source/generic_encoder.h", + "main/source/inter_frame_delay.cc", + "main/source/inter_frame_delay.h", + "main/source/internal_defines.h", + "main/source/jitter_buffer.cc", + "main/source/jitter_buffer.h", + "main/source/jitter_buffer_common.h", + "main/source/jitter_estimator.cc", + "main/source/jitter_estimator.h", + "main/source/media_opt_util.cc", + "main/source/media_opt_util.h", + "main/source/media_optimization.cc", + "main/source/media_optimization.h", + "main/source/nack_fec_tables.h", + "main/source/packet.cc", + "main/source/packet.h", + "main/source/qm_select_data.h", + "main/source/qm_select.cc", + "main/source/qm_select.h", + "main/source/receiver.cc", + "main/source/receiver.h", + "main/source/rtt_filter.cc", + "main/source/rtt_filter.h", + "main/source/session_info.cc", + "main/source/session_info.h", + "main/source/timestamp_map.cc", + "main/source/timestamp_map.h", + "main/source/timing.cc", + "main/source/timing.h", + "main/source/video_coding_impl.cc", + "main/source/video_coding_impl.h", + "main/source/video_receiver.cc", + "main/source/video_sender.cc", + ] + + deps = [ + ":video_coding_utility", + ":webrtc_i420", + ":webrtc_vp8", + "../../common_video", + "../../system_wrappers", + ] +} + +source_set("video_coding_utility") { + # TODO(stefan): Implement. +} + +source_set("webrtc_i420") { + # TODO(stefan): Implement. +} + +source_set("webrtc_vp8") { + # TODO(stefan): Implement. +} diff --git a/modules/video_coding/OWNERS b/modules/video_coding/OWNERS index 7183cf21..037de93f 100644 --- a/modules/video_coding/OWNERS +++ b/modules/video_coding/OWNERS @@ -2,3 +2,5 @@ stefan@webrtc.org mikhal@webrtc.org marpan@webrtc.org henrik.lundin@webrtc.org + +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/video_processing/BUILD.gn b/modules/video_processing/BUILD.gn new file mode 100644 index 00000000..40171caf --- /dev/null +++ b/modules/video_processing/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("video_processing") { + # TODO(stefan): Implement. +} diff --git a/modules/video_processing/OWNERS b/modules/video_processing/OWNERS new file mode 100644 index 00000000..d5ae8473 --- /dev/null +++ b/modules/video_processing/OWNERS @@ -0,0 +1 @@ +per-file BUILD.gn=kjellander@webrtc.org diff --git a/modules/video_render/BUILD.gn b/modules/video_render/BUILD.gn new file mode 100644 index 00000000..c569b7fa --- /dev/null +++ b/modules/video_render/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright (c) 2014 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. + +import("../../build/webrtc.gni") + +source_set("video_render") { + # TODO(wuchengli): Implement. +} diff --git a/modules/video_render/OWNERS b/modules/video_render/OWNERS index 7dd4a362..da941f40 100644 --- a/modules/video_render/OWNERS +++ b/modules/video_render/OWNERS @@ -10,3 +10,5 @@ per-file *.isolate=kjellander@webrtc.org # structural changes, please get a review from a reviewer in this file. per-file *.gyp=* per-file *.gypi=* + +per-file BUILD.gn=kjellander@webrtc.org -- cgit v1.2.3 From a2c69185be1737c73534fa8e3f149ae1173e18e8 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Mon, 23 Jun 2014 19:52:27 +0000 Subject: Annotating the rest of AudioCodingModuleImpl A few extra locks had to be acquired as a result of the annotation. BUG=3401 R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/15819004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6524 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/acm2/audio_coding_module_impl.cc | 4 ++++ .../main/acm2/audio_coding_module_impl.h | 20 ++++++++++++-------- .../main/interface/audio_coding_module.h | 1 + 3 files changed, 17 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/modules/audio_coding/main/acm2/audio_coding_module_impl.cc index a07e8543..fac71ea9 100644 --- a/modules/audio_coding/main/acm2/audio_coding_module_impl.cc +++ b/modules/audio_coding/main/acm2/audio_coding_module_impl.cc @@ -1203,6 +1203,7 @@ int AudioCodingModuleImpl::SendBitrate() const { // Set available bandwidth, inform the encoder about the estimated bandwidth // received from the remote party. int AudioCodingModuleImpl::SetReceivedEstimatedBandwidth(int bw) { + CriticalSectionScoped lock(acm_crit_sect_); return codecs_[current_send_codec_idx_]->SetEstimatedBandwidth(bw); } @@ -1452,6 +1453,7 @@ int AudioCodingModuleImpl::SetREDStatus( // bool AudioCodingModuleImpl::CodecFEC() const { + CriticalSectionScoped lock(acm_crit_sect_); return codec_fec_enabled_; } @@ -1476,6 +1478,7 @@ int AudioCodingModuleImpl::SetCodecFEC(bool enable_codec_fec) { } int AudioCodingModuleImpl::SetPacketLossRate(int loss_rate) { + CriticalSectionScoped lock(acm_crit_sect_); if (HaveValidEncoder("SetPacketLossRate") && codecs_[current_send_codec_idx_]->SetPacketLossRate(loss_rate) < 0) { WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, @@ -1950,6 +1953,7 @@ int AudioCodingModuleImpl::REDPayloadISAC(int isac_rate, int isac_bw_estimate, uint8_t* payload, int16_t* length_bytes) { + CriticalSectionScoped lock(acm_crit_sect_); if (!HaveValidEncoder("EncodeData")) { return -1; } diff --git a/modules/audio_coding/main/acm2/audio_coding_module_impl.h b/modules/audio_coding/main/acm2/audio_coding_module_impl.h index e54202bf..02290da0 100644 --- a/modules/audio_coding/main/acm2/audio_coding_module_impl.h +++ b/modules/audio_coding/main/acm2/audio_coding_module_impl.h @@ -214,6 +214,7 @@ class AudioCodingModuleImpl : public AudioCodingModule { // GET RED payload for iSAC. The method id called when 'this' ACM is // the default ACM. + // TODO(henrik.lundin) Not used. Remove? int REDPayloadISAC(int isac_rate, int isac_bw_estimate, uint8_t* payload, @@ -248,7 +249,8 @@ class AudioCodingModuleImpl : public AudioCodingModule { int InitializeReceiverSafe() EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); - bool HaveValidEncoder(const char* caller_name) const; + bool HaveValidEncoder(const char* caller_name) const + EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); // Set VAD/DTX status. This function does not acquire a lock, and it is // created to be called only from inside a critical section. @@ -303,7 +305,8 @@ class AudioCodingModuleImpl : public AudioCodingModule { // codec owns the decoder-instance. For such codecs |*decoder| should be a // valid pointer, otherwise it will be NULL. int GetAudioDecoder(const CodecInst& codec, int codec_id, - int mirror_id, AudioDecoder** decoder); + int mirror_id, AudioDecoder** decoder) + EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); CriticalSectionWrapper* acm_crit_sect_; int id_; // TODO(henrik.lundin) Make const. @@ -320,13 +323,14 @@ class AudioCodingModuleImpl : public AudioCodingModule { bool vad_enabled_ GUARDED_BY(acm_crit_sect_); bool dtx_enabled_ GUARDED_BY(acm_crit_sect_); ACMVADMode vad_mode_ GUARDED_BY(acm_crit_sect_); - ACMGenericCodec* codecs_[ACMCodecDB::kMaxNumCodecs]; - int mirror_codec_idx_[ACMCodecDB::kMaxNumCodecs]; + ACMGenericCodec* codecs_[ACMCodecDB::kMaxNumCodecs] + GUARDED_BY(acm_crit_sect_); + int mirror_codec_idx_[ACMCodecDB::kMaxNumCodecs] GUARDED_BY(acm_crit_sect_); bool stereo_send_ GUARDED_BY(acm_crit_sect_); - int current_send_codec_idx_; - bool send_codec_registered_; + int current_send_codec_idx_ GUARDED_BY(acm_crit_sect_); + bool send_codec_registered_ GUARDED_BY(acm_crit_sect_); ACMResampler resampler_ GUARDED_BY(acm_crit_sect_); - AcmReceiver receiver_; + AcmReceiver receiver_; // AcmReceiver has it's own internal lock. // RED. bool is_first_red_ GUARDED_BY(acm_crit_sect_); @@ -345,7 +349,7 @@ class AudioCodingModuleImpl : public AudioCodingModule { uint32_t last_red_timestamp_ GUARDED_BY(acm_crit_sect_); // Codec internal FEC - bool codec_fec_enabled_; + bool codec_fec_enabled_ GUARDED_BY(acm_crit_sect_); // This is to keep track of CN instances where we can send DTMFs. uint8_t previous_pltype_ GUARDED_BY(acm_crit_sect_); diff --git a/modules/audio_coding/main/interface/audio_coding_module.h b/modules/audio_coding/main/interface/audio_coding_module.h index cb0953aa..48270047 100644 --- a/modules/audio_coding/main/interface/audio_coding_module.h +++ b/modules/audio_coding/main/interface/audio_coding_module.h @@ -330,6 +330,7 @@ class AudioCodingModule: public Module { // -1 if error occurred in setting the bandwidth, // 0 bandwidth is set successfully. // + // TODO(henrik.lundin) Unused. Remove? virtual int32_t SetReceivedEstimatedBandwidth( const int32_t bw) = 0; -- cgit v1.2.3 From c7821703b9ec2887850180cc0d2bba2598c487da Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Mon, 23 Jun 2014 22:40:58 +0000 Subject: Fix array declarations in aec_core.c Was causing warnings in Chromium such as: warning C4742: 'WebRtcAec_overDriveCurve' has different alignment in 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core_sse2.c' and 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core.c': 4 and 16 warning C4744: 'WebRtcAec_overDriveCurve' has different type in 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core_sse2.c' and 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core.c': 'array (260 bytes)' and '__declspec(align(16)) array (260 bytes)' warning C4742: 'WebRtcAec_weightCurve' has different alignment in 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core_sse2.c' and 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core.c': 4 and 16 warning C4744: 'WebRtcAec_weightCurve' has different type in 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core_sse2.c' and 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core.c': 'array (260 bytes)' and '__declspec(align(16)) array (260 bytes)' BUG=https://code.google.com/p/chromium/issues/detail?id=336620 R=andrew@webrtc.org, cd@webrtc.org Review URL: https://webrtc-codereview.appspot.com/15869004 Patch from Sebastien Marchand . git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6525 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/audio_processing/aec/aec_core_sse2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/audio_processing/aec/aec_core_sse2.c b/modules/audio_processing/aec/aec_core_sse2.c index 8d4afdba..1489d26e 100644 --- a/modules/audio_processing/aec/aec_core_sse2.c +++ b/modules/audio_processing/aec/aec_core_sse2.c @@ -354,8 +354,8 @@ static __m128 mm_pow_ps(__m128 a, __m128 b) { return a_exp_b; } -extern const float WebRtcAec_weightCurve[65]; -extern const float WebRtcAec_overDriveCurve[65]; +extern ALIGN16_BEG const float ALIGN16_END WebRtcAec_weightCurve[65]; +extern ALIGN16_BEG const float ALIGN16_END WebRtcAec_overDriveCurve[65]; static void OverdriveAndSuppressSSE2(AecCore* aec, float hNl[PART_LEN1], -- cgit v1.2.3 From 47b4b9d94cafb22e19bc8a6e6ca83b0568dcb973 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Tue, 24 Jun 2014 05:51:34 +0000 Subject: Annotating the rest of AcmGenericCodec A few locks had to be acquired to fully annotate the class, and a few others had to be moved. Removing an API method that was not used. BUG=3401 R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/12759004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6526 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/audio_coding/main/acm2/acm_cng.h | 3 +- modules/audio_coding/main/acm2/acm_g722.h | 7 ++- modules/audio_coding/main/acm2/acm_generic_codec.h | 72 +++++++++++++--------- modules/audio_coding/main/acm2/acm_ilbc.h | 10 ++- modules/audio_coding/main/acm2/acm_isac.cc | 6 +- modules/audio_coding/main/acm2/acm_isac.h | 20 +++--- modules/audio_coding/main/acm2/acm_opus.h | 7 ++- modules/audio_coding/main/acm2/acm_pcm16b.h | 7 ++- modules/audio_coding/main/acm2/acm_pcma.h | 4 +- modules/audio_coding/main/acm2/acm_pcmu.h | 7 ++- 10 files changed, 93 insertions(+), 50 deletions(-) (limited to 'modules') diff --git a/modules/audio_coding/main/acm2/acm_cng.h b/modules/audio_coding/main/acm2/acm_cng.h index a0c1c554..8b0a3928 100644 --- a/modules/audio_coding/main/acm2/acm_cng.h +++ b/modules/audio_coding/main/acm2/acm_cng.h @@ -35,7 +35,8 @@ class ACMCNG: public ACMGenericCodec { int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params); protected: - void DestructEncoderSafe(); + void DestructEncoderSafe() OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalCreateEncoder(); diff --git a/modules/audio_coding/main/acm2/acm_g722.h b/modules/audio_coding/main/acm2/acm_g722.h index 6197a9d9..6cdd79d4 100644 --- a/modules/audio_coding/main/acm2/acm_g722.h +++ b/modules/audio_coding/main/acm2/acm_g722.h @@ -33,7 +33,9 @@ class ACMG722 : public ACMGenericCodec { // For FEC. ACMGenericCodec* CreateInstance(void); - int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte); + int16_t InternalEncode(uint8_t* bitstream, + int16_t* bitstream_len_byte) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params); @@ -44,7 +46,8 @@ class ACMG722 : public ACMGenericCodec { const uint8_t audio_channel) EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); - void DestructEncoderSafe(); + void DestructEncoderSafe() OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalCreateEncoder(); diff --git a/modules/audio_coding/main/acm2/acm_generic_codec.h b/modules/audio_coding/main/acm2/acm_generic_codec.h index fa21ca01..d90e8fdd 100644 --- a/modules/audio_coding/main/acm2/acm_generic_codec.h +++ b/modules/audio_coding/main/acm2/acm_generic_codec.h @@ -312,7 +312,10 @@ class ACMGenericCodec { // true if the codec has an internal DTX, e.g. G729, // false otherwise. // - bool HasInternalDTX() const { return has_internal_dtx_; } + bool HasInternalDTX() const { + ReadLockScoped rl(codec_wrapper_lock_); + return has_internal_dtx_; + } /////////////////////////////////////////////////////////////////////////// // int32_t GetEstimatedBandwidth() @@ -436,7 +439,8 @@ class ACMGenericCodec { // -1 if failed, or if this is meaningless for the given codec. // 0 if succeeded. // - virtual int16_t UpdateEncoderSampFreq(uint16_t samp_freq_hz); + virtual int16_t UpdateEncoderSampFreq(uint16_t samp_freq_hz) + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); /////////////////////////////////////////////////////////////////////////// // EncoderSampFreq() @@ -450,7 +454,8 @@ class ACMGenericCodec { // -1 if failed to output sampling rate. // 0 if the sample rate is returned successfully. // - virtual int16_t EncoderSampFreq(uint16_t* samp_freq_hz); + virtual int16_t EncoderSampFreq(uint16_t* samp_freq_hz) + SHARED_LOCKS_REQUIRED(codec_wrapper_lock_); /////////////////////////////////////////////////////////////////////////// // int32_t ConfigISACBandwidthEstimator() @@ -515,8 +520,6 @@ class ACMGenericCodec { // virtual int32_t SetISACMaxRate(const uint32_t max_rate_bps); - int32_t FrameSize() { return frame_len_smpl_; } - /////////////////////////////////////////////////////////////////////////// // REDPayloadISAC() // This is an iSAC-specific function. The function is called to get RED @@ -569,7 +572,10 @@ class ACMGenericCodec { // true if the codec has an internal FEC, e.g. Opus. // false otherwise. // - bool HasInternalFEC() const { return has_internal_fec_; } + bool HasInternalFEC() const { + ReadLockScoped rl(codec_wrapper_lock_); + return has_internal_fec_; + } /////////////////////////////////////////////////////////////////////////// // int SetFEC(); @@ -624,7 +630,8 @@ class ACMGenericCodec { // See EncoderParam() for the description of function, input(s)/output(s) // and return value. // - int16_t EncoderParamsSafe(WebRtcACMCodecParams* enc_params); + int16_t EncoderParamsSafe(WebRtcACMCodecParams* enc_params) + SHARED_LOCKS_REQUIRED(codec_wrapper_lock_); /////////////////////////////////////////////////////////////////////////// // See ResetEncoder() for the description of function, input(s)/output(s) @@ -651,7 +658,8 @@ class ACMGenericCodec { // See DestructEncoder() for the description of function, // input(s)/output(s) and return value. // - virtual void DestructEncoderSafe() = 0; + virtual void DestructEncoderSafe() + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_) = 0; /////////////////////////////////////////////////////////////////////////// // See SetBitRate() for the description of function, input(s)/output(s) @@ -659,7 +667,8 @@ class ACMGenericCodec { // // Any codec that can change the bit-rate has to implement this. // - virtual int16_t SetBitRateSafe(const int32_t bitrate_bps); + virtual int16_t SetBitRateSafe(const int32_t bitrate_bps) + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); /////////////////////////////////////////////////////////////////////////// // See GetEstimatedBandwidth() for the description of function, @@ -707,7 +716,7 @@ class ACMGenericCodec { // -1 if failed, // 0 if succeeded. // - int16_t CreateEncoder(); + int16_t CreateEncoder() EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); /////////////////////////////////////////////////////////////////////////// // int16_t EnableVAD(); @@ -773,7 +782,8 @@ class ACMGenericCodec { // otherwise the length of the bit-stream is returned. // virtual int16_t InternalEncode(uint8_t* bitstream, - int16_t* bitstream_len_byte) = 0; + int16_t* bitstream_len_byte) + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_) = 0; /////////////////////////////////////////////////////////////////////////// // int16_t InternalInitEncoder() @@ -794,7 +804,8 @@ class ACMGenericCodec { // -1 if failed, // 0 if succeeded. // - virtual int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params) = 0; + virtual int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params) + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_) = 0; /////////////////////////////////////////////////////////////////////////// // void IncreaseNoMissedSamples() @@ -805,7 +816,8 @@ class ACMGenericCodec { // -num_samples : the number of overwritten samples is incremented // by this value. // - void IncreaseNoMissedSamples(const int16_t num_samples); + void IncreaseNoMissedSamples(const int16_t num_samples) + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); /////////////////////////////////////////////////////////////////////////// // int16_t InternalCreateEncoder() @@ -849,7 +861,8 @@ class ACMGenericCodec { // -1 if failed, // 0 if succeeded. // - virtual int16_t InternalResetEncoder(); + virtual int16_t InternalResetEncoder() + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); /////////////////////////////////////////////////////////////////////////// // int16_t ProcessFrameVADDTX() @@ -900,41 +913,42 @@ class ACMGenericCodec { // &in_audio_[in_audio_ix_write_] always point to where new audio can be // written to - int16_t in_audio_ix_write_; + int16_t in_audio_ix_write_ GUARDED_BY(codec_wrapper_lock_); // &in_audio_[in_audio_ix_read_] points to where audio has to be read from - int16_t in_audio_ix_read_; + int16_t in_audio_ix_read_ GUARDED_BY(codec_wrapper_lock_); - int16_t in_timestamp_ix_write_; + int16_t in_timestamp_ix_write_ GUARDED_BY(codec_wrapper_lock_); // Where the audio is stored before encoding, // To save memory the following buffer can be allocated // dynamically for 80 ms depending on the sampling frequency // of the codec. - int16_t* in_audio_; - uint32_t* in_timestamp_; + int16_t* in_audio_ GUARDED_BY(codec_wrapper_lock_); + uint32_t* in_timestamp_ GUARDED_BY(codec_wrapper_lock_); - int16_t frame_len_smpl_; - uint16_t num_channels_; + int16_t frame_len_smpl_ GUARDED_BY(codec_wrapper_lock_); + uint16_t num_channels_ GUARDED_BY(codec_wrapper_lock_); // This will point to a static database of the supported codecs - int16_t codec_id_; + int16_t codec_id_ GUARDED_BY(codec_wrapper_lock_); // This will account for the number of samples were not encoded // the case is rare, either samples are missed due to overwrite // at input buffer or due to encoding error - uint32_t num_missed_samples_; + uint32_t num_missed_samples_ GUARDED_BY(codec_wrapper_lock_); // True if the encoder instance created - bool encoder_exist_; + bool encoder_exist_ GUARDED_BY(codec_wrapper_lock_); // True if the encoder instance initialized - bool encoder_initialized_; + bool encoder_initialized_ GUARDED_BY(codec_wrapper_lock_); - const bool registered_in_neteq_; // TODO(henrik.lundin) Remove? + const bool registered_in_neteq_ + GUARDED_BY(codec_wrapper_lock_); // TODO(henrik.lundin) Remove? // VAD/DTX - bool has_internal_dtx_; + bool has_internal_dtx_ GUARDED_BY(codec_wrapper_lock_); WebRtcVadInst* ptr_vad_inst_ GUARDED_BY(codec_wrapper_lock_); bool vad_enabled_ GUARDED_BY(codec_wrapper_lock_); ACMVADMode vad_mode_ GUARDED_BY(codec_wrapper_lock_); @@ -947,9 +961,9 @@ class ACMGenericCodec { int16_t prev_frame_cng_ GUARDED_BY(codec_wrapper_lock_); // FEC. - bool has_internal_fec_; + bool has_internal_fec_ GUARDED_BY(codec_wrapper_lock_); - WebRtcACMCodecParams encoder_params_; + WebRtcACMCodecParams encoder_params_ GUARDED_BY(codec_wrapper_lock_); // Used as a global lock for all available decoders // so that no decoder is used when NetEQ decodes. diff --git a/modules/audio_coding/main/acm2/acm_ilbc.h b/modules/audio_coding/main/acm2/acm_ilbc.h index fd6e8537..714c9004 100644 --- a/modules/audio_coding/main/acm2/acm_ilbc.h +++ b/modules/audio_coding/main/acm2/acm_ilbc.h @@ -29,14 +29,18 @@ class ACMILBC : public ACMGenericCodec { // for FEC ACMGenericCodec* CreateInstance(void); - int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte); + int16_t InternalEncode(uint8_t* bitstream, + int16_t* bitstream_len_byte) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params); protected: - int16_t SetBitRateSafe(const int32_t rate); + int16_t SetBitRateSafe(const int32_t rate) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); - void DestructEncoderSafe(); + void DestructEncoderSafe() OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalCreateEncoder(); diff --git a/modules/audio_coding/main/acm2/acm_isac.cc b/modules/audio_coding/main/acm2/acm_isac.cc index 9fbcdd4c..2adae861 100644 --- a/modules/audio_coding/main/acm2/acm_isac.cc +++ b/modules/audio_coding/main/acm2/acm_isac.cc @@ -694,7 +694,10 @@ int32_t ACMISAC::ConfigISACBandwidthEstimator( "Couldn't config iSAC BWE."); return -1; } - UpdateFrameLen(); + { + WriteLockScoped wl(codec_wrapper_lock_); + UpdateFrameLen(); + } CriticalSectionScoped lock(codec_inst_crit_sect_.get()); ACM_ISAC_GETSENDBITRATE(codec_inst_ptr_->inst, &isac_current_bn_); return 0; @@ -792,6 +795,7 @@ int ACMISAC::ErrorCode() { AudioDecoder* ACMISAC::Decoder(int codec_id) { // Create iSAC instance if it does not exist. + WriteLockScoped wl(codec_wrapper_lock_); if (!encoder_exist_) { CriticalSectionScoped lock(codec_inst_crit_sect_.get()); assert(codec_inst_ptr_->inst == NULL); diff --git a/modules/audio_coding/main/acm2/acm_isac.h b/modules/audio_coding/main/acm2/acm_isac.h index 3249526f..31263c70 100644 --- a/modules/audio_coding/main/acm2/acm_isac.h +++ b/modules/audio_coding/main/acm2/acm_isac.h @@ -34,19 +34,23 @@ class ACMISAC : public ACMGenericCodec, AudioDecoder { explicit ACMISAC(int16_t codec_id); ~ACMISAC(); - int16_t InternalInitDecoder(WebRtcACMCodecParams* codec_params); + int16_t InternalInitDecoder(WebRtcACMCodecParams* codec_params) + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); // Methods below are inherited from ACMGenericCodec. ACMGenericCodec* CreateInstance(void) OVERRIDE; int16_t InternalEncode(uint8_t* bitstream, - int16_t* bitstream_len_byte) OVERRIDE; + int16_t* bitstream_len_byte) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); - int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params) OVERRIDE; + int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t UpdateDecoderSampFreq(int16_t codec_id) OVERRIDE; - int16_t UpdateEncoderSampFreq(uint16_t samp_freq_hz) OVERRIDE; + int16_t UpdateEncoderSampFreq(uint16_t samp_freq_hz) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t EncoderSampFreq(uint16_t* samp_freq_hz) OVERRIDE; @@ -95,12 +99,14 @@ class ACMISAC : public ACMGenericCodec, AudioDecoder { int32_t rate, bool is_red); - void UpdateFrameLen(); + void UpdateFrameLen() EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); // Methods below are inherited from ACMGenericCodec. - void DestructEncoderSafe() OVERRIDE; + void DestructEncoderSafe() OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); - int16_t SetBitRateSafe(const int32_t bit_rate) OVERRIDE; + int16_t SetBitRateSafe(const int32_t bit_rate) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int32_t GetEstimatedBandwidthSafe() OVERRIDE; diff --git a/modules/audio_coding/main/acm2/acm_opus.h b/modules/audio_coding/main/acm2/acm_opus.h index 07ce0721..b94adc47 100644 --- a/modules/audio_coding/main/acm2/acm_opus.h +++ b/modules/audio_coding/main/acm2/acm_opus.h @@ -28,7 +28,9 @@ class ACMOpus : public ACMGenericCodec { ACMGenericCodec* CreateInstance(void); - int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte); + int16_t InternalEncode(uint8_t* bitstream, + int16_t* bitstream_len_byte) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params); @@ -43,7 +45,8 @@ class ACMOpus : public ACMGenericCodec { void InternalDestructEncoderInst(void* ptr_inst); - int16_t SetBitRateSafe(const int32_t rate); + int16_t SetBitRateSafe(const int32_t rate) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); WebRtcOpusEncInst* encoder_inst_ptr_; uint16_t sample_freq_; diff --git a/modules/audio_coding/main/acm2/acm_pcm16b.h b/modules/audio_coding/main/acm2/acm_pcm16b.h index 23b8c121..de4330d5 100644 --- a/modules/audio_coding/main/acm2/acm_pcm16b.h +++ b/modules/audio_coding/main/acm2/acm_pcm16b.h @@ -25,12 +25,15 @@ class ACMPCM16B : public ACMGenericCodec { // For FEC. ACMGenericCodec* CreateInstance(void); - int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte); + int16_t InternalEncode(uint8_t* bitstream, + int16_t* bitstream_len_byte) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params); protected: - void DestructEncoderSafe(); + void DestructEncoderSafe() OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalCreateEncoder(); diff --git a/modules/audio_coding/main/acm2/acm_pcma.h b/modules/audio_coding/main/acm2/acm_pcma.h index 2da873cb..a2d8874a 100644 --- a/modules/audio_coding/main/acm2/acm_pcma.h +++ b/modules/audio_coding/main/acm2/acm_pcma.h @@ -25,7 +25,9 @@ class ACMPCMA : public ACMGenericCodec { // For FEC. ACMGenericCodec* CreateInstance(void); - int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte); + int16_t InternalEncode(uint8_t* bitstream, + int16_t* bitstream_len_byte) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params); diff --git a/modules/audio_coding/main/acm2/acm_pcmu.h b/modules/audio_coding/main/acm2/acm_pcmu.h index 18d8279d..7aa83b75 100644 --- a/modules/audio_coding/main/acm2/acm_pcmu.h +++ b/modules/audio_coding/main/acm2/acm_pcmu.h @@ -25,12 +25,15 @@ class ACMPCMU : public ACMGenericCodec { // For FEC. ACMGenericCodec* CreateInstance(void); - int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte); + int16_t InternalEncode(uint8_t* bitstream, + int16_t* bitstream_len_byte) OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params); protected: - void DestructEncoderSafe(); + void DestructEncoderSafe() OVERRIDE + EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_); int16_t InternalCreateEncoder(); -- cgit v1.2.3 From 26f68fe36316141f949c723088540e055b95fb98 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Tue, 24 Jun 2014 10:25:00 +0000 Subject: Neon version of ScaleErrorSignal() The performance gain on a Nexus 7 reported by audioproc is ~4.7% The output is NOT bit exact. Any difference seen is +-1. BUG=3131 R=bjornv@webrtc.org, cd@webrtc.org Review URL: https://webrtc-codereview.appspot.com/12779004 Patch from Scott LaVarnway . git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6529 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/audio_processing/aec/aec_core_neon.c | 99 ++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) (limited to 'modules') diff --git a/modules/audio_processing/aec/aec_core_neon.c b/modules/audio_processing/aec/aec_core_neon.c index cec0a7e3..5cce4897 100644 --- a/modules/audio_processing/aec/aec_core_neon.c +++ b/modules/audio_processing/aec/aec_core_neon.c @@ -30,6 +30,104 @@ __inline static float MulRe(float aRe, float aIm, float bRe, float bIm) { return aRe * bRe - aIm * bIm; } +static float32x4_t vdivq_f32(float32x4_t a, float32x4_t b) { + int i; + float32x4_t x = vrecpeq_f32(b); + // from arm documentation + // The Newton-Raphson iteration: + // x[n+1] = x[n] * (2 - d * x[n]) + // converges to (1/d) if x0 is the result of VRECPE applied to d. + // + // Note: The precision did not improve after 2 iterations. + for (i = 0; i < 2; i++) { + x = vmulq_f32(vrecpsq_f32(b, x), x); + } + // a/b = a*(1/b) + return vmulq_f32(a, x); +} + +static float32x4_t vsqrtq_f32(float32x4_t s) { + int i; + float32x4_t x = vrsqrteq_f32(s); + + // Code to handle sqrt(0). + // If the input to sqrtf() is zero, a zero will be returned. + // If the input to vrsqrteq_f32() is zero, positive infinity is returned. + const uint32x4_t vec_p_inf = vdupq_n_u32(0x7F800000); + // check for divide by zero + const uint32x4_t div_by_zero = vceqq_u32(vec_p_inf, vreinterpretq_u32_f32(x)); + // zero out the positive infinity results + x = vreinterpretq_f32_u32(vandq_u32(vmvnq_u32(div_by_zero), + vreinterpretq_u32_f32(x))); + // from arm documentation + // The Newton-Raphson iteration: + // x[n+1] = x[n] * (3 - d * (x[n] * x[n])) / 2) + // converges to (1/√d) if x0 is the result of VRSQRTE applied to d. + // + // Note: The precision did not improve after 2 iterations. + for (i = 0; i < 2; i++) { + x = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x, x), s), x); + } + // sqrt(s) = s * 1/sqrt(s) + return vmulq_f32(s, x);; +} + +static void ScaleErrorSignalNEON(AecCore* aec, float ef[2][PART_LEN1]) { + const float mu = aec->extended_filter_enabled ? kExtendedMu : aec->normal_mu; + const float error_threshold = aec->extended_filter_enabled ? + kExtendedErrorThreshold : aec->normal_error_threshold; + const float32x4_t k1e_10f = vdupq_n_f32(1e-10f); + const float32x4_t kMu = vmovq_n_f32(mu); + const float32x4_t kThresh = vmovq_n_f32(error_threshold); + int i; + // vectorized code (four at once) + for (i = 0; i + 3 < PART_LEN1; i += 4) { + const float32x4_t xPow = vld1q_f32(&aec->xPow[i]); + const float32x4_t ef_re_base = vld1q_f32(&ef[0][i]); + const float32x4_t ef_im_base = vld1q_f32(&ef[1][i]); + const float32x4_t xPowPlus = vaddq_f32(xPow, k1e_10f); + float32x4_t ef_re = vdivq_f32(ef_re_base, xPowPlus); + float32x4_t ef_im = vdivq_f32(ef_im_base, xPowPlus); + const float32x4_t ef_re2 = vmulq_f32(ef_re, ef_re); + const float32x4_t ef_sum2 = vmlaq_f32(ef_re2, ef_im, ef_im); + const float32x4_t absEf = vsqrtq_f32(ef_sum2); + const uint32x4_t bigger = vcgtq_f32(absEf, kThresh); + const float32x4_t absEfPlus = vaddq_f32(absEf, k1e_10f); + const float32x4_t absEfInv = vdivq_f32(kThresh, absEfPlus); + uint32x4_t ef_re_if = vreinterpretq_u32_f32(vmulq_f32(ef_re, absEfInv)); + uint32x4_t ef_im_if = vreinterpretq_u32_f32(vmulq_f32(ef_im, absEfInv)); + uint32x4_t ef_re_u32 = vandq_u32(vmvnq_u32(bigger), + vreinterpretq_u32_f32(ef_re)); + uint32x4_t ef_im_u32 = vandq_u32(vmvnq_u32(bigger), + vreinterpretq_u32_f32(ef_im)); + ef_re_if = vandq_u32(bigger, ef_re_if); + ef_im_if = vandq_u32(bigger, ef_im_if); + ef_re_u32 = vorrq_u32(ef_re_u32, ef_re_if); + ef_im_u32 = vorrq_u32(ef_im_u32, ef_im_if); + ef_re = vmulq_f32(vreinterpretq_f32_u32(ef_re_u32), kMu); + ef_im = vmulq_f32(vreinterpretq_f32_u32(ef_im_u32), kMu); + vst1q_f32(&ef[0][i], ef_re); + vst1q_f32(&ef[1][i], ef_im); + } + // scalar code for the remaining items. + for (; i < PART_LEN1; i++) { + float abs_ef; + ef[0][i] /= (aec->xPow[i] + 1e-10f); + ef[1][i] /= (aec->xPow[i] + 1e-10f); + abs_ef = sqrtf(ef[0][i] * ef[0][i] + ef[1][i] * ef[1][i]); + + if (abs_ef > error_threshold) { + abs_ef = error_threshold / (abs_ef + 1e-10f); + ef[0][i] *= abs_ef; + ef[1][i] *= abs_ef; + } + + // Stepsize factor + ef[0][i] *= mu; + ef[1][i] *= mu; + } +} + static void FilterAdaptationNEON(AecCore* aec, float* fft, float ef[2][PART_LEN1]) { @@ -298,6 +396,7 @@ static void OverdriveAndSuppressNEON(AecCore* aec, } void WebRtcAec_InitAec_neon(void) { + WebRtcAec_ScaleErrorSignal = ScaleErrorSignalNEON; WebRtcAec_FilterAdaptation = FilterAdaptationNEON; WebRtcAec_OverdriveAndSuppress = OverdriveAndSuppressNEON; } -- cgit v1.2.3 From c34b9e5d5cd44c31c4f9da649b71d0d3132cf516 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Tue, 24 Jun 2014 13:11:22 +0000 Subject: Removing neteq decode lock and friends NetEq is thread-safe by virtue of it's own lock, and in r6404 the ACMISAC class was made thread-safe. Therefore, the neteq decode lock is no longer needed. R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/18599004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6531 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../audio_coding/main/acm2/acm_generic_codec.cc | 5 -- modules/audio_coding/main/acm2/acm_generic_codec.h | 15 ------ modules/audio_coding/main/acm2/acm_receiver.cc | 59 +++++++++------------- modules/audio_coding/main/acm2/acm_receiver.h | 9 ---- .../main/acm2/audio_coding_module_impl.cc | 1 - 5 files changed, 24 insertions(+), 65 deletions(-) (limited to 'modules') diff --git a/modules/audio_coding/main/acm2/acm_generic_codec.cc b/modules/audio_coding/main/acm2/acm_generic_codec.cc index a4808c0e..d16d1d38 100644 --- a/modules/audio_coding/main/acm2/acm_generic_codec.cc +++ b/modules/audio_coding/main/acm2/acm_generic_codec.cc @@ -60,7 +60,6 @@ ACMGenericCodec::ACMGenericCodec() sent_cn_previous_(false), prev_frame_cng_(0), has_internal_fec_(false), - neteq_decode_lock_(NULL), codec_wrapper_lock_(*RWLockWrapper::CreateRWLock()), last_timestamp_(0xD87F3F9F), unique_id_(0) { @@ -210,7 +209,6 @@ int16_t ACMGenericCodec::Encode(uint8_t* bitstream, return 0; } WriteLockScoped lockCodec(codec_wrapper_lock_); - ReadLockScoped lockNetEq(*neteq_decode_lock_); // Not all codecs accept the whole frame to be pushed into encoder at once. // Some codecs needs to be feed with a specific number of samples different @@ -394,7 +392,6 @@ int16_t ACMGenericCodec::EncoderParamsSafe(WebRtcACMCodecParams* enc_params) { int16_t ACMGenericCodec::ResetEncoder() { WriteLockScoped lockCodec(codec_wrapper_lock_); - ReadLockScoped lockNetEq(*neteq_decode_lock_); return ResetEncoderSafe(); } @@ -443,7 +440,6 @@ int16_t ACMGenericCodec::InternalResetEncoder() { int16_t ACMGenericCodec::InitEncoder(WebRtcACMCodecParams* codec_params, bool force_initialization) { WriteLockScoped lockCodec(codec_wrapper_lock_); - ReadLockScoped lockNetEq(*neteq_decode_lock_); return InitEncoderSafe(codec_params, force_initialization); } @@ -629,7 +625,6 @@ int16_t ACMGenericCodec::CreateEncoder() { void ACMGenericCodec::DestructEncoderInst(void* ptr_inst) { if (ptr_inst != NULL) { WriteLockScoped lockCodec(codec_wrapper_lock_); - ReadLockScoped lockNetEq(*neteq_decode_lock_); InternalDestructEncoderInst(ptr_inst); } } diff --git a/modules/audio_coding/main/acm2/acm_generic_codec.h b/modules/audio_coding/main/acm2/acm_generic_codec.h index d90e8fdd..80f239ac 100644 --- a/modules/audio_coding/main/acm2/acm_generic_codec.h +++ b/modules/audio_coding/main/acm2/acm_generic_codec.h @@ -293,17 +293,6 @@ class ACMGenericCodec { // int32_t IsInternalDTXReplaced(bool* internal_dtx_replaced); - /////////////////////////////////////////////////////////////////////////// - // void SetNetEqDecodeLock() - // Passes the NetEq lock to the codec. - // - // Input: - // -neteq_decode_lock : pointer to the lock associated with NetEQ of ACM. - // - void SetNetEqDecodeLock(RWLockWrapper* neteq_decode_lock) { - neteq_decode_lock_ = neteq_decode_lock; - } - /////////////////////////////////////////////////////////////////////////// // bool HasInternalDTX() // Used to check if the codec has internal DTX. @@ -965,10 +954,6 @@ class ACMGenericCodec { WebRtcACMCodecParams encoder_params_ GUARDED_BY(codec_wrapper_lock_); - // Used as a global lock for all available decoders - // so that no decoder is used when NetEQ decodes. - RWLockWrapper* neteq_decode_lock_; - // Used to lock wrapper internal data // such as buffers and state variables. RWLockWrapper& codec_wrapper_lock_; diff --git a/modules/audio_coding/main/acm2/acm_receiver.cc b/modules/audio_coding/main/acm2/acm_receiver.cc index cb7c4184..f40250f2 100644 --- a/modules/audio_coding/main/acm2/acm_receiver.cc +++ b/modules/audio_coding/main/acm2/acm_receiver.cc @@ -26,7 +26,6 @@ #include "webrtc/system_wrappers/interface/clock.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/logging.h" -#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" #include "webrtc/system_wrappers/interface/tick_util.h" #include "webrtc/system_wrappers/interface/trace.h" @@ -126,7 +125,6 @@ AcmReceiver::AcmReceiver(const AudioCodingModule::Config& config) nack_(), nack_enabled_(false), neteq_(NetEq::Create(config.neteq_config)), - decode_lock_(RWLockWrapper::CreateRWLock()), vad_enabled_(true), clock_(config.clock), av_sync_(false), @@ -149,7 +147,6 @@ AcmReceiver::AcmReceiver(const AudioCodingModule::Config& config) AcmReceiver::~AcmReceiver() { delete neteq_; - delete decode_lock_; } int AcmReceiver::SetMinimumDelay(int delay_ms) { @@ -331,22 +328,18 @@ int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header, } } // |crit_sect_| is released. - { - WriteLockScoped lock_codecs(*decode_lock_); // Lock to prevent an encoding. - - // If |missing_packets_sync_stream_| is allocated then we are in AV-sync and - // we may need to insert sync-packets. We don't check |av_sync_| as we are - // outside AcmReceiver's critical section. - if (missing_packets_sync_stream_.get()) { - InsertStreamOfSyncPackets(missing_packets_sync_stream_.get()); - } + // If |missing_packets_sync_stream_| is allocated then we are in AV-sync and + // we may need to insert sync-packets. We don't check |av_sync_| as we are + // outside AcmReceiver's critical section. + if (missing_packets_sync_stream_.get()) { + InsertStreamOfSyncPackets(missing_packets_sync_stream_.get()); + } - if (neteq_->InsertPacket(rtp_header, incoming_payload, length_payload, - receive_timestamp) < 0) { - LOG_FERR1(LS_ERROR, "AcmReceiver::InsertPacket", header->payloadType) << - " Failed to insert packet"; - return -1; - } + if (neteq_->InsertPacket(rtp_header, incoming_payload, length_payload, + receive_timestamp) < 0) { + LOG_FERR1(LS_ERROR, "AcmReceiver::InsertPacket", header->payloadType) << + " Failed to insert packet"; + return -1; } return 0; } @@ -384,24 +377,20 @@ int AcmReceiver::GetAudio(int desired_freq_hz, AudioFrame* audio_frame) { } } - { - WriteLockScoped lock_codecs(*decode_lock_); // Lock to prevent an encoding. - - // If |late_packets_sync_stream_| is allocated then we have been in AV-sync - // mode and we might have to insert sync-packets. - if (late_packets_sync_stream_.get()) { - InsertStreamOfSyncPackets(late_packets_sync_stream_.get()); - if (return_silence) // Silence generated, don't pull from NetEq. - return 0; - } + // If |late_packets_sync_stream_| is allocated then we have been in AV-sync + // mode and we might have to insert sync-packets. + if (late_packets_sync_stream_.get()) { + InsertStreamOfSyncPackets(late_packets_sync_stream_.get()); + if (return_silence) // Silence generated, don't pull from NetEq. + return 0; + } - if (neteq_->GetAudio(AudioFrame::kMaxDataSizeSamples, - ptr_audio_buffer, - &samples_per_channel, - &num_channels, &type) != NetEq::kOK) { - LOG_FERR0(LS_ERROR, "AcmReceiver::GetAudio") << "NetEq Failed."; - return -1; - } + if (neteq_->GetAudio(AudioFrame::kMaxDataSizeSamples, + ptr_audio_buffer, + &samples_per_channel, + &num_channels, &type) != NetEq::kOK) { + LOG_FERR0(LS_ERROR, "AcmReceiver::GetAudio") << "NetEq Failed."; + return -1; } // Accessing members, take the lock. diff --git a/modules/audio_coding/main/acm2/acm_receiver.h b/modules/audio_coding/main/acm2/acm_receiver.h index b6898f73..dd6de528 100644 --- a/modules/audio_coding/main/acm2/acm_receiver.h +++ b/modules/audio_coding/main/acm2/acm_receiver.h @@ -30,7 +30,6 @@ namespace webrtc { struct CodecInst; class CriticalSectionWrapper; -class RWLockWrapper; class NetEq; namespace acm2 { @@ -209,13 +208,6 @@ class AcmReceiver { // bool vad_enabled() const { return vad_enabled_; } - // - // Get the decode lock used to protect decoder instances while decoding. - // - // Return value : Pointer to the decode lock. - // - RWLockWrapper* DecodeLock() const { return decode_lock_; } - // // Flushes the NetEq packet and speech buffers. // @@ -354,7 +346,6 @@ class AcmReceiver { CallStatistics call_stats_ GUARDED_BY(crit_sect_); NetEq* neteq_; Decoder decoders_[ACMCodecDB::kMaxNumCodecs]; - RWLockWrapper* decode_lock_; bool vad_enabled_; Clock* clock_; // TODO(henrik.lundin) Make const if possible. diff --git a/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/modules/audio_coding/main/acm2/audio_coding_module_impl.cc index fac71ea9..f2410b7d 100644 --- a/modules/audio_coding/main/acm2/audio_coding_module_impl.cc +++ b/modules/audio_coding/main/acm2/audio_coding_module_impl.cc @@ -749,7 +749,6 @@ ACMGenericCodec* AudioCodingModuleImpl::CreateCodec(const CodecInst& codec) { return my_codec; } my_codec->SetUniqueID(id_); - my_codec->SetNetEqDecodeLock(receiver_.DecodeLock()); return my_codec; } -- cgit v1.2.3