Commit Graph

29 Commits

Author SHA1 Message Date
1bd0e03ce5 ACM: Removing runtime APIs related to playout mode
The playout mode in NetEq can still be set through the constructor
configuration.

BUG=webrtc:3520

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

Cr-Commit-Position: refs/heads/master@{#10089}
2015-09-28 13:12:21 +00:00
4e14f0961b Add support for external decoders in ACM
Test added too.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4474
TBR=minyue@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9765}
2015-08-24 12:27:28 +00:00
d8399e630f Also provide sample rate when registering decoders
This replaces the old practice of looking up the sample rate in a
table, which won't work when we add support for external decoders.

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

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

Cr-Commit-Position: refs/heads/master@{#9276}
2015-05-25 12:40:05 +00:00
a990784da3 AcmReceiver: index decoders by payload type instead of ACM codec ID
Change internal indexing of registered decoders. It makes sense because payload type is unique, while ACM codec ID may not be. This is a step towards allowing for addition of external decoders.

R=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8867}
2015-03-26 13:01:37 +00:00
a4bef3e6c0 AcmReceiver: use std::map instead of an array to keep the list of decoders
R=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8824}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8824 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-23 11:20:31 +00:00
00b8f6b364 Use base/scoped_ptr.h; system_wrappers/interface/scoped_ptr.h is going away
BUG=
R=andrew@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8517}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8517 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-26 14:43:50 +00:00
1eda4e3db6 Reland r8476 "Set decoder output frequency in AudioDecoder::Decode call"
This should be safe to land now that issue 4143 was resolved (in r8492).
This change effectively reverts 8488.

TBR=kwiberg@webrtc.org

Original commit message:
This CL changes the way the decoder sample rate is set and updated. In
practice, it only concerns the iSAC (float) codec.

One single iSAC decoder instance is used for both wideband and
super-wideband decoding, and the instance must be told to switch
output frequency if the payload type changes. This used to be done
through a call to UpdateDecoderSampleRate, but is now instead done in
the Decode call as an extra parameter.

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

Cr-Commit-Position: refs/heads/master@{#8496}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8496 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-25 10:03:19 +00:00
903182bd8e Revert r8476 "Set decoder output frequency in AudioDecoder::Decode call"
This change uncovered issue 4143, evading the Memcheck suppression
since the signature is changed in the Decode function.

A fix for this is in the making; see
https://review.webrtc.org/36309004. This CL will be re-landed once the
fix is in place.

BUG=4143
TBR=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8488}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8488 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-24 21:18:44 +00:00
b9c18d5643 Set decoder output frequency in AudioDecoder::Decode call
This CL changes the way the decoder sample rate is set and updated. In
practice, it only concerns the iSAC (float) codec.

One single iSAC decoder instance is used for both wideband and
super-wideband decoding, and the instance must be told to switch
output frequency if the payload type changes. This used to be done
through a call to UpdateDecoderSampleRate, but is now instead done in
the Decode call as an extra parameter.

R=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8476}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8476 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-24 15:59:20 +00:00
c0bd7be0df Adding two new stats to VoiceReceiverInfo
There have been requests of two new stats namely

speech_expand_rate and secondary_decoded_rate.

BUG=3867
R=henrik.lundin@webrtc.org, henrika@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8415}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8415 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-18 15:24:39 +00:00
16825b1a82 Use int64_t more consistently for times, in particular for RTT values.
Existing code was inconsistent about whether to use uint16_t, int, unsigned int,
or uint32_t, and sometimes silently truncated one to another, or truncated
int64_t.  Because most core time-handling functions use int64_t, being
consistent about using int64_t unless otherwise necessary minimizes the number
of explicit or implicit casts.

BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, holmer@google.com, tommi@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8045 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-12 21:51:21 +00:00
4591fbd09f Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.

This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.

BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
913f7b8d5e Fix for glitches in ACM when switching desired output sample rate
The problem was that if the output sample rate is changed such from one
where no resampling is needed to a rate that requires resampling, the
first output from the resampler will contain an onset period. The
solution provided in this CL is to keep a copy of the last output frame
in ACM, and if the resampler is engaged, it will be primed with this
old frame before resampling the current frame.

