Commit Graph

16 Commits

Author SHA1 Message Date
ba35d05a49 Cleanup of iOS AudioDevice implementation
TBR=tkchin
BUG=webrtc:4789
TEST=modules_unittests --gtest_filter=AudioDeviceTest* and AppRTCDemo

Review URL: https://codereview.webrtc.org/1206783002 .

Cr-Commit-Position: refs/heads/master@{#9578}
2015-07-14 15:04:19 +00:00
728d9037c0 Reformat existing code. There should be no functional effects.
This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)

BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org

Review URL: https://codereview.webrtc.org/1172163004

Cr-Commit-Position: refs/heads/master@{#9420}
2015-06-11 21:31:48 +00:00
b7e5054414 Match existing type usage better.
This makes a variety of small changes to synchronize bits of code using different types, remove useless code or casts, and add explicit casts in some places previously doing implicit ones.  For example:

* Change a few type declarations to better match how the majority of code uses those objects.
* Eliminate "< 0" check for unsigned values.
* Replace "(float)sin(x)", where |x| is also a float, with "sinf(x)", and similar.
* Add casts to uint32_t in many places timestamps were used and the existing code stored signed values into the unsigned objects.
* Remove downcasts when the results would be passed to a larger type, e.g. calling "foo((int16_t)x)" with an int |x| when foo() takes an int instead of an int16_t.
* Similarly, add casts when passing a larger type to a function taking a smaller one.
* Add casts to int16_t when doing something like "int16_t = int16_t + int16_t" as the "+" operation would implicitly upconvert to int, and similar.
* Use "false" instead of "0" for setting a bool.
* Shift a few temp types when doing a multi-stage calculation involving typecasts, so as to put the most logical/semantically correct type possible into the temps.  For example, when doing "int foo = int + int; size_t bar = (size_t)foo + size_t;", we might change |foo| to a size_t and move the cast if it makes more sense for |foo| to be represented as a size_t.

BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kwiberg@webrtc.org
TBR=andrew, asapersson, henrika

Review URL: https://codereview.webrtc.org/1168753002

Cr-Commit-Position: refs/heads/master@{#9419}
2015-06-11 19:56:03 +00:00
68898a2652 Remove AudioDeviceUtility.
The class doesn't do anything in almost all cases except for grabbing and releasing locks + allocate memory.  There are a couple of methods there such as WaitForKey and GetTimeInMs that are used, but those methods aren't specific to audio and we have implementations of these elsewhere.  The third method, StringCompare isn't used anywhere (and also isn't specific to audio).

BUG=
R=henrika@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/50009004

Cr-Commit-Position: refs/heads/master@{#9220}
2015-05-19 15:27:50 +00:00
94454b71ad Fix the chain that propagates the audio frame's rtp and ntp timestamp including:
* In AudioCodingModuleImpl::PlayoutData10Ms, don't reset the timestamp got from GetAudio.
* When there're more than one participant, set AudioFrame's RTP timestamp to 0.
* Copy ntp_time_ms_ in AudioFrame::CopyFrom method.
* In RemixAndResample, pass src frame's timestamp_ and ntp_time_ms_ to the dst frame.
* Fix how |elapsed_time_ms| is computed in channel.cc by adding GetPlayoutFrequency.

Tweaks on ntp_time_ms_:
* Init ntp_time_ms_ to -1 in AudioFrame ctor.
* When there're more than one participant, set AudioFrame's ntp_time_ms_ to an invalid value. I.e. we don't support ntp_time_ms_ in multiple participants case before the mixing is moved to chrome.

Added elapsed_time_ms to AudioFrame and pass it to chrome, where we don't have the information about the rtp timestmp's sample rate, i.e. can't convert rtp timestamp to ms.

BUG=3111
R=henrik.lundin@webrtc.org, turaj@webrtc.org, xians@webrtc.org
TBR=andrew
andrew to take another look on audio_conference_mixer_impl.cc

Review URL: https://webrtc-codereview.appspot.com/14559004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6346 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-05 20:34:08 +00:00
cb711f77d2 Add interface to propagate audio capture timestamp to the renderer.
BUG=3111
R=andrew@webrtc.org, turaj@webrtc.org, xians@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/12239004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6189 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-19 17:39:11 +00:00
2553450959 Fix win trybot errors due to r4729.
The addition of logging.h in r4729 was causing the win trybot to fail
with "#pragma deprecated" errors in standard library headers. This
turned out to be due to including strsafe.h (via audio_device_config.h)
before sstream (via logging.h).

strsafe.h was only being included for the unused DEBUG_PRINT macro. I
removed all references to it.

This incidentally removes a bunch of other unneeded headers discovered
while trying to track the problem down.

This didn't show up in the commitbots; my guess is that the trybots are
using the VC10 toolchain and the commitbots the VC11 toolchain.

TBR=pbos

Review URL: https://webrtc-codereview.appspot.com/2204004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4738 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-13 00:02:13 +00:00
5eb997a2fd Fix unsigned/signed comparison error due to r4729.
Fix it for real by switching to ints rather than casting.

TBR=xians

Review URL: https://webrtc-codereview.appspot.com/2191009

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4730 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-12 01:01:42 +00:00
8f94013651 Reduce frequency of high audio delay warning logs.
This will log the warning every 5 seconds instead of every 10 ms.

BUG=b/10674993
TESTED=Ran voe_cmd_test with hard-coded high delay. Observed a log
every 5 seconds.

R=noahric@chromium.org, xians@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2184009

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4729 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-11 22:35:00 +00:00
12dc1a38ca Switch C++-style C headers with their C equivalents.
The C++ headers define the C functions within the std:: namespace, but
we mainly don't use the std:: namespace for C functions. Therefore we
should include the C headers.

BUG=1833
R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1917004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4486 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-05 16:22:53 +00:00
811269df40 Include files from webrtc/.. paths in audio_device/.
BUG=1662
R=xians@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1785005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4330 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-07-11 13:24:38 +00:00
3be565b502 Refactoring for typing detection
R=henrika@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1370004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3976 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-05-07 21:04:24 +00:00
233c58de47 Landing 1399004, Minor clean up on the un-used _measureDelay code
Those code is/will never used, removing it makes the code better.



git-svn-id: http://webrtc.googlecode.com/svn/trunk@3961 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-05-06 11:52:47 +00:00
2550988baa WebRtc_Word32 -> int32_t in audio_device/
BUG=314

Review URL: https://webrtc-codereview.appspot.com/1302006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3793 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-04-09 10:30:35 +00:00
19da719a5f Resolves TSan v2 reports data races in voe_auto_test.
--- Note that I will add more fixes to this CL ---

BUG=1590

Review URL: https://webrtc-codereview.appspot.com/1286005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3770 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-04-05 14:34:57 +00:00
14b43beb7c Move src/ -> webrtc/
TBR=niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/915006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2963 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-10-22 18:19:23 +00:00