Commit Graph

30 Commits

Author SHA1 Message Date
9cd5c8ca79 Move the FEC enabling logic from CodecManager to Rent-A-Codec
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10785}
2015-11-25 09:25:14 +00:00
989b4abcf3 Move the stereo-disables-CNG logic from CodecManager to Rent-A-Codec
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10784}
2015-11-25 09:19:19 +00:00
1379f1f1e6 Extract the parameters for the encoder stack from the CodecManager
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10750}
2015-11-23 12:30:56 +00:00
223692aa85 Remove dead code
Review URL: https://codereview.webrtc.org/1452153003

Cr-Commit-Position: refs/heads/master@{#10692}
2015-11-18 16:27:56 +00:00
e1a27d48ad Move CNG/RED payload type extraction to Rent-A-Codec
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10691}
2015-11-18 15:32:57 +00:00
e155ae671c Move CNG and RED management into the Rent-A-Codec
This leaves CodecOwner without a job, so we eliminate it.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10650}
2015-11-16 12:50:02 +00:00
4dc941128f CodecManager::RegisterEncoder: Call SetFec on new encoder, not old
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10604}
2015-11-11 16:34:28 +00:00
be57983f4b Rename Maybe to Optional
And add examples of good and bad usage to the documentation.

R=aluebs@webrtc.org, henrik.lundin@webrtc.org, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10588}
2015-11-10 21:34:32 +00:00
ed8275a44f CodecManager: Eliminate the stereo_send_ member
It can be computed from other members, notably the current encoder's
number of channels.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10585}
2015-11-10 17:47:41 +00:00
c95c366f5a Move the Rent-A-Codec™ from CodecOwner to CodecManager
Future CLs will move it even further down the stack.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10580}
2015-11-10 14:35:28 +00:00
39d8bee397 Make ACMCodecDB private to RentACodec
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10549}
2015-11-07 00:22:50 +00:00
d6c0f8cac1 Remove ACMCodecDB::Codec, and make the rest of ACMCodecDB private
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10546}
2015-11-06 22:28:08 +00:00
93a2febe73 Move ACMCodecDB::ValidPayloadType to RentACodec
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10525}
2015-11-05 15:39:42 +00:00
1fd4a4ab35 Let AudioCodingModule::SendCodec return Maybe<CodecInst>
And deal with the consequences thereof...

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

Cr-Commit-Position: refs/heads/master@{#10497}
2015-11-03 19:20:57 +00:00
de94d08d57 Hide ACMCodecDB::codec_settings_ behind an accessor
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10494}
2015-11-03 13:46:14 +00:00
98f53510b2 system_wrappers: rename interface -> include
BUG=webrtc:5095
R=tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10438}
2015-10-28 17:17:50 +00:00
fce4a945b8 RentACodec: New class that takes over part of ACMCodecDB's job
Following CLs will finish the takeover completely. After that,
RentACodec will also start creating and owning codecs, at which point
its name will start making sense.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10432}
2015-10-27 18:40:29 +00:00
574d5daa6d CodecOwner::SetEncoders: Return error code when given bad arguments
Instead of FATAL on a bad codec specification, log and return an error
code. This is a band-aid until callers are taught to only give it good
specifications.

BUG=webrtc:5033, chromium:526478

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

