Later steps in the refactoring will have the factory injected from the
outside rather than owned by NetEq.
BUG=webrtc:5801
Review-Url: https://codereview.webrtc.org/1928293002
Cr-Commit-Position: refs/heads/master@{#12604}
But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.
BUG=webrtc:5520
Review-Url: https://codereview.webrtc.org/1937693002
Cr-Commit-Position: refs/heads/master@{#12581}
The problem with gmock is worked around by commenting out any other override declarations in classes using gmock.
NOPRESUBMIT=True
BUG=webrtc:3970
Review-Url: https://codereview.webrtc.org/1921653002
Cr-Commit-Position: refs/heads/master@{#12563}
This is a first draft of what we're hoping to use to create all
AudioDecoder instances. Follow-up CLs will start using this internally
in NetEq instead of calling constructors manually.
BUG=webrtc:5801
Review-Url: https://codereview.webrtc.org/1917163002
Cr-Commit-Position: refs/heads/master@{#12548}
Any file that uses the RTC_DISALLOW_* macros should #include
"webrtc/base/constructormagic.h", but a shocking number of them don't.
This causes trouble when we try to wean files off of #including
scoped_ptr.h, since a bunch of files get their constructormagic macros
only from there.
Rather than fixing these errors one by one as they turn up, this CL
simply ensures that every file in the WebRTC tree that uses the
RTC_DISALLOW_* macros #includes "webrtc/base/constructormagic.h".
BUG=webrtc:5520
Review URL: https://codereview.webrtc.org/1917043005
Cr-Commit-Position: refs/heads/master@{#12509}
The audio_decoder_interface and audio_encoder_interface
targets are depending on rtc_base_approved headers but don't
declare such dependencies.
NOTRY=True
Review URL: https://codereview.webrtc.org/1916953002
Cr-Commit-Position: refs/heads/master@{#12500}
Broke out CNG from AudioDecoder as they didn't really share an interface.
Converted the CNG code to C++, to make initialization and resource handling easier. This includes several changes to the behavior, favoring RTC_CHECKs over returning error codes.
Review URL: https://codereview.webrtc.org/1868143002
Cr-Commit-Position: refs/heads/master@{#12491}
They can all benefit from moving, since they contain std::string and
std::vector. We intended to add these in
https://codereview.webrtc.org/1896953004/, but got compiler errors we
couldn't make sense of, so we skipped them. It turns out that what the
compiler was complaining about was that when we said we'd have a
user-defined move constructor, it stopped generating a copy assignment
operator for us. This CL solves the problem by outfitting the types
with defaulted copy and move assignment operators too.
Review URL: https://codereview.webrtc.org/1899173002
Cr-Commit-Position: refs/heads/master@{#12469}
Remove the deprecated EncodeInternal interface from AudioEncoder
Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.
BUG=webrtc:5591
Review URL: https://codereview.webrtc.org/1881003003
Cr-Commit-Position: refs/heads/master@{#12409}
Reason for revert:
Broke import. Implementations of the old interface still exists somewhere.
Original issue's description:
> Remove the deprecated EncodeInternal interface from AudioEncoder
>
> Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.
>
> BUG=webrtc:5591
>
> Committed: https://crrev.com/5222d315dbea8f3563c100cc9f2451907f70b05f
> Cr-Commit-Position: refs/heads/master@{#12329}
TBR=kwiberg@webrtc.org,solenberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5591
Review URL: https://codereview.webrtc.org/1883543002
Cr-Commit-Position: refs/heads/master@{#12330}
Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.
BUG=webrtc:5591
Review URL: https://codereview.webrtc.org/1864993002
Cr-Commit-Position: refs/heads/master@{#12329}
Now that the Rent-A-Codec no longer owns the encoders and decoders it
produces, they may outlive it. It's thus no longer correct for the
Rent-A-Codec to own the bandwidth estimation state; all of the
involved objects need to share ownership.
BUG=webrtc:5028
Review URL: https://codereview.webrtc.org/1821513003
Cr-Commit-Position: refs/heads/master@{#12159}
WebRtcIsacfix_PitchFilterCore requires indW32 >= PITCH_FRACORDER - 2;
otherwise, it will read from entries of ubufQQ that haven't been
written yet. (The problem of indW32 being too small has only been seen
in fuzzer tests, not in real life.)
BUG=chromium:581901
Review URL: https://codereview.webrtc.org/1811453002
Cr-Commit-Position: refs/heads/master@{#12047}
We want this because otherwise the ACM uses its mutex to protect an
encoder that's owned by someone else. That someone else may easily
slip up and delete or otherwise touch the encoder before making sure
that the ACM has stopped using it, bypassing the lock.
BUG=webrtc:5028
Review URL: https://codereview.webrtc.org/1702943002
Cr-Commit-Position: refs/heads/master@{#11909}
This copies the contents (unittest excluded) of base/numerics in
chromium to base/numerics in webrtc. Files added:
- safe_conversions.h
- safe_conversions_impl.h
- safe_math.h
- safe_math_impl.h
A really old version of safe_conversions[_impl].h previously existed in
base/, this has been deleted and sources using it have been updated
to include the new base/numerics/safe_converions.h.
This CL also adds a DEPS file to webrtc/base.
NOPRESUBMIT=True
BUG=webrtc:5548, webrtc:5623
Review URL: https://codereview.webrtc.org/1753293002
Cr-Commit-Position: refs/heads/master@{#11907}
Renamed the new variant of EncodeInternal to EncodeImpl, so that
subclasses implementing one of the EncodeInternal don't need to
explicitly contain 'using AudioEncoder::EncodeInternal' to avoid their
implementation hiding the other variant of EncodeInternal. This causes
a warning (treated as an error) when building using GCC.
Review URL: https://codereview.webrtc.org/1764583003
Cr-Commit-Position: refs/heads/master@{#11868}
For backwards compatibility, I've added kept the old interface to
Encode() and EncodeInternal and created default implementations of both
variants of EncodeInternal(), each calling the other. At least one of
the variants must be implemented in a subclass or we'll run out of stack
and explode. Would be nice if we could catch that before runtime. :/
The new interface to EncodeInternal() is protected, since it should
never be called from the outside.
Was unable to mark the old EncodeInternal() as RTC_DEPRECATED, since the
default implementaion of the new variant needs to call it to work around
old implementations. The old Encode() variant is deprecated, at least.
Added a test for backwards compatibility in audio_encoder_unittest.cc.
For the added test I broke out MockEncodeHelper from
audio_encoder_copy_red_unittest.cc and renamed it MockAudioEncoderHelper.
Review URL: https://codereview.webrtc.org/1725143003
Cr-Commit-Position: refs/heads/master@{#11823}
By doing an unsigned instead of a signed addition, we get the exact
same machine code (in non-UBSan builds), but no longer trigger
undefined behavior since unsigned overflow is defined behavior.
BUG=webrtc:5485
Review URL: https://codereview.webrtc.org/1734883003
Cr-Commit-Position: refs/heads/master@{#11776}
The array is reset in Init() but not the indexer. This makes the start point undefined after Init() for re-initializing an AudioLoop. This can be fixed.
BUG=
Review URL: https://codereview.webrtc.org/1727353002
Cr-Commit-Position: refs/heads/master@{#11739}
Previously, we relied on the encoded stream to come to an end before
the end of the buffer. This is a bad idea, since it is possible to
craft a stream that fills the buffer while decoding to less than the
expected amount of data; without the new checks introduced here, this
causes the decoder to read past the end of the input buffer.
BUG=chromium:582471, chromium:587852
Review URL: https://codereview.webrtc.org/1721593004
Cr-Commit-Position: refs/heads/master@{#11734}
In some cases, the decoder can write outside of an allocated array. See
the new comment in the code for more details.
BUG=chromium:568885, webrtc:5305
Review URL: https://codereview.webrtc.org/1704463002
Cr-Commit-Position: refs/heads/master@{#11641}
In some cases, the decoder can read outside of an allocated array. See
the new comment in the code for more details.
BUG=chromium:568889, webrtc:5305
Review URL: https://codereview.webrtc.org/1700973002
Cr-Commit-Position: refs/heads/master@{#11637}
Visual Studio 2015 balks at the implicit truncation of values. Easily fixed with an explicit cast.
Fixed redefinition of CLOCKS_PER_SEC when using Visual Studio 2015 and the Windows 10 SDK. CLOCKS_PER_SEC is also defined in "<WIN10 SDK DIR>\include\10.0.10240.0\ucrt\time.h" and also has the value of 1000
Hiding snprintf definition if building with Visual Studio 2015
Fixed C4573 compiler complaint in audio_processing_impl_locking_unittest.cc.
BUG=webrtc:5183
Review URL: https://codereview.webrtc.org/1412653006
Cr-Commit-Position: refs/heads/master@{#11434}
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests). Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks
All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1534193008
Cr-Commit-Position: refs/heads/master@{#11191}
Also removes virtual from VideoDecoder::Decode and updated mocks and
tests accordingly to use VideoDecoder::DecodeInternal instead.
BUG=webrtc:5167
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1512483003 .
Cr-Commit-Position: refs/heads/master@{#10935}
Also clean up some include_dir entries and update the few
references to them with absolute include paths instead.
Finally fixed a few lint errors and invalid header guards.
None of these are used downstream.
BUG=webrtc:5095
TESTED=git cl try -c --bot=android_compile_rel --bot=linux_compile_rel --bot=win_compile_rel --bot=mac_compile_rel --bot=ios_rel --bot=linux_gn_rel --bot=win_x64_gn_rel --bot=mac_x64_gn_rel --bot=android_gn_rel -m tryserver.webrtc
R=kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1438663003 .
Cr-Commit-Position: refs/heads/master@{#10700}
This is to prevent size_t from undefined. This does not happen in current WebRTC since the sources that opus_inst.h gets used have proper definitions. But it would be good to add the definition in itself.
Review URL: https://codereview.webrtc.org/1446093003
Cr-Commit-Position: refs/heads/master@{#10653}
Opus may have an internal error that causes this. Here we make a workaround by adding some small disturbance to the input signals to break a long sequence of zeros.
BUG=webrtc:5127
Review URL: https://codereview.webrtc.org/1415173005
Cr-Commit-Position: refs/heads/master@{#10565}
Some toolchains (in this case referring to a g++ 4.9, or "arm-linux-
androideabi-g++ (GCC) 4.9 20140827 (prerelease)" according to my
--version, from the Android NDK r10e-rc4 and potentially with custom
patches; others may be affected as well) fail to prove that myVec in
WebRtcIsac_CorrelateInterVec is never used uninitialized. This is likely
due to the compiler thinking the assignment in line 468 might not
happen. Changing the loop condition in line 466 to rowCntr <
SOME_CONSTANT also helps, suggesting that the compiler can't infer that
there are only 2 values interVecDim can have at that point, and neither
of them are 0. Of course, this is not an acceptable fix, as it changes
behaviour.
This seems to be a compiler bug, or at least an issue with its
heuristics. However, we can't really change toolchains at the moment,
and ultimately this change improves support for certain older compilers.
BUG=
Review URL: https://codereview.webrtc.org/1406423004
Cr-Commit-Position: refs/heads/master@{#10337}