webrtc::VideoSource resolves the kMaxFrameRate constraint by capping the desired framerate to kMaxFrameRate. That framerate is then passed into cricket::VideoCapturer::GetBestCaptureFormat(). The default implementation will choose a format from the supported formats list. Instead, we should override this function in AndroidVideoCapturer to give VideoCapturerAndroid.java the opportunity to choose a suitable framerate range.
BUG=webrtc:4938
R=glaznev@webrtc.org
Review URL: https://codereview.webrtc.org/1308953004 .
Cr-Commit-Position: refs/heads/master@{#9805}
These asserts cover error cases that are also handled by the code
after the assert. Should not have both assert and error handling.
BUG=webrtc:4840
Review URL: https://codereview.webrtc.org/1321023002
Cr-Commit-Position: refs/heads/master@{#9804}
This is a bug that was introduced in
https://codereview.webrtc.org/1230503003, where the variable "int
temp_bufsize" was changed to a size_t. If the packet buffer was
flushed while inserting a packet, temp_bufsize became negative, which
was tested later in an if-statement. Now, with size_t instead, it
would just become very large, and the if-statement would never see a
negative value. The effect was that the packet size in samples could
be updated with a very large positive number, causing an overflow
which triggered rtc::checked_cast in
StatisticsCalculator::GetNetworkStatistics, line 220.
Also adding a test to reproduce the crash. Without the fix, the test
results in the above mentioned checked_cast to trigger. With the fix,
everything works fine.
BUG=chromium:525260
Review URL: https://codereview.webrtc.org/1307893004
Cr-Commit-Position: refs/heads/master@{#9802}
This was not implemented before. It returns the current total delay
(packet buffer and sync buffer) of NetEq. This is the same information
that was already available in
NetEqNetworkStatistics::current_buffer_size_ms, that can be obtained
through NetEq::NetworkStatistics(). But, since the current delay is a
key metric of NetEq, it is convenient to have it available in a
simpler way.
This is a re-landing of r9359,
https://webrtc-codereview.appspot.com/51149004, which was reverted in
r9360. The refactoring made in r9669 facilitated the relanding.
TBR=minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1313873003
Cr-Commit-Position: refs/heads/master@{#9801}
The Init() method was previously used to initialize and reset
decoders, and returned an error code. The new Reset() method is used
for reset only; the constructor is now responsible for fully
initializing the AudioDecoder.
Reset() doesn't return an error code; it turned out that none of the
functions it ended up calling could actually fail, so this CL removes
their error return codes as well.
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1319683002 .
Cr-Commit-Position: refs/heads/master@{#9798}
Why the replacements? Mainly two reasons:
1) RTCCertificate owns the identity and as long as things are referencing the identity there should be a scoped_refptr reference to the RTCCertificate. Handing out raw pointers is less memory safe.
2) With the latest RFC, an RTCCertificate should be sufficient for specifying a crypto cert and the code should be updated to use RTCCertificate instead of SSLIdentity directly.
This replace work is split up into multiple CLs. In this CL...
- WebRtcSessionDescriptionFactory is updated to use RTCCertificate over SSLIdentity.
- WebRtcSessionDescriptionFactory::SignalCertificateReady is connected to WebRtcSession::OnCertificateReady and WebRtcSession is updated to use RTCCertificate.
- The cricket::Transport and related classes are updated to use RTCCertificate. These are called from WebRtcSession::OnCertificateReady.
BUG=webrtc:4927
R=tommi@webrtc.org, torbjorng@webrtc.org
Review URL: https://codereview.webrtc.org/1312643004 .
Cr-Commit-Position: refs/heads/master@{#9794}
There are 2 ways to design this.
1. TCP Only mode: this means that we disable all UDP protocols across board.
2. disallow TURN over UDP. Along with DISABLE_UDP, DISABLE_STUN, we should achieve the same result.
I'm going with #2.
BUG=webrtc:4784
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1311153003 .
Cr-Commit-Position: refs/heads/master@{#9791}
The Buffer is saved between calls, so after the initial allocation
it'll already be allocated and of the right size. The stack-allocated
array had the advantage of requiring no heap allocation at all, but
for most popular encoders it ended up allocating about 15 kB too much,
and now that we allow user-defined encoders there was also the
(remote) possibility that the buffer would actually be too small.
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1303413003 .
Cr-Commit-Position: refs/heads/master@{#9789}
VideoFrameBuffer currently has two overloaded data() functions for pixel access, one for const and one for non-const. Unfortunately, it will default to the non-const version, even when 'const scoped_refptr<VideoFrameBuffer>&' is used. This is a problem, because many subclasses use RTC_NOTREACHED() in the non-const version.
This CL makes the non-const version of data() explicit with a different, longer function name MutableData().
R=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1304143003 .
Cr-Commit-Position: refs/heads/master@{#9787}
- Pull out part of WebRtcVoiceMediaChannel::SetRecvCodecs() into WebRtcVoiceMediaChannel::SetRecvCodecsInternal().
BUG=webrtc:4690
R=pbos@webrtc.org
Review URL: https://codereview.webrtc.org/1291343002 .
Cr-Commit-Position: refs/heads/master@{#9785}
The primary fix in this CL is to remove the dangling |thread_| pointer in AndroidVideoCapturerJni. That thread is not safe to use after Stop() has been called. Even after Stop() has been called, we must still be able to return late frames to Java in order to not leak them, so that path has been made thread safe instead. To make sure that we always return frames, the Java frame should be wrapped in a scoped_refptr as quickly as possible, so this CL moves the wrapping from AndroidVideoCapturer to AndroidVideoCapturerJni. This also removes the need for the interface function AndroidVideoCapturerDelegate::ReturnBuffer().
Some other minor changes are:
* Remove |valid_global_refs_| and all logic related to that. Now that rtc::Bind() captures method objects as scoped_refptr, the destructor of AndroidVideoCapturerJni will not be called before all frames are returned.
* Remove global ref |j_frame_observer_|. No need for this, we don’t call it and it is kept alive with standard Java memory management.
* Add helper function ShallowCenterCrop() for VideoFrameBuffers. This functionality already exists in the constructor of WrappedI420Buffer, but it’s more convenient to have it as a separate function.
BUG=webrtc:4742,webrtc:4909
R=glaznev@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1307973002 .
Cr-Commit-Position: refs/heads/master@{#9784}
Since the TCPConnection has never been connected, they are not scheduled for ping hence will never be detected.
Also fix the case when reconnect fails, as it has become READABLE before, it also will not be deleted.
BUG=webrtc:4936
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1307083002 .
Cr-Commit-Position: refs/heads/master@{#9782}
With this change, the aggregates for packet waiting times are
calculated in NetEq's StatisticsCalculator insead of in
AcmReceiver. This simplifies things somewhat, and avoids having to
copy the raw data on polling.
R=ivoc@webrtc.org, minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1296633002 .
Cr-Commit-Position: refs/heads/master@{#9778}
By converting three raw pointers to scoped_ptrs, we can eliminate the
need for a manually-defined destructor, and generally sleep better at
night.
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1310213003 .
Cr-Commit-Position: refs/heads/master@{#9776}
This CL allows you to, having generated one or more RTCCertificates, supply them to RTCConfiguration for CreatePeerConnection use. This means an SSLIdentity does not have to be generated with a DtlsIdentityStore[Interface/Impl] as part of the CreatePeerConnection steps because the certificate contains all the necessary information.
To create an RTCCertificate you have to do the identity generation yourself though. But you could reuse the same RTCCertificate for multiple connections.
BUG=webrtc:4927
R=tommi@webrtc.org, torbjorng@webrtc.org
Review URL: https://codereview.webrtc.org/1288033009 .
Cr-Commit-Position: refs/heads/master@{#9774}
During the reconnection phase, EWOULDBLOCK has been returned to upper layer which stops the sending of video stream.
BUG=webrtc:4930
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1288553010 .
Cr-Commit-Position: refs/heads/master@{#9767}
The only shared state is now the bandwidth estimation info.
This reduces the amount and complexity of the locking
substantially.
Review URL: https://codereview.webrtc.org/1208993010
Cr-Commit-Position: refs/heads/master@{#9762}
AudioDeviceTemplate doesn't initialize `output_` and `input_` if the
initialization of `audio_manager_` succeeds. Similarly, it doesn't
terminate `input_` and `audio_manager_` if the termination of `output_`
succeeds. This CL fixes this.
BUG=
Review URL: https://codereview.webrtc.org/1296693003
Cr-Commit-Position: refs/heads/master@{#9760}