019955d770
Revert 8749 "We changed Encode() and EncodeInternal() return typ..."
...
The reason is that this cl adds a static initializer so we can't roll webrtc into Chromium.
See audio_encoder.cc and 'sizes' regression here:
http://build.chromium.org/p/chromium/builders/Linux%20x64/builds/186
> We changed Encode() and EncodeInternal() return type from bool to void in this issue:
> https://webrtc-codereview.appspot.com/38279004/
> Now we don't have to pass EncodedInfo as output parameter, but can return it instead. This also adds the benefit of making clear that EncodeInternal() needs to fill in this info.
>
> R=kwiberg@webrtc.org
>
> Review URL: https://webrtc-codereview.appspot.com/43839004
TBR=jmarusic@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/49449004
Cr-Commit-Position: refs/heads/master@{#8772}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8772 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-18 06:38:40 +00:00
0cb612b43b
We changed Encode() and EncodeInternal() return type from bool to void in this issue:
...
https://webrtc-codereview.appspot.com/38279004/
Now we don't have to pass EncodedInfo as output parameter, but can return it instead. This also adds the benefit of making clear that EncodeInternal() needs to fill in this info.
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/43839004
Cr-Commit-Position: refs/heads/master@{#8749}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8749 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-17 12:13:13 +00:00
51ccf37638
AudioEncoder: add method MaxEncodedBytes
...
Added method AudioEncoder::MaxEncodedBytes() and provided implementations in derived encoders. This method returns the number of bytes that can be produced by the encoder at each Encode() call.
Unit tests were updated to use the new method.
Buffer allocation was not changed in AudioCodingModuleImpl::Encode(). It will be done after additional investigation.
Other refactoring work that was done, that may not be obvious why:
1. Moved some code into AudioEncoderCng::EncodePassive() to make it more consistent with EncodeActive().
2. Changed the order of NumChannels() and RtpTimestampRateHz() declarations in AudioEncoderG722 and AudioEncoderCopyRed classes. It just bothered me that the order was not the same as in AudioEncoder class and its other derived classes.
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/40259005
Cr-Commit-Position: refs/heads/master@{#8671}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8671 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-10 15:42:21 +00:00
c86bbbaa93
Add speech flag to EncodedInfo
...
The flag indicates if the encoded bitstream is speech or comfort noise.
COAUTHOR=kwiberg@webrtc.org
R=jmarusic@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/42629004
Cr-Commit-Position: refs/heads/master@{#8598}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8598 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-04 16:03:19 +00:00
abbdd520b0
AudioEncoder: documentation fix
...
Follow-up to https://webrtc-codereview.appspot.com/38279004/
R=henrik.lundin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38309004
Cr-Commit-Position: refs/heads/master@{#8524}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8524 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-27 09:20:25 +00:00
b1f0de30be
AudioEncoder: change Encode and EncodeInternal return type to void
...
After code cleanup done on issues:
https://webrtc-codereview.appspot.com/34259004/
https://webrtc-codereview.appspot.com/43409004/
https://webrtc-codereview.appspot.com/34309004/
https://webrtc-codereview.appspot.com/34309004/
https://webrtc-codereview.appspot.com/36209004/
https://webrtc-codereview.appspot.com/40899004/
https://webrtc-codereview.appspot.com/39279004/
https://webrtc-codereview.appspot.com/42099005/
and the similar work done for AudioEncoderDecoderIsacT, methods AudioEncoder::Encode and AudioEncoder::EncodeInternal will always succeed. Therefore, there is no need for them to return bool value that represents success or failure.
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38279004
Cr-Commit-Position: refs/heads/master@{#8518}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8518 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-26 15:38:46 +00:00
0521127779
AudioEncoder: Rename virtual accessors to CamelCase
...
Although sample_rate_hz(), num_channels(), and rtp_timestamp_rate_hz()
are simple accessors for almost all implementations of AudioEncoder,
they are virtual and not guaranteed to be just simple accessors. Thus,
it makes more sense to use the normal CamelCase naming scheme.
BUG=4235
R=henrik.lundin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/34239004
Cr-Commit-Position: refs/heads/master@{#8407}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8407 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-18 12:01:13 +00:00
bb1219eca3
Add a unit test for callbacks with empty frames and fix bug in code
...
This change adds a couple of new tests that verify that callbacks
with frame type kFrameEmpty are sent in between comfort noise packets.
This used to be the case until r8268, and with the fix included in
this CL is once again so.
COAUTHOR=kwiberg@webrtc.org
R=minyue@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/37229004
Cr-Commit-Position: refs/heads/master@{#8353}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8353 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-12 15:53:55 +00:00
f45c8ca88b
Reland r8248 "Introduce ACMGenericCodecWrapper"
...
This effectively reverts r8249.
This new class inherits from ACMGenericCodec. The purpose is to wrap
AudioEncoder objects into an ACMGenericCodec interface. This is a
temporary construction that will be used during the ACM redesign work.
BUG=4228
COAUTHOR=kwiberg@webrtc.org
TBR=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38919004
Cr-Commit-Position: refs/heads/master@{#8255}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8255 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-05 18:30:16 +00:00
478cedc055
Add new methods to AudioEncoder interface
...
The following three methods are added:
rtp_timestamp_rate_hz()
SetTargetBitrate()
SetProjectedPacketLossRate()
Default implementations are provided, and a few overrides are
implemented. AudioEncoderCopyRed and AudioEncoderCng propagate the new
methods to the underlying speech codec.
BUG=3926
COAUTHOR:kwiberg@webrtc.org
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/34049004
Cr-Commit-Position: refs/heads/master@{#8171}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8171 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-27 18:25:40 +00:00
c1c9291e9b
Make an AudioEncoder subclass for RED
...
This class only supports the simple case of payload duplication. That
is, one single encoder is used, and the redundant payload is a one-step
delayed payload.
BUG=3926
R=kjellander@webrtc.org , kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31199004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7913 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-16 13:41:36 +00:00
3b79daff14
Moving encoded_bytes into EncodedInfo
...
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/35469004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7883 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-12 13:31:24 +00:00
8911bc52f1
Add AudioEncoder::Max10MsFramesInAPacket
...
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/29179004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7834 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-08 21:15:55 +00:00
8dc21dc238
Rename internal AudioEncoder::Encode method to EncodeInternal
...
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/28129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7801 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-03 20:36:03 +00:00
7f1dfa5b61
Adding a payload type to AudioEncoder objects
...
The type is set in the Config struct and is provided in the EncodedInfo
output struct from each Encode() call. The audio_decoder_unittest is
updated to verify correct propagation of the payload type.
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/27299004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7780 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-02 12:08:39 +00:00
1db20a4180
Adding EncodedInfo struct to AudioEncoder::Encode
...
This struct will be expanded in future changes.
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31049004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7771 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-01 14:44:50 +00:00
decd9306ae
AudioEncoder: num_10ms_frames_per_packet -> Num10MsFramesInNextPacket
...
Rename this accessor function to reflect its new, slightly changed
meaning. The reason for the change is that some codecs (iSAC) vary the
number of 10 ms frames from packet to packet, and so can't return a
truly constant value.
BUG=3926
R=henrik.lundin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31849004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7556 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-29 08:38:50 +00:00
663fdd02fd
Make an AudioEncoder subclass for Opus
...
BUG=3926
R=henrik.lundin@webrtc.org , kjellander@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/23239004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7552 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-29 07:28:36 +00:00
def1e97ed2
Implement AudioEncoderPcmU/A classes and convert AudioDecoder tests
...
BUG=3926
R=kjellander@webrtc.org , kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/29799004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7481 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-21 12:48:29 +00:00
264e66f7a5
Add encoded_timestamp to AudioEncoder base class
...
BUG=3926
TBR=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/24029004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7464 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-16 21:16:07 +00:00
9ea6f8a84d
New interface class AudioEncoder
...
This class will be the base for new C++ wrapper classes for all
encoders.
BUG=3926
TBR=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/23999004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7463 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-16 11:26:24 +00:00