BUG=3919
R=bjornv@webrtc.org, turaj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7479 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-21 06:54:23 +00:00
38344ed280 Move thread_annotations.h to webrtc/base/.
R=andresp@webrtc.org, mflodman@webrtc.org
BUG=

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7283 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-09-24 06:05:00 +00:00
ea25784107 Change how background noise mode in NetEq is set
This change prepares for switching default background noise (bgn) mode
from on to off. The actual switch will be done later.

In this change, the bgn mode is included as a setting in NetEq's config
struct. We're also removing the connection between playout modes and
bgn modes in ACM. In practice this means that bgn mode will change from
off to on for streaming mode, but since the playout modes are not used
it does not matter.

BUG=3519
R=tina.legrand@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6843 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-07 12:27:37 +00:00
eecf5e6ba7 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@6531 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-24 13:11:22 +00:00
a90abdef62 Add thread annotations to AcmReceiver
This change adds thread annotations to AcmReceiver. These are the
annotations that could be added without changing acquiring the locks in
more locations, or changing the lock structure.

BUG=3401
R=kwiberg@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6376 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-09 18:35:11 +00:00
9c55f0f957 Rename neteq4 folder to neteq
Keep the old neteq4/audio_decoder_unittests.isolate while waiting for
a hard-coded reference to change.

This CL effectively reverts r6257 "Rename neteq4 folder to neteq".

BUG=2996
TBR=tina.legrand@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6367 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-09 08:10:28 +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
1b9df05c85 Revert 6257 "Rename neteq4 folder to neteq"
> Rename neteq4 folder to neteq
> 
> BUG=2996
> R=turaj@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/12569005

TBR=henrik.lundin@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6259 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-28 07:33:39 +00:00
a90f6d67f7 Rename neteq4 folder to neteq
BUG=2996
R=turaj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6257 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-28 06:23:34 +00:00
0bc9b5a5a7 Add clock to ACM config struct
The purpose is to clean up the ACM interface a bit. This is a
follow-up of a comment in http://review.webrtc.org/13379004/.

R=turaj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6006 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-04-29 08:09:31 +00:00
e772c71743 Introduce a config struct for AudioCoding module
The config struct currently contains the module ID, and the NetEq
config struct, but will be extended in the future. The purpose of this
change is to expose certain NetEq settings to the ACM interface.

BUG=3083
R=turaj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5993 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-04-28 10:16:57 +00:00
0c1444c748 Create ACM2 instance when calling AudioCodingModule::Create
BUG=2996
R=turaj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5952 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-04-22 08:18:42 +00:00
35ead381f8 Adding a config struct to NetEq
With this change, the parameters sent to the NetEq::Create method are
collected in one NetEq::Config struct. The benefit is that it is easier
to set, change and override default values, and easier to expand with
more parameters in the future.

BUG=3083
R=turaj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5902 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-04-14 18:49:17 +00:00
24301a67c6 Update talk to 58174641 together with http://review.webrtc.org/4319005/.
R=turaj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5287 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-12-13 19:17:43 +00:00
6d5d248075 Wrap ACM2 code inside acm2 namespace. This gurantees that one ACM would not use components of others by accident.
BUG=
R=minyue@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4933 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-06 04:47:28 +00:00
48af652ea5 Prepare to compile ACM1 and ACM2.
ACM1 code is wrapped in namespace acm1. Inculde paths and define guards of ACM2 source codes are corrected. gypi file of ACM2 is changed so that ACM1 will later on depends on ACM2.

BUG=
R=andrew@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4743 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-13 23:06:59 +00:00
7959e16cc2 ACM2 integration with NetEq 4.
nack{.cc, .h, _unittest.cc} are basically copies from main/source/ folder, with cpplint warning cleaned up.

BUG=
R=andrew@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4736 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-12 18:30:26 +00:00