Cr-Commit-Position: refs/heads/master@{#10066}
2015-09-25 05:54:00 +00:00
91d6edef35 Add RTC_ prefix to (D)CHECKs and related macros.
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.

Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.

BUG=chromium:468375
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#9964}
2015-09-17 07:24:51 +00:00
844a91081e Remove the preprocessor symbol WEBRTC_CODEC_PCM16 (it was always defined)
BUG=webrtc:4557

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

Cr-Commit-Position: refs/heads/master@{#9955}
2015-09-16 16:42:26 +00:00
12cfc9b4da Fold AudioEncoderMutable into AudioEncoder
It makes more sense to combine the two interfaces, since there wasn't
a clear line separating them. The result is a combined interface with
just over a dozen methods, half of which need to be implemented by
every subclass, while the other half have sensible (and trivial)
default implementations and are implemented only by the few subclasses
that need non-default behavior.

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

Cr-Commit-Position: refs/heads/master@{#9894}
2015-09-08 12:57:59 +00:00
dce40cf804 Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.

This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.

This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002

The change is being landed as TBR to all the folks who reviewed the above.

BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher

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

Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 21:52:45 +00:00
93fb53acf5 Adding a new ChangeLogger class to handle UMA logging of bitrates
This change introduces the sub-class ChangeLogger in AudioCodingModuleImpl. The class writes values to the named UMA histogram, but only if the value has changed since the last time (and always for the first call). This is to avoid the problem with audio codecs being registered but never used. Before this change, these codecs' bitrate was also logged, even though they were never used.

BUG=chromium:488124
R=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9506}
2015-06-25 20:03:12 +00:00
6b4a564d21 Add UMA logging for target audio bitrate
This CL logs the target audio bitrate to a UMA histogram called
WebRTC.Audio.TargetBitrateInKbps. It logs the rate when a codec is
created, and when the target is explicitly updated. Note that since
each codec implementation is free to change or ignore the target
value, there is no guarantee that the logged value will actually be
used as the target.

BUG=chromium:488124

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

Cr-Commit-Position: refs/heads/master@{#9484}
2015-06-22 13:35:22 +00:00
7e0c7d49ea Add support for external encoders in ACM
Also introduce tests using external (mock) encoders, both for
CodecOwner and for AudioCodingModule.

Support for external decoders is still missing.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4474
R=jmarusic@webrtc.org, minyue@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9206}
2015-05-18 12:52:13 +00:00
bd1bc47395 Restructure decoder registration in ACM
Before this change, a decoder was registered into ACMReceiver through
the CodecOwner; the CodecOwner had to have a pointer back to the
AudioCodingModuleImpl object to make this call. With this change, the
AudioCodingModuleImpl object asks the CodecOwner for a decoder pointer
instead, making the chain of calls more straightforward.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4474
R=jmarusic@webrtc.org, minyue@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9204}
2015-05-18 10:18:44 +00:00
2ea71c3279 Replace ACMGenericCodec with CodecOwner and AudioEncoderMutable
CodecOwner is introduced here; AudioEncoderMutable was introduced in a
previous commit, but had no users until now. The only remaining task
for ACMGenericCodec was to construct and maintain the stack of speech,
CNG, and RED encoders. This task is now handled by the CodecOwner,
which is owned and used by the CodecManager.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4228
R=jmarusic@webrtc.org, minyue@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9152}
2015-05-07 13:49:24 +00:00
adf89b7e33 Added SetBitRate function to VoE API to allow changing the audio bitrate.
If the requested bitrate is not valid for the codec, the codec will decide on
an appropriate value.
Updated VoE command line tool to use new SetBitRate function.
Includes unittests for SetBitRate function.

BUG=
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kwiberg@webrtc.org, pbos@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9115}
2015-04-29 14:03:45 +00:00
93ef1d85fe Change ACM's CodecManager to hold one encoder instead of an array
With this change, the currently used encoder is held in a scoped_ptr.
iSAC is a special case, since the encoder instance is also a decoder
instance, so it may have to be available also if another send codec is
used. This is accomplished by having a separate scoped_ptr for iSAC.

Remove mirror ID from ACM codec database functions, and remove unused
functions from the database.

COAUTHOR=kwiberg@webrtc.org
BUG=4228
R=tina.legrand@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8982}
2015-04-13 07:31:17 +00:00
45c6449114 Introduce CodecManager and move code from AudioCodingModuleImpl
This change essentially divides AudioCodingModuleImpl into two parts:
one is the code related to managing codecs, now moved into CodecManager,
and the other is what remains in AudioCodingModuleImpl.

This change also removes AudioCodingModuleImpl::InitializeSender. The
function was essentially no-op, since it was always called immediately
after construction.

COAUTHOR=kwiberg@webrtc.org
BUG=4228
R=minyue@webrtc.org, tina.legrand@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8893}
2015-03-30 17:00:54 +00:00