Peer connection may generate answer and ICE candidates before
websocket client is registered. Remove check from sendAnswer()
and sendLocalIceCandidate() functions and allow websocket client
to accumulate messages and send them later once it will be
registered.
R=wzh@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/44379004
Cr-Commit-Position: refs/heads/master@{#8508}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8508 4adac7df-926f-26a2-2b94-8c16560cd09d
Add some const safety by DCHECK(HasOneRef()) in non-const GetYPlane. This CL also replaces all incorrect non-const calls with const calls for pixel data access in cricket::VideoFrame. It's easy to call the non-const version of e.g. GetYPlane by mistake, even if only const-access is needed. For example:
const scoped_ptr<cricket::VideoFrame> foo;
const uint8_t* y = foo->GetYPlane();
will actually call the non-const version of GetYPlane.
R=mflodman@webrtc.org, perkj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/39079004
Cr-Commit-Position: refs/heads/master@{#8507}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8507 4adac7df-926f-26a2-2b94-8c16560cd09d
TestScaler::ComputeAvgSequencePSNR is currently a complex NOP, that always returns kPerfectPSNR. Two frames are read from files into arrays, and then converted into I420VideoFrames. However, the incorrect function ConvertFromI420 is used instead of ConvertToI420, resulting in two empty I420VideoFrames. I420PSNR on empty frames returns kPerfectPSNR.
This CL replaces ConvertFromI420 with ConvertToI420 and actually measures the PSNR. Unfortunately, some tests do not pass when we use the real psnr. The tests that fail are the ones that scale back and forth to a different aspect ratio. webrtc::Scaler has been changed to preserve aspect ratio, and this means that we will end up with a cropped frame if scale and rescale to a different target aspect ratio. I simply removed those tests to make it pass. Having some working tests instead of a lot of dummy tests seems like a win.
R=stefan@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/35339004
Cr-Commit-Position: refs/heads/master@{#8506}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8506 4adac7df-926f-26a2-2b94-8c16560cd09d
Call to AudioEncoder::Encode fails only if fed bad input, so instead of handling failure, we can just CHECK.
There is also no need to handle case where size of encoded data is larger than allowed maximum, so we just CHECK.
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/42099005
Cr-Commit-Position: refs/heads/master@{#8504}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8504 4adac7df-926f-26a2-2b94-8c16560cd09d
It looks like it is being used single threadedly, except that in some cases it is created and/or destroyed in threads other than the one running its operations. As such, CaptureManager() contains 'thread_checker_.DetachFromThread()' and ~CaptureManager() does not have a DCHECK.
BUG=
R=perkj@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/36279004
Cr-Commit-Position: refs/heads/master@{#8498}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8498 4adac7df-926f-26a2-2b94-8c16560cd09d
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
With this cl, video buffers are now allocated using direct buffers.
These buffers are guaranteed to live as long as the capturer is running.
We can now post frames in c++ from the Java thread to the c++ worker thread and let c++ post the buffers back when it has finished
processing them.
This cl also reverts back to make Stop asynchronouse so that it is guaranteed that the c++ worker thread is not used and no frames are delivered to VideoCapturerAndroid after Stop completes.
BUG=4318
TESTED= On a N5, N6, N9 and Samsung device.
R=glaznev@webrtc.org, magjed@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/43369004
Cr-Commit-Position: refs/heads/master@{#8493}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8493 4adac7df-926f-26a2-2b94-8c16560cd09d
Without this patch, Valgrind's Memcheck was complaining that the test
for whether we should return -1 following the call to
WebRtcIsac_DecodeLb made a conditional branch or move based on the
value of numSamplesLB, which was uninitialized if WebRtcIsac_DecodeLb
failed.
However, as can be seen in the source, the control flow only depends
on the value of numSamplesLB if numDecodedBytesLB >= 0; i.e., if
WebRtcIsac_DecodeLb returned successfully, in which case numSamplesLB
is always initialized. The discrepancy is due to the fact that
Valgrind works on the generated machine code, which contains spurious
such dependencies. The generated code for this test:
if ((numDecodedBytesLB < 0) || (numDecodedBytesLB > lenEncodedLBBytes) ||
(numSamplesLB > MAX_FRAMESAMPLES)) {
looks like this:
95: 0f bf 45 d6 movswl -0x2a(%rbp),%eax
99: 3d c0 03 00 00 cmp $0x3c0,%eax
9e: 0f 8f 45 01 00 00 jg 1e9 <Decode+0x1e9>
a4: 44 89 f0 mov %r14d,%eax
a7: c1 e0 10 shl $0x10,%eax
aa: 0f 88 39 01 00 00 js 1e9 <Decode+0x1e9>
b0: 41 0f bf ce movswl %r14w,%ecx
b4: 89 8d 98 e1 ff ff mov %ecx,-0x1e68(%rbp)
ba: 41 0f bf c7 movswl %r15w,%eax
be: 39 c1 cmp %eax,%ecx
c0: 0f 8f 23 01 00 00 jg 1e9 <Decode+0x1e9>
Note how the compiler has seemingly ignored the C language's guarantee
that the arguments to || must be evaluated in left-to-right order, and
compares numSamplesLB (%eax) with MAX_FRAMESAMPLES (0x3c0, a.k.a. 960)
before the other two conditions! If the uninitialized value in
numSamplesLB happens to be greater than 960, we'll jump to
Decode+0x1e9 (where we'll return -1) without even looking at the other
two conditions. Has the compiler generated broken code?
Well, no. If numDecodedBytesLB is < 0 so that numSamplesLB is
uninitialized, we'll end up jumping to 1e9 whether that value is
greater than 960 or not; we'll just do it with different jump
instructions. This is entirely invisible as far as the C language is
concerned, but the dependency on the uninitialized value is visible at
the machine code level, which is why Memcheck complains.
This patch solves the problem by pragmatically initializing
numSamplesLB before the call even though it isn't necessary other than
for placating Memcheck.
BUG=4143
R=henrik.lundin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/36309004
Cr-Commit-Position: refs/heads/master@{#8492}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8492 4adac7df-926f-26a2-2b94-8c16560cd09d
- Qualcomm H.264 HW decoder on KK and older requires
a few video frames before it can generate output. Increase
maximum allowed pending frames for H.264 decoder to 30.
Plus changes in the logging to track decoder buffers
timestamps.
R=wzh@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/36319004
Cr-Commit-Position: refs/heads/master@{#8490}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8490 4adac7df-926f-26a2-2b94-8c16560cd09d
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
Calls to WebRtcCng_Encode, AudioEncoder::Encode and Vad::VoiceActivity fail only if fed bad input, so instead of handling failure, we can just CHECK. This also makes it unnecessary for methods AudioEncoderCng::EncodePassive and AudioEncoderCng::EncodeActive to return a value, so we can make them void.
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/39279004
Cr-Commit-Position: refs/heads/master@{#8475}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8475 4adac7df-926f-26a2-2b94-8c16560cd09d
- Add a setting option to disable outgoing video in a call.
- Add an option to select audio codec.
- Add an option to specify audio bitrate for Opus codec.
- Plus add an option to select H.264 as default video codec.
R=wzh@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/42449004
Cr-Commit-Position: refs/heads/master@{#8468}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8468 4adac7df-926f-26a2-2b94-8c16560cd09d
* Move constants into the files/functions that use them
* Declare variables in the narrowest scope possible
* Use correct (expected, actual) order for gtest macros
* Remove unused functions
* Untabify
* 80-column limit
* Avoid C-style casts
* Prefer true typed constants to "enum hack" constants
* Print size_t using the right format macro
* Shorten and simplify code
* Other random cleanup bits and style fixes
BUG=none
TEST=none
R=henrik.lundin@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/36179004
Cr-Commit-Position: refs/heads/master@{#8467}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8467 4adac7df-926f-26a2-2b94-8c16560cd09d
- Allow to configure MediaCodec Java wrapper to use VP8
and H.264 codec.
- Save H.264 config frames with SPS and PPS NALUs and append them to every key frame.
- Correctly handle the case when one encoded frame may generate several output NALUs.
- Add code to find H.264 start codes.
- Add a flag (non configurable yet) to use H.264 in AppRTCDemo.
- Improve MediaCodec logging.
R=wzh@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/43379004
Cr-Commit-Position: refs/heads/master@{#8465}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8465 4adac7df-926f-26a2-2b94-8c16560cd09d
ACMGenericCodecWrapper was the only remaining subclass of
ACMGenericCodec, and was the only class that was ever instantiated.
This CL merges the two, essentially keeping the function implementations
from ACMGenericCodecWrapper except where the base class's code was
invoked.
As it turns out, a lot of functions were never used, but in some cases
they were refernced in AudioCodingModuleImpl. In these cases, the
referencing code is commented out and marked FATAL(). This will be
further cleaned up in follow-up CLs.
BUG=4228
COAUTHOR=kwiberg@webrtc.orgR=minyue@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38209004
Cr-Commit-Position: refs/heads/master@{#8463}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8463 4adac7df-926f-26a2-2b94-8c16560cd09d