(Auto)update libjingle 63738002-> 63773382
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5787 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
440fa23553
commit
dce3feb0b0
@ -77,6 +77,14 @@ const char MediaConstraintsInterface::kCpuUnderuseThreshold[] =
|
||||
const char MediaConstraintsInterface::kCpuOveruseThreshold[] =
|
||||
"googCpuOveruseThreshold";
|
||||
|
||||
// Google-specific PeerConnection constraint keys.
|
||||
const char MediaConstraintsInterface::kImprovedWifiBwe[] =
|
||||
"googImprovedWifiBwe";
|
||||
const char MediaConstraintsInterface::kScreencastMinBitrate[] =
|
||||
"googScreencastMinBitrate";
|
||||
const char MediaConstraintsInterface::kSkipEncodingUnusedStreams[] =
|
||||
"googSkipEncodingUnusedStreams";
|
||||
|
||||
// Constraint keys for CreateOffer / CreateAnswer defined in W3C specification.
|
||||
const char MediaConstraintsInterface::kOfferToReceiveAudio[] =
|
||||
"OfferToReceiveAudio";
|
||||
|
@ -87,12 +87,19 @@ class MediaConstraintsInterface {
|
||||
// Google-specific constraint keys for a local video source
|
||||
static const char kNoiseReduction[]; // googNoiseReduction
|
||||
static const char kLeakyBucket[]; // googLeakyBucket
|
||||
|
||||
// googTemporalLayeredScreencast
|
||||
static const char kTemporalLayeredScreencast[];
|
||||
static const char kCpuOveruseDetection[];
|
||||
static const char kCpuUnderuseThreshold[];
|
||||
static const char kCpuOveruseThreshold[];
|
||||
|
||||
// Google-specific PeerConnection constraint keys.
|
||||
static const char kImprovedWifiBwe[]; // googImprovedWifiBwe
|
||||
static const char kScreencastMinBitrate[]; // googScreencastMinBitrate
|
||||
static const char kSkipEncodingUnusedStreams[];
|
||||
// googSkipEncodingUnusedStreams
|
||||
|
||||
// Constraint keys for CreateOffer / CreateAnswer
|
||||
// Specified by the W3C PeerConnection spec
|
||||
static const char kOfferToReceiveVideo[]; // OfferToReceiveVideo
|
||||
|
@ -517,6 +517,34 @@ bool WebRtcSession::Initialize(
|
||||
video_options_.suspend_below_min_bitrate.Set(value);
|
||||
}
|
||||
|
||||
if (FindConstraint(
|
||||
constraints,
|
||||
MediaConstraintsInterface::kSkipEncodingUnusedStreams,
|
||||
&value,
|
||||
NULL)) {
|
||||
video_options_.skip_encoding_unused_streams.Set(value);
|
||||
}
|
||||
|
||||
std::string string_value;
|
||||
if (constraints &&
|
||||
constraints->GetOptional().FindFirst(
|
||||
MediaConstraintsInterface::kScreencastMinBitrate,
|
||||
&string_value)) {
|
||||
int bitrate;
|
||||
if (talk_base::FromString(string_value, &bitrate)) {
|
||||
video_options_.screencast_min_bitrate.Set(bitrate);
|
||||
}
|
||||
}
|
||||
|
||||
// Find improved wifi bwe constraint.
|
||||
if (FindConstraint(
|
||||
constraints,
|
||||
MediaConstraintsInterface::kImprovedWifiBwe,
|
||||
&value,
|
||||
NULL)) {
|
||||
video_options_.use_improved_wifi_bandwidth_estimator.Set(value);
|
||||
}
|
||||
|
||||
const cricket::VideoCodec default_codec(
|
||||
JsepSessionDescription::kDefaultVideoCodecId,
|
||||
JsepSessionDescription::kDefaultVideoCodecName,
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* libjingle
|
||||
* Copyright 2013, Google Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class RTCVideoTrack;
|
||||
|
||||
// This class encapsulates VideoRenderIosView.
|
||||
@interface APPRTCVideoView : UIView
|
||||
|
||||
// Property to get/set required video orientation.
|
||||
@property(nonatomic, assign) UIInterfaceOrientation videoOrientation;
|
||||
// Specifies whether the object represents a local or remote video stream.
|
||||
@property(nonatomic, assign) BOOL isRemote;
|
||||
|
||||
// Sets up the underlying renderer and track objects.
|
||||
- (void)renderVideoTrackInterface:(RTCVideoTrack*)track;
|
||||
|
||||
@end
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
* libjingle
|
||||
* Copyright 2013, Google Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This APPRTCVideoView must be initialzed and added to a View to get
|
||||
* either the local or remote video stream rendered.
|
||||
* It is a view itself and it encapsulates
|
||||
* an object of VideoRenderIosView and UIActivityIndicatorView.
|
||||
* Both of the views will get resized as per the frame of their parent.
|
||||
*/
|
||||
|
||||
#import "APPRTCVideoView.h"
|
||||
|
||||
#import "RTCVideoRenderer.h"
|
||||
#import "RTCVideoTrack.h"
|
||||
|
||||
@interface APPRTCVideoView () {
|
||||
RTCVideoTrack* _track;
|
||||
RTCVideoRenderer* _renderer;
|
||||
}
|
||||
|
||||
@property(nonatomic, weak) UIView* renderView;
|
||||
@property(nonatomic, weak) UIActivityIndicatorView* activityView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation APPRTCVideoView
|
||||
|
||||
@synthesize videoOrientation = _videoOrientation;
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
if (!_renderer) {
|
||||
// Left-right (mirror) flip the remote view.
|
||||
CGAffineTransform xform =
|
||||
CGAffineTransformMakeScale(self.isRemote ? -1 : 1, 1);
|
||||
// TODO(fischman): why is this rotate (vertical+horizontal flip) needed?!?
|
||||
xform = CGAffineTransformRotate(xform, M_PI);
|
||||
// TODO(fischman): ensure back-camera flip is correct in all orientations,
|
||||
// when back-camera support is added.
|
||||
[self setTransform:xform];
|
||||
_renderer = [[RTCVideoRenderer alloc] initWithView:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)renderVideoTrackInterface:(RTCVideoTrack*)videoTrack {
|
||||
[_track removeRenderer:_renderer];
|
||||
[_renderer stop];
|
||||
|
||||
_track = videoTrack;
|
||||
|
||||
if (_track) {
|
||||
[_track addRenderer:_renderer];
|
||||
[_renderer start];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@ -329,6 +329,10 @@ struct VideoOptions {
|
||||
suspend_below_min_bitrate.SetFrom(change.suspend_below_min_bitrate);
|
||||
unsignalled_recv_stream_limit.SetFrom(change.unsignalled_recv_stream_limit);
|
||||
use_simulcast_adapter.SetFrom(change.use_simulcast_adapter);
|
||||
skip_encoding_unused_streams.SetFrom(change.skip_encoding_unused_streams);
|
||||
screencast_min_bitrate.SetFrom(change.screencast_min_bitrate);
|
||||
use_improved_wifi_bandwidth_estimator.SetFrom(
|
||||
change.use_improved_wifi_bandwidth_estimator);
|
||||
}
|
||||
|
||||
bool operator==(const VideoOptions& o) const {
|
||||
@ -359,7 +363,11 @@ struct VideoOptions {
|
||||
dscp == o.dscp &&
|
||||
suspend_below_min_bitrate == o.suspend_below_min_bitrate &&
|
||||
unsignalled_recv_stream_limit == o.unsignalled_recv_stream_limit &&
|
||||
use_simulcast_adapter == o.use_simulcast_adapter;
|
||||
use_simulcast_adapter == o.use_simulcast_adapter &&
|
||||
skip_encoding_unused_streams == o.skip_encoding_unused_streams &&
|
||||
screencast_min_bitrate == o.screencast_min_bitrate;
|
||||
use_improved_wifi_bandwidth_estimator ==
|
||||
o.use_improved_wifi_bandwidth_estimator;
|
||||
}
|
||||
|
||||
std::string ToString() const {
|
||||
@ -395,6 +403,11 @@ struct VideoOptions {
|
||||
ost << ToStringIfSet("num channels for early receive",
|
||||
unsignalled_recv_stream_limit);
|
||||
ost << ToStringIfSet("use simulcast adapter", use_simulcast_adapter);
|
||||
ost << ToStringIfSet("skip encoding unused streams",
|
||||
skip_encoding_unused_streams);
|
||||
ost << ToStringIfSet("screencast min bitrate", screencast_min_bitrate);
|
||||
ost << ToStringIfSet("improved wifi bwe",
|
||||
use_improved_wifi_bandwidth_estimator);
|
||||
ost << "}";
|
||||
return ost.str();
|
||||
}
|
||||
@ -454,6 +467,13 @@ struct VideoOptions {
|
||||
Settable<int> unsignalled_recv_stream_limit;
|
||||
// Enable use of simulcast adapter.
|
||||
Settable<bool> use_simulcast_adapter;
|
||||
// Enables the encoder to skip encoding stream not actually sent due to too
|
||||
// low available bit rate.
|
||||
Settable<bool> skip_encoding_unused_streams;
|
||||
// Force screencast to use a minimum bitrate
|
||||
Settable<int> screencast_min_bitrate;
|
||||
// Enable improved bandwidth estiamtor on wifi.
|
||||
Settable<bool> use_improved_wifi_bandwidth_estimator;
|
||||
};
|
||||
|
||||
// A class for playing out soundclips.
|
||||
|
@ -244,10 +244,6 @@ class FakeWebRtcVideoEncoderFactory : public WebRtcVideoEncoderFactory {
|
||||
(*it)->OnCodecsAvailable();
|
||||
}
|
||||
|
||||
int GetNumCreatedEncoders() {
|
||||
return num_created_encoders_;
|
||||
}
|
||||
|
||||
const std::vector<FakeWebRtcVideoEncoder*>& encoders() {
|
||||
return encoders_;
|
||||
}
|
||||
|
@ -2837,6 +2837,13 @@ bool WebRtcVideoMediaChannel::SetOptions(const VideoOptions &options) {
|
||||
conference_mode_turned_off = true;
|
||||
}
|
||||
|
||||
#ifdef USE_WEBRTC_DEV_BRANCH
|
||||
bool improved_wifi_bwe_changed =
|
||||
options.use_improved_wifi_bandwidth_estimator.IsSet() &&
|
||||
options_.use_improved_wifi_bandwidth_estimator !=
|
||||
options.use_improved_wifi_bandwidth_estimator;
|
||||
|
||||
#endif
|
||||
|
||||
// Save the options, to be interpreted where appropriate.
|
||||
// Use options_.SetAll() instead of assignment so that unset value in options
|
||||
@ -2961,6 +2968,19 @@ bool WebRtcVideoMediaChannel::SetOptions(const VideoOptions &options) {
|
||||
LOG(LS_WARNING) << "Cannot disable video suspension once it is enabled";
|
||||
}
|
||||
}
|
||||
#ifdef USE_WEBRTC_DEV_BRANCH
|
||||
if (improved_wifi_bwe_changed) {
|
||||
webrtc::Config config;
|
||||
config.Set(new webrtc::AimdRemoteRateControl(
|
||||
options_.use_improved_wifi_bandwidth_estimator
|
||||
.GetWithDefaultIfUnset(false)));
|
||||
for (SendChannelMap::iterator it = send_channels_.begin();
|
||||
it != send_channels_.end(); ++it) {
|
||||
engine()->vie()->network()->SetBandwidthEstimationConfig(
|
||||
it->second->channel_id(), config);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3753,6 +3773,11 @@ bool WebRtcVideoMediaChannel::MaybeResetVieSendCodec(
|
||||
// Disable denoising for screencasting.
|
||||
bool enable_denoising =
|
||||
options_.video_noise_reduction.GetWithDefaultIfUnset(false);
|
||||
#ifdef USE_WEBRTC_DEV_BRANCH
|
||||
int screencast_min_bitrate =
|
||||
options_.screencast_min_bitrate.GetWithDefaultIfUnset(0);
|
||||
bool leaky_bucket = options_.video_leaky_bucket.GetWithDefaultIfUnset(false);
|
||||
#endif
|
||||
bool denoising = !is_screencast && enable_denoising;
|
||||
bool reset_send_codec =
|
||||
target_width != cur_width || target_height != cur_height ||
|
||||
@ -3786,6 +3811,24 @@ bool WebRtcVideoMediaChannel::MaybeResetVieSendCodec(
|
||||
LOG_RTCERR1(SetSendCodec, channel_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef USE_WEBRTC_DEV_BRANCH
|
||||
if (is_screencast) {
|
||||
engine()->vie()->rtp()->SetMinTransmitBitrate(channel_id,
|
||||
screencast_min_bitrate);
|
||||
// If screencast and min bitrate set, force enable pacer.
|
||||
if (screencast_min_bitrate > 0) {
|
||||
engine()->vie()->rtp()->SetTransmissionSmoothingStatus(channel_id,
|
||||
true);
|
||||
}
|
||||
} else {
|
||||
// In case of switching from screencast to regular capture, set
|
||||
// min bitrate padding and pacer back to defaults.
|
||||
engine()->vie()->rtp()->SetMinTransmitBitrate(channel_id, 0);
|
||||
engine()->vie()->rtp()->SetTransmissionSmoothingStatus(channel_id,
|
||||
leaky_bucket);
|
||||
}
|
||||
#endif
|
||||
if (reset) {
|
||||
*reset = true;
|
||||
}
|
||||
|
@ -1662,11 +1662,9 @@ TEST_F(WebRtcVideoEngineTestFake, DontRegisterEncoderMultipleTimes) {
|
||||
|
||||
EXPECT_TRUE(vie_.ExternalEncoderRegistered(channel_num, 100));
|
||||
EXPECT_EQ(1, vie_.GetNumExternalEncoderRegistered(channel_num));
|
||||
EXPECT_EQ(1, encoder_factory_.GetNumCreatedEncoders());
|
||||
|
||||
EXPECT_TRUE(channel_->SetSendCodecs(codecs));
|
||||
EXPECT_EQ(1, vie_.GetNumExternalEncoderRegistered(channel_num));
|
||||
EXPECT_EQ(1, encoder_factory_.GetNumCreatedEncoders());
|
||||
|
||||
// Remove stream previously added to free the external encoder instance.
|
||||
EXPECT_TRUE(channel_->RemoveSendStream(kSsrc));
|
||||
@ -1798,7 +1796,6 @@ TEST_F(WebRtcVideoEngineTestFake, UpdateEncoderCodecsAfterSetFactory) {
|
||||
|
||||
EXPECT_TRUE(vie_.ExternalEncoderRegistered(channel_num, 100));
|
||||
EXPECT_EQ(1, vie_.GetNumExternalEncoderRegistered(channel_num));
|
||||
EXPECT_EQ(1, encoder_factory_.GetNumCreatedEncoders());
|
||||
|
||||
// Remove stream previously added to free the external encoder instance.
|
||||
EXPECT_TRUE(channel_->RemoveSendStream(kSsrc));
|
||||
|
Loading…
x
Reference in New Issue
Block a user