2014-05-13 11:07:01 +00:00
|
|
|
/*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
|
2014-05-13 11:07:01 +00:00
|
|
|
*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2014-05-13 11:07:01 +00:00
|
|
|
*/
|
|
|
|
|
|
2015-01-05 18:51:13 +00:00
|
|
|
#include <algorithm>
|
2014-05-13 11:07:01 +00:00
|
|
|
#include <map>
|
2016-02-26 03:00:35 -08:00
|
|
|
#include <memory>
|
2017-10-31 09:53:08 -07:00
|
|
|
#include <utility>
|
2014-06-10 08:53:05 +00:00
|
|
|
#include <vector>
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2017-12-22 09:36:42 -08:00
|
|
|
#include "api/rtpparameters.h"
|
2017-10-30 23:10:12 -07:00
|
|
|
#include "api/test/mock_video_decoder_factory.h"
|
|
|
|
|
#include "api/test/mock_video_encoder_factory.h"
|
2018-05-14 09:48:06 +02:00
|
|
|
#include "api/video_codecs/builtin_video_decoder_factory.h"
|
|
|
|
|
#include "api/video_codecs/builtin_video_encoder_factory.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/video_codecs/sdp_video_format.h"
|
|
|
|
|
#include "api/video_codecs/video_decoder_factory.h"
|
|
|
|
|
#include "api/video_codecs/video_encoder.h"
|
|
|
|
|
#include "api/video_codecs/video_encoder_factory.h"
|
|
|
|
|
#include "call/flexfec_receive_stream.h"
|
|
|
|
|
#include "common_video/h264/profile_level_id.h"
|
|
|
|
|
#include "logging/rtc_event_log/rtc_event_log.h"
|
2018-04-11 15:18:34 +02:00
|
|
|
#include "media/base/fakenetworkinterface.h"
|
|
|
|
|
#include "media/base/fakevideocapturer.h"
|
|
|
|
|
#include "media/base/fakevideorenderer.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "media/base/mediaconstants.h"
|
|
|
|
|
#include "media/base/rtputils.h"
|
|
|
|
|
#include "media/base/testutils.h"
|
|
|
|
|
#include "media/engine/constants.h"
|
|
|
|
|
#include "media/engine/fakewebrtccall.h"
|
|
|
|
|
#include "media/engine/fakewebrtcvideoengine.h"
|
|
|
|
|
#include "media/engine/simulcast.h"
|
|
|
|
|
#include "media/engine/webrtcvideoengine.h"
|
|
|
|
|
#include "media/engine/webrtcvoiceengine.h"
|
|
|
|
|
#include "rtc_base/arraysize.h"
|
|
|
|
|
#include "rtc_base/gunit.h"
|
2018-05-30 15:31:29 +02:00
|
|
|
#include "rtc_base/numerics/safe_conversions.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/stringutils.h"
|
|
|
|
|
#include "test/field_trial.h"
|
|
|
|
|
#include "test/gmock.h"
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
using cricket::FakeVideoCapturerWithTaskQueue;
|
2018-02-21 13:07:13 +01:00
|
|
|
using webrtc::BitrateConstraints;
|
2016-05-26 11:24:55 -07:00
|
|
|
using webrtc::RtpExtension;
|
2018-02-21 13:07:13 +01:00
|
|
|
using testing::Field;
|
2016-05-26 11:24:55 -07:00
|
|
|
|
2014-05-13 11:07:01 +00:00
|
|
|
namespace {
|
2014-12-10 09:01:18 +00:00
|
|
|
static const int kDefaultQpMax = 56;
|
|
|
|
|
|
2015-07-10 11:27:55 -07:00
|
|
|
static const uint8_t kRedRtxPayloadType = 125;
|
|
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
static const uint32_t kTimeout = 5000U;
|
|
|
|
|
static const uint32_t kDefaultReceiveSsrc = 0;
|
|
|
|
|
static const uint32_t kSsrc = 1234u;
|
|
|
|
|
static const uint32_t kSsrcs4[] = {1, 2, 3, 4};
|
|
|
|
|
static const int kVideoWidth = 640;
|
|
|
|
|
static const int kVideoHeight = 360;
|
|
|
|
|
static const int kFramerate = 30;
|
|
|
|
|
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
static const uint32_t kSsrcs1[] = {1};
|
|
|
|
|
static const uint32_t kSsrcs3[] = {1, 2, 3};
|
|
|
|
|
static const uint32_t kRtxSsrcs1[] = {4};
|
2016-11-22 02:16:47 -08:00
|
|
|
static const uint32_t kFlexfecSsrc = 5;
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
static const uint32_t kIncomingUnsignalledSsrc = 0xC0FFEE;
|
2017-02-17 15:46:43 -08:00
|
|
|
static const uint32_t kDefaultRecvSsrc = 0;
|
|
|
|
|
|
2014-07-20 15:27:35 +00:00
|
|
|
static const char kUnsupportedExtensionName[] =
|
|
|
|
|
"urn:ietf:params:rtp-hdrext:unsupported";
|
2014-06-13 12:27:38 +00:00
|
|
|
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoCodec RemoveFeedbackParams(cricket::VideoCodec&& codec) {
|
|
|
|
|
codec.feedback_params = cricket::FeedbackParams();
|
2018-04-25 23:58:26 +02:00
|
|
|
return std::move(codec);
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
}
|
|
|
|
|
|
2014-06-13 12:27:38 +00:00
|
|
|
void VerifyCodecHasDefaultFeedbackParams(const cricket::VideoCodec& codec) {
|
|
|
|
|
EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
|
|
|
|
|
cricket::kRtcpFbParamNack, cricket::kParamValueEmpty)));
|
|
|
|
|
EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
|
|
|
|
|
cricket::kRtcpFbParamNack, cricket::kRtcpFbNackParamPli)));
|
|
|
|
|
EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
|
|
|
|
|
cricket::kRtcpFbParamRemb, cricket::kParamValueEmpty)));
|
2015-11-20 18:05:48 -08:00
|
|
|
EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
|
|
|
|
|
cricket::kRtcpFbParamTransportCc, cricket::kParamValueEmpty)));
|
2014-06-13 12:27:38 +00:00
|
|
|
EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
|
|
|
|
|
cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir)));
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-16 00:48:13 -08:00
|
|
|
// Return true if any codec in |codecs| is an RTX codec with associated payload
|
|
|
|
|
// type |payload_type|.
|
|
|
|
|
bool HasRtxCodec(const std::vector<cricket::VideoCodec>& codecs,
|
|
|
|
|
int payload_type) {
|
|
|
|
|
for (const cricket::VideoCodec& codec : codecs) {
|
|
|
|
|
int associated_payload_type;
|
|
|
|
|
if (cricket::CodecNamesEq(codec.name.c_str(), "rtx") &&
|
|
|
|
|
codec.GetParam(cricket::kCodecParamAssociatedPayloadType,
|
|
|
|
|
&associated_payload_type) &&
|
|
|
|
|
associated_payload_type == payload_type) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3007303002/ )
Reason for revert:
Identified a configuration problem in the video quality tests. Intend to fix and reland.
Original issue's description:
> Revert of Use RtxReceiveStream. (patchset #5 id:320001 of https://codereview.webrtc.org/3006063002/ )
>
> Reason for revert:
> This change appears to break ulpfec, with severe regressions, e.g., for webrtc_perf_test FullStackTest.ForemanCifPlr5Ulpfec
>
> Original issue's description:
> > Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3010983002/ )
> >
> > Reason for revert:
> > Intend to fix perf failures and reland.
> >
> > Original issue's description:
> > > Revert of Use RtxReceiveStream. (patchset #5 id:80001 of https://codereview.webrtc.org/3008773002/ )
> > >
> > > Reason for revert:
> > > A few perf tests broken, including
> > >
> > > RampUpTest.UpDownUpAbsSendTimeSimulcastRedRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberPacketLoss
> > >
> > >
> > > Original issue's description:
> > > > Use RtxReceiveStream.
> > > >
> > > > This also has the beneficial side-effect that when a media stream
> > > > which is protected by FlexFEC receives an RTX retransmission, the
> > > > retransmitted media packet is passed into the FlexFEC machinery,
> > > > which should improve its ability to recover packets via FEC.
> > > >
> > > > BUG=webrtc:7135
> > > >
> > > > Review-Url: https://codereview.webrtc.org/3008773002
> > > > Cr-Commit-Position: refs/heads/master@{#19649}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/5c0f6c62ea3b1d2c43f8fc152961af27033475f7
> > >
> > > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:7135
> > >
> > > Review-Url: https://codereview.webrtc.org/3010983002
> > > Cr-Commit-Position: refs/heads/master@{#19653}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/3c39c0137afa274d1d524b150b50304b38a2847b
> >
> > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > BUG=webrtc:7135
> >
> > Review-Url: https://codereview.webrtc.org/3006063002
> > Cr-Commit-Position: refs/heads/master@{#19715}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/35713eaf565c0fef07c8afc158d7b8fdf7ec3d78
>
> TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:7135
>
> Review-Url: https://codereview.webrtc.org/3007303002
> Cr-Commit-Position: refs/heads/master@{#19744}
> Committed: https://chromium.googlesource.com/external/webrtc/+/8e7eee035178a7f10e19883681b5eaa4a7523107
TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7135
Review-Url: https://codereview.webrtc.org/3012963002
Cr-Commit-Position: refs/heads/master@{#19765}
2017-09-11 02:32:16 -07:00
|
|
|
// TODO(nisse): Duplicated in call.cc.
|
|
|
|
|
const int* FindKeyByValue(const std::map<int, int>& m, int v) {
|
|
|
|
|
for (const auto& kv : m) {
|
|
|
|
|
if (kv.second == v)
|
|
|
|
|
return &kv.first;
|
|
|
|
|
}
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool HasRtxReceiveAssociation(const webrtc::VideoReceiveStream::Config& config,
|
|
|
|
|
int payload_type) {
|
|
|
|
|
return FindKeyByValue(config.rtp.rtx_associated_payload_types,
|
|
|
|
|
payload_type) != nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check that there's an Rtx payload type for each decoder.
|
|
|
|
|
bool VerifyRtxReceiveAssociations(
|
|
|
|
|
const webrtc::VideoReceiveStream::Config& config) {
|
|
|
|
|
for (const auto& decoder : config.decoders) {
|
|
|
|
|
if (!HasRtxReceiveAssociation(config, decoder.payload_type))
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-28 06:02:22 -08:00
|
|
|
rtc::scoped_refptr<webrtc::VideoFrameBuffer> CreateBlackFrameBuffer(
|
Reland of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #1 id:1 of https://codereview.webrtc.org/2354223002/ )
Reason for revert:
Downstream application now fixed.
Original issue's description:
> Revert of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #14 id:260001 of https://codereview.webrtc.org/2278883002/ )
>
> Reason for revert:
> Broke downstream application.
>
> Original issue's description:
> > Move MutableDataY{,U,V} methods to I420Buffer only.
> >
> > Deleted from the VideoFrameBuffer base class.
> >
> > BUG=webrtc:5921
> >
> > Committed: https://crrev.com/5539ef6c03c273f39fadae41ace47fdc11ac6d60
> > Cr-Commit-Position: refs/heads/master@{#14317}
>
> TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5921
>
> Committed: https://crrev.com/776870a2599b8f43ad56987f9031690e3ccecde8
> Cr-Commit-Position: refs/heads/master@{#14325}
TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5921
Review-Url: https://codereview.webrtc.org/2372483002
Cr-Commit-Position: refs/heads/master@{#14389}
2016-09-27 00:17:25 -07:00
|
|
|
int width,
|
|
|
|
|
int height) {
|
|
|
|
|
rtc::scoped_refptr<webrtc::I420Buffer> buffer =
|
|
|
|
|
webrtc::I420Buffer::Create(width, height);
|
2017-01-10 07:44:26 -08:00
|
|
|
webrtc::I420Buffer::SetBlack(buffer);
|
Reland of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #1 id:1 of https://codereview.webrtc.org/2354223002/ )
Reason for revert:
Downstream application now fixed.
Original issue's description:
> Revert of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #14 id:260001 of https://codereview.webrtc.org/2278883002/ )
>
> Reason for revert:
> Broke downstream application.
>
> Original issue's description:
> > Move MutableDataY{,U,V} methods to I420Buffer only.
> >
> > Deleted from the VideoFrameBuffer base class.
> >
> > BUG=webrtc:5921
> >
> > Committed: https://crrev.com/5539ef6c03c273f39fadae41ace47fdc11ac6d60
> > Cr-Commit-Position: refs/heads/master@{#14317}
>
> TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5921
>
> Committed: https://crrev.com/776870a2599b8f43ad56987f9031690e3ccecde8
> Cr-Commit-Position: refs/heads/master@{#14325}
TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5921
Review-Url: https://codereview.webrtc.org/2372483002
Cr-Commit-Position: refs/heads/master@{#14389}
2016-09-27 00:17:25 -07:00
|
|
|
return buffer;
|
2015-01-27 09:57:01 +00:00
|
|
|
}
|
|
|
|
|
|
2015-04-21 20:24:50 +08:00
|
|
|
void VerifySendStreamHasRtxTypes(const webrtc::VideoSendStream::Config& config,
|
|
|
|
|
const std::map<int, int>& rtx_types) {
|
|
|
|
|
std::map<int, int>::const_iterator it;
|
Reland "Reland "Move rtp-specific config out of EncoderSettings.""
This reverts commit 6c2c13af06b32778b86950681758a7970d1c5d9e.
Reason for revert: Intend to investigate and fix perf problems.
Original change's description:
> Revert "Reland "Move rtp-specific config out of EncoderSettings.""
>
> This reverts commit 04dd1768625eb2241d1fb97fd0137897e703e266.
>
> Reason for revert: Regression in ramp up perf tests.
>
> Original change's description:
> > Reland "Move rtp-specific config out of EncoderSettings."
> >
> > This is a reland of bc900cb1d1810fcf678fe41cf1e3966daa39c88c
> >
> > Original change's description:
> > > Move rtp-specific config out of EncoderSettings.
> > >
> > > In VideoSendStream::Config, move payload_name and payload_type from
> > > EncoderSettings to Rtp.
> > >
> > > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > > and should perhaps be renamed in a follow up cl. It's no longer
> > > passed as an argument to VideoCodecInitializer::SetupCodec.
> > >
> > > The latter then needs a different way to know the codec type,
> > > which is provided by a new codec_type member in VideoEncoderConfig.
> > >
> > > Bug: webrtc:8830
> > > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#22532}
> >
> > Bug: webrtc:8830
> > Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> > Reviewed-on: https://webrtc-review.googlesource.com/63721
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22595}
>
> TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
>
> Bug: webrtc:8830,chromium:827080
> Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
> Reviewed-on: https://webrtc-review.googlesource.com/65520
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22677}
TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: webrtc:8830, chromium:827080
Change-Id: I9b62987bf5daced90dfeb3ebb6739c80117c487f
Reviewed-on: https://webrtc-review.googlesource.com/66862
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22751}
2018-04-05 15:36:51 +02:00
|
|
|
it = rtx_types.find(config.rtp.payload_type);
|
2015-04-21 20:24:50 +08:00
|
|
|
EXPECT_TRUE(it != rtx_types.end() &&
|
|
|
|
|
it->second == config.rtp.rtx.payload_type);
|
|
|
|
|
|
2016-10-04 23:28:39 -07:00
|
|
|
if (config.rtp.ulpfec.red_rtx_payload_type != -1) {
|
|
|
|
|
it = rtx_types.find(config.rtp.ulpfec.red_payload_type);
|
2015-04-21 20:24:50 +08:00
|
|
|
EXPECT_TRUE(it != rtx_types.end() &&
|
2016-10-04 23:28:39 -07:00
|
|
|
it->second == config.rtp.ulpfec.red_rtx_payload_type);
|
2015-04-21 20:24:50 +08:00
|
|
|
}
|
|
|
|
|
}
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
|
|
|
|
|
cricket::MediaConfig GetMediaConfig() {
|
|
|
|
|
cricket::MediaConfig media_config;
|
2018-01-18 15:25:12 +01:00
|
|
|
media_config.video.enable_cpu_adaptation = false;
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
return media_config;
|
|
|
|
|
}
|
2017-08-25 04:44:25 -07:00
|
|
|
|
2014-05-13 11:07:01 +00:00
|
|
|
} // namespace
|
|
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
#define EXPECT_FRAME_WAIT(c, w, h, t) \
|
|
|
|
|
EXPECT_EQ_WAIT((c), renderer_.num_rendered_frames(), (t)); \
|
|
|
|
|
EXPECT_EQ((w), renderer_.width()); \
|
|
|
|
|
EXPECT_EQ((h), renderer_.height()); \
|
|
|
|
|
EXPECT_EQ(0, renderer_.errors());
|
|
|
|
|
|
|
|
|
|
#define EXPECT_FRAME_ON_RENDERER_WAIT(r, c, w, h, t) \
|
|
|
|
|
EXPECT_EQ_WAIT((c), (r).num_rendered_frames(), (t)); \
|
|
|
|
|
EXPECT_EQ((w), (r).width()); \
|
|
|
|
|
EXPECT_EQ((h), (r).height()); \
|
|
|
|
|
EXPECT_EQ(0, (r).errors());
|
|
|
|
|
|
2014-05-13 11:07:01 +00:00
|
|
|
namespace cricket {
|
2017-06-12 01:16:46 -07:00
|
|
|
class WebRtcVideoEngineTest : public ::testing::Test {
|
2014-05-13 11:07:01 +00:00
|
|
|
public:
|
2017-06-12 01:16:46 -07:00
|
|
|
WebRtcVideoEngineTest() : WebRtcVideoEngineTest("") {}
|
|
|
|
|
explicit WebRtcVideoEngineTest(const char* field_trials)
|
2015-10-15 07:26:07 -07:00
|
|
|
: override_field_trials_(field_trials),
|
2016-10-07 11:53:05 -07:00
|
|
|
call_(webrtc::Call::Create(webrtc::Call::Config(&event_log_))),
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_(new cricket::FakeWebRtcVideoEncoderFactory),
|
|
|
|
|
decoder_factory_(new cricket::FakeWebRtcVideoDecoderFactory),
|
2018-05-03 11:28:29 +02:00
|
|
|
engine_(std::unique_ptr<cricket::FakeWebRtcVideoEncoderFactory>(
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_),
|
2018-05-03 11:28:29 +02:00
|
|
|
std::unique_ptr<cricket::FakeWebRtcVideoDecoderFactory>(
|
2018-05-14 09:48:06 +02:00
|
|
|
decoder_factory_)) {}
|
2014-05-13 11:07:01 +00:00
|
|
|
|
|
|
|
|
protected:
|
2018-05-14 09:48:06 +02:00
|
|
|
void AssignDefaultAptRtxTypes();
|
|
|
|
|
void AssignDefaultCodec();
|
|
|
|
|
|
2017-11-18 12:08:55 +01:00
|
|
|
// Find the index of the codec in the engine with the given name. The codec
|
|
|
|
|
// must be present.
|
2017-12-21 13:32:23 +01:00
|
|
|
size_t GetEngineCodecIndex(const std::string& name) const;
|
2017-11-18 12:08:55 +01:00
|
|
|
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
// Find the codec in the engine with the given name. The codec must be
|
|
|
|
|
// present.
|
2017-11-18 12:08:55 +01:00
|
|
|
cricket::VideoCodec GetEngineCodec(const std::string& name) const;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
VideoMediaChannel* SetSendParamsWithAllSupportedCodecs();
|
2014-10-20 11:07:07 +00:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
VideoMediaChannel* SetRecvParamsWithSupportedCodecs(
|
2014-11-03 14:46:44 +00:00
|
|
|
const std::vector<VideoCodec>& codecs);
|
|
|
|
|
|
2016-02-05 11:13:28 +01:00
|
|
|
void TestExtendedEncoderOveruse(bool use_external_encoder);
|
|
|
|
|
|
2015-10-15 07:26:07 -07:00
|
|
|
webrtc::test::ScopedFieldTrials override_field_trials_;
|
2016-10-07 11:53:05 -07:00
|
|
|
webrtc::RtcEventLogNullImpl event_log_;
|
2017-06-12 01:16:46 -07:00
|
|
|
// Used in WebRtcVideoEngineVoiceTest, but defined here so it's properly
|
2015-03-02 13:30:15 +00:00
|
|
|
// initialized when the constructor is called.
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<webrtc::Call> call_;
|
2017-09-23 17:21:32 +02:00
|
|
|
cricket::FakeWebRtcVideoEncoderFactory* encoder_factory_;
|
|
|
|
|
cricket::FakeWebRtcVideoDecoderFactory* decoder_factory_;
|
2017-06-12 01:16:46 -07:00
|
|
|
WebRtcVideoEngine engine_;
|
2014-05-13 11:07:01 +00:00
|
|
|
VideoCodec default_codec_;
|
2015-04-21 20:24:50 +08:00
|
|
|
std::map<int, int> default_apt_rtx_types_;
|
2014-05-13 11:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, DefaultRtxCodecHasAssociatedPayloadTypeSet) {
|
2018-05-14 09:48:06 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
AssignDefaultCodec();
|
|
|
|
|
|
2014-06-13 11:47:28 +00:00
|
|
|
std::vector<VideoCodec> engine_codecs = engine_.codecs();
|
|
|
|
|
for (size_t i = 0; i < engine_codecs.size(); ++i) {
|
|
|
|
|
if (engine_codecs[i].name != kRtxCodecName)
|
|
|
|
|
continue;
|
|
|
|
|
int associated_payload_type;
|
|
|
|
|
EXPECT_TRUE(engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType,
|
2014-10-03 11:25:45 +00:00
|
|
|
&associated_payload_type));
|
2014-06-13 11:47:28 +00:00
|
|
|
EXPECT_EQ(default_codec_.id, associated_payload_type);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
FAIL() << "No RTX codec found among default codecs.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, SupportsTimestampOffsetHeaderExtension) {
|
2015-12-07 10:45:43 +01:00
|
|
|
RtpCapabilities capabilities = engine_.GetCapabilities();
|
|
|
|
|
ASSERT_FALSE(capabilities.header_extensions.empty());
|
2016-05-26 11:24:55 -07:00
|
|
|
for (const RtpExtension& extension : capabilities.header_extensions) {
|
|
|
|
|
if (extension.uri == RtpExtension::kTimestampOffsetUri) {
|
|
|
|
|
EXPECT_EQ(RtpExtension::kTimestampOffsetDefaultId, extension.id);
|
2014-06-16 17:32:02 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FAIL() << "Timestamp offset extension not in header-extension list.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, SupportsAbsoluteSenderTimeHeaderExtension) {
|
2015-12-07 10:45:43 +01:00
|
|
|
RtpCapabilities capabilities = engine_.GetCapabilities();
|
|
|
|
|
ASSERT_FALSE(capabilities.header_extensions.empty());
|
2016-05-26 11:24:55 -07:00
|
|
|
for (const RtpExtension& extension : capabilities.header_extensions) {
|
|
|
|
|
if (extension.uri == RtpExtension::kAbsSendTimeUri) {
|
|
|
|
|
EXPECT_EQ(RtpExtension::kAbsSendTimeDefaultId, extension.id);
|
2014-06-16 17:32:02 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FAIL() << "Absolute Sender Time extension not in header-extension list.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, SupportsTransportSequenceNumberHeaderExtension) {
|
2015-12-07 10:45:43 +01:00
|
|
|
RtpCapabilities capabilities = engine_.GetCapabilities();
|
|
|
|
|
ASSERT_FALSE(capabilities.header_extensions.empty());
|
2016-05-26 11:24:55 -07:00
|
|
|
for (const RtpExtension& extension : capabilities.header_extensions) {
|
|
|
|
|
if (extension.uri == RtpExtension::kTransportSequenceNumberUri) {
|
|
|
|
|
EXPECT_EQ(RtpExtension::kTransportSequenceNumberDefaultId, extension.id);
|
2015-10-15 07:26:07 -07:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FAIL() << "Transport sequence number extension not in header-extension list.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, SupportsVideoRotationHeaderExtension) {
|
2015-12-07 10:45:43 +01:00
|
|
|
RtpCapabilities capabilities = engine_.GetCapabilities();
|
|
|
|
|
ASSERT_FALSE(capabilities.header_extensions.empty());
|
2016-05-26 11:24:55 -07:00
|
|
|
for (const RtpExtension& extension : capabilities.header_extensions) {
|
|
|
|
|
if (extension.uri == RtpExtension::kVideoRotationUri) {
|
|
|
|
|
EXPECT_EQ(RtpExtension::kVideoRotationDefaultId, extension.id);
|
2015-04-01 15:33:06 -07:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FAIL() << "Video Rotation extension not in header-extension list.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeCapturer) {
|
2015-04-01 15:33:06 -07:00
|
|
|
// Allocate the capturer first to prevent early destruction before channel's
|
|
|
|
|
// dtor is called.
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2015-04-01 15:33:06 -07:00
|
|
|
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2015-04-01 15:33:06 -07:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
SetSendParamsWithAllSupportedCodecs());
|
2015-04-01 15:33:06 -07:00
|
|
|
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
|
|
|
|
|
// Add CVO extension.
|
|
|
|
|
const int id = 1;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kVideoRotationUri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2015-04-01 15:33:06 -07:00
|
|
|
|
|
|
|
|
// Set capturer.
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &capturer));
|
2015-04-01 15:33:06 -07:00
|
|
|
|
|
|
|
|
// Verify capturer has turned off applying rotation.
|
2016-05-25 08:47:01 -07:00
|
|
|
EXPECT_FALSE(capturer.apply_rotation());
|
2015-04-01 15:33:06 -07:00
|
|
|
|
|
|
|
|
// Verify removing header extension turns on applying rotation.
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.extensions.clear();
|
|
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2016-05-25 08:47:01 -07:00
|
|
|
EXPECT_TRUE(capturer.apply_rotation());
|
2015-04-01 15:33:06 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeAddSendStream) {
|
2016-03-02 05:34:00 -08:00
|
|
|
// Allocate the capturer first to prevent early destruction before channel's
|
|
|
|
|
// dtor is called.
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2016-03-02 05:34:00 -08:00
|
|
|
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2016-03-02 05:34:00 -08:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
SetSendParamsWithAllSupportedCodecs());
|
2016-03-02 05:34:00 -08:00
|
|
|
// Add CVO extension.
|
|
|
|
|
const int id = 1;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2016-03-02 05:34:00 -08:00
|
|
|
parameters.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kVideoRotationUri, id));
|
2016-03-02 05:34:00 -08:00
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
|
|
|
|
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
|
|
|
|
|
// Set capturer.
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &capturer));
|
2016-03-02 05:34:00 -08:00
|
|
|
|
|
|
|
|
// Verify capturer has turned off applying rotation.
|
2016-05-25 08:47:01 -07:00
|
|
|
EXPECT_FALSE(capturer.apply_rotation());
|
2016-03-02 05:34:00 -08:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionAfterCapturer) {
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2015-04-01 15:33:06 -07:00
|
|
|
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP9");
|
2015-04-01 15:33:06 -07:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
SetSendParamsWithAllSupportedCodecs());
|
2015-04-01 15:33:06 -07:00
|
|
|
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
|
|
|
|
|
// Set capturer.
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &capturer));
|
2015-04-01 15:33:06 -07:00
|
|
|
|
2016-03-20 07:34:29 -07:00
|
|
|
// Verify capturer has turned on applying rotation.
|
2016-05-25 08:47:01 -07:00
|
|
|
EXPECT_TRUE(capturer.apply_rotation());
|
2016-03-20 07:34:29 -07:00
|
|
|
|
2015-04-01 15:33:06 -07:00
|
|
|
// Add CVO extension.
|
|
|
|
|
const int id = 1;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kVideoRotationUri, id));
|
2016-03-20 07:34:29 -07:00
|
|
|
// Also remove the first codec to trigger a codec change as well.
|
|
|
|
|
parameters.codecs.erase(parameters.codecs.begin());
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2015-04-01 15:33:06 -07:00
|
|
|
|
|
|
|
|
// Verify capturer has turned off applying rotation.
|
2016-05-25 08:47:01 -07:00
|
|
|
EXPECT_FALSE(capturer.apply_rotation());
|
2015-04-01 15:33:06 -07:00
|
|
|
|
|
|
|
|
// Verify removing header extension turns on applying rotation.
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.extensions.clear();
|
|
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2016-05-25 08:47:01 -07:00
|
|
|
EXPECT_TRUE(capturer.apply_rotation());
|
2015-04-01 15:33:06 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, SetSendFailsBeforeSettingCodecs) {
|
2018-05-14 09:48:06 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions()));
|
2014-07-17 08:51:46 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
|
|
|
|
|
|
|
|
|
|
EXPECT_FALSE(channel->SetSend(true))
|
|
|
|
|
<< "Channel should not start without codecs.";
|
|
|
|
|
EXPECT_TRUE(channel->SetSend(false))
|
|
|
|
|
<< "Channel should be stoppable even without set codecs.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, GetStatsWithoutSendCodecsSetDoesNotCrash) {
|
2018-05-14 09:48:06 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions()));
|
2014-08-12 20:55:10 +00:00
|
|
|
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
|
|
|
|
|
VideoMediaInfo info;
|
|
|
|
|
channel->GetStats(&info);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
TEST_F(WebRtcVideoEngineTest, UseFactoryForVp8WhenSupported) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2014-10-14 04:25:33 +00:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
SetSendParamsWithAllSupportedCodecs());
|
2016-11-22 16:08:30 -08:00
|
|
|
channel->OnReadyToSend(true);
|
2014-10-14 04:25:33 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(0, encoder_factory_->GetNumCreatedEncoders());
|
2014-10-14 04:25:33 +00:00
|
|
|
EXPECT_TRUE(channel->SetSend(true));
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &capturer));
|
2014-10-14 04:25:33 +00:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2016-10-30 21:37:57 +01:00
|
|
|
// Sending one frame will have allocate the encoder.
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->WaitForCreatedVideoEncoders(1));
|
|
|
|
|
EXPECT_TRUE_WAIT(encoder_factory_->encoders()[0]->GetNumEncodedFrames() > 0,
|
2014-10-14 04:25:33 +00:00
|
|
|
kTimeout);
|
|
|
|
|
|
2017-09-23 17:21:32 +02:00
|
|
|
int num_created_encoders = encoder_factory_->GetNumCreatedEncoders();
|
2016-10-30 21:37:57 +01:00
|
|
|
EXPECT_EQ(num_created_encoders, 1);
|
2015-02-16 21:02:00 +00:00
|
|
|
|
|
|
|
|
// Setting codecs of the same type should not reallocate any encoders
|
|
|
|
|
// (expecting a no-op).
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(num_created_encoders, encoder_factory_->GetNumCreatedEncoders());
|
2014-10-14 04:25:33 +00:00
|
|
|
|
|
|
|
|
// Remove stream previously added to free the external encoder instance.
|
|
|
|
|
EXPECT_TRUE(channel->RemoveSendStream(kSsrc));
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(0u, encoder_factory_->encoders().size());
|
2014-10-14 04:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
// Test that when an encoder factory supports H264, we add an RTX
|
|
|
|
|
// codec for it.
|
|
|
|
|
// TODO(deadbeef): This test should be updated if/when we start
|
|
|
|
|
// adding RTX codecs for unrecognized codec names.
|
|
|
|
|
TEST_F(WebRtcVideoEngineTest, RtxCodecAddedForH264Codec) {
|
2016-11-16 00:48:13 -08:00
|
|
|
using webrtc::H264::ProfileLevelIdToString;
|
|
|
|
|
using webrtc::H264::ProfileLevelId;
|
|
|
|
|
using webrtc::H264::kLevel1;
|
2018-05-03 11:28:29 +02:00
|
|
|
webrtc::SdpVideoFormat h264_constrained_baseline("H264");
|
|
|
|
|
h264_constrained_baseline.parameters[kH264FmtpProfileLevelId] =
|
2016-11-16 00:48:13 -08:00
|
|
|
*ProfileLevelIdToString(
|
|
|
|
|
ProfileLevelId(webrtc::H264::kProfileConstrainedBaseline, kLevel1));
|
2018-05-03 11:28:29 +02:00
|
|
|
webrtc::SdpVideoFormat h264_constrained_high("H264");
|
|
|
|
|
h264_constrained_high.parameters[kH264FmtpProfileLevelId] =
|
2016-11-16 00:48:13 -08:00
|
|
|
*ProfileLevelIdToString(
|
|
|
|
|
ProfileLevelId(webrtc::H264::kProfileConstrainedHigh, kLevel1));
|
2018-05-03 11:28:29 +02:00
|
|
|
webrtc::SdpVideoFormat h264_high("H264");
|
|
|
|
|
h264_high.parameters[kH264FmtpProfileLevelId] = *ProfileLevelIdToString(
|
2016-11-16 00:48:13 -08:00
|
|
|
ProfileLevelId(webrtc::H264::kProfileHigh, kLevel1));
|
|
|
|
|
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodec(h264_constrained_baseline);
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodec(h264_constrained_high);
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodec(h264_high);
|
2016-06-29 11:14:19 -07:00
|
|
|
|
2016-11-16 00:48:13 -08:00
|
|
|
// First figure out what payload types the test codecs got assigned.
|
|
|
|
|
const std::vector<cricket::VideoCodec> codecs = engine_.codecs();
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
// Now search for RTX codecs for them. Expect that they all have associated
|
|
|
|
|
// RTX codecs.
|
2016-11-16 00:48:13 -08:00
|
|
|
EXPECT_TRUE(HasRtxCodec(
|
2018-05-03 11:28:29 +02:00
|
|
|
codecs,
|
|
|
|
|
FindMatchingCodec(codecs, cricket::VideoCodec(h264_constrained_baseline))
|
|
|
|
|
->id));
|
2016-11-16 00:48:13 -08:00
|
|
|
EXPECT_TRUE(HasRtxCodec(
|
2018-05-03 11:28:29 +02:00
|
|
|
codecs,
|
|
|
|
|
FindMatchingCodec(codecs, cricket::VideoCodec(h264_constrained_high))
|
|
|
|
|
->id));
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_TRUE(HasRtxCodec(
|
2018-05-03 11:28:29 +02:00
|
|
|
codecs, FindMatchingCodec(codecs, cricket::VideoCodec(h264_high))->id));
|
2016-06-29 11:14:19 -07:00
|
|
|
}
|
|
|
|
|
|
2016-05-14 02:03:18 +02:00
|
|
|
#if !defined(RTC_DISABLE_VP9)
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, CanConstructDecoderForVp9EncoderFactory) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP9");
|
2015-03-27 15:53:18 +01:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
SetSendParamsWithAllSupportedCodecs());
|
2015-03-27 15:53:18 +01:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
}
|
2016-05-14 02:03:18 +02:00
|
|
|
#endif // !defined(RTC_DISABLE_VP9)
|
2015-03-27 15:53:18 +01:00
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, PropagatesInputFrameTimestamp) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2018-02-21 13:07:13 +01:00
|
|
|
FakeCall* fake_call = new FakeCall();
|
2015-09-15 12:26:33 +02:00
|
|
|
call_.reset(fake_call);
|
2018-05-14 09:48:06 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
SetSendParamsWithAllSupportedCodecs());
|
2015-07-16 10:27:16 -07:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &capturer));
|
2015-07-16 10:27:16 -07:00
|
|
|
capturer.Start(cricket::VideoFormat(1280, 720,
|
|
|
|
|
cricket::VideoFormat::FpsToInterval(60),
|
|
|
|
|
cricket::FOURCC_I420));
|
|
|
|
|
channel->SetSend(true);
|
|
|
|
|
|
2015-09-15 12:26:33 +02:00
|
|
|
FakeVideoSendStream* stream = fake_call->GetVideoSendStreams()[0];
|
2015-07-16 10:27:16 -07:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2015-09-14 11:38:38 -07:00
|
|
|
int64_t last_timestamp = stream->GetLastTimestamp();
|
2015-07-16 10:27:16 -07:00
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2015-09-14 11:38:38 -07:00
|
|
|
int64_t timestamp = stream->GetLastTimestamp();
|
2015-07-16 10:27:16 -07:00
|
|
|
int64_t interval = timestamp - last_timestamp;
|
|
|
|
|
|
|
|
|
|
// Precision changes from nanosecond to millisecond.
|
|
|
|
|
// Allow error to be no more than 1.
|
|
|
|
|
EXPECT_NEAR(cricket::VideoFormat::FpsToInterval(60) / 1E6, interval, 1);
|
|
|
|
|
|
|
|
|
|
last_timestamp = timestamp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
capturer.Start(cricket::VideoFormat(1280, 720,
|
|
|
|
|
cricket::VideoFormat::FpsToInterval(30),
|
|
|
|
|
cricket::FOURCC_I420));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
last_timestamp = stream->GetLastTimestamp();
|
|
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2015-09-14 11:38:38 -07:00
|
|
|
int64_t timestamp = stream->GetLastTimestamp();
|
2015-07-16 10:27:16 -07:00
|
|
|
int64_t interval = timestamp - last_timestamp;
|
|
|
|
|
|
|
|
|
|
// Precision changes from nanosecond to millisecond.
|
|
|
|
|
// Allow error to be no more than 1.
|
|
|
|
|
EXPECT_NEAR(cricket::VideoFormat::FpsToInterval(30) / 1E6, interval, 1);
|
|
|
|
|
|
|
|
|
|
last_timestamp = timestamp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Remove stream previously added to free the external encoder instance.
|
|
|
|
|
EXPECT_TRUE(channel->RemoveSendStream(kSsrc));
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
void WebRtcVideoEngineTest::AssignDefaultAptRtxTypes() {
|
|
|
|
|
std::vector<VideoCodec> engine_codecs = engine_.codecs();
|
|
|
|
|
RTC_DCHECK(!engine_codecs.empty());
|
|
|
|
|
for (const cricket::VideoCodec& codec : engine_codecs) {
|
|
|
|
|
if (codec.name == "rtx") {
|
|
|
|
|
int associated_payload_type;
|
|
|
|
|
if (codec.GetParam(kCodecParamAssociatedPayloadType,
|
|
|
|
|
&associated_payload_type)) {
|
|
|
|
|
default_apt_rtx_types_[associated_payload_type] = codec.id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WebRtcVideoEngineTest::AssignDefaultCodec() {
|
|
|
|
|
std::vector<VideoCodec> engine_codecs = engine_.codecs();
|
|
|
|
|
RTC_DCHECK(!engine_codecs.empty());
|
|
|
|
|
bool codec_set = false;
|
|
|
|
|
for (const cricket::VideoCodec& codec : engine_codecs) {
|
|
|
|
|
if (!codec_set && codec.name != "rtx" && codec.name != "red" &&
|
|
|
|
|
codec.name != "ulpfec") {
|
|
|
|
|
default_codec_ = codec;
|
|
|
|
|
codec_set = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RTC_DCHECK(codec_set);
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 13:32:23 +01:00
|
|
|
size_t WebRtcVideoEngineTest::GetEngineCodecIndex(
|
|
|
|
|
const std::string& name) const {
|
2017-11-18 12:08:55 +01:00
|
|
|
const std::vector<cricket::VideoCodec> codecs = engine_.codecs();
|
|
|
|
|
for (size_t i = 0; i < codecs.size(); ++i) {
|
|
|
|
|
const cricket::VideoCodec engine_codec = codecs[i];
|
2017-10-05 13:13:32 +02:00
|
|
|
if (!CodecNamesEq(name, engine_codec.name))
|
|
|
|
|
continue;
|
|
|
|
|
// The tests only use H264 Constrained Baseline. Make sure we don't return
|
|
|
|
|
// an internal H264 codec from the engine with a different H264 profile.
|
|
|
|
|
if (CodecNamesEq(name.c_str(), kH264CodecName)) {
|
2018-06-15 15:58:38 +02:00
|
|
|
const absl::optional<webrtc::H264::ProfileLevelId> profile_level_id =
|
2017-10-05 13:13:32 +02:00
|
|
|
webrtc::H264::ParseSdpProfileLevelId(engine_codec.params);
|
|
|
|
|
if (profile_level_id->profile !=
|
|
|
|
|
webrtc::H264::kProfileConstrainedBaseline) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-11-18 12:08:55 +01:00
|
|
|
return i;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
}
|
|
|
|
|
// This point should never be reached.
|
|
|
|
|
ADD_FAILURE() << "Unrecognized codec name: " << name;
|
2017-11-18 12:08:55 +01:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cricket::VideoCodec WebRtcVideoEngineTest::GetEngineCodec(
|
|
|
|
|
const std::string& name) const {
|
|
|
|
|
return engine_.codecs()[GetEngineCodecIndex(name)];
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
VideoMediaChannel*
|
|
|
|
|
WebRtcVideoEngineTest::SetSendParamsWithAllSupportedCodecs() {
|
2014-10-14 20:29:28 +00:00
|
|
|
VideoMediaChannel* channel =
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions());
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
// We need to look up the codec in the engine to get the correct payload type.
|
2018-05-03 11:28:29 +02:00
|
|
|
for (const webrtc::SdpVideoFormat& format :
|
|
|
|
|
encoder_factory_->GetSupportedFormats()) {
|
|
|
|
|
cricket::VideoCodec engine_codec = GetEngineCodec(format.name);
|
|
|
|
|
if (std::find(parameters.codecs.begin(), parameters.codecs.end(),
|
|
|
|
|
engine_codec) == parameters.codecs.end()) {
|
|
|
|
|
parameters.codecs.push_back(engine_codec);
|
|
|
|
|
}
|
|
|
|
|
}
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2014-10-14 04:25:33 +00:00
|
|
|
|
|
|
|
|
return channel;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
VideoMediaChannel* WebRtcVideoEngineTest::SetRecvParamsWithSupportedCodecs(
|
2014-11-03 14:46:44 +00:00
|
|
|
const std::vector<VideoCodec>& codecs) {
|
|
|
|
|
VideoMediaChannel* channel =
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions());
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
|
|
|
|
parameters.codecs = codecs;
|
|
|
|
|
EXPECT_TRUE(channel->SetRecvParameters(parameters));
|
2014-11-03 14:46:44 +00:00
|
|
|
|
|
|
|
|
return channel;
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, UsesSimulcastAdapterForVp8Factories) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2015-01-14 16:26:23 +00:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
SetSendParamsWithAllSupportedCodecs());
|
2015-01-14 16:26:23 +00:00
|
|
|
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
2015-01-14 16:26:23 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel->AddSendStream(CreateSimStreamParams("cname", ssrcs)));
|
|
|
|
|
EXPECT_TRUE(channel->SetSend(true));
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(ssrcs.front(), nullptr, &capturer));
|
2015-02-16 21:02:00 +00:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->WaitForCreatedVideoEncoders(2));
|
2015-01-14 16:26:23 +00:00
|
|
|
|
|
|
|
|
// Verify that encoders are configured for simulcast through adapter
|
|
|
|
|
// (increasing resolution and only configured to send one stream each).
|
|
|
|
|
int prev_width = -1;
|
2017-09-23 17:21:32 +02:00
|
|
|
for (size_t i = 0; i < encoder_factory_->encoders().size(); ++i) {
|
|
|
|
|
ASSERT_TRUE(encoder_factory_->encoders()[i]->WaitForInitEncode());
|
2015-01-14 16:26:23 +00:00
|
|
|
webrtc::VideoCodec codec_settings =
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->encoders()[i]->GetCodecSettings();
|
2015-01-14 16:26:23 +00:00
|
|
|
EXPECT_EQ(0, codec_settings.numberOfSimulcastStreams);
|
|
|
|
|
EXPECT_GT(codec_settings.width, prev_width);
|
|
|
|
|
prev_width = codec_settings.width;
|
|
|
|
|
}
|
2015-02-16 21:02:00 +00:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(ssrcs.front(), nullptr, nullptr));
|
2015-03-06 02:20:58 +00:00
|
|
|
|
|
|
|
|
channel.reset();
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_EQ(0u, encoder_factory_->encoders().size());
|
2015-01-14 16:26:23 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
TEST_F(WebRtcVideoEngineTest, ChannelWithH264CanChangeToVp8) {
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("H264");
|
2014-10-14 04:25:33 +00:00
|
|
|
|
2018-04-19 09:04:13 +02:00
|
|
|
// Set capturer.
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
|
2018-05-03 11:28:29 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions()));
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("H264"));
|
|
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2014-10-14 04:25:33 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
2018-04-19 09:04:13 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &capturer));
|
|
|
|
|
// Sending one frame will have allocate the encoder.
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ_WAIT(1u, encoder_factory_->encoders().size(), kTimeout);
|
2014-10-14 04:25:33 +00:00
|
|
|
|
2018-05-03 11:28:29 +02:00
|
|
|
cricket::VideoSendParameters new_parameters;
|
|
|
|
|
new_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
EXPECT_TRUE(channel->SetSendParameters(new_parameters));
|
2018-04-19 09:04:13 +02:00
|
|
|
|
|
|
|
|
// Sending one frame will switch encoder.
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
2018-05-14 12:40:04 +02:00
|
|
|
EXPECT_EQ_WAIT(1u, encoder_factory_->encoders().size(), kTimeout);
|
2014-10-14 04:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest,
|
2015-03-06 02:20:58 +00:00
|
|
|
UsesSimulcastAdapterForVp8WithCombinedVP8AndH264Factory) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType("H264");
|
2015-03-06 02:20:58 +00:00
|
|
|
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions()));
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2015-03-06 02:20:58 +00:00
|
|
|
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
2015-03-06 02:20:58 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel->AddSendStream(CreateSimStreamParams("cname", ssrcs)));
|
|
|
|
|
EXPECT_TRUE(channel->SetSend(true));
|
|
|
|
|
|
|
|
|
|
// Send a fake frame, or else the media engine will configure the simulcast
|
|
|
|
|
// encoder adapter at a low-enough size that it'll only create a single
|
|
|
|
|
// encoder layer.
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(ssrcs.front(), nullptr, &capturer));
|
2015-03-06 02:20:58 +00:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->WaitForCreatedVideoEncoders(2));
|
|
|
|
|
ASSERT_TRUE(encoder_factory_->encoders()[0]->WaitForInitEncode());
|
2015-03-06 02:20:58 +00:00
|
|
|
EXPECT_EQ(webrtc::kVideoCodecVP8,
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->encoders()[0]->GetCodecSettings().codecType);
|
2015-03-06 02:20:58 +00:00
|
|
|
|
|
|
|
|
channel.reset();
|
|
|
|
|
// Make sure DestroyVideoEncoder was called on the factory.
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(0u, encoder_factory_->encoders().size());
|
2015-03-06 02:20:58 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest,
|
2015-03-06 02:20:58 +00:00
|
|
|
DestroysNonSimulcastEncoderFromCombinedVP8AndH264Factory) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType("H264");
|
2015-03-06 02:20:58 +00:00
|
|
|
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions()));
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("H264"));
|
|
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2015-03-06 02:20:58 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
2016-10-30 21:37:57 +01:00
|
|
|
|
|
|
|
|
// Send a frame of 720p. This should trigger a "real" encoder initialization.
|
|
|
|
|
cricket::VideoFormat format(
|
|
|
|
|
1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420);
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &capturer));
|
2016-10-30 21:37:57 +01:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(format));
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2018-04-19 09:04:13 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->WaitForCreatedVideoEncoders(1));
|
|
|
|
|
ASSERT_EQ(1u, encoder_factory_->encoders().size());
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->encoders()[0]->WaitForInitEncode());
|
2015-03-06 02:20:58 +00:00
|
|
|
EXPECT_EQ(webrtc::kVideoCodecH264,
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->encoders()[0]->GetCodecSettings().codecType);
|
2015-03-06 02:20:58 +00:00
|
|
|
|
|
|
|
|
channel.reset();
|
|
|
|
|
// Make sure DestroyVideoEncoder was called on the factory.
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_EQ(0u, encoder_factory_->encoders().size());
|
2014-10-14 04:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
2018-06-21 13:41:01 +00:00
|
|
|
TEST_F(WebRtcVideoEngineTest, SimulcastDisabledForH264) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("H264");
|
2015-08-27 01:59:29 -07:00
|
|
|
|
2018-05-03 11:28:29 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions()));
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("H264"));
|
|
|
|
|
EXPECT_TRUE(channel->SetSendParameters(parameters));
|
2015-08-27 01:59:29 -07:00
|
|
|
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
2015-08-27 01:59:29 -07:00
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel->AddSendStream(cricket::CreateSimStreamParams("cname", ssrcs)));
|
2016-02-02 14:14:30 +01:00
|
|
|
|
|
|
|
|
// Send a frame of 720p. This should trigger a "real" encoder initialization.
|
2015-08-27 01:59:29 -07:00
|
|
|
cricket::VideoFormat format(
|
|
|
|
|
1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420);
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(ssrcs[0], nullptr, &capturer));
|
2016-02-02 14:14:30 +01:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(format));
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
2018-04-19 09:04:13 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->WaitForCreatedVideoEncoders(1));
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_EQ(1u, encoder_factory_->encoders().size());
|
|
|
|
|
FakeWebRtcVideoEncoder* encoder = encoder_factory_->encoders()[0];
|
|
|
|
|
ASSERT_TRUE(encoder_factory_->encoders()[0]->WaitForInitEncode());
|
2015-08-27 01:59:29 -07:00
|
|
|
EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType);
|
2018-06-21 13:41:01 +00:00
|
|
|
EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams);
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(ssrcs[0], nullptr, nullptr));
|
2015-08-27 01:59:29 -07:00
|
|
|
}
|
|
|
|
|
|
2016-11-28 06:02:22 -08:00
|
|
|
// Test that the FlexFEC field trial properly alters the output of
|
2017-06-12 01:16:46 -07:00
|
|
|
// WebRtcVideoEngine::codecs(), for an existing |engine_| object.
|
2016-11-28 06:02:22 -08:00
|
|
|
//
|
|
|
|
|
// TODO(brandtr): Remove this test, when the FlexFEC field trial is gone.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest,
|
2016-11-28 06:02:22 -08:00
|
|
|
Flexfec03SupportedAsInternalCodecBehindFieldTrial) {
|
2018-05-14 09:48:06 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
|
2016-11-28 06:02:22 -08:00
|
|
|
auto is_flexfec = [](const VideoCodec& codec) {
|
|
|
|
|
if (codec.name == "flexfec-03")
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// FlexFEC is not active without field trial.
|
|
|
|
|
const std::vector<VideoCodec> codecs_before = engine_.codecs();
|
|
|
|
|
EXPECT_EQ(codecs_before.end(), std::find_if(codecs_before.begin(),
|
|
|
|
|
codecs_before.end(), is_flexfec));
|
|
|
|
|
|
|
|
|
|
// FlexFEC is active with field trial.
|
|
|
|
|
webrtc::test::ScopedFieldTrials override_field_trials_(
|
2017-02-28 15:43:10 -08:00
|
|
|
"WebRTC-FlexFEC-03-Advertised/Enabled/");
|
2016-11-28 06:02:22 -08:00
|
|
|
const std::vector<VideoCodec> codecs_after = engine_.codecs();
|
|
|
|
|
EXPECT_NE(codecs_after.end(),
|
|
|
|
|
std::find_if(codecs_after.begin(), codecs_after.end(), is_flexfec));
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
// Test that codecs are added in the order they are reported from the factory.
|
|
|
|
|
TEST_F(WebRtcVideoEngineTest, ReportSupportedCodecs) {
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
const char* kFakeCodecName = "FakeCodec";
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType(kFakeCodecName);
|
2014-10-14 04:25:33 +00:00
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
// The last reported codec should appear after the first codec in the vector.
|
2017-12-21 13:32:23 +01:00
|
|
|
const size_t vp8_index = GetEngineCodecIndex("VP8");
|
2018-05-14 09:48:06 +02:00
|
|
|
const size_t fake_codec_index = GetEngineCodecIndex(kFakeCodecName);
|
|
|
|
|
EXPECT_LT(vp8_index, fake_codec_index);
|
2014-10-14 04:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
// Test that a codec that was added after the engine was initialized
|
2016-11-28 06:02:22 -08:00
|
|
|
// does show up in the codec list after it was added.
|
2018-05-14 09:48:06 +02:00
|
|
|
TEST_F(WebRtcVideoEngineTest, ReportSupportedAddedCodec) {
|
2017-11-18 12:08:55 +01:00
|
|
|
const char* kFakeExternalCodecName1 = "FakeExternalCodec1";
|
|
|
|
|
const char* kFakeExternalCodecName2 = "FakeExternalCodec2";
|
|
|
|
|
|
2016-11-28 06:02:22 -08:00
|
|
|
// Set up external encoder factory with first codec, and initialize engine.
|
2017-11-18 12:08:55 +01:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType(kFakeExternalCodecName1);
|
2016-11-28 06:02:22 -08:00
|
|
|
|
|
|
|
|
std::vector<cricket::VideoCodec> codecs_before(engine_.codecs());
|
|
|
|
|
|
|
|
|
|
// Add second codec.
|
2017-11-18 12:08:55 +01:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType(kFakeExternalCodecName2);
|
2016-11-28 06:02:22 -08:00
|
|
|
std::vector<cricket::VideoCodec> codecs_after(engine_.codecs());
|
|
|
|
|
EXPECT_EQ(codecs_before.size() + 1, codecs_after.size());
|
2017-11-18 12:08:55 +01:00
|
|
|
|
|
|
|
|
// Check that both fake codecs are present and that the second fake codec
|
|
|
|
|
// appears after the first fake codec.
|
2017-12-21 13:32:23 +01:00
|
|
|
const size_t fake_codec_index1 = GetEngineCodecIndex(kFakeExternalCodecName1);
|
|
|
|
|
const size_t fake_codec_index2 = GetEngineCodecIndex(kFakeExternalCodecName2);
|
2017-11-18 12:08:55 +01:00
|
|
|
EXPECT_LT(fake_codec_index1, fake_codec_index2);
|
2016-11-28 06:02:22 -08:00
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
TEST_F(WebRtcVideoEngineTest, RegisterDecodersIfSupported) {
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2018-05-03 11:28:29 +02:00
|
|
|
decoder_factory_->AddSupportedVideoCodecType(webrtc::SdpVideoFormat("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2014-11-03 14:46:44 +00:00
|
|
|
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
2018-05-14 09:48:06 +02:00
|
|
|
SetRecvParamsWithSupportedCodecs(parameters.codecs));
|
2014-11-03 14:46:44 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_EQ(1u, decoder_factory_->decoders().size());
|
2014-11-03 14:46:44 +00:00
|
|
|
|
|
|
|
|
// Setting codecs of the same type should not reallocate the decoder.
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel->SetRecvParameters(parameters));
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(1, decoder_factory_->GetNumCreatedDecoders());
|
2014-11-03 14:46:44 +00:00
|
|
|
|
|
|
|
|
// Remove stream previously added to free the external decoder instance.
|
|
|
|
|
EXPECT_TRUE(channel->RemoveRecvStream(kSsrc));
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(0u, decoder_factory_->decoders().size());
|
2014-11-03 14:46:44 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-14 09:48:06 +02:00
|
|
|
// Verifies that we can set up decoders.
|
|
|
|
|
TEST_F(WebRtcVideoEngineTest, RegisterH264DecoderIfSupported) {
|
2014-11-03 14:46:44 +00:00
|
|
|
// TODO(pbos): Do not assume that encoder/decoder support is symmetric. We
|
|
|
|
|
// can't even query the WebRtcVideoDecoderFactory for supported codecs.
|
|
|
|
|
// For now we add a FakeWebRtcVideoEncoderFactory to add H264 to supported
|
|
|
|
|
// codecs.
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("H264");
|
2018-05-03 11:28:29 +02:00
|
|
|
decoder_factory_->AddSupportedVideoCodecType(webrtc::SdpVideoFormat("H264"));
|
2014-11-03 14:46:44 +00:00
|
|
|
std::vector<cricket::VideoCodec> codecs;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
codecs.push_back(GetEngineCodec("H264"));
|
2014-11-03 14:46:44 +00:00
|
|
|
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
2018-05-14 09:48:06 +02:00
|
|
|
SetRecvParamsWithSupportedCodecs(codecs));
|
2014-11-03 14:46:44 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_EQ(1u, decoder_factory_->decoders().size());
|
2014-11-03 14:46:44 +00:00
|
|
|
}
|
|
|
|
|
|
2017-09-14 10:24:54 +02:00
|
|
|
TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, NullFactories) {
|
|
|
|
|
std::unique_ptr<webrtc::VideoEncoderFactory> encoder_factory;
|
|
|
|
|
std::unique_ptr<webrtc::VideoDecoderFactory> decoder_factory;
|
|
|
|
|
WebRtcVideoEngine engine(std::move(encoder_factory),
|
|
|
|
|
std::move(decoder_factory));
|
|
|
|
|
EXPECT_EQ(0u, engine.codecs().size());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, EmptyFactories) {
|
|
|
|
|
// |engine| take ownership of the factories.
|
2017-10-30 23:10:12 -07:00
|
|
|
webrtc::MockVideoEncoderFactory* encoder_factory =
|
|
|
|
|
new webrtc::MockVideoEncoderFactory();
|
|
|
|
|
webrtc::MockVideoDecoderFactory* decoder_factory =
|
|
|
|
|
new webrtc::MockVideoDecoderFactory();
|
2017-09-14 10:24:54 +02:00
|
|
|
WebRtcVideoEngine engine(
|
|
|
|
|
(std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)),
|
|
|
|
|
(std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)));
|
|
|
|
|
EXPECT_CALL(*encoder_factory, GetSupportedFormats());
|
|
|
|
|
EXPECT_EQ(0u, engine.codecs().size());
|
|
|
|
|
EXPECT_CALL(*encoder_factory, Die());
|
|
|
|
|
EXPECT_CALL(*decoder_factory, Die());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test full behavior in the video engine when video codec factories of the new
|
|
|
|
|
// type are injected supporting the single codec Vp8. Check the returned codecs
|
|
|
|
|
// from the engine and that we will create a Vp8 encoder and decoder using the
|
|
|
|
|
// new factories.
|
|
|
|
|
TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) {
|
|
|
|
|
// |engine| take ownership of the factories.
|
2017-10-30 23:10:12 -07:00
|
|
|
webrtc::MockVideoEncoderFactory* encoder_factory =
|
|
|
|
|
new webrtc::MockVideoEncoderFactory();
|
|
|
|
|
webrtc::MockVideoDecoderFactory* decoder_factory =
|
|
|
|
|
new webrtc::MockVideoDecoderFactory();
|
2017-09-14 10:24:54 +02:00
|
|
|
WebRtcVideoEngine engine(
|
|
|
|
|
(std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)),
|
|
|
|
|
(std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)));
|
|
|
|
|
const webrtc::SdpVideoFormat vp8_format("VP8");
|
|
|
|
|
const std::vector<webrtc::SdpVideoFormat> supported_formats = {vp8_format};
|
|
|
|
|
EXPECT_CALL(*encoder_factory, GetSupportedFormats())
|
|
|
|
|
.WillRepeatedly(testing::Return(supported_formats));
|
|
|
|
|
|
|
|
|
|
// Verify the codecs from the engine.
|
|
|
|
|
const std::vector<VideoCodec> engine_codecs = engine.codecs();
|
2017-11-18 12:08:55 +01:00
|
|
|
// Verify default codecs has been added correctly.
|
|
|
|
|
EXPECT_EQ(5u, engine_codecs.size());
|
2017-09-14 10:24:54 +02:00
|
|
|
EXPECT_EQ("VP8", engine_codecs.at(0).name);
|
2017-11-18 12:08:55 +01:00
|
|
|
|
|
|
|
|
// RTX codec for VP8.
|
2017-09-14 10:24:54 +02:00
|
|
|
EXPECT_EQ("rtx", engine_codecs.at(1).name);
|
2017-11-18 12:08:55 +01:00
|
|
|
int vp8_associated_payload;
|
|
|
|
|
EXPECT_TRUE(engine_codecs.at(1).GetParam(kCodecParamAssociatedPayloadType,
|
|
|
|
|
&vp8_associated_payload));
|
|
|
|
|
EXPECT_EQ(vp8_associated_payload, engine_codecs.at(0).id);
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(kRedCodecName, engine_codecs.at(2).name);
|
|
|
|
|
|
|
|
|
|
// RTX codec for RED.
|
|
|
|
|
EXPECT_EQ("rtx", engine_codecs.at(3).name);
|
|
|
|
|
int red_associated_payload;
|
|
|
|
|
EXPECT_TRUE(engine_codecs.at(3).GetParam(kCodecParamAssociatedPayloadType,
|
|
|
|
|
&red_associated_payload));
|
|
|
|
|
EXPECT_EQ(red_associated_payload, engine_codecs.at(2).id);
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(kUlpfecCodecName, engine_codecs.at(4).name);
|
|
|
|
|
|
2017-09-14 10:24:54 +02:00
|
|
|
int associated_payload_type;
|
|
|
|
|
EXPECT_TRUE(engine_codecs.at(1).GetParam(
|
|
|
|
|
cricket::kCodecParamAssociatedPayloadType, &associated_payload_type));
|
|
|
|
|
EXPECT_EQ(engine_codecs.at(0).id, associated_payload_type);
|
|
|
|
|
// Verify default parameters has been added to the VP8 codec.
|
|
|
|
|
VerifyCodecHasDefaultFeedbackParams(engine_codecs.at(0));
|
|
|
|
|
|
|
|
|
|
// Mock encoder creation. |engine| take ownership of the encoder.
|
|
|
|
|
webrtc::VideoEncoderFactory::CodecInfo codec_info;
|
|
|
|
|
codec_info.is_hardware_accelerated = false;
|
|
|
|
|
codec_info.has_internal_source = false;
|
|
|
|
|
const webrtc::SdpVideoFormat format("VP8");
|
|
|
|
|
EXPECT_CALL(*encoder_factory, QueryVideoEncoder(format))
|
|
|
|
|
.WillRepeatedly(testing::Return(codec_info));
|
2018-05-03 11:28:29 +02:00
|
|
|
FakeWebRtcVideoEncoder* const encoder = new FakeWebRtcVideoEncoder(nullptr);
|
2018-04-19 09:04:13 +02:00
|
|
|
rtc::Event encoder_created(false, false);
|
2017-09-14 10:24:54 +02:00
|
|
|
EXPECT_CALL(*encoder_factory, CreateVideoEncoderProxy(format))
|
2018-04-19 09:04:13 +02:00
|
|
|
.WillOnce(
|
|
|
|
|
::testing::DoAll(::testing::InvokeWithoutArgs(
|
|
|
|
|
[&encoder_created]() { encoder_created.Set(); }),
|
|
|
|
|
::testing::Return(encoder)));
|
2017-09-14 10:24:54 +02:00
|
|
|
|
|
|
|
|
// Mock decoder creation. |engine| take ownership of the decoder.
|
2018-05-03 11:28:29 +02:00
|
|
|
FakeWebRtcVideoDecoder* const decoder = new FakeWebRtcVideoDecoder(nullptr);
|
2017-09-14 10:24:54 +02:00
|
|
|
EXPECT_CALL(*decoder_factory, CreateVideoDecoderProxy(format))
|
|
|
|
|
.WillOnce(testing::Return(decoder));
|
|
|
|
|
|
|
|
|
|
// Create a call.
|
|
|
|
|
webrtc::RtcEventLogNullImpl event_log;
|
|
|
|
|
std::unique_ptr<webrtc::Call> call(
|
|
|
|
|
webrtc::Call::Create(webrtc::Call::Config(&event_log)));
|
|
|
|
|
|
|
|
|
|
// Create send channel.
|
|
|
|
|
const int send_ssrc = 123;
|
|
|
|
|
std::unique_ptr<VideoMediaChannel> send_channel(
|
|
|
|
|
engine.CreateChannel(call.get(), GetMediaConfig(), VideoOptions()));
|
|
|
|
|
cricket::VideoSendParameters send_parameters;
|
|
|
|
|
send_parameters.codecs.push_back(engine_codecs.at(0));
|
|
|
|
|
EXPECT_TRUE(send_channel->SetSendParameters(send_parameters));
|
|
|
|
|
send_channel->OnReadyToSend(true);
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
send_channel->AddSendStream(StreamParams::CreateLegacy(send_ssrc)));
|
|
|
|
|
EXPECT_TRUE(send_channel->SetSend(true));
|
|
|
|
|
|
2018-04-19 09:04:13 +02:00
|
|
|
// Set capturer.
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
EXPECT_TRUE(send_channel->SetVideoSend(send_ssrc, nullptr, &capturer));
|
|
|
|
|
// Sending one frame will allocate the encoder.
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
encoder_created.Wait(kTimeout);
|
|
|
|
|
|
2017-09-14 10:24:54 +02:00
|
|
|
// Create recv channel.
|
|
|
|
|
const int recv_ssrc = 321;
|
|
|
|
|
std::unique_ptr<VideoMediaChannel> recv_channel(
|
|
|
|
|
engine.CreateChannel(call.get(), GetMediaConfig(), VideoOptions()));
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
|
|
|
|
recv_parameters.codecs.push_back(engine_codecs.at(0));
|
|
|
|
|
EXPECT_TRUE(recv_channel->SetRecvParameters(recv_parameters));
|
|
|
|
|
EXPECT_TRUE(recv_channel->AddRecvStream(
|
|
|
|
|
cricket::StreamParams::CreateLegacy(recv_ssrc)));
|
|
|
|
|
|
|
|
|
|
// Remove streams previously added to free the encoder and decoder instance.
|
|
|
|
|
EXPECT_CALL(*encoder_factory, Die());
|
|
|
|
|
EXPECT_CALL(*decoder_factory, Die());
|
|
|
|
|
EXPECT_TRUE(send_channel->RemoveSendStream(send_ssrc));
|
|
|
|
|
EXPECT_TRUE(recv_channel->RemoveRecvStream(recv_ssrc));
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-09 13:43:42 +01:00
|
|
|
// Test behavior when decoder factory fails to create a decoder (returns null).
|
|
|
|
|
TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, NullDecoder) {
|
|
|
|
|
// |engine| take ownership of the factories.
|
|
|
|
|
webrtc::MockVideoEncoderFactory* encoder_factory =
|
|
|
|
|
new testing::StrictMock<webrtc::MockVideoEncoderFactory>();
|
|
|
|
|
webrtc::MockVideoDecoderFactory* decoder_factory =
|
|
|
|
|
new testing::StrictMock<webrtc::MockVideoDecoderFactory>();
|
|
|
|
|
WebRtcVideoEngine engine(
|
|
|
|
|
(std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)),
|
|
|
|
|
(std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)));
|
|
|
|
|
const webrtc::SdpVideoFormat vp8_format("VP8");
|
|
|
|
|
const std::vector<webrtc::SdpVideoFormat> supported_formats = {vp8_format};
|
|
|
|
|
EXPECT_CALL(*encoder_factory, GetSupportedFormats())
|
|
|
|
|
.WillRepeatedly(testing::Return(supported_formats));
|
|
|
|
|
|
|
|
|
|
// Decoder creation fails.
|
|
|
|
|
EXPECT_CALL(*decoder_factory, CreateVideoDecoderProxy(testing::_))
|
|
|
|
|
.WillOnce(testing::Return(nullptr));
|
|
|
|
|
|
|
|
|
|
// Create a call.
|
|
|
|
|
webrtc::RtcEventLogNullImpl event_log;
|
|
|
|
|
std::unique_ptr<webrtc::Call> call(
|
|
|
|
|
webrtc::Call::Create(webrtc::Call::Config(&event_log)));
|
|
|
|
|
|
|
|
|
|
// Create recv channel.
|
|
|
|
|
const int recv_ssrc = 321;
|
|
|
|
|
std::unique_ptr<VideoMediaChannel> recv_channel(
|
|
|
|
|
engine.CreateChannel(call.get(), GetMediaConfig(), VideoOptions()));
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
|
|
|
|
recv_parameters.codecs.push_back(engine.codecs().front());
|
|
|
|
|
EXPECT_TRUE(recv_channel->SetRecvParameters(recv_parameters));
|
|
|
|
|
EXPECT_TRUE(recv_channel->AddRecvStream(
|
|
|
|
|
cricket::StreamParams::CreateLegacy(recv_ssrc)));
|
|
|
|
|
|
|
|
|
|
// Remove streams previously added to free the encoder and decoder instance.
|
|
|
|
|
EXPECT_TRUE(recv_channel->RemoveRecvStream(recv_ssrc));
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoEngineTest, DISABLED_RecreatesEncoderOnContentTypeChange) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2018-02-21 13:07:13 +01:00
|
|
|
std::unique_ptr<FakeCall> fake_call(new FakeCall());
|
2018-05-14 09:48:06 +02:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel(
|
|
|
|
|
SetSendParamsWithAllSupportedCodecs());
|
2017-02-28 13:23:26 -08:00
|
|
|
ASSERT_TRUE(
|
|
|
|
|
channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
cricket::VideoCodec codec = GetEngineCodec("VP8");
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(codec);
|
|
|
|
|
channel->OnReadyToSend(true);
|
|
|
|
|
channel->SetSend(true);
|
|
|
|
|
ASSERT_TRUE(channel->SetSendParameters(parameters));
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2017-02-28 13:23:26 -08:00
|
|
|
VideoOptions options;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, &options, &capturer));
|
2017-02-28 13:23:26 -08:00
|
|
|
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->WaitForCreatedVideoEncoders(1));
|
2018-06-13 11:52:16 +02:00
|
|
|
EXPECT_EQ(webrtc::VideoCodecMode::kRealtimeVideo,
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->encoders().back()->GetCodecSettings().mode);
|
2017-02-28 13:23:26 -08:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, &options, &capturer));
|
2017-02-28 13:23:26 -08:00
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
// No change in content type, keep current encoder.
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(1, encoder_factory_->GetNumCreatedEncoders());
|
2017-02-28 13:23:26 -08:00
|
|
|
|
|
|
|
|
options.is_screencast.emplace(true);
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, &options, &capturer));
|
2017-02-28 13:23:26 -08:00
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
// Change to screen content, recreate encoder. For the simulcast encoder
|
|
|
|
|
// adapter case, this will result in two calls since InitEncode triggers a
|
|
|
|
|
// a new instance.
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->WaitForCreatedVideoEncoders(2));
|
2018-06-13 11:52:16 +02:00
|
|
|
EXPECT_EQ(webrtc::VideoCodecMode::kScreensharing,
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->encoders().back()->GetCodecSettings().mode);
|
2017-02-28 13:23:26 -08:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, &options, &capturer));
|
2017-02-28 13:23:26 -08:00
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
// Still screen content, no need to update encoder.
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(2, encoder_factory_->GetNumCreatedEncoders());
|
2017-02-28 13:23:26 -08:00
|
|
|
|
|
|
|
|
options.is_screencast.emplace(false);
|
|
|
|
|
options.video_noise_reduction.emplace(false);
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel->SetVideoSend(kSsrc, &options, &capturer));
|
2017-02-28 13:23:26 -08:00
|
|
|
// Change back to regular video content, update encoder. Also change
|
|
|
|
|
// a non |is_screencast| option just to verify it doesn't affect recreation.
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2017-09-23 17:21:32 +02:00
|
|
|
ASSERT_TRUE(encoder_factory_->WaitForCreatedVideoEncoders(3));
|
2018-06-13 11:52:16 +02:00
|
|
|
EXPECT_EQ(webrtc::VideoCodecMode::kRealtimeVideo,
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->encoders().back()->GetCodecSettings().mode);
|
2017-02-28 13:23:26 -08:00
|
|
|
|
|
|
|
|
// Remove stream previously added to free the external encoder instance.
|
|
|
|
|
EXPECT_TRUE(channel->RemoveSendStream(kSsrc));
|
2017-09-23 17:21:32 +02:00
|
|
|
EXPECT_EQ(0u, encoder_factory_->encoders().size());
|
2017-02-28 13:23:26 -08:00
|
|
|
}
|
|
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
class WebRtcVideoChannelBaseTest : public testing::Test {
|
|
|
|
|
protected:
|
|
|
|
|
WebRtcVideoChannelBaseTest()
|
|
|
|
|
: call_(webrtc::Call::Create(webrtc::Call::Config(&event_log_))),
|
2018-05-14 09:48:06 +02:00
|
|
|
engine_(webrtc::CreateBuiltinVideoEncoderFactory(),
|
|
|
|
|
webrtc::CreateBuiltinVideoDecoderFactory()) {}
|
2018-04-11 15:18:34 +02:00
|
|
|
|
|
|
|
|
virtual void SetUp() {
|
|
|
|
|
cricket::MediaConfig media_config;
|
|
|
|
|
// Disabling cpu overuse detection actually disables quality scaling too; it
|
|
|
|
|
// implies DegradationPreference kMaintainResolution. Automatic scaling
|
|
|
|
|
// needs to be disabled, otherwise, tests which check the size of received
|
|
|
|
|
// frames become flaky.
|
|
|
|
|
media_config.video.enable_cpu_adaptation = false;
|
|
|
|
|
channel_.reset(engine_.CreateChannel(call_.get(), media_config,
|
|
|
|
|
cricket::VideoOptions()));
|
|
|
|
|
channel_->OnReadyToSend(true);
|
|
|
|
|
EXPECT_TRUE(channel_.get() != NULL);
|
|
|
|
|
network_interface_.SetDestination(channel_.get());
|
|
|
|
|
channel_->SetInterface(&network_interface_);
|
|
|
|
|
cricket::VideoRecvParameters parameters;
|
|
|
|
|
parameters.codecs = engine_.codecs();
|
|
|
|
|
channel_->SetRecvParameters(parameters);
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(DefaultSendStreamParams()));
|
|
|
|
|
video_capturer_.reset(CreateFakeVideoCapturer());
|
|
|
|
|
cricket::VideoFormat format(640, 480,
|
|
|
|
|
cricket::VideoFormat::FpsToInterval(kFramerate),
|
|
|
|
|
cricket::FOURCC_I420);
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, video_capturer_->Start(format));
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrc, nullptr, video_capturer_.get()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual cricket::FakeVideoCapturerWithTaskQueue* CreateFakeVideoCapturer() {
|
|
|
|
|
return new cricket::FakeVideoCapturerWithTaskQueue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Utility method to setup an additional stream to send and receive video.
|
|
|
|
|
// Used to test send and recv between two streams.
|
|
|
|
|
void SetUpSecondStream() {
|
|
|
|
|
SetUpSecondStreamWithNoRecv();
|
|
|
|
|
// Setup recv for second stream.
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(
|
|
|
|
|
cricket::StreamParams::CreateLegacy(kSsrc + 2)));
|
|
|
|
|
// Make the second renderer available for use by a new stream.
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kSsrc + 2, &renderer2_));
|
|
|
|
|
}
|
|
|
|
|
// Setup an additional stream just to send video. Defer add recv stream.
|
|
|
|
|
// This is required if you want to test unsignalled recv of video rtp packets.
|
|
|
|
|
void SetUpSecondStreamWithNoRecv() {
|
|
|
|
|
// SetUp() already added kSsrc make sure duplicate SSRCs cant be added.
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kSsrc, &renderer_));
|
|
|
|
|
EXPECT_FALSE(
|
|
|
|
|
channel_->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(
|
|
|
|
|
cricket::StreamParams::CreateLegacy(kSsrc + 2)));
|
|
|
|
|
// We dont add recv for the second stream.
|
|
|
|
|
|
|
|
|
|
// Setup the receive and renderer for second stream after send.
|
|
|
|
|
video_capturer_2_.reset(CreateFakeVideoCapturer());
|
|
|
|
|
cricket::VideoFormat format(640, 480,
|
|
|
|
|
cricket::VideoFormat::FpsToInterval(kFramerate),
|
|
|
|
|
cricket::FOURCC_I420);
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, video_capturer_2_->Start(format));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->SetVideoSend(kSsrc + 2, nullptr, video_capturer_2_.get()));
|
|
|
|
|
}
|
|
|
|
|
virtual void TearDown() { channel_.reset(); }
|
|
|
|
|
bool SetDefaultCodec() { return SetOneCodec(DefaultCodec()); }
|
|
|
|
|
|
|
|
|
|
bool SetOneCodec(const cricket::VideoCodec& codec) {
|
|
|
|
|
cricket::VideoFormat capture_format(
|
|
|
|
|
kVideoWidth, kVideoHeight,
|
|
|
|
|
cricket::VideoFormat::FpsToInterval(kFramerate), cricket::FOURCC_I420);
|
|
|
|
|
|
|
|
|
|
if (video_capturer_) {
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, video_capturer_->Start(capture_format));
|
|
|
|
|
}
|
|
|
|
|
if (video_capturer_2_) {
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, video_capturer_2_->Start(capture_format));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool sending = channel_->sending();
|
|
|
|
|
bool success = SetSend(false);
|
|
|
|
|
if (success) {
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(codec);
|
|
|
|
|
success = channel_->SetSendParameters(parameters);
|
|
|
|
|
}
|
|
|
|
|
if (success) {
|
|
|
|
|
success = SetSend(sending);
|
|
|
|
|
}
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
bool SetSend(bool send) { return channel_->SetSend(send); }
|
|
|
|
|
bool SendFrame() {
|
|
|
|
|
if (video_capturer_2_) {
|
|
|
|
|
video_capturer_2_->CaptureFrame();
|
|
|
|
|
}
|
|
|
|
|
return video_capturer_.get() && video_capturer_->CaptureFrame();
|
|
|
|
|
}
|
|
|
|
|
bool WaitAndSendFrame(int wait_ms) {
|
|
|
|
|
bool ret = rtc::Thread::Current()->ProcessMessages(wait_ms);
|
|
|
|
|
ret &= SendFrame();
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
int NumRtpBytes() { return network_interface_.NumRtpBytes(); }
|
|
|
|
|
int NumRtpBytes(uint32_t ssrc) {
|
|
|
|
|
return network_interface_.NumRtpBytes(ssrc);
|
|
|
|
|
}
|
|
|
|
|
int NumRtpPackets() { return network_interface_.NumRtpPackets(); }
|
|
|
|
|
int NumRtpPackets(uint32_t ssrc) {
|
|
|
|
|
return network_interface_.NumRtpPackets(ssrc);
|
|
|
|
|
}
|
|
|
|
|
int NumSentSsrcs() { return network_interface_.NumSentSsrcs(); }
|
|
|
|
|
const rtc::CopyOnWriteBuffer* GetRtpPacket(int index) {
|
|
|
|
|
return network_interface_.GetRtpPacket(index);
|
|
|
|
|
}
|
|
|
|
|
static int GetPayloadType(const rtc::CopyOnWriteBuffer* p) {
|
|
|
|
|
int pt = -1;
|
|
|
|
|
ParseRtpPacket(p, NULL, &pt, NULL, NULL, NULL, NULL);
|
|
|
|
|
return pt;
|
|
|
|
|
}
|
|
|
|
|
static bool ParseRtpPacket(const rtc::CopyOnWriteBuffer* p,
|
|
|
|
|
bool* x,
|
|
|
|
|
int* pt,
|
|
|
|
|
int* seqnum,
|
|
|
|
|
uint32_t* tstamp,
|
|
|
|
|
uint32_t* ssrc,
|
|
|
|
|
std::string* payload) {
|
|
|
|
|
rtc::ByteBufferReader buf(p->data<char>(), p->size());
|
|
|
|
|
uint8_t u08 = 0;
|
|
|
|
|
uint16_t u16 = 0;
|
|
|
|
|
uint32_t u32 = 0;
|
|
|
|
|
|
|
|
|
|
// Read X and CC fields.
|
|
|
|
|
if (!buf.ReadUInt8(&u08))
|
|
|
|
|
return false;
|
|
|
|
|
bool extension = ((u08 & 0x10) != 0);
|
|
|
|
|
uint8_t cc = (u08 & 0x0F);
|
|
|
|
|
if (x)
|
|
|
|
|
*x = extension;
|
|
|
|
|
|
|
|
|
|
// Read PT field.
|
|
|
|
|
if (!buf.ReadUInt8(&u08))
|
|
|
|
|
return false;
|
|
|
|
|
if (pt)
|
|
|
|
|
*pt = (u08 & 0x7F);
|
|
|
|
|
|
|
|
|
|
// Read Sequence Number field.
|
|
|
|
|
if (!buf.ReadUInt16(&u16))
|
|
|
|
|
return false;
|
|
|
|
|
if (seqnum)
|
|
|
|
|
*seqnum = u16;
|
|
|
|
|
|
|
|
|
|
// Read Timestamp field.
|
|
|
|
|
if (!buf.ReadUInt32(&u32))
|
|
|
|
|
return false;
|
|
|
|
|
if (tstamp)
|
|
|
|
|
*tstamp = u32;
|
|
|
|
|
|
|
|
|
|
// Read SSRC field.
|
|
|
|
|
if (!buf.ReadUInt32(&u32))
|
|
|
|
|
return false;
|
|
|
|
|
if (ssrc)
|
|
|
|
|
*ssrc = u32;
|
|
|
|
|
|
|
|
|
|
// Skip CSRCs.
|
|
|
|
|
for (uint8_t i = 0; i < cc; ++i) {
|
|
|
|
|
if (!buf.ReadUInt32(&u32))
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Skip extension header.
|
|
|
|
|
if (extension) {
|
|
|
|
|
// Read Profile-specific extension header ID
|
|
|
|
|
if (!buf.ReadUInt16(&u16))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Read Extension header length
|
|
|
|
|
if (!buf.ReadUInt16(&u16))
|
|
|
|
|
return false;
|
|
|
|
|
uint16_t ext_header_len = u16;
|
|
|
|
|
|
|
|
|
|
// Read Extension header
|
|
|
|
|
for (uint16_t i = 0; i < ext_header_len; ++i) {
|
|
|
|
|
if (!buf.ReadUInt32(&u32))
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (payload) {
|
|
|
|
|
return buf.ReadString(payload, buf.Length());
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tests that we can send and receive frames.
|
|
|
|
|
void SendAndReceive(const cricket::VideoCodec& codec) {
|
|
|
|
|
EXPECT_TRUE(SetOneCodec(codec));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_));
|
|
|
|
|
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout);
|
|
|
|
|
std::unique_ptr<const rtc::CopyOnWriteBuffer> p(GetRtpPacket(0));
|
|
|
|
|
EXPECT_EQ(codec.id, GetPayloadType(p.get()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SendReceiveManyAndGetStats(const cricket::VideoCodec& codec,
|
|
|
|
|
int duration_sec,
|
|
|
|
|
int fps) {
|
|
|
|
|
EXPECT_TRUE(SetOneCodec(codec));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_));
|
|
|
|
|
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
|
|
|
|
for (int i = 0; i < duration_sec; ++i) {
|
|
|
|
|
for (int frame = 1; frame <= fps; ++frame) {
|
|
|
|
|
EXPECT_TRUE(WaitAndSendFrame(1000 / fps));
|
|
|
|
|
EXPECT_FRAME_WAIT(frame + i * fps, kVideoWidth, kVideoHeight, kTimeout);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
std::unique_ptr<const rtc::CopyOnWriteBuffer> p(GetRtpPacket(0));
|
|
|
|
|
EXPECT_EQ(codec.id, GetPayloadType(p.get()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cricket::VideoSenderInfo GetSenderStats(size_t i) {
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
EXPECT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
return info.senders[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cricket::VideoReceiverInfo GetReceiverStats(size_t i) {
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
EXPECT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
return info.receivers[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Two streams one channel tests.
|
|
|
|
|
|
|
|
|
|
// Tests that we can send and receive frames.
|
|
|
|
|
void TwoStreamsSendAndReceive(const cricket::VideoCodec& codec) {
|
|
|
|
|
SetUpSecondStream();
|
|
|
|
|
// Test sending and receiving on first stream.
|
|
|
|
|
SendAndReceive(codec);
|
|
|
|
|
// Test sending and receiving on second stream.
|
|
|
|
|
EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout);
|
|
|
|
|
EXPECT_GT(NumRtpPackets(), 0);
|
|
|
|
|
EXPECT_EQ(1, renderer2_.num_rendered_frames());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cricket::VideoCodec GetEngineCodec(const std::string& name) {
|
|
|
|
|
for (const cricket::VideoCodec& engine_codec : engine_.codecs()) {
|
|
|
|
|
if (CodecNamesEq(name, engine_codec.name))
|
|
|
|
|
return engine_codec;
|
|
|
|
|
}
|
|
|
|
|
// This point should never be reached.
|
|
|
|
|
ADD_FAILURE() << "Unrecognized codec name: " << name;
|
|
|
|
|
return cricket::VideoCodec();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cricket::VideoCodec DefaultCodec() { return GetEngineCodec("VP8"); }
|
|
|
|
|
|
|
|
|
|
cricket::StreamParams DefaultSendStreamParams() {
|
|
|
|
|
return cricket::StreamParams::CreateLegacy(kSsrc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
webrtc::RtcEventLogNullImpl event_log_;
|
|
|
|
|
const std::unique_ptr<webrtc::Call> call_;
|
|
|
|
|
WebRtcVideoEngine engine_;
|
|
|
|
|
std::unique_ptr<cricket::FakeVideoCapturerWithTaskQueue> video_capturer_;
|
|
|
|
|
std::unique_ptr<cricket::FakeVideoCapturerWithTaskQueue> video_capturer_2_;
|
|
|
|
|
std::unique_ptr<WebRtcVideoChannel> channel_;
|
|
|
|
|
cricket::FakeNetworkInterface network_interface_;
|
|
|
|
|
cricket::FakeVideoRenderer renderer_;
|
|
|
|
|
|
|
|
|
|
// Used by test cases where 2 streams are run on the same channel.
|
|
|
|
|
cricket::FakeVideoRenderer renderer2_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Test that SetSend works.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SetSend) {
|
2018-04-11 15:18:34 +02:00
|
|
|
EXPECT_FALSE(channel_->sending());
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrc, nullptr, video_capturer_.get()));
|
|
|
|
|
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
|
|
|
|
EXPECT_FALSE(channel_->sending());
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(channel_->sending());
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout);
|
|
|
|
|
EXPECT_TRUE(SetSend(false));
|
|
|
|
|
EXPECT_FALSE(channel_->sending());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that SetSend fails without codecs being set.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SetSendWithoutCodecs) {
|
2018-04-11 15:18:34 +02:00
|
|
|
EXPECT_FALSE(channel_->sending());
|
|
|
|
|
EXPECT_FALSE(SetSend(true));
|
|
|
|
|
EXPECT_FALSE(channel_->sending());
|
2017-12-15 17:44:33 +01:00
|
|
|
}
|
2018-04-11 15:18:34 +02:00
|
|
|
|
|
|
|
|
// Test that we properly set the send and recv buffer sizes by the time
|
|
|
|
|
// SetSend is called.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SetSendSetsTransportBufferSizes) {
|
2018-04-11 15:18:34 +02:00
|
|
|
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_EQ(64 * 1024, network_interface_.sendbuf_size());
|
|
|
|
|
EXPECT_EQ(64 * 1024, network_interface_.recvbuf_size());
|
2017-12-15 17:44:33 +01:00
|
|
|
}
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
// Test that stats work properly for a 1-1 call.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, GetStats) {
|
2018-04-11 15:18:34 +02:00
|
|
|
const int kDurationSec = 3;
|
|
|
|
|
const int kFps = 10;
|
|
|
|
|
SendReceiveManyAndGetStats(DefaultCodec(), kDurationSec, kFps);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
EXPECT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(1U, info.senders.size());
|
|
|
|
|
// TODO(whyuan): bytes_sent and bytes_rcvd are different. Are both payload?
|
|
|
|
|
// For webrtc, bytes_sent does not include the RTP header length.
|
|
|
|
|
EXPECT_GT(info.senders[0].bytes_sent, 0);
|
|
|
|
|
EXPECT_EQ(NumRtpPackets(), info.senders[0].packets_sent);
|
|
|
|
|
EXPECT_EQ(0.0, info.senders[0].fraction_lost);
|
|
|
|
|
ASSERT_TRUE(info.senders[0].codec_payload_type);
|
|
|
|
|
EXPECT_EQ(DefaultCodec().id, *info.senders[0].codec_payload_type);
|
|
|
|
|
EXPECT_EQ(0, info.senders[0].firs_rcvd);
|
|
|
|
|
EXPECT_EQ(0, info.senders[0].plis_rcvd);
|
|
|
|
|
EXPECT_EQ(0, info.senders[0].nacks_rcvd);
|
|
|
|
|
EXPECT_EQ(kVideoWidth, info.senders[0].send_frame_width);
|
|
|
|
|
EXPECT_EQ(kVideoHeight, info.senders[0].send_frame_height);
|
|
|
|
|
EXPECT_GT(info.senders[0].framerate_input, 0);
|
|
|
|
|
EXPECT_GT(info.senders[0].framerate_sent, 0);
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(1U, info.send_codecs.count(DefaultCodec().id));
|
|
|
|
|
EXPECT_EQ(DefaultCodec().ToCodecParameters(),
|
|
|
|
|
info.send_codecs[DefaultCodec().id]);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(1U, info.receivers.size());
|
|
|
|
|
EXPECT_EQ(1U, info.senders[0].ssrcs().size());
|
|
|
|
|
EXPECT_EQ(1U, info.receivers[0].ssrcs().size());
|
|
|
|
|
EXPECT_EQ(info.senders[0].ssrcs()[0], info.receivers[0].ssrcs()[0]);
|
|
|
|
|
ASSERT_TRUE(info.receivers[0].codec_payload_type);
|
|
|
|
|
EXPECT_EQ(DefaultCodec().id, *info.receivers[0].codec_payload_type);
|
|
|
|
|
EXPECT_EQ(NumRtpBytes(), info.receivers[0].bytes_rcvd);
|
|
|
|
|
EXPECT_EQ(NumRtpPackets(), info.receivers[0].packets_rcvd);
|
|
|
|
|
EXPECT_EQ(0.0, info.receivers[0].fraction_lost);
|
|
|
|
|
EXPECT_EQ(0, info.receivers[0].packets_lost);
|
|
|
|
|
// TODO(asapersson): Not set for webrtc. Handle missing stats.
|
|
|
|
|
// EXPECT_EQ(0, info.receivers[0].packets_concealed);
|
|
|
|
|
EXPECT_EQ(0, info.receivers[0].firs_sent);
|
|
|
|
|
EXPECT_EQ(0, info.receivers[0].plis_sent);
|
|
|
|
|
EXPECT_EQ(0, info.receivers[0].nacks_sent);
|
|
|
|
|
EXPECT_EQ(kVideoWidth, info.receivers[0].frame_width);
|
|
|
|
|
EXPECT_EQ(kVideoHeight, info.receivers[0].frame_height);
|
|
|
|
|
EXPECT_GT(info.receivers[0].framerate_rcvd, 0);
|
|
|
|
|
EXPECT_GT(info.receivers[0].framerate_decoded, 0);
|
|
|
|
|
EXPECT_GT(info.receivers[0].framerate_output, 0);
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(1U, info.receive_codecs.count(DefaultCodec().id));
|
|
|
|
|
EXPECT_EQ(DefaultCodec().ToCodecParameters(),
|
|
|
|
|
info.receive_codecs[DefaultCodec().id]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that stats work properly for a conf call with multiple recv streams.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, GetStatsMultipleRecvStreams) {
|
2018-04-11 15:18:34 +02:00
|
|
|
cricket::FakeVideoRenderer renderer1, renderer2;
|
|
|
|
|
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(DefaultCodec());
|
|
|
|
|
parameters.conference_mode = true;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(2)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(1, &renderer1));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(2, &renderer2));
|
|
|
|
|
EXPECT_EQ(0, renderer1.num_rendered_frames());
|
|
|
|
|
EXPECT_EQ(0, renderer2.num_rendered_frames());
|
|
|
|
|
std::vector<uint32_t> ssrcs;
|
|
|
|
|
ssrcs.push_back(1);
|
|
|
|
|
ssrcs.push_back(2);
|
|
|
|
|
network_interface_.SetConferenceMode(true, ssrcs);
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_FRAME_ON_RENDERER_WAIT(renderer1, 1, kVideoWidth, kVideoHeight,
|
|
|
|
|
kTimeout);
|
|
|
|
|
EXPECT_FRAME_ON_RENDERER_WAIT(renderer2, 1, kVideoWidth, kVideoHeight,
|
|
|
|
|
kTimeout);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(false));
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
EXPECT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
ASSERT_EQ(1U, info.senders.size());
|
|
|
|
|
// TODO(whyuan): bytes_sent and bytes_rcvd are different. Are both payload?
|
|
|
|
|
// For webrtc, bytes_sent does not include the RTP header length.
|
|
|
|
|
EXPECT_GT(GetSenderStats(0).bytes_sent, 0);
|
|
|
|
|
EXPECT_EQ_WAIT(NumRtpPackets(), GetSenderStats(0).packets_sent, kTimeout);
|
|
|
|
|
EXPECT_EQ(kVideoWidth, GetSenderStats(0).send_frame_width);
|
|
|
|
|
EXPECT_EQ(kVideoHeight, GetSenderStats(0).send_frame_height);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(2U, info.receivers.size());
|
|
|
|
|
for (size_t i = 0; i < info.receivers.size(); ++i) {
|
|
|
|
|
EXPECT_EQ(1U, GetReceiverStats(i).ssrcs().size());
|
|
|
|
|
EXPECT_EQ(i + 1, GetReceiverStats(i).ssrcs()[0]);
|
|
|
|
|
EXPECT_EQ_WAIT(NumRtpBytes(), GetReceiverStats(i).bytes_rcvd, kTimeout);
|
|
|
|
|
EXPECT_EQ_WAIT(NumRtpPackets(), GetReceiverStats(i).packets_rcvd, kTimeout);
|
|
|
|
|
EXPECT_EQ_WAIT(kVideoWidth, GetReceiverStats(i).frame_width, kTimeout);
|
|
|
|
|
EXPECT_EQ_WAIT(kVideoHeight, GetReceiverStats(i).frame_height, kTimeout);
|
|
|
|
|
}
|
2017-12-15 17:44:33 +01:00
|
|
|
}
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
// Test that stats work properly for a conf call with multiple send streams.
|
|
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, GetStatsMultipleSendStreams) {
|
|
|
|
|
// Normal setup; note that we set the SSRC explicitly to ensure that
|
|
|
|
|
// it will come first in the senders map.
|
|
|
|
|
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(DefaultCodec());
|
|
|
|
|
parameters.conference_mode = true;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kSsrc, &renderer_));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout);
|
|
|
|
|
EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout);
|
|
|
|
|
|
|
|
|
|
// Add an additional capturer, and hook up a renderer to receive it.
|
|
|
|
|
cricket::FakeVideoRenderer renderer2;
|
|
|
|
|
std::unique_ptr<cricket::FakeVideoCapturerWithTaskQueue> capturer(
|
|
|
|
|
CreateFakeVideoCapturer());
|
|
|
|
|
const int kTestWidth = 160;
|
|
|
|
|
const int kTestHeight = 120;
|
|
|
|
|
cricket::VideoFormat format(kTestWidth, kTestHeight,
|
|
|
|
|
cricket::VideoFormat::FpsToInterval(5),
|
|
|
|
|
cricket::FOURCC_I420);
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer->Start(format));
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddSendStream(cricket::StreamParams::CreateLegacy(5678)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(5678, nullptr, capturer.get()));
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(5678)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(5678, &renderer2));
|
|
|
|
|
EXPECT_TRUE(capturer->CaptureCustomFrame(kTestWidth, kTestHeight));
|
|
|
|
|
EXPECT_FRAME_ON_RENDERER_WAIT(renderer2, 1, kTestWidth, kTestHeight,
|
|
|
|
|
kTimeout);
|
|
|
|
|
|
|
|
|
|
// Get stats, and make sure they are correct for two senders. We wait until
|
|
|
|
|
// the number of expected packets have been sent to avoid races where we
|
|
|
|
|
// check stats before it has been updated.
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
for (uint32_t i = 0; i < kTimeout; ++i) {
|
|
|
|
|
rtc::Thread::Current()->ProcessMessages(1);
|
|
|
|
|
EXPECT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
ASSERT_EQ(2U, info.senders.size());
|
|
|
|
|
if (info.senders[0].packets_sent + info.senders[1].packets_sent ==
|
|
|
|
|
NumRtpPackets()) {
|
|
|
|
|
// Stats have been updated for both sent frames, expectations can be
|
|
|
|
|
// checked now.
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
EXPECT_EQ(NumRtpPackets(),
|
|
|
|
|
info.senders[0].packets_sent + info.senders[1].packets_sent)
|
|
|
|
|
<< "Timed out while waiting for packet counts for all sent packets.";
|
|
|
|
|
EXPECT_EQ(1U, info.senders[0].ssrcs().size());
|
|
|
|
|
EXPECT_EQ(1234U, info.senders[0].ssrcs()[0]);
|
|
|
|
|
EXPECT_EQ(kVideoWidth, info.senders[0].send_frame_width);
|
|
|
|
|
EXPECT_EQ(kVideoHeight, info.senders[0].send_frame_height);
|
|
|
|
|
EXPECT_EQ(1U, info.senders[1].ssrcs().size());
|
|
|
|
|
EXPECT_EQ(5678U, info.senders[1].ssrcs()[0]);
|
|
|
|
|
EXPECT_EQ(kTestWidth, info.senders[1].send_frame_width);
|
|
|
|
|
EXPECT_EQ(kTestHeight, info.senders[1].send_frame_height);
|
|
|
|
|
// The capturer must be unregistered here as it runs out of it's scope next.
|
|
|
|
|
channel_->SetVideoSend(5678, nullptr, nullptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that we can set the bandwidth.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SetSendBandwidth) {
|
2018-04-11 15:18:34 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(DefaultCodec());
|
|
|
|
|
parameters.max_bandwidth_bps = -1; // <= 0 means unlimited.
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
parameters.max_bandwidth_bps = 128 * 1024;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2017-12-15 17:44:33 +01:00
|
|
|
}
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
// Test that we can set the SSRC for the default send source.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SetSendSsrc) {
|
2018-04-11 15:18:34 +02:00
|
|
|
EXPECT_TRUE(SetDefaultCodec());
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout);
|
|
|
|
|
uint32_t ssrc = 0;
|
|
|
|
|
std::unique_ptr<const rtc::CopyOnWriteBuffer> p(GetRtpPacket(0));
|
|
|
|
|
ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL);
|
|
|
|
|
EXPECT_EQ(kSsrc, ssrc);
|
|
|
|
|
// Packets are being paced out, so these can mismatch between the first and
|
|
|
|
|
// second call to NumRtpPackets until pending packets are paced out.
|
|
|
|
|
EXPECT_EQ_WAIT(NumRtpPackets(), NumRtpPackets(ssrc), kTimeout);
|
|
|
|
|
EXPECT_EQ_WAIT(NumRtpBytes(), NumRtpBytes(ssrc), kTimeout);
|
|
|
|
|
EXPECT_EQ(1, NumSentSsrcs());
|
|
|
|
|
EXPECT_EQ(0, NumRtpPackets(kSsrc - 1));
|
|
|
|
|
EXPECT_EQ(0, NumRtpBytes(kSsrc - 1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that we can set the SSRC even after codecs are set.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SetSendSsrcAfterSetCodecs) {
|
2018-04-11 15:18:34 +02:00
|
|
|
// Remove stream added in Setup.
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveSendStream(kSsrc));
|
|
|
|
|
EXPECT_TRUE(SetDefaultCodec());
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddSendStream(cricket::StreamParams::CreateLegacy(999)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(999u, nullptr, video_capturer_.get()));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(WaitAndSendFrame(0));
|
|
|
|
|
EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout);
|
|
|
|
|
uint32_t ssrc = 0;
|
|
|
|
|
std::unique_ptr<const rtc::CopyOnWriteBuffer> p(GetRtpPacket(0));
|
|
|
|
|
ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL);
|
|
|
|
|
EXPECT_EQ(999u, ssrc);
|
|
|
|
|
// Packets are being paced out, so these can mismatch between the first and
|
|
|
|
|
// second call to NumRtpPackets until pending packets are paced out.
|
|
|
|
|
EXPECT_EQ_WAIT(NumRtpPackets(), NumRtpPackets(ssrc), kTimeout);
|
|
|
|
|
EXPECT_EQ_WAIT(NumRtpBytes(), NumRtpBytes(ssrc), kTimeout);
|
|
|
|
|
EXPECT_EQ(1, NumSentSsrcs());
|
|
|
|
|
EXPECT_EQ(0, NumRtpPackets(kSsrc));
|
|
|
|
|
EXPECT_EQ(0, NumRtpBytes(kSsrc));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that we can set the default video renderer before and after
|
|
|
|
|
// media is received.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SetSink) {
|
2018-04-11 15:18:34 +02:00
|
|
|
uint8_t data1[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
|
|
|
|
|
|
|
|
|
rtc::CopyOnWriteBuffer packet1(data1, sizeof(data1));
|
|
|
|
|
rtc::SetBE32(packet1.data() + 8, kSsrc);
|
|
|
|
|
channel_->SetSink(kDefaultReceiveSsrc, NULL);
|
|
|
|
|
EXPECT_TRUE(SetDefaultCodec());
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
|
|
|
|
channel_->OnPacketReceived(&packet1, rtc::PacketTime());
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_));
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tests setting up and configuring a send stream.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, AddRemoveSendStreams) {
|
2018-04-11 15:18:34 +02:00
|
|
|
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_));
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout);
|
|
|
|
|
EXPECT_GT(NumRtpPackets(), 0);
|
|
|
|
|
uint32_t ssrc = 0;
|
|
|
|
|
size_t last_packet = NumRtpPackets() - 1;
|
|
|
|
|
std::unique_ptr<const rtc::CopyOnWriteBuffer> p(
|
|
|
|
|
GetRtpPacket(static_cast<int>(last_packet)));
|
|
|
|
|
ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL);
|
|
|
|
|
EXPECT_EQ(kSsrc, ssrc);
|
|
|
|
|
|
|
|
|
|
// Remove the send stream that was added during Setup.
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveSendStream(kSsrc));
|
|
|
|
|
int rtp_packets = NumRtpPackets();
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddSendStream(cricket::StreamParams::CreateLegacy(789u)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(789u, nullptr, video_capturer_.get()));
|
|
|
|
|
EXPECT_EQ(rtp_packets, NumRtpPackets());
|
|
|
|
|
// Wait 30ms to guarantee the engine does not drop the frame.
|
|
|
|
|
EXPECT_TRUE(WaitAndSendFrame(30));
|
|
|
|
|
EXPECT_TRUE_WAIT(NumRtpPackets() > rtp_packets, kTimeout);
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
last_packet = NumRtpPackets() - 1;
|
|
|
|
|
p.reset(GetRtpPacket(static_cast<int>(last_packet)));
|
|
|
|
|
ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL);
|
|
|
|
|
EXPECT_EQ(789u, ssrc);
|
2017-12-15 17:44:33 +01:00
|
|
|
}
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
// Tests the behavior of incoming streams in a conference scenario.
|
|
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SimulateConference) {
|
|
|
|
|
cricket::FakeVideoRenderer renderer1, renderer2;
|
|
|
|
|
EXPECT_TRUE(SetDefaultCodec());
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(DefaultCodec());
|
|
|
|
|
parameters.conference_mode = true;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(2)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(1, &renderer1));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(2, &renderer2));
|
|
|
|
|
EXPECT_EQ(0, renderer1.num_rendered_frames());
|
|
|
|
|
EXPECT_EQ(0, renderer2.num_rendered_frames());
|
|
|
|
|
std::vector<uint32_t> ssrcs;
|
|
|
|
|
ssrcs.push_back(1);
|
|
|
|
|
ssrcs.push_back(2);
|
|
|
|
|
network_interface_.SetConferenceMode(true, ssrcs);
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_FRAME_ON_RENDERER_WAIT(renderer1, 1, kVideoWidth, kVideoHeight,
|
|
|
|
|
kTimeout);
|
|
|
|
|
EXPECT_FRAME_ON_RENDERER_WAIT(renderer2, 1, kVideoWidth, kVideoHeight,
|
|
|
|
|
kTimeout);
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<const rtc::CopyOnWriteBuffer> p(GetRtpPacket(0));
|
|
|
|
|
EXPECT_EQ(DefaultCodec().id, GetPayloadType(p.get()));
|
|
|
|
|
EXPECT_EQ(kVideoWidth, renderer1.width());
|
|
|
|
|
EXPECT_EQ(kVideoHeight, renderer1.height());
|
|
|
|
|
EXPECT_EQ(kVideoWidth, renderer2.width());
|
|
|
|
|
EXPECT_EQ(kVideoHeight, renderer2.height());
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveRecvStream(2));
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveRecvStream(1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tests that we can add and remove capturers and frames are sent out properly
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, DISABLED_AddRemoveCapturer) {
|
2018-04-11 15:18:34 +02:00
|
|
|
using cricket::VideoCodec;
|
|
|
|
|
using cricket::VideoOptions;
|
|
|
|
|
using cricket::VideoFormat;
|
|
|
|
|
using cricket::FOURCC_I420;
|
|
|
|
|
|
|
|
|
|
VideoCodec codec = DefaultCodec();
|
|
|
|
|
const int time_between_send_ms = VideoFormat::FpsToInterval(kFramerate);
|
|
|
|
|
EXPECT_TRUE(SetOneCodec(codec));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_));
|
|
|
|
|
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout);
|
|
|
|
|
std::unique_ptr<cricket::FakeVideoCapturerWithTaskQueue> capturer(
|
|
|
|
|
CreateFakeVideoCapturer());
|
|
|
|
|
|
|
|
|
|
// TODO(nisse): This testcase fails if we don't configure
|
|
|
|
|
// screencast. It's unclear why, I see nothing obvious in this
|
|
|
|
|
// test which is related to screencast logic.
|
|
|
|
|
VideoOptions video_options;
|
|
|
|
|
video_options.is_screencast = true;
|
|
|
|
|
channel_->SetVideoSend(kSsrc, &video_options, nullptr);
|
|
|
|
|
|
|
|
|
|
VideoFormat format(480, 360, VideoFormat::FpsToInterval(30), FOURCC_I420);
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer->Start(format));
|
|
|
|
|
// All capturers start generating frames with the same timestamp. ViE does
|
|
|
|
|
// not allow the same timestamp to be used. Capture one frame before
|
|
|
|
|
// associating the capturer with the channel.
|
|
|
|
|
EXPECT_TRUE(capturer->CaptureCustomFrame(format.width, format.height));
|
|
|
|
|
|
|
|
|
|
int captured_frames = 1;
|
|
|
|
|
for (int iterations = 0; iterations < 2; ++iterations) {
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrc, nullptr, capturer.get()));
|
|
|
|
|
rtc::Thread::Current()->ProcessMessages(time_between_send_ms);
|
|
|
|
|
EXPECT_TRUE(capturer->CaptureCustomFrame(format.width, format.height));
|
|
|
|
|
++captured_frames;
|
|
|
|
|
// Wait until frame of right size is captured.
|
|
|
|
|
EXPECT_TRUE_WAIT(renderer_.num_rendered_frames() >= captured_frames &&
|
|
|
|
|
format.width == renderer_.width() &&
|
|
|
|
|
format.height == renderer_.height() &&
|
|
|
|
|
!renderer_.black_frame(),
|
|
|
|
|
kTimeout);
|
|
|
|
|
EXPECT_GE(renderer_.num_rendered_frames(), captured_frames);
|
|
|
|
|
EXPECT_EQ(format.width, renderer_.width());
|
|
|
|
|
EXPECT_EQ(format.height, renderer_.height());
|
|
|
|
|
captured_frames = renderer_.num_rendered_frames() + 1;
|
|
|
|
|
EXPECT_FALSE(renderer_.black_frame());
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrc, nullptr, nullptr));
|
|
|
|
|
// Make sure a black frame is generated within the specified timeout.
|
|
|
|
|
// The black frame should be the resolution of the previous frame to
|
|
|
|
|
// prevent expensive encoder reconfigurations.
|
|
|
|
|
EXPECT_TRUE_WAIT(renderer_.num_rendered_frames() >= captured_frames &&
|
|
|
|
|
format.width == renderer_.width() &&
|
|
|
|
|
format.height == renderer_.height() &&
|
|
|
|
|
renderer_.black_frame(),
|
|
|
|
|
kTimeout);
|
|
|
|
|
EXPECT_GE(renderer_.num_rendered_frames(), captured_frames);
|
|
|
|
|
EXPECT_EQ(format.width, renderer_.width());
|
|
|
|
|
EXPECT_EQ(format.height, renderer_.height());
|
|
|
|
|
EXPECT_TRUE(renderer_.black_frame());
|
|
|
|
|
|
|
|
|
|
// The black frame has the same timestamp as the next frame since it's
|
|
|
|
|
// timestamp is set to the last frame's timestamp + interval. WebRTC will
|
|
|
|
|
// not render a frame with the same timestamp so capture another frame
|
|
|
|
|
// with the frame capturer to increment the next frame's timestamp.
|
|
|
|
|
EXPECT_TRUE(capturer->CaptureCustomFrame(format.width, format.height));
|
|
|
|
|
}
|
2017-12-15 17:44:33 +01:00
|
|
|
}
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2018-04-11 15:18:34 +02:00
|
|
|
// Tests that if SetVideoSend is called with a NULL capturer after the
|
|
|
|
|
// capturer was already removed, the application doesn't crash (and no black
|
|
|
|
|
// frame is sent).
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, RemoveCapturerWithoutAdd) {
|
2018-04-11 15:18:34 +02:00
|
|
|
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_));
|
|
|
|
|
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
|
|
|
|
EXPECT_TRUE(SendFrame());
|
|
|
|
|
EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout);
|
|
|
|
|
// Wait for one frame so they don't get dropped because we send frames too
|
|
|
|
|
// tightly.
|
|
|
|
|
rtc::Thread::Current()->ProcessMessages(30);
|
|
|
|
|
// Remove the capturer.
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrc, nullptr, nullptr));
|
|
|
|
|
|
|
|
|
|
// No capturer was added, so this SetVideoSend shouldn't do anything.
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrc, nullptr, nullptr));
|
|
|
|
|
rtc::Thread::Current()->ProcessMessages(300);
|
|
|
|
|
// Verify no more frames were sent.
|
|
|
|
|
EXPECT_EQ(1, renderer_.num_rendered_frames());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tests that we can add and remove capturer as unique sources.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, AddRemoveCapturerMultipleSources) {
|
2018-04-11 15:18:34 +02:00
|
|
|
// WebRTC implementation will drop frames if pushed to quickly. Wait the
|
|
|
|
|
// interval time to avoid that.
|
|
|
|
|
// WebRTC implementation will drop frames if pushed to quickly. Wait the
|
|
|
|
|
// interval time to avoid that.
|
|
|
|
|
// Set up the stream associated with the engine.
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kSsrc, &renderer_));
|
|
|
|
|
cricket::VideoFormat capture_format(
|
|
|
|
|
kVideoWidth, kVideoHeight,
|
|
|
|
|
cricket::VideoFormat::FpsToInterval(kFramerate), cricket::FOURCC_I420);
|
|
|
|
|
// Set up additional stream 1.
|
|
|
|
|
cricket::FakeVideoRenderer renderer1;
|
|
|
|
|
EXPECT_FALSE(channel_->SetSink(1, &renderer1));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(1, &renderer1));
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(cricket::StreamParams::CreateLegacy(1)));
|
|
|
|
|
std::unique_ptr<cricket::FakeVideoCapturerWithTaskQueue> capturer1(
|
|
|
|
|
CreateFakeVideoCapturer());
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer1->Start(capture_format));
|
|
|
|
|
// Set up additional stream 2.
|
|
|
|
|
cricket::FakeVideoRenderer renderer2;
|
|
|
|
|
EXPECT_FALSE(channel_->SetSink(2, &renderer2));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(2)));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(2, &renderer2));
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(cricket::StreamParams::CreateLegacy(2)));
|
|
|
|
|
std::unique_ptr<cricket::FakeVideoCapturerWithTaskQueue> capturer2(
|
|
|
|
|
CreateFakeVideoCapturer());
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer2->Start(capture_format));
|
|
|
|
|
// State for all the streams.
|
|
|
|
|
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
|
|
|
|
// A limitation in the lmi implementation requires that SetVideoSend() is
|
|
|
|
|
// called after SetOneCodec().
|
|
|
|
|
// TODO(hellner): this seems like an unnecessary constraint, fix it.
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(1, nullptr, capturer1.get()));
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(2, nullptr, capturer2.get()));
|
|
|
|
|
EXPECT_TRUE(SetSend(true));
|
|
|
|
|
// Test capturer associated with engine.
|
|
|
|
|
const int kTestWidth = 160;
|
|
|
|
|
const int kTestHeight = 120;
|
|
|
|
|
EXPECT_TRUE(capturer1->CaptureCustomFrame(kTestWidth, kTestHeight));
|
|
|
|
|
EXPECT_FRAME_ON_RENDERER_WAIT(renderer1, 1, kTestWidth, kTestHeight,
|
|
|
|
|
kTimeout);
|
|
|
|
|
// Capture a frame with additional capturer2, frames should be received
|
|
|
|
|
EXPECT_TRUE(capturer2->CaptureCustomFrame(kTestWidth, kTestHeight));
|
|
|
|
|
EXPECT_FRAME_ON_RENDERER_WAIT(renderer2, 1, kTestWidth, kTestHeight,
|
|
|
|
|
kTimeout);
|
|
|
|
|
// Successfully remove the capturer.
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrc, nullptr, nullptr));
|
|
|
|
|
// The capturers must be unregistered here as it runs out of it's scope
|
|
|
|
|
// next.
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(1, nullptr, nullptr));
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(2, nullptr, nullptr));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tests empty StreamParams is rejected.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, RejectEmptyStreamParams) {
|
2018-04-11 15:18:34 +02:00
|
|
|
// Remove the send stream that was added during Setup.
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveSendStream(kSsrc));
|
|
|
|
|
|
|
|
|
|
cricket::StreamParams empty;
|
|
|
|
|
EXPECT_FALSE(channel_->AddSendStream(empty));
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddSendStream(cricket::StreamParams::CreateLegacy(789u)));
|
2017-12-15 17:44:33 +01:00
|
|
|
}
|
2018-04-11 15:18:34 +02:00
|
|
|
|
|
|
|
|
// Test that multiple send streams can be created and deleted properly.
|
2017-12-15 17:44:33 +01:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, MultipleSendStreams) {
|
2018-04-11 15:18:34 +02:00
|
|
|
// Remove stream added in Setup. I.e. remove stream corresponding to default
|
|
|
|
|
// channel.
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveSendStream(kSsrc));
|
|
|
|
|
const unsigned int kSsrcsSize = sizeof(kSsrcs4) / sizeof(kSsrcs4[0]);
|
|
|
|
|
for (unsigned int i = 0; i < kSsrcsSize; ++i) {
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(
|
|
|
|
|
cricket::StreamParams::CreateLegacy(kSsrcs4[i])));
|
|
|
|
|
}
|
|
|
|
|
// Delete one of the non default channel streams, let the destructor delete
|
|
|
|
|
// the remaining ones.
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveSendStream(kSsrcs4[kSsrcsSize - 1]));
|
|
|
|
|
// Stream should already be deleted.
|
|
|
|
|
EXPECT_FALSE(channel_->RemoveSendStream(kSsrcs4[kSsrcsSize - 1]));
|
2017-12-15 17:44:33 +01:00
|
|
|
}
|
2014-09-03 15:25:49 +00:00
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SendAndReceiveVp8Vga) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
SendAndReceive(GetEngineCodec("VP8"));
|
2014-07-23 15:44:48 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SendAndReceiveVp8Qvga) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
SendAndReceive(GetEngineCodec("VP8"));
|
2014-07-23 15:44:48 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, SendAndReceiveVp8SvcQqvga) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
SendAndReceive(GetEngineCodec("VP8"));
|
2014-07-23 15:44:48 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelBaseTest, TwoStreamsSendAndReceive) {
|
2016-04-20 16:31:53 +02:00
|
|
|
// Set a high bitrate to not be downscaled by VP8 due to low initial start
|
|
|
|
|
// bitrates. This currently happens at <250k, and two streams sharing 300k
|
|
|
|
|
// initially will use QVGA instead of VGA.
|
|
|
|
|
// TODO(pbos): Set up the quality scaler so that both senders reliably start
|
|
|
|
|
// at QVGA, then verify that instead.
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoCodec codec = GetEngineCodec("VP8");
|
2016-04-20 16:31:53 +02:00
|
|
|
codec.params[kCodecParamStartBitrate] = "1000000";
|
2018-04-11 15:18:34 +02:00
|
|
|
TwoStreamsSendAndReceive(codec);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
class WebRtcVideoChannelTest : public WebRtcVideoEngineTest {
|
2014-05-13 11:07:01 +00:00
|
|
|
public:
|
2017-06-12 01:16:46 -07:00
|
|
|
WebRtcVideoChannelTest() : WebRtcVideoChannelTest("") {}
|
|
|
|
|
explicit WebRtcVideoChannelTest(const char* field_trials)
|
|
|
|
|
: WebRtcVideoEngineTest(field_trials), last_ssrc_(0) {}
|
2015-03-04 12:58:35 +00:00
|
|
|
void SetUp() override {
|
2018-05-14 09:48:06 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP9");
|
|
|
|
|
#if defined(WEBRTC_USE_H264)
|
|
|
|
|
encoder_factory_->AddSupportedVideoCodecType("H264");
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-02-21 13:07:13 +01:00
|
|
|
fake_call_.reset(new FakeCall());
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
channel_.reset(engine_.CreateChannel(fake_call_.get(), GetMediaConfig(),
|
|
|
|
|
VideoOptions()));
|
2016-11-22 16:08:30 -08:00
|
|
|
channel_->OnReadyToSend(true);
|
2014-05-13 11:07:01 +00:00
|
|
|
last_ssrc_ = 123;
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.codecs = engine_.codecs();
|
|
|
|
|
recv_parameters_.codecs = engine_.codecs();
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FakeVideoSendStream* AddSendStream() {
|
2014-10-03 11:25:45 +00:00
|
|
|
return AddSendStream(StreamParams::CreateLegacy(++last_ssrc_));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* AddSendStream(const StreamParams& sp) {
|
2014-10-03 11:25:45 +00:00
|
|
|
size_t num_streams = fake_call_->GetVideoSendStreams().size();
|
2014-05-13 11:07:01 +00:00
|
|
|
EXPECT_TRUE(channel_->AddSendStream(sp));
|
|
|
|
|
std::vector<FakeVideoSendStream*> streams =
|
2014-10-03 11:25:45 +00:00
|
|
|
fake_call_->GetVideoSendStreams();
|
2014-05-13 11:07:01 +00:00
|
|
|
EXPECT_EQ(num_streams + 1, streams.size());
|
|
|
|
|
return streams[streams.size() - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<FakeVideoSendStream*> GetFakeSendStreams() {
|
2014-10-03 11:25:45 +00:00
|
|
|
return fake_call_->GetVideoSendStreams();
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* AddRecvStream() {
|
2014-10-03 11:25:45 +00:00
|
|
|
return AddRecvStream(StreamParams::CreateLegacy(++last_ssrc_));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* AddRecvStream(const StreamParams& sp) {
|
2014-10-03 11:25:45 +00:00
|
|
|
size_t num_streams = fake_call_->GetVideoReceiveStreams().size();
|
2014-05-13 11:07:01 +00:00
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
|
|
|
|
std::vector<FakeVideoReceiveStream*> streams =
|
2014-10-03 11:25:45 +00:00
|
|
|
fake_call_->GetVideoReceiveStreams();
|
2014-05-13 11:07:01 +00:00
|
|
|
EXPECT_EQ(num_streams + 1, streams.size());
|
|
|
|
|
return streams[streams.size() - 1];
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-25 14:03:34 +00:00
|
|
|
void SetSendCodecsShouldWorkForBitrates(const char* min_bitrate_kbps,
|
|
|
|
|
int expected_min_bitrate_bps,
|
|
|
|
|
const char* start_bitrate_kbps,
|
|
|
|
|
int expected_start_bitrate_bps,
|
|
|
|
|
const char* max_bitrate_kbps,
|
|
|
|
|
int expected_max_bitrate_bps) {
|
2018-02-21 13:07:13 +01:00
|
|
|
ExpectSetBitrateParameters(expected_min_bitrate_bps,
|
|
|
|
|
expected_start_bitrate_bps,
|
|
|
|
|
expected_max_bitrate_bps);
|
2015-09-17 16:42:56 +02:00
|
|
|
auto& codecs = send_parameters_.codecs;
|
|
|
|
|
codecs.clear();
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
codecs.push_back(GetEngineCodec("VP8"));
|
2014-11-25 14:03:34 +00:00
|
|
|
codecs[0].params[kCodecParamMinBitrate] = min_bitrate_kbps;
|
|
|
|
|
codecs[0].params[kCodecParamStartBitrate] = start_bitrate_kbps;
|
|
|
|
|
codecs[0].params[kCodecParamMaxBitrate] = max_bitrate_kbps;
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2018-02-21 13:07:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ExpectSetBitrateParameters(int min_bitrate_bps,
|
|
|
|
|
int start_bitrate_bps,
|
|
|
|
|
int max_bitrate_bps) {
|
|
|
|
|
EXPECT_CALL(
|
|
|
|
|
*fake_call_->GetMockTransportControllerSend(),
|
|
|
|
|
SetSdpBitrateParameters(AllOf(
|
|
|
|
|
Field(&BitrateConstraints::min_bitrate_bps, min_bitrate_bps),
|
|
|
|
|
Field(&BitrateConstraints::start_bitrate_bps, start_bitrate_bps),
|
|
|
|
|
Field(&BitrateConstraints::max_bitrate_bps, max_bitrate_bps))));
|
|
|
|
|
}
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2018-02-21 13:07:13 +01:00
|
|
|
void ExpectSetMaxBitrate(int max_bitrate_bps) {
|
|
|
|
|
EXPECT_CALL(*fake_call_->GetMockTransportControllerSend(),
|
|
|
|
|
SetSdpBitrateParameters(Field(
|
|
|
|
|
&BitrateConstraints::max_bitrate_bps, max_bitrate_bps)));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2016-05-26 11:24:55 -07:00
|
|
|
void TestSetSendRtpHeaderExtensions(const std::string& ext_uri) {
|
2014-06-16 17:32:02 +00:00
|
|
|
// Enable extension.
|
|
|
|
|
const int id = 1;
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters = send_parameters_;
|
2016-05-26 11:24:55 -07:00
|
|
|
parameters.extensions.push_back(RtpExtension(ext_uri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-06-16 17:32:02 +00:00
|
|
|
FakeVideoSendStream* send_stream =
|
|
|
|
|
AddSendStream(cricket::StreamParams::CreateLegacy(123));
|
|
|
|
|
|
|
|
|
|
// Verify the send extension id.
|
|
|
|
|
ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
|
|
|
|
|
EXPECT_EQ(id, send_stream->GetConfig().rtp.extensions[0].id);
|
2016-05-26 11:24:55 -07:00
|
|
|
EXPECT_EQ(ext_uri, send_stream->GetConfig().rtp.extensions[0].uri);
|
2014-06-16 17:32:02 +00:00
|
|
|
// Verify call with same set of extensions returns true.
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-06-16 17:32:02 +00:00
|
|
|
// Verify that SetSendRtpHeaderExtensions doesn't implicitly add them for
|
|
|
|
|
// receivers.
|
|
|
|
|
EXPECT_TRUE(AddRecvStream(cricket::StreamParams::CreateLegacy(123))
|
|
|
|
|
->GetConfig()
|
|
|
|
|
.rtp.extensions.empty());
|
|
|
|
|
|
2014-07-18 09:35:58 +00:00
|
|
|
// Verify that existing RTP header extensions can be removed.
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-09-15 12:26:33 +02:00
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
|
|
|
|
|
send_stream = fake_call_->GetVideoSendStreams()[0];
|
2014-07-18 09:35:58 +00:00
|
|
|
EXPECT_TRUE(send_stream->GetConfig().rtp.extensions.empty());
|
|
|
|
|
|
|
|
|
|
// Verify that adding receive RTP header extensions adds them for existing
|
|
|
|
|
// streams.
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2015-09-15 12:26:33 +02:00
|
|
|
send_stream = fake_call_->GetVideoSendStreams()[0];
|
2014-07-18 09:35:58 +00:00
|
|
|
ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
|
|
|
|
|
EXPECT_EQ(id, send_stream->GetConfig().rtp.extensions[0].id);
|
2016-05-26 11:24:55 -07:00
|
|
|
EXPECT_EQ(ext_uri, send_stream->GetConfig().rtp.extensions[0].uri);
|
2014-06-16 17:32:02 +00:00
|
|
|
}
|
|
|
|
|
|
2016-05-26 11:24:55 -07:00
|
|
|
void TestSetRecvRtpHeaderExtensions(const std::string& ext_uri) {
|
2014-06-16 17:32:02 +00:00
|
|
|
// Enable extension.
|
|
|
|
|
const int id = 1;
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters = recv_parameters_;
|
2016-05-26 11:24:55 -07:00
|
|
|
parameters.extensions.push_back(RtpExtension(ext_uri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2014-06-16 17:32:02 +00:00
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* recv_stream =
|
|
|
|
|
AddRecvStream(cricket::StreamParams::CreateLegacy(123));
|
|
|
|
|
|
|
|
|
|
// Verify the recv extension id.
|
|
|
|
|
ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size());
|
|
|
|
|
EXPECT_EQ(id, recv_stream->GetConfig().rtp.extensions[0].id);
|
2016-05-26 11:24:55 -07:00
|
|
|
EXPECT_EQ(ext_uri, recv_stream->GetConfig().rtp.extensions[0].uri);
|
2014-06-16 17:32:02 +00:00
|
|
|
// Verify call with same set of extensions returns true.
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2014-07-18 09:35:58 +00:00
|
|
|
|
2014-06-16 17:32:02 +00:00
|
|
|
// Verify that SetRecvRtpHeaderExtensions doesn't implicitly add them for
|
|
|
|
|
// senders.
|
|
|
|
|
EXPECT_TRUE(AddSendStream(cricket::StreamParams::CreateLegacy(123))
|
|
|
|
|
->GetConfig()
|
|
|
|
|
.rtp.extensions.empty());
|
|
|
|
|
|
2014-07-18 09:35:58 +00:00
|
|
|
// Verify that existing RTP header extensions can be removed.
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
|
2015-09-15 12:26:33 +02:00
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
2014-07-18 09:35:58 +00:00
|
|
|
EXPECT_TRUE(recv_stream->GetConfig().rtp.extensions.empty());
|
|
|
|
|
|
|
|
|
|
// Verify that adding receive RTP header extensions adds them for existing
|
|
|
|
|
// streams.
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2015-09-15 12:26:33 +02:00
|
|
|
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
2014-07-18 09:35:58 +00:00
|
|
|
ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size());
|
|
|
|
|
EXPECT_EQ(id, recv_stream->GetConfig().rtp.extensions[0].id);
|
2016-05-26 11:24:55 -07:00
|
|
|
EXPECT_EQ(ext_uri, recv_stream->GetConfig().rtp.extensions[0].uri);
|
2014-06-16 17:32:02 +00:00
|
|
|
}
|
|
|
|
|
|
2015-10-29 18:53:23 +01:00
|
|
|
void TestExtensionFilter(const std::vector<std::string>& extensions,
|
|
|
|
|
const std::string& expected_extension) {
|
|
|
|
|
cricket::VideoSendParameters parameters = send_parameters_;
|
|
|
|
|
int expected_id = -1;
|
|
|
|
|
int id = 1;
|
|
|
|
|
for (const std::string& extension : extensions) {
|
|
|
|
|
if (extension == expected_extension)
|
|
|
|
|
expected_id = id;
|
2016-05-26 11:24:55 -07:00
|
|
|
parameters.extensions.push_back(RtpExtension(extension, id++));
|
2015-10-29 18:53:23 +01:00
|
|
|
}
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
FakeVideoSendStream* send_stream =
|
|
|
|
|
AddSendStream(cricket::StreamParams::CreateLegacy(123));
|
|
|
|
|
|
|
|
|
|
// Verify that only one of them has been set, and that it is the one with
|
|
|
|
|
// highest priority (transport sequence number).
|
|
|
|
|
ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
|
|
|
|
|
EXPECT_EQ(expected_id, send_stream->GetConfig().rtp.extensions[0].id);
|
|
|
|
|
EXPECT_EQ(expected_extension,
|
2016-05-26 11:24:55 -07:00
|
|
|
send_stream->GetConfig().rtp.extensions[0].uri);
|
2015-10-29 18:53:23 +01:00
|
|
|
}
|
|
|
|
|
|
2017-06-14 05:52:21 -07:00
|
|
|
void TestDegradationPreference(bool resolution_scaling_enabled,
|
|
|
|
|
bool fps_scaling_enabled);
|
|
|
|
|
|
2015-04-29 16:21:28 +02:00
|
|
|
void TestCpuAdaptation(bool enable_overuse, bool is_screenshare);
|
2015-05-22 18:48:36 +02:00
|
|
|
void TestReceiverLocalSsrcConfiguration(bool receiver_first);
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
void TestReceiveUnsignaledSsrcPacket(uint8_t payload_type,
|
|
|
|
|
bool expect_created_receive_stream);
|
2014-10-03 11:25:45 +00:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
FakeVideoSendStream* SetDenoisingOption(
|
2016-03-16 02:22:50 -07:00
|
|
|
uint32_t ssrc,
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue* capturer,
|
2016-03-01 04:29:59 -08:00
|
|
|
bool enabled) {
|
2016-03-16 02:22:50 -07:00
|
|
|
cricket::VideoOptions options;
|
2017-11-16 11:09:55 +01:00
|
|
|
options.video_noise_reduction = enabled;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(ssrc, &options, capturer));
|
2016-03-01 04:29:59 -08:00
|
|
|
// Options only take effect on the next frame.
|
|
|
|
|
EXPECT_TRUE(capturer->CaptureFrame());
|
|
|
|
|
|
2015-04-28 10:01:41 +02:00
|
|
|
return fake_call_->GetVideoSendStreams().back();
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-09 14:32:14 +02:00
|
|
|
FakeVideoSendStream* SetUpSimulcast(bool enabled, bool with_rtx) {
|
|
|
|
|
const int kRtxSsrcOffset = 0xDEADBEEF;
|
2015-04-28 10:01:41 +02:00
|
|
|
last_ssrc_ += 3;
|
2015-09-09 14:32:14 +02:00
|
|
|
std::vector<uint32_t> ssrcs;
|
|
|
|
|
std::vector<uint32_t> rtx_ssrcs;
|
|
|
|
|
uint32_t num_streams = enabled ? 3 : 1;
|
|
|
|
|
for (uint32_t i = 0; i < num_streams; ++i) {
|
|
|
|
|
uint32_t ssrc = last_ssrc_ + i;
|
|
|
|
|
ssrcs.push_back(ssrc);
|
|
|
|
|
if (with_rtx) {
|
|
|
|
|
rtx_ssrcs.push_back(ssrc + kRtxSsrcOffset);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (with_rtx) {
|
|
|
|
|
return AddSendStream(
|
|
|
|
|
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
|
2015-04-28 10:01:41 +02:00
|
|
|
}
|
2015-09-09 14:32:14 +02:00
|
|
|
return AddSendStream(CreateSimStreamParams("cname", ssrcs));
|
2015-04-28 10:01:41 +02:00
|
|
|
}
|
|
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
int GetMaxEncoderBitrate() {
|
2016-03-16 19:07:43 -07:00
|
|
|
std::vector<FakeVideoSendStream*> streams =
|
|
|
|
|
fake_call_->GetVideoSendStreams();
|
2016-10-02 23:45:26 -07:00
|
|
|
EXPECT_EQ(1u, streams.size());
|
2016-03-16 19:07:43 -07:00
|
|
|
FakeVideoSendStream* stream = streams[streams.size() - 1];
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(1u, stream->GetEncoderConfig().number_of_streams);
|
2016-10-02 23:45:26 -07:00
|
|
|
return stream->GetVideoStreams()[0].max_bitrate_bps;
|
2016-03-16 19:07:43 -07:00
|
|
|
}
|
|
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
void SetAndExpectMaxBitrate(int global_max,
|
2016-03-16 19:07:43 -07:00
|
|
|
int stream_max,
|
|
|
|
|
int expected_encoder_bitrate) {
|
|
|
|
|
VideoSendParameters limited_send_params = send_parameters_;
|
|
|
|
|
limited_send_params.max_bandwidth_bps = global_max;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(limited_send_params));
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters parameters =
|
|
|
|
|
channel_->GetRtpSendParameters(last_ssrc_);
|
2016-03-16 19:07:43 -07:00
|
|
|
EXPECT_EQ(1UL, parameters.encodings.size());
|
2017-11-16 11:09:55 +01:00
|
|
|
parameters.encodings[0].max_bitrate_bps = stream_max;
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2016-03-16 19:07:43 -07:00
|
|
|
// Read back the parameteres and verify they have the correct value
|
2016-05-16 11:40:30 -07:00
|
|
|
parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
2016-03-16 19:07:43 -07:00
|
|
|
EXPECT_EQ(1UL, parameters.encodings.size());
|
2017-11-16 11:09:55 +01:00
|
|
|
EXPECT_EQ(stream_max, parameters.encodings[0].max_bitrate_bps);
|
2016-03-16 19:07:43 -07:00
|
|
|
// Verify that the new value propagated down to the encoder
|
2016-10-02 23:45:26 -07:00
|
|
|
EXPECT_EQ(expected_encoder_bitrate, GetMaxEncoderBitrate());
|
2016-03-16 19:07:43 -07:00
|
|
|
}
|
|
|
|
|
|
2018-06-18 17:51:32 +02:00
|
|
|
// Values from kSimulcastConfigs in simulcast.cc.
|
|
|
|
|
const std::vector<webrtc::VideoStream> GetSimulcastBitrates720p() const {
|
|
|
|
|
std::vector<webrtc::VideoStream> layers(3);
|
|
|
|
|
layers[0].min_bitrate_bps = 30000;
|
|
|
|
|
layers[0].target_bitrate_bps = 150000;
|
|
|
|
|
layers[0].max_bitrate_bps = 200000;
|
|
|
|
|
layers[1].min_bitrate_bps = 150000;
|
|
|
|
|
layers[1].target_bitrate_bps = 500000;
|
|
|
|
|
layers[1].max_bitrate_bps = 700000;
|
|
|
|
|
layers[2].min_bitrate_bps = 600000;
|
|
|
|
|
layers[2].target_bitrate_bps = 2500000;
|
|
|
|
|
layers[2].max_bitrate_bps = 2500000;
|
|
|
|
|
return layers;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<FakeCall> fake_call_;
|
|
|
|
|
std::unique_ptr<VideoMediaChannel> channel_;
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters send_parameters_;
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters_;
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
uint32_t last_ssrc_;
|
2014-05-13 11:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetsSyncGroupFromSyncLabel) {
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const uint32_t kVideoSsrc = 123;
|
2015-07-15 08:02:58 -07:00
|
|
|
const std::string kSyncLabel = "AvSyncLabel";
|
|
|
|
|
|
|
|
|
|
cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kVideoSsrc);
|
2018-03-02 11:34:10 -08:00
|
|
|
sp.set_stream_ids({kSyncLabel});
|
2015-07-15 08:02:58 -07:00
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
|
|
|
|
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
2015-07-15 08:02:58 -07:00
|
|
|
EXPECT_EQ(kSyncLabel,
|
|
|
|
|
fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group)
|
|
|
|
|
<< "SyncGroup should be set based on sync_label";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RecvStreamWithSimAndRtx) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs = engine_.codecs();
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
2016-02-17 05:25:36 -08:00
|
|
|
parameters.conference_mode = true;
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
|
|
|
|
|
// Send side.
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
|
|
|
|
|
const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
|
2014-05-13 11:07:01 +00:00
|
|
|
FakeVideoSendStream* send_stream = AddSendStream(
|
|
|
|
|
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size());
|
|
|
|
|
for (size_t i = 0; i < rtx_ssrcs.size(); ++i)
|
|
|
|
|
EXPECT_EQ(rtx_ssrcs[i], send_stream->GetConfig().rtp.rtx.ssrcs[i]);
|
|
|
|
|
|
|
|
|
|
// Receiver side.
|
|
|
|
|
FakeVideoReceiveStream* recv_stream = AddRecvStream(
|
|
|
|
|
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
|
2017-08-25 04:44:25 -07:00
|
|
|
EXPECT_FALSE(
|
|
|
|
|
recv_stream->GetConfig().rtp.rtx_associated_payload_types.empty());
|
Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3007303002/ )
Reason for revert:
Identified a configuration problem in the video quality tests. Intend to fix and reland.
Original issue's description:
> Revert of Use RtxReceiveStream. (patchset #5 id:320001 of https://codereview.webrtc.org/3006063002/ )
>
> Reason for revert:
> This change appears to break ulpfec, with severe regressions, e.g., for webrtc_perf_test FullStackTest.ForemanCifPlr5Ulpfec
>
> Original issue's description:
> > Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3010983002/ )
> >
> > Reason for revert:
> > Intend to fix perf failures and reland.
> >
> > Original issue's description:
> > > Revert of Use RtxReceiveStream. (patchset #5 id:80001 of https://codereview.webrtc.org/3008773002/ )
> > >
> > > Reason for revert:
> > > A few perf tests broken, including
> > >
> > > RampUpTest.UpDownUpAbsSendTimeSimulcastRedRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberPacketLoss
> > >
> > >
> > > Original issue's description:
> > > > Use RtxReceiveStream.
> > > >
> > > > This also has the beneficial side-effect that when a media stream
> > > > which is protected by FlexFEC receives an RTX retransmission, the
> > > > retransmitted media packet is passed into the FlexFEC machinery,
> > > > which should improve its ability to recover packets via FEC.
> > > >
> > > > BUG=webrtc:7135
> > > >
> > > > Review-Url: https://codereview.webrtc.org/3008773002
> > > > Cr-Commit-Position: refs/heads/master@{#19649}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/5c0f6c62ea3b1d2c43f8fc152961af27033475f7
> > >
> > > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:7135
> > >
> > > Review-Url: https://codereview.webrtc.org/3010983002
> > > Cr-Commit-Position: refs/heads/master@{#19653}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/3c39c0137afa274d1d524b150b50304b38a2847b
> >
> > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > BUG=webrtc:7135
> >
> > Review-Url: https://codereview.webrtc.org/3006063002
> > Cr-Commit-Position: refs/heads/master@{#19715}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/35713eaf565c0fef07c8afc158d7b8fdf7ec3d78
>
> TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:7135
>
> Review-Url: https://codereview.webrtc.org/3007303002
> Cr-Commit-Position: refs/heads/master@{#19744}
> Committed: https://chromium.googlesource.com/external/webrtc/+/8e7eee035178a7f10e19883681b5eaa4a7523107
TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7135
Review-Url: https://codereview.webrtc.org/3012963002
Cr-Commit-Position: refs/heads/master@{#19765}
2017-09-11 02:32:16 -07:00
|
|
|
EXPECT_TRUE(VerifyRtxReceiveAssociations(recv_stream->GetConfig()))
|
2016-05-12 16:44:36 +02:00
|
|
|
<< "RTX should be mapped for all decoders/payload types.";
|
Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3007303002/ )
Reason for revert:
Identified a configuration problem in the video quality tests. Intend to fix and reland.
Original issue's description:
> Revert of Use RtxReceiveStream. (patchset #5 id:320001 of https://codereview.webrtc.org/3006063002/ )
>
> Reason for revert:
> This change appears to break ulpfec, with severe regressions, e.g., for webrtc_perf_test FullStackTest.ForemanCifPlr5Ulpfec
>
> Original issue's description:
> > Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3010983002/ )
> >
> > Reason for revert:
> > Intend to fix perf failures and reland.
> >
> > Original issue's description:
> > > Revert of Use RtxReceiveStream. (patchset #5 id:80001 of https://codereview.webrtc.org/3008773002/ )
> > >
> > > Reason for revert:
> > > A few perf tests broken, including
> > >
> > > RampUpTest.UpDownUpAbsSendTimeSimulcastRedRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberPacketLoss
> > >
> > >
> > > Original issue's description:
> > > > Use RtxReceiveStream.
> > > >
> > > > This also has the beneficial side-effect that when a media stream
> > > > which is protected by FlexFEC receives an RTX retransmission, the
> > > > retransmitted media packet is passed into the FlexFEC machinery,
> > > > which should improve its ability to recover packets via FEC.
> > > >
> > > > BUG=webrtc:7135
> > > >
> > > > Review-Url: https://codereview.webrtc.org/3008773002
> > > > Cr-Commit-Position: refs/heads/master@{#19649}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/5c0f6c62ea3b1d2c43f8fc152961af27033475f7
> > >
> > > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:7135
> > >
> > > Review-Url: https://codereview.webrtc.org/3010983002
> > > Cr-Commit-Position: refs/heads/master@{#19653}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/3c39c0137afa274d1d524b150b50304b38a2847b
> >
> > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > BUG=webrtc:7135
> >
> > Review-Url: https://codereview.webrtc.org/3006063002
> > Cr-Commit-Position: refs/heads/master@{#19715}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/35713eaf565c0fef07c8afc158d7b8fdf7ec3d78
>
> TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:7135
>
> Review-Url: https://codereview.webrtc.org/3007303002
> Cr-Commit-Position: refs/heads/master@{#19744}
> Committed: https://chromium.googlesource.com/external/webrtc/+/8e7eee035178a7f10e19883681b5eaa4a7523107
TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7135
Review-Url: https://codereview.webrtc.org/3012963002
Cr-Commit-Position: refs/heads/master@{#19765}
2017-09-11 02:32:16 -07:00
|
|
|
EXPECT_TRUE(HasRtxReceiveAssociation(recv_stream->GetConfig(),
|
|
|
|
|
GetEngineCodec("red").id))
|
|
|
|
|
<< "RTX should be mapped for the RED payload type";
|
|
|
|
|
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
EXPECT_EQ(rtx_ssrcs[0], recv_stream->GetConfig().rtp.rtx_ssrc);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RecvStreamWithRtx) {
|
2014-06-13 11:47:28 +00:00
|
|
|
// Setup one channel with an associated RTX stream.
|
|
|
|
|
cricket::StreamParams params =
|
|
|
|
|
cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
|
|
|
|
|
params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]);
|
|
|
|
|
FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
EXPECT_EQ(kRtxSsrcs1[0], recv_stream->GetConfig().rtp.rtx_ssrc);
|
Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3007303002/ )
Reason for revert:
Identified a configuration problem in the video quality tests. Intend to fix and reland.
Original issue's description:
> Revert of Use RtxReceiveStream. (patchset #5 id:320001 of https://codereview.webrtc.org/3006063002/ )
>
> Reason for revert:
> This change appears to break ulpfec, with severe regressions, e.g., for webrtc_perf_test FullStackTest.ForemanCifPlr5Ulpfec
>
> Original issue's description:
> > Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3010983002/ )
> >
> > Reason for revert:
> > Intend to fix perf failures and reland.
> >
> > Original issue's description:
> > > Revert of Use RtxReceiveStream. (patchset #5 id:80001 of https://codereview.webrtc.org/3008773002/ )
> > >
> > > Reason for revert:
> > > A few perf tests broken, including
> > >
> > > RampUpTest.UpDownUpAbsSendTimeSimulcastRedRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberPacketLoss
> > >
> > >
> > > Original issue's description:
> > > > Use RtxReceiveStream.
> > > >
> > > > This also has the beneficial side-effect that when a media stream
> > > > which is protected by FlexFEC receives an RTX retransmission, the
> > > > retransmitted media packet is passed into the FlexFEC machinery,
> > > > which should improve its ability to recover packets via FEC.
> > > >
> > > > BUG=webrtc:7135
> > > >
> > > > Review-Url: https://codereview.webrtc.org/3008773002
> > > > Cr-Commit-Position: refs/heads/master@{#19649}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/5c0f6c62ea3b1d2c43f8fc152961af27033475f7
> > >
> > > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:7135
> > >
> > > Review-Url: https://codereview.webrtc.org/3010983002
> > > Cr-Commit-Position: refs/heads/master@{#19653}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/3c39c0137afa274d1d524b150b50304b38a2847b
> >
> > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > BUG=webrtc:7135
> >
> > Review-Url: https://codereview.webrtc.org/3006063002
> > Cr-Commit-Position: refs/heads/master@{#19715}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/35713eaf565c0fef07c8afc158d7b8fdf7ec3d78
>
> TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:7135
>
> Review-Url: https://codereview.webrtc.org/3007303002
> Cr-Commit-Position: refs/heads/master@{#19744}
> Committed: https://chromium.googlesource.com/external/webrtc/+/8e7eee035178a7f10e19883681b5eaa4a7523107
TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7135
Review-Url: https://codereview.webrtc.org/3012963002
Cr-Commit-Position: refs/heads/master@{#19765}
2017-09-11 02:32:16 -07:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(VerifyRtxReceiveAssociations(recv_stream->GetConfig()))
|
|
|
|
|
<< "RTX should be mapped for all decoders/payload types.";
|
|
|
|
|
EXPECT_TRUE(HasRtxReceiveAssociation(recv_stream->GetConfig(),
|
|
|
|
|
GetEngineCodec("red").id))
|
|
|
|
|
<< "RTX should be mapped for the RED payload type";
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RecvStreamNoRtx) {
|
2014-06-13 11:47:28 +00:00
|
|
|
// Setup one channel without an associated RTX stream.
|
|
|
|
|
cricket::StreamParams params =
|
|
|
|
|
cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
|
|
|
|
|
FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
ASSERT_EQ(0U, recv_stream->GetConfig().rtp.rtx_ssrc);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, NoHeaderExtesionsByDefault) {
|
2014-06-16 17:32:02 +00:00
|
|
|
FakeVideoSendStream* send_stream =
|
|
|
|
|
AddSendStream(cricket::StreamParams::CreateLegacy(kSsrcs1[0]));
|
|
|
|
|
ASSERT_TRUE(send_stream->GetConfig().rtp.extensions.empty());
|
|
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* recv_stream =
|
|
|
|
|
AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrcs1[0]));
|
|
|
|
|
ASSERT_TRUE(recv_stream->GetConfig().rtp.extensions.empty());
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2014-06-16 17:32:02 +00:00
|
|
|
// Test support for RTP timestamp offset header extension.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SendRtpTimestampOffsetHeaderExtensions) {
|
2016-05-26 11:24:55 -07:00
|
|
|
TestSetSendRtpHeaderExtensions(RtpExtension::kTimestampOffsetUri);
|
2014-06-16 17:32:02 +00:00
|
|
|
}
|
2016-05-26 11:24:55 -07:00
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RecvRtpTimestampOffsetHeaderExtensions) {
|
2016-05-26 11:24:55 -07:00
|
|
|
TestSetRecvRtpHeaderExtensions(RtpExtension::kTimestampOffsetUri);
|
2014-06-16 17:32:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test support for absolute send time header extension.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SendAbsoluteSendTimeHeaderExtensions) {
|
2016-05-26 11:24:55 -07:00
|
|
|
TestSetSendRtpHeaderExtensions(RtpExtension::kAbsSendTimeUri);
|
2014-06-16 17:32:02 +00:00
|
|
|
}
|
2016-05-26 11:24:55 -07:00
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RecvAbsoluteSendTimeHeaderExtensions) {
|
2016-05-26 11:24:55 -07:00
|
|
|
TestSetRecvRtpHeaderExtensions(RtpExtension::kAbsSendTimeUri);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, FiltersExtensionsPicksTransportSeqNum) {
|
2015-10-29 18:53:23 +01:00
|
|
|
// Enable three redundant extensions.
|
|
|
|
|
std::vector<std::string> extensions;
|
2016-05-26 11:24:55 -07:00
|
|
|
extensions.push_back(RtpExtension::kAbsSendTimeUri);
|
|
|
|
|
extensions.push_back(RtpExtension::kTimestampOffsetUri);
|
|
|
|
|
extensions.push_back(RtpExtension::kTransportSequenceNumberUri);
|
|
|
|
|
TestExtensionFilter(extensions, RtpExtension::kTransportSequenceNumberUri);
|
2015-10-29 18:53:23 +01:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, FiltersExtensionsPicksAbsSendTime) {
|
2015-10-29 18:53:23 +01:00
|
|
|
// Enable two redundant extensions.
|
|
|
|
|
std::vector<std::string> extensions;
|
2016-05-26 11:24:55 -07:00
|
|
|
extensions.push_back(RtpExtension::kAbsSendTimeUri);
|
|
|
|
|
extensions.push_back(RtpExtension::kTimestampOffsetUri);
|
|
|
|
|
TestExtensionFilter(extensions, RtpExtension::kAbsSendTimeUri);
|
2015-10-29 18:53:23 +01:00
|
|
|
}
|
|
|
|
|
|
2015-10-15 07:26:07 -07:00
|
|
|
// Test support for transport sequence number header extension.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SendTransportSequenceNumberHeaderExtensions) {
|
2016-05-26 11:24:55 -07:00
|
|
|
TestSetSendRtpHeaderExtensions(RtpExtension::kTransportSequenceNumberUri);
|
2015-10-15 07:26:07 -07:00
|
|
|
}
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RecvTransportSequenceNumberHeaderExtensions) {
|
2016-05-26 11:24:55 -07:00
|
|
|
TestSetRecvRtpHeaderExtensions(RtpExtension::kTransportSequenceNumberUri);
|
2015-10-15 07:26:07 -07:00
|
|
|
}
|
|
|
|
|
|
2015-04-01 15:33:06 -07:00
|
|
|
// Test support for video rotation header extension.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SendVideoRotationHeaderExtensions) {
|
2016-05-26 11:24:55 -07:00
|
|
|
TestSetSendRtpHeaderExtensions(RtpExtension::kVideoRotationUri);
|
2015-04-01 15:33:06 -07:00
|
|
|
}
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RecvVideoRotationHeaderExtensions) {
|
2016-05-26 11:24:55 -07:00
|
|
|
TestSetRecvRtpHeaderExtensions(RtpExtension::kVideoRotationUri);
|
2015-04-01 15:33:06 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, IdenticalSendExtensionsDoesntRecreateStream) {
|
2015-10-29 18:53:23 +01:00
|
|
|
const int kAbsSendTimeId = 1;
|
|
|
|
|
const int kVideoRotationId = 2;
|
2016-05-26 11:24:55 -07:00
|
|
|
send_parameters_.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
|
|
|
|
|
send_parameters_.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kVideoRotationUri, kVideoRotationId));
|
2015-01-05 18:51:13 +00:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-01-05 18:51:13 +00:00
|
|
|
FakeVideoSendStream* send_stream =
|
|
|
|
|
AddSendStream(cricket::StreamParams::CreateLegacy(123));
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
|
2015-10-29 18:53:23 +01:00
|
|
|
ASSERT_EQ(2u, send_stream->GetConfig().rtp.extensions.size());
|
2015-01-05 18:51:13 +00:00
|
|
|
|
|
|
|
|
// Setting the same extensions (even if in different order) shouldn't
|
|
|
|
|
// reallocate the stream.
|
2015-09-17 16:42:56 +02:00
|
|
|
std::reverse(send_parameters_.extensions.begin(),
|
|
|
|
|
send_parameters_.extensions.end());
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-01-05 18:51:13 +00:00
|
|
|
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
|
|
|
|
|
|
|
|
|
|
// Setting different extensions should recreate the stream.
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.extensions.resize(1);
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-01-05 18:51:13 +00:00
|
|
|
|
|
|
|
|
EXPECT_EQ(2, fake_call_->GetNumCreatedSendStreams());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, IdenticalRecvExtensionsDoesntRecreateStream) {
|
2015-01-05 18:51:13 +00:00
|
|
|
const int kTOffsetId = 1;
|
|
|
|
|
const int kAbsSendTimeId = 2;
|
2015-04-01 15:33:06 -07:00
|
|
|
const int kVideoRotationId = 3;
|
2016-05-26 11:24:55 -07:00
|
|
|
recv_parameters_.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
|
|
|
|
|
recv_parameters_.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kTOffsetId));
|
|
|
|
|
recv_parameters_.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kVideoRotationUri, kVideoRotationId));
|
2015-01-05 18:51:13 +00:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
|
2015-05-25 15:04:24 +02:00
|
|
|
FakeVideoReceiveStream* recv_stream =
|
2015-01-05 18:51:13 +00:00
|
|
|
AddRecvStream(cricket::StreamParams::CreateLegacy(123));
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
|
2015-05-25 15:04:24 +02:00
|
|
|
ASSERT_EQ(3u, recv_stream->GetConfig().rtp.extensions.size());
|
2015-01-05 18:51:13 +00:00
|
|
|
|
|
|
|
|
// Setting the same extensions (even if in different order) shouldn't
|
|
|
|
|
// reallocate the stream.
|
2015-09-17 16:42:56 +02:00
|
|
|
std::reverse(recv_parameters_.extensions.begin(),
|
|
|
|
|
recv_parameters_.extensions.end());
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
|
2015-01-05 18:51:13 +00:00
|
|
|
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
|
|
|
|
|
|
|
|
|
|
// Setting different extensions should recreate the stream.
|
2015-09-17 16:42:56 +02:00
|
|
|
recv_parameters_.extensions.resize(1);
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
|
2015-01-05 18:51:13 +00:00
|
|
|
|
|
|
|
|
EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2014-10-03 11:25:45 +00:00
|
|
|
SetSendRtpHeaderExtensionsExcludeUnsupportedExtensions) {
|
2014-07-20 15:27:35 +00:00
|
|
|
const int kUnsupportedId = 1;
|
|
|
|
|
const int kTOffsetId = 2;
|
|
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(kUnsupportedExtensionName, kUnsupportedId));
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kTOffsetId));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2014-07-20 15:27:35 +00:00
|
|
|
FakeVideoSendStream* send_stream =
|
|
|
|
|
AddSendStream(cricket::StreamParams::CreateLegacy(123));
|
|
|
|
|
|
|
|
|
|
// Only timestamp offset extension is set to send stream,
|
|
|
|
|
// unsupported rtp extension is ignored.
|
|
|
|
|
ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
|
2016-05-26 11:24:55 -07:00
|
|
|
EXPECT_STREQ(RtpExtension::kTimestampOffsetUri,
|
|
|
|
|
send_stream->GetConfig().rtp.extensions[0].uri.c_str());
|
2014-07-20 15:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2014-10-03 11:25:45 +00:00
|
|
|
SetRecvRtpHeaderExtensionsExcludeUnsupportedExtensions) {
|
2014-07-20 15:27:35 +00:00
|
|
|
const int kUnsupportedId = 1;
|
|
|
|
|
const int kTOffsetId = 2;
|
|
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
recv_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(kUnsupportedExtensionName, kUnsupportedId));
|
2015-09-17 16:42:56 +02:00
|
|
|
recv_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kTOffsetId));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
|
2014-07-20 15:27:35 +00:00
|
|
|
FakeVideoReceiveStream* recv_stream =
|
|
|
|
|
AddRecvStream(cricket::StreamParams::CreateLegacy(123));
|
|
|
|
|
|
|
|
|
|
// Only timestamp offset extension is set to receive stream,
|
|
|
|
|
// unsupported rtp extension is ignored.
|
|
|
|
|
ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size());
|
2016-05-26 11:24:55 -07:00
|
|
|
EXPECT_STREQ(RtpExtension::kTimestampOffsetUri,
|
|
|
|
|
recv_stream->GetConfig().rtp.extensions[0].uri.c_str());
|
2014-07-20 15:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendRtpHeaderExtensionsRejectsIncorrectIds) {
|
2015-03-31 15:08:04 +02:00
|
|
|
const int kIncorrectIds[] = {-2, -1, 0, 15, 16};
|
2015-01-28 21:36:55 +00:00
|
|
|
for (size_t i = 0; i < arraysize(kIncorrectIds); ++i) {
|
2016-05-26 11:24:55 -07:00
|
|
|
send_parameters_.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kIncorrectIds[i]));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_FALSE(channel_->SetSendParameters(send_parameters_))
|
2014-07-20 15:27:35 +00:00
|
|
|
<< "Bad extension id '" << kIncorrectIds[i] << "' accepted.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvRtpHeaderExtensionsRejectsIncorrectIds) {
|
2015-03-31 15:08:04 +02:00
|
|
|
const int kIncorrectIds[] = {-2, -1, 0, 15, 16};
|
2015-01-28 21:36:55 +00:00
|
|
|
for (size_t i = 0; i < arraysize(kIncorrectIds); ++i) {
|
2016-05-26 11:24:55 -07:00
|
|
|
recv_parameters_.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kIncorrectIds[i]));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(recv_parameters_))
|
2014-07-20 15:27:35 +00:00
|
|
|
<< "Bad extension id '" << kIncorrectIds[i] << "' accepted.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendRtpHeaderExtensionsRejectsDuplicateIds) {
|
2014-07-20 15:27:35 +00:00
|
|
|
const int id = 1;
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kAbsSendTimeUri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_FALSE(channel_->SetSendParameters(send_parameters_));
|
2014-07-20 15:27:35 +00:00
|
|
|
|
|
|
|
|
// Duplicate entries are also not supported.
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.extensions.clear();
|
|
|
|
|
send_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.extensions.push_back(send_parameters_.extensions.back());
|
|
|
|
|
EXPECT_FALSE(channel_->SetSendParameters(send_parameters_));
|
2014-07-20 15:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvRtpHeaderExtensionsRejectsDuplicateIds) {
|
2014-07-20 15:27:35 +00:00
|
|
|
const int id = 1;
|
2015-09-17 16:42:56 +02:00
|
|
|
recv_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
recv_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kAbsSendTimeUri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(recv_parameters_));
|
2014-07-20 15:27:35 +00:00
|
|
|
|
|
|
|
|
// Duplicate entries are also not supported.
|
2015-09-17 16:42:56 +02:00
|
|
|
recv_parameters_.extensions.clear();
|
|
|
|
|
recv_parameters_.extensions.push_back(
|
2016-05-26 11:24:55 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, id));
|
2015-09-17 16:42:56 +02:00
|
|
|
recv_parameters_.extensions.push_back(recv_parameters_.extensions.back());
|
|
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(recv_parameters_));
|
2014-07-20 15:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, AddRecvStreamOnlyUsesOneReceiveStream) {
|
2014-05-13 11:07:01 +00:00
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
|
2014-10-03 11:25:45 +00:00
|
|
|
EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RtcpIsCompoundByDefault) {
|
2015-06-05 14:09:38 +02:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
2015-10-02 02:36:56 -07:00
|
|
|
EXPECT_EQ(webrtc::RtcpMode::kCompound, stream->GetConfig().rtp.rtcp_mode);
|
2015-06-05 14:09:38 +02:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RembIsEnabledByDefault) {
|
2014-07-25 19:01:32 +00:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
EXPECT_TRUE(stream->GetConfig().rtp.remb);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, TransportCcIsEnabledByDefault) {
|
2015-11-20 18:05:48 -08:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
EXPECT_TRUE(stream->GetConfig().rtp.transport_cc);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RembCanBeEnabledAndDisabled) {
|
2014-07-25 19:01:32 +00:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
EXPECT_TRUE(stream->GetConfig().rtp.remb);
|
|
|
|
|
|
2015-05-11 12:48:12 +02:00
|
|
|
// Verify that REMB is turned off when send(!) codecs without REMB are set.
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(RemoveFeedbackParams(GetEngineCodec("VP8")));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(parameters.codecs[0].feedback_params.params().empty());
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-10-03 11:25:45 +00:00
|
|
|
stream = fake_call_->GetVideoReceiveStreams()[0];
|
2014-07-25 19:01:32 +00:00
|
|
|
EXPECT_FALSE(stream->GetConfig().rtp.remb);
|
|
|
|
|
|
|
|
|
|
// Verify that REMB is turned on when setting default codecs since the
|
|
|
|
|
// default codecs have REMB enabled.
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs = engine_.codecs();
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-10-03 11:25:45 +00:00
|
|
|
stream = fake_call_->GetVideoReceiveStreams()[0];
|
2014-07-25 19:01:32 +00:00
|
|
|
EXPECT_TRUE(stream->GetConfig().rtp.remb);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, TransportCcCanBeEnabledAndDisabled) {
|
2015-11-20 18:05:48 -08:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
EXPECT_TRUE(stream->GetConfig().rtp.transport_cc);
|
|
|
|
|
|
|
|
|
|
// Verify that transport cc feedback is turned off when send(!) codecs without
|
|
|
|
|
// transport cc feedback are set.
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(RemoveFeedbackParams(GetEngineCodec("VP8")));
|
2015-11-20 18:05:48 -08:00
|
|
|
EXPECT_TRUE(parameters.codecs[0].feedback_params.params().empty());
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
stream = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_FALSE(stream->GetConfig().rtp.transport_cc);
|
|
|
|
|
|
|
|
|
|
// Verify that transport cc feedback is turned on when setting default codecs
|
|
|
|
|
// since the default codecs have transport cc feedback enabled.
|
|
|
|
|
parameters.codecs = engine_.codecs();
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
stream = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_TRUE(stream->GetConfig().rtp.transport_cc);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, NackIsEnabledByDefault) {
|
2018-05-14 09:48:06 +02:00
|
|
|
AssignDefaultCodec();
|
2014-06-13 12:27:38 +00:00
|
|
|
VerifyCodecHasDefaultFeedbackParams(default_codec_);
|
|
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs = engine_.codecs();
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-05-30 07:35:47 +00:00
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
|
|
|
|
|
// Send side.
|
|
|
|
|
FakeVideoSendStream* send_stream =
|
|
|
|
|
AddSendStream(cricket::StreamParams::CreateLegacy(1));
|
|
|
|
|
EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
|
|
|
|
|
|
|
|
|
|
// Receiver side.
|
|
|
|
|
FakeVideoReceiveStream* recv_stream =
|
|
|
|
|
AddRecvStream(cricket::StreamParams::CreateLegacy(1));
|
|
|
|
|
EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
|
|
|
|
|
|
|
|
|
|
// Nack history size should match between sender and receiver.
|
|
|
|
|
EXPECT_EQ(send_stream->GetConfig().rtp.nack.rtp_history_ms,
|
|
|
|
|
recv_stream->GetConfig().rtp.nack.rtp_history_ms);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, NackCanBeEnabledAndDisabled) {
|
2015-05-11 14:34:58 +02:00
|
|
|
FakeVideoSendStream* send_stream = AddSendStream();
|
2015-05-22 18:48:36 +02:00
|
|
|
FakeVideoReceiveStream* recv_stream = AddRecvStream();
|
2015-05-11 14:34:58 +02:00
|
|
|
|
|
|
|
|
EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
|
|
|
|
|
EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
|
|
|
|
|
|
|
|
|
|
// Verify that NACK is turned off when send(!) codecs without NACK are set.
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(RemoveFeedbackParams(GetEngineCodec("VP8")));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(parameters.codecs[0].feedback_params.params().empty());
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2015-05-11 14:34:58 +02:00
|
|
|
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_EQ(0, recv_stream->GetConfig().rtp.nack.rtp_history_ms);
|
|
|
|
|
send_stream = fake_call_->GetVideoSendStreams()[0];
|
2014-06-13 12:27:38 +00:00
|
|
|
EXPECT_EQ(0, send_stream->GetConfig().rtp.nack.rtp_history_ms);
|
|
|
|
|
|
2015-05-11 14:34:58 +02:00
|
|
|
// Verify that NACK is turned on when setting default codecs since the
|
|
|
|
|
// default codecs have NACK enabled.
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs = engine_.codecs();
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2015-05-11 14:34:58 +02:00
|
|
|
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
|
|
|
|
|
send_stream = fake_call_->GetVideoSendStreams()[0];
|
|
|
|
|
EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
|
2014-06-13 12:27:38 +00:00
|
|
|
}
|
|
|
|
|
|
2016-03-12 00:02:28 +01:00
|
|
|
// This test verifies that new frame sizes reconfigures encoders even though not
|
|
|
|
|
// (yet) sending. The purpose of this is to permit encoding as quickly as
|
|
|
|
|
// possible once we start sending. Likely the frames being input are from the
|
|
|
|
|
// same source that will be sent later, which just means that we're ready
|
|
|
|
|
// earlier.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, ReconfiguresEncodersWhenNotSending) {
|
2016-03-12 00:02:28 +01:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2016-03-12 00:02:28 +01:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
channel_->SetSend(false);
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
// No frames entered.
|
2016-03-12 00:02:28 +01:00
|
|
|
std::vector<webrtc::VideoStream> streams = stream->GetVideoStreams();
|
2018-06-08 11:04:04 +00:00
|
|
|
EXPECT_EQ(0u, streams[0].width);
|
|
|
|
|
EXPECT_EQ(0u, streams[0].height);
|
2016-03-12 00:02:28 +01:00
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2016-10-24 01:21:16 -07:00
|
|
|
VideoFormat capture_format = capturer.GetSupportedFormats()->front();
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format));
|
2016-03-12 00:02:28 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
// Frame entered, should be reconfigured to new dimensions.
|
|
|
|
|
streams = stream->GetVideoStreams();
|
2018-06-08 11:04:04 +00:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(capture_format.width), streams[0].width);
|
|
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(capture_format.height),
|
|
|
|
|
streams[0].height);
|
2016-03-12 00:02:28 +01:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2016-03-12 00:02:28 +01:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, UsesCorrectSettingsForScreencast) {
|
2014-10-27 13:58:00 +00:00
|
|
|
static const int kScreenshareMinBitrateKbps = 800;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoCodec codec = GetEngineCodec("VP8");
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(codec);
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-10-27 13:58:00 +00:00
|
|
|
AddSendStream();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2016-03-16 02:22:50 -07:00
|
|
|
VideoOptions min_bitrate_options;
|
2017-11-16 11:09:55 +01:00
|
|
|
min_bitrate_options.screencast_min_bitrate_kbps = kScreenshareMinBitrateKbps;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->SetVideoSend(last_ssrc_, &min_bitrate_options, &capturer));
|
2014-10-27 13:58:00 +00:00
|
|
|
cricket::VideoFormat capture_format_hd =
|
|
|
|
|
capturer.GetSupportedFormats()->front();
|
|
|
|
|
EXPECT_EQ(1280, capture_format_hd.width);
|
|
|
|
|
EXPECT_EQ(720, capture_format_hd.height);
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
|
|
|
|
|
FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
|
|
|
|
|
// Verify non-screencast settings.
|
2016-09-01 01:17:40 -07:00
|
|
|
webrtc::VideoEncoderConfig encoder_config =
|
|
|
|
|
send_stream->GetEncoderConfig().Copy();
|
2015-04-28 10:01:41 +02:00
|
|
|
EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo,
|
2014-10-27 13:58:00 +00:00
|
|
|
encoder_config.content_type);
|
2016-10-02 23:45:26 -07:00
|
|
|
std::vector<webrtc::VideoStream> streams = send_stream->GetVideoStreams();
|
2018-06-08 11:04:04 +00:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(capture_format_hd.width),
|
|
|
|
|
streams.front().width);
|
|
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(capture_format_hd.height),
|
|
|
|
|
streams.front().height);
|
2014-10-27 13:58:00 +00:00
|
|
|
EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps)
|
|
|
|
|
<< "Non-screenshare shouldn't use min-transmit bitrate.";
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2017-01-13 05:57:25 -08:00
|
|
|
EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
|
2016-03-16 02:22:50 -07:00
|
|
|
VideoOptions screencast_options;
|
2017-11-16 11:09:55 +01:00
|
|
|
screencast_options.is_screencast = true;
|
2016-06-02 16:23:38 -07:00
|
|
|
EXPECT_TRUE(
|
2018-04-09 08:49:14 +02:00
|
|
|
channel_->SetVideoSend(last_ssrc_, &screencast_options, &capturer));
|
2014-10-27 13:58:00 +00:00
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2017-02-28 13:23:26 -08:00
|
|
|
// Send stream recreated after option change.
|
|
|
|
|
ASSERT_EQ(2, fake_call_->GetNumCreatedSendStreams());
|
|
|
|
|
send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
|
2014-10-27 13:58:00 +00:00
|
|
|
|
|
|
|
|
// Verify screencast settings.
|
2016-09-01 01:17:40 -07:00
|
|
|
encoder_config = send_stream->GetEncoderConfig().Copy();
|
2015-04-28 10:01:41 +02:00
|
|
|
EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen,
|
2014-10-27 13:58:00 +00:00
|
|
|
encoder_config.content_type);
|
|
|
|
|
EXPECT_EQ(kScreenshareMinBitrateKbps * 1000,
|
|
|
|
|
encoder_config.min_transmit_bitrate_bps);
|
|
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
streams = send_stream->GetVideoStreams();
|
2018-06-08 11:04:04 +00:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(capture_format_hd.width),
|
|
|
|
|
streams.front().width);
|
|
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(capture_format_hd.height),
|
|
|
|
|
streams.front().height);
|
2018-03-01 15:11:29 +01:00
|
|
|
EXPECT_FALSE(streams[0].num_temporal_layers.has_value());
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2014-10-31 13:08:10 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2014-10-31 13:08:10 +00:00
|
|
|
ConferenceModeScreencastConfiguresTemporalLayer) {
|
2018-05-09 11:28:01 +02:00
|
|
|
static const int kConferenceScreencastTemporalBitrateBps = 200 * 1000;
|
2016-02-17 05:25:36 -08:00
|
|
|
send_parameters_.conference_mode = true;
|
2015-09-17 16:42:56 +02:00
|
|
|
channel_->SetSendParameters(send_parameters_);
|
2014-10-31 13:08:10 +00:00
|
|
|
|
|
|
|
|
AddSendStream();
|
2016-03-16 02:22:50 -07:00
|
|
|
VideoOptions options;
|
2017-11-16 11:09:55 +01:00
|
|
|
options.is_screencast = true;
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
2014-10-31 13:08:10 +00:00
|
|
|
cricket::VideoFormat capture_format_hd =
|
|
|
|
|
capturer.GetSupportedFormats()->front();
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
|
|
|
|
|
FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
webrtc::VideoEncoderConfig encoder_config =
|
|
|
|
|
send_stream->GetEncoderConfig().Copy();
|
2014-10-31 13:08:10 +00:00
|
|
|
|
|
|
|
|
// Verify screencast settings.
|
2016-09-01 01:17:40 -07:00
|
|
|
encoder_config = send_stream->GetEncoderConfig().Copy();
|
2015-04-28 10:01:41 +02:00
|
|
|
EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen,
|
2014-10-31 13:08:10 +00:00
|
|
|
encoder_config.content_type);
|
2016-10-02 23:45:26 -07:00
|
|
|
|
|
|
|
|
std::vector<webrtc::VideoStream> streams = send_stream->GetVideoStreams();
|
|
|
|
|
ASSERT_EQ(1u, streams.size());
|
2018-03-01 15:11:29 +01:00
|
|
|
ASSERT_EQ(2u, streams[0].num_temporal_layers);
|
2014-10-31 13:08:10 +00:00
|
|
|
EXPECT_EQ(kConferenceScreencastTemporalBitrateBps,
|
2018-03-01 15:11:29 +01:00
|
|
|
streams[0].target_bitrate_bps);
|
2014-10-27 13:58:00 +00:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SuspendBelowMinBitrateDisabledByDefault) {
|
2014-07-23 07:28:56 +00:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetMediaConfigSuspendBelowMinBitrate) {
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
MediaConfig media_config = GetMediaConfig();
|
2016-03-01 04:29:59 -08:00
|
|
|
media_config.video.suspend_below_min_bitrate = true;
|
|
|
|
|
|
|
|
|
|
channel_.reset(
|
|
|
|
|
engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
|
2016-11-22 16:08:30 -08:00
|
|
|
channel_->OnReadyToSend(true);
|
2016-03-01 04:29:59 -08:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
channel_->SetSendParameters(send_parameters_);
|
2014-07-23 07:28:56 +00:00
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
EXPECT_TRUE(stream->GetConfig().suspend_below_min_bitrate);
|
|
|
|
|
|
2016-03-01 04:29:59 -08:00
|
|
|
media_config.video.suspend_below_min_bitrate = false;
|
|
|
|
|
channel_.reset(
|
|
|
|
|
engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
|
2016-11-22 16:08:30 -08:00
|
|
|
channel_->OnReadyToSend(true);
|
2016-03-01 04:29:59 -08:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
channel_->SetSendParameters(send_parameters_);
|
2014-07-23 07:28:56 +00:00
|
|
|
|
2016-03-01 04:29:59 -08:00
|
|
|
stream = AddSendStream();
|
2014-07-23 07:28:56 +00:00
|
|
|
EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, Vp8DenoisingEnabledByDefault) {
|
2014-07-22 16:29:54 +00:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoCodecVP8 vp8_settings;
|
|
|
|
|
ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
|
|
|
|
|
EXPECT_TRUE(vp8_settings.denoisingOn);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, VerifyVp8SpecificSettings) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2015-04-28 10:01:41 +02:00
|
|
|
|
2015-09-09 14:32:14 +02:00
|
|
|
// Single-stream settings should apply with RTX as well (verifies that we
|
|
|
|
|
// check number of regular SSRCs and not StreamParams::ssrcs which contains
|
|
|
|
|
// both RTX and regular SSRCs).
|
|
|
|
|
FakeVideoSendStream* stream = SetUpSimulcast(false, true);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2015-04-28 10:01:41 +02:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2015-04-28 10:01:41 +02:00
|
|
|
channel_->SetSend(true);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
2015-10-26 11:18:18 -07:00
|
|
|
webrtc::VideoCodecVP8 vp8_settings;
|
|
|
|
|
ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
|
|
|
|
|
EXPECT_TRUE(vp8_settings.denoisingOn)
|
|
|
|
|
<< "VP8 denoising should be on by default.";
|
|
|
|
|
|
2016-03-16 02:22:50 -07:00
|
|
|
stream = SetDenoisingOption(last_ssrc_, &capturer, false);
|
2014-07-22 16:29:54 +00:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
|
|
|
|
|
EXPECT_FALSE(vp8_settings.denoisingOn);
|
2015-04-28 10:01:41 +02:00
|
|
|
EXPECT_TRUE(vp8_settings.automaticResizeOn);
|
|
|
|
|
EXPECT_TRUE(vp8_settings.frameDroppingOn);
|
2014-07-22 16:29:54 +00:00
|
|
|
|
2016-03-16 02:22:50 -07:00
|
|
|
stream = SetDenoisingOption(last_ssrc_, &capturer, true);
|
2014-07-22 16:29:54 +00:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
|
|
|
|
|
EXPECT_TRUE(vp8_settings.denoisingOn);
|
2015-04-28 10:01:41 +02:00
|
|
|
EXPECT_TRUE(vp8_settings.automaticResizeOn);
|
|
|
|
|
EXPECT_TRUE(vp8_settings.frameDroppingOn);
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2015-09-09 14:32:14 +02:00
|
|
|
stream = SetUpSimulcast(true, false);
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2015-04-28 10:01:41 +02:00
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(3u, stream->GetVideoStreams().size());
|
2015-04-28 10:01:41 +02:00
|
|
|
ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
|
|
|
|
|
// Autmatic resize off when using simulcast.
|
|
|
|
|
EXPECT_FALSE(vp8_settings.automaticResizeOn);
|
|
|
|
|
EXPECT_TRUE(vp8_settings.frameDroppingOn);
|
|
|
|
|
|
|
|
|
|
// In screen-share mode, denoising is forced off and simulcast disabled.
|
2016-03-16 02:22:50 -07:00
|
|
|
VideoOptions options;
|
2017-11-16 11:09:55 +01:00
|
|
|
options.is_screencast = true;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
New flag is_screencast in VideoOptions.
This cl copies the value of cricket::VideoCapturer::IsScreencast into
a flag in VideoOptions. It is passed on via the chain
VideortpSender::SetVideoSend
WebRtcVideoChannel2::SetVideoSend
WebRtcVideoChannel2::SetOptions
WebRtcVideoChannel2::WebRtcVideoSendStream::SetOptions
Where it's used, in
WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame, we can look it up
in parameters_, instead of calling capturer_->IsScreencast().
Doesn't touch screencast logic related to cpu adaptation, since that
code is in flux in a different cl.
Also drop the is_screencast flag from the Dimensions struct, and drop separate options argument from ConfigureVideoEncoderSettings and SetCodecAndOptions, instead always using the options recorded in VideoSendStreamParameters::options.
In the tests, changed FakeVideoCapturer::is_screencast to be a construction time flag. Generally, unittests of screencast have to both use a capturer configured for screencast, and set the screencast flag using SetSendParameters. Since the automatic connection via VideoSource and VideoRtpSender isn't involved in the unit tests.
Note that using SetSendParameters to set the screencast flag doesn't make sense, since it's not per-stream. SetVideoSend would be more appropriate. That should be fixed if/when we drop VideoOptions from SetSendParameters.
BUG=webrtc:5426
R=pbos@webrtc.org, perkj@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1711763003 .
Cr-Commit-Position: refs/heads/master@{#11837}
2016-03-02 11:41:36 +01:00
|
|
|
|
2016-03-16 02:22:50 -07:00
|
|
|
stream = SetDenoisingOption(last_ssrc_, &capturer, false);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(1u, stream->GetVideoStreams().size());
|
2015-04-28 10:01:41 +02:00
|
|
|
ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
|
|
|
|
|
EXPECT_FALSE(vp8_settings.denoisingOn);
|
|
|
|
|
// Resizing and frame dropping always off for screen sharing.
|
|
|
|
|
EXPECT_FALSE(vp8_settings.automaticResizeOn);
|
|
|
|
|
EXPECT_FALSE(vp8_settings.frameDroppingOn);
|
|
|
|
|
|
2016-03-16 02:22:50 -07:00
|
|
|
stream = SetDenoisingOption(last_ssrc_, &capturer, true);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
|
|
|
|
|
EXPECT_FALSE(vp8_settings.denoisingOn);
|
|
|
|
|
EXPECT_FALSE(vp8_settings.automaticResizeOn);
|
|
|
|
|
EXPECT_FALSE(vp8_settings.frameDroppingOn);
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2015-04-28 10:01:41 +02:00
|
|
|
}
|
|
|
|
|
|
2016-04-04 11:43:27 -07:00
|
|
|
// Test that setting the same options doesn't result in the encoder being
|
|
|
|
|
// reconfigured.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetIdenticalOptionsDoesntReconfigureEncoder) {
|
2016-04-04 11:43:27 -07:00
|
|
|
VideoOptions options;
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2016-04-04 11:43:27 -07:00
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
AddSendStream();
|
2016-04-04 11:43:27 -07:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
2016-10-02 23:45:26 -07:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2016-10-02 23:45:26 -07:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
2016-04-04 11:43:27 -07:00
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2016-10-02 23:45:26 -07:00
|
|
|
// Expect 1 reconfigurations at this point from the initial configuration.
|
|
|
|
|
EXPECT_EQ(1, send_stream->num_encoder_reconfigurations());
|
2016-04-04 11:43:27 -07:00
|
|
|
|
|
|
|
|
// Set the options one more time and expect no additional reconfigurations.
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
2016-10-02 23:45:26 -07:00
|
|
|
EXPECT_EQ(1, send_stream->num_encoder_reconfigurations());
|
|
|
|
|
|
|
|
|
|
// Change |options| and expect 2 reconfigurations.
|
2017-11-16 11:09:55 +01:00
|
|
|
options.video_noise_reduction = true;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
2016-04-04 11:43:27 -07:00
|
|
|
EXPECT_EQ(2, send_stream->num_encoder_reconfigurations());
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2016-04-04 11:43:27 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
class Vp9SettingsTest : public WebRtcVideoChannelTest {
|
2015-04-28 10:01:41 +02:00
|
|
|
public:
|
2016-03-21 04:15:50 -07:00
|
|
|
Vp9SettingsTest() : Vp9SettingsTest("") {}
|
|
|
|
|
explicit Vp9SettingsTest(const char* field_trials)
|
2017-06-12 01:16:46 -07:00
|
|
|
: WebRtcVideoChannelTest(field_trials) {
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP9");
|
2015-04-28 10:01:41 +02:00
|
|
|
}
|
|
|
|
|
virtual ~Vp9SettingsTest() {}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void TearDown() override {
|
|
|
|
|
// Remove references to encoder_factory_ since this will be destroyed
|
|
|
|
|
// before channel_ and engine_.
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-04-28 10:01:41 +02:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TEST_F(Vp9SettingsTest, VerifyVp9SpecificSettings) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2015-04-28 10:01:41 +02:00
|
|
|
|
2015-09-09 14:32:14 +02:00
|
|
|
FakeVideoSendStream* stream = SetUpSimulcast(false, false);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2015-04-28 10:01:41 +02:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2015-04-28 10:01:41 +02:00
|
|
|
channel_->SetSend(true);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
2015-10-26 11:18:18 -07:00
|
|
|
webrtc::VideoCodecVP9 vp9_settings;
|
|
|
|
|
ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
|
2017-03-27 10:09:00 -07:00
|
|
|
EXPECT_TRUE(vp9_settings.denoisingOn)
|
|
|
|
|
<< "VP9 denoising should be on by default.";
|
2015-10-26 11:18:18 -07:00
|
|
|
|
2016-03-16 02:22:50 -07:00
|
|
|
stream = SetDenoisingOption(last_ssrc_, &capturer, false);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
|
|
|
|
|
EXPECT_FALSE(vp9_settings.denoisingOn);
|
|
|
|
|
// Frame dropping always on for real time video.
|
|
|
|
|
EXPECT_TRUE(vp9_settings.frameDroppingOn);
|
|
|
|
|
|
2016-03-16 02:22:50 -07:00
|
|
|
stream = SetDenoisingOption(last_ssrc_, &capturer, true);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
|
|
|
|
|
EXPECT_TRUE(vp9_settings.denoisingOn);
|
|
|
|
|
EXPECT_TRUE(vp9_settings.frameDroppingOn);
|
|
|
|
|
|
|
|
|
|
// In screen-share mode, denoising is forced off.
|
2016-03-16 02:22:50 -07:00
|
|
|
VideoOptions options;
|
2017-11-16 11:09:55 +01:00
|
|
|
options.is_screencast = true;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
2016-02-29 00:04:41 -08:00
|
|
|
|
2016-03-16 02:22:50 -07:00
|
|
|
stream = SetDenoisingOption(last_ssrc_, &capturer, false);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
|
|
|
|
|
EXPECT_FALSE(vp9_settings.denoisingOn);
|
2018-05-17 16:46:43 +02:00
|
|
|
// Frame dropping always on for screen sharing.
|
|
|
|
|
EXPECT_TRUE(vp9_settings.frameDroppingOn);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
2016-03-16 02:22:50 -07:00
|
|
|
stream = SetDenoisingOption(last_ssrc_, &capturer, false);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
|
|
|
|
|
EXPECT_FALSE(vp9_settings.denoisingOn);
|
2018-05-17 16:46:43 +02:00
|
|
|
EXPECT_TRUE(vp9_settings.frameDroppingOn);
|
2015-04-28 10:01:41 +02:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2018-03-14 10:35:35 +01:00
|
|
|
TEST_F(Vp9SettingsTest, MultipleSsrcsEnablesSvc) {
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream =
|
|
|
|
|
AddSendStream(CreateSimStreamParams("cname", ssrcs));
|
|
|
|
|
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
EXPECT_EQ(ssrcs.size(), config.rtp.ssrcs.size());
|
|
|
|
|
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(ssrcs[0], nullptr, &capturer));
|
2018-03-14 10:35:35 +01:00
|
|
|
channel_->SetSend(true);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
webrtc::VideoCodecVP9 vp9_settings;
|
|
|
|
|
ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
|
|
|
|
|
|
|
|
|
|
const size_t kNumSpatialLayers = ssrcs.size();
|
|
|
|
|
const size_t kNumTemporalLayers = 3;
|
|
|
|
|
EXPECT_EQ(vp9_settings.numberOfSpatialLayers, kNumSpatialLayers);
|
|
|
|
|
EXPECT_EQ(vp9_settings.numberOfTemporalLayers, kNumTemporalLayers);
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(ssrcs[0], nullptr, nullptr));
|
2018-03-14 10:35:35 +01:00
|
|
|
}
|
|
|
|
|
|
2016-03-21 04:15:50 -07:00
|
|
|
class Vp9SettingsTestWithFieldTrial : public Vp9SettingsTest {
|
|
|
|
|
public:
|
2016-11-22 02:16:47 -08:00
|
|
|
explicit Vp9SettingsTestWithFieldTrial(const char* field_trials)
|
2016-03-21 04:15:50 -07:00
|
|
|
: Vp9SettingsTest(field_trials) {}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void VerifySettings(int num_spatial_layers, int num_temporal_layers) {
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2016-03-21 04:15:50 -07:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = SetUpSimulcast(false, false);
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2016-03-21 04:15:50 -07:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2016-03-21 04:15:50 -07:00
|
|
|
channel_->SetSend(true);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
webrtc::VideoCodecVP9 vp9_settings;
|
|
|
|
|
ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
|
|
|
|
|
EXPECT_EQ(num_spatial_layers, vp9_settings.numberOfSpatialLayers);
|
|
|
|
|
EXPECT_EQ(num_temporal_layers, vp9_settings.numberOfTemporalLayers);
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2016-03-21 04:15:50 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class Vp9SettingsTestWithNoFlag : public Vp9SettingsTestWithFieldTrial {
|
|
|
|
|
public:
|
|
|
|
|
Vp9SettingsTestWithNoFlag() : Vp9SettingsTestWithFieldTrial("") {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TEST_F(Vp9SettingsTestWithNoFlag, VerifySettings) {
|
|
|
|
|
const int kNumSpatialLayers = 1;
|
|
|
|
|
const int kNumTemporalLayers = 1;
|
|
|
|
|
VerifySettings(kNumSpatialLayers, kNumTemporalLayers);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Vp9SettingsTestWithInvalidFlag : public Vp9SettingsTestWithFieldTrial {
|
|
|
|
|
public:
|
|
|
|
|
Vp9SettingsTestWithInvalidFlag()
|
|
|
|
|
: Vp9SettingsTestWithFieldTrial("WebRTC-SupportVP9SVC/Default/") {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TEST_F(Vp9SettingsTestWithInvalidFlag, VerifySettings) {
|
|
|
|
|
const int kNumSpatialLayers = 1;
|
|
|
|
|
const int kNumTemporalLayers = 1;
|
|
|
|
|
VerifySettings(kNumSpatialLayers, kNumTemporalLayers);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Vp9SettingsTestWith2SL3TLFlag : public Vp9SettingsTestWithFieldTrial {
|
|
|
|
|
public:
|
|
|
|
|
Vp9SettingsTestWith2SL3TLFlag()
|
|
|
|
|
: Vp9SettingsTestWithFieldTrial(
|
|
|
|
|
"WebRTC-SupportVP9SVC/EnabledByFlag_2SL3TL/") {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TEST_F(Vp9SettingsTestWith2SL3TLFlag, VerifySettings) {
|
|
|
|
|
const int kNumSpatialLayers = 2;
|
|
|
|
|
const int kNumTemporalLayers = 3;
|
|
|
|
|
VerifySettings(kNumSpatialLayers, kNumTemporalLayers);
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-13 10:16:47 +01:00
|
|
|
TEST_F(WebRtcVideoChannelTest, VerifyMinBitrate) {
|
|
|
|
|
std::vector<webrtc::VideoStream> streams = AddSendStream()->GetVideoStreams();
|
|
|
|
|
ASSERT_EQ(1u, streams.size());
|
|
|
|
|
EXPECT_EQ(cricket::kMinVideoBitrateBps, streams[0].min_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, VerifyMinBitrateWithForcedFallbackFieldTrial) {
|
|
|
|
|
webrtc::test::ScopedFieldTrials override_field_trials_(
|
|
|
|
|
"WebRTC-VP8-Forced-Fallback-Encoder-v2/Enabled-1,2,34567/");
|
|
|
|
|
std::vector<webrtc::VideoStream> streams = AddSendStream()->GetVideoStreams();
|
|
|
|
|
ASSERT_EQ(1u, streams.size());
|
|
|
|
|
EXPECT_EQ(34567, streams[0].min_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-14 05:52:21 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
|
|
|
|
BalancedDegradationPreferenceNotSupportedWithoutFieldtrial) {
|
|
|
|
|
webrtc::test::ScopedFieldTrials override_field_trials_(
|
|
|
|
|
"WebRTC-Video-BalancedDegradation/Disabled/");
|
|
|
|
|
const bool kResolutionScalingEnabled = true;
|
|
|
|
|
const bool kFpsScalingEnabled = false;
|
|
|
|
|
TestDegradationPreference(kResolutionScalingEnabled, kFpsScalingEnabled);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
|
|
|
|
BalancedDegradationPreferenceSupportedBehindFieldtrial) {
|
|
|
|
|
webrtc::test::ScopedFieldTrials override_field_trials_(
|
|
|
|
|
"WebRTC-Video-BalancedDegradation/Enabled/");
|
|
|
|
|
const bool kResolutionScalingEnabled = true;
|
|
|
|
|
const bool kFpsScalingEnabled = true;
|
|
|
|
|
TestDegradationPreference(kResolutionScalingEnabled, kFpsScalingEnabled);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, AdaptsOnOveruse) {
|
2015-04-29 16:21:28 +02:00
|
|
|
TestCpuAdaptation(true, false);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, DoesNotAdaptOnOveruseWhenDisabled) {
|
2015-04-29 16:21:28 +02:00
|
|
|
TestCpuAdaptation(false, false);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, DoesNotAdaptOnOveruseWhenScreensharing) {
|
2015-04-29 16:21:28 +02:00
|
|
|
TestCpuAdaptation(true, true);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, AdaptsOnOveruseAndChangeResolution) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoCodec codec = GetEngineCodec("VP8");
|
2016-02-29 00:04:41 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(codec);
|
|
|
|
|
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
MediaConfig media_config = GetMediaConfig();
|
2016-02-29 00:04:41 -08:00
|
|
|
channel_.reset(
|
|
|
|
|
engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
|
2016-11-22 16:08:30 -08:00
|
|
|
channel_->OnReadyToSend(true);
|
2016-02-29 00:04:41 -08:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
AddSendStream();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
ASSERT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2016-02-29 00:04:41 -08:00
|
|
|
ASSERT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
ASSERT_TRUE(channel_->SetSend(true));
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
|
|
|
|
|
FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720));
|
2016-02-29 00:04:41 -08:00
|
|
|
EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
EXPECT_EQ(1280, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(720, send_stream->GetLastHeight());
|
|
|
|
|
|
|
|
|
|
// Trigger overuse.
|
2016-11-01 11:45:46 -07:00
|
|
|
rtc::VideoSinkWants wants;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
wants.max_pixel_count =
|
|
|
|
|
send_stream->GetLastWidth() * send_stream->GetLastHeight() - 1;
|
2016-11-01 11:45:46 -07:00
|
|
|
send_stream->InjectVideoSinkWants(wants);
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720));
|
2016-02-29 00:04:41 -08:00
|
|
|
EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
EXPECT_EQ(1280 * 3 / 4, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(720 * 3 / 4, send_stream->GetLastHeight());
|
|
|
|
|
|
|
|
|
|
// Trigger overuse again.
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
wants.max_pixel_count =
|
|
|
|
|
send_stream->GetLastWidth() * send_stream->GetLastHeight() - 1;
|
2016-11-01 11:45:46 -07:00
|
|
|
send_stream->InjectVideoSinkWants(wants);
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720));
|
2016-02-29 00:04:41 -08:00
|
|
|
EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
EXPECT_EQ(1280 * 2 / 4, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(720 * 2 / 4, send_stream->GetLastHeight());
|
|
|
|
|
|
|
|
|
|
// Change input resolution.
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1284, 724));
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(4, send_stream->GetNumberOfSwappedFrames());
|
2016-02-29 00:04:41 -08:00
|
|
|
EXPECT_EQ(1284 / 2, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(724 / 2, send_stream->GetLastHeight());
|
|
|
|
|
|
|
|
|
|
// Trigger underuse which should go back up in resolution.
|
2017-02-10 07:04:27 -08:00
|
|
|
int current_pixel_count =
|
|
|
|
|
send_stream->GetLastWidth() * send_stream->GetLastHeight();
|
|
|
|
|
// Cap the max to 4x the pixel count (assuming max 1/2 x 1/2 scale downs)
|
|
|
|
|
// of the current stream, so we don't take too large steps.
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
wants.max_pixel_count = current_pixel_count * 4;
|
2017-02-10 07:04:27 -08:00
|
|
|
// Default step down is 3/5 pixel count, so go up by 5/3.
|
2017-11-16 11:09:55 +01:00
|
|
|
wants.target_pixel_count = (current_pixel_count * 5 / 3);
|
2016-11-01 11:45:46 -07:00
|
|
|
send_stream->InjectVideoSinkWants(wants);
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1284, 724));
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(5, send_stream->GetNumberOfSwappedFrames());
|
2016-02-29 00:04:41 -08:00
|
|
|
EXPECT_EQ(1284 * 3 / 4, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(724 * 3 / 4, send_stream->GetLastHeight());
|
|
|
|
|
|
2017-02-10 07:04:27 -08:00
|
|
|
// Trigger underuse again, should go back up to full resolution.
|
|
|
|
|
current_pixel_count =
|
|
|
|
|
send_stream->GetLastWidth() * send_stream->GetLastHeight();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
wants.max_pixel_count = current_pixel_count * 4;
|
2017-11-16 11:09:55 +01:00
|
|
|
wants.target_pixel_count = (current_pixel_count * 5 / 3);
|
2016-11-01 11:45:46 -07:00
|
|
|
send_stream->InjectVideoSinkWants(wants);
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1284, 724));
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(6, send_stream->GetNumberOfSwappedFrames());
|
2016-02-29 00:04:41 -08:00
|
|
|
EXPECT_EQ(1284, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(724, send_stream->GetLastHeight());
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2016-02-29 00:04:41 -08:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, PreviousAdaptationDoesNotApplyToScreenshare) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoCodec codec = GetEngineCodec("VP8");
|
2016-04-05 15:23:49 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(codec);
|
|
|
|
|
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
MediaConfig media_config = GetMediaConfig();
|
2018-01-18 15:25:12 +01:00
|
|
|
media_config.video.enable_cpu_adaptation = true;
|
2016-04-05 15:23:49 +02:00
|
|
|
channel_.reset(
|
|
|
|
|
engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
|
2016-11-22 16:08:30 -08:00
|
|
|
channel_->OnReadyToSend(true);
|
2016-04-05 15:23:49 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
AddSendStream();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2016-04-05 15:23:49 +02:00
|
|
|
ASSERT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
ASSERT_TRUE(channel_->SetSend(true));
|
|
|
|
|
cricket::VideoOptions camera_options;
|
2017-11-16 11:09:55 +01:00
|
|
|
camera_options.is_screencast = false;
|
2018-04-09 08:49:14 +02:00
|
|
|
channel_->SetVideoSend(last_ssrc_, &camera_options, &capturer);
|
2016-04-05 15:23:49 +02:00
|
|
|
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
|
|
|
|
|
FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720));
|
2016-04-05 15:23:49 +02:00
|
|
|
EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
EXPECT_EQ(1280, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(720, send_stream->GetLastHeight());
|
|
|
|
|
|
|
|
|
|
// Trigger overuse.
|
2016-11-01 11:45:46 -07:00
|
|
|
rtc::VideoSinkWants wants;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
wants.max_pixel_count =
|
|
|
|
|
send_stream->GetLastWidth() * send_stream->GetLastHeight() - 1;
|
2016-11-01 11:45:46 -07:00
|
|
|
send_stream->InjectVideoSinkWants(wants);
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720));
|
2016-04-05 15:23:49 +02:00
|
|
|
EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
EXPECT_EQ(1280 * 3 / 4, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(720 * 3 / 4, send_stream->GetLastHeight());
|
|
|
|
|
|
|
|
|
|
// Switch to screen share. Expect no CPU adaptation.
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue screen_share(true);
|
2016-04-05 15:23:49 +02:00
|
|
|
ASSERT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
screen_share.Start(screen_share.GetSupportedFormats()->front()));
|
|
|
|
|
cricket::VideoOptions screenshare_options;
|
2017-11-16 11:09:55 +01:00
|
|
|
screenshare_options.is_screencast = true;
|
2018-04-09 08:49:14 +02:00
|
|
|
channel_->SetVideoSend(last_ssrc_, &screenshare_options, &screen_share);
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(screen_share.CaptureCustomFrame(1284, 724));
|
2017-02-28 13:23:26 -08:00
|
|
|
ASSERT_EQ(2, fake_call_->GetNumCreatedSendStreams());
|
|
|
|
|
send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
|
2016-04-05 15:23:49 +02:00
|
|
|
EXPECT_EQ(1284, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(724, send_stream->GetLastHeight());
|
|
|
|
|
|
|
|
|
|
// Switch back to the normal capturer. Expect the frame to be CPU adapted.
|
2018-04-09 08:49:14 +02:00
|
|
|
channel_->SetVideoSend(last_ssrc_, &camera_options, &capturer);
|
2017-02-28 13:23:26 -08:00
|
|
|
send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
// We have a new fake send stream, so it doesn't remember the old sink wants.
|
|
|
|
|
// In practice, it will be populated from
|
2017-08-03 08:27:51 -07:00
|
|
|
// VideoStreamEncoder::VideoSourceProxy::SetSource(), so simulate that here.
|
2017-02-28 13:23:26 -08:00
|
|
|
send_stream->InjectVideoSinkWants(wants);
|
2018-02-12 17:14:55 +01:00
|
|
|
EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720));
|
2017-02-28 13:23:26 -08:00
|
|
|
ASSERT_EQ(3, fake_call_->GetNumCreatedSendStreams());
|
|
|
|
|
send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
|
2016-04-05 15:23:49 +02:00
|
|
|
EXPECT_EQ(1280 * 3 / 4, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(720 * 3 / 4, send_stream->GetLastHeight());
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2016-04-05 15:23:49 +02:00
|
|
|
}
|
|
|
|
|
|
2017-06-14 05:52:21 -07:00
|
|
|
// TODO(asapersson): Remove this test when the balanced field trial is removed.
|
|
|
|
|
void WebRtcVideoChannelTest::TestDegradationPreference(
|
|
|
|
|
bool resolution_scaling_enabled,
|
|
|
|
|
bool fps_scaling_enabled) {
|
|
|
|
|
cricket::VideoCodec codec = GetEngineCodec("VP8");
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(codec);
|
|
|
|
|
|
|
|
|
|
MediaConfig media_config = GetMediaConfig();
|
2018-01-18 15:25:12 +01:00
|
|
|
media_config.video.enable_cpu_adaptation = true;
|
2017-06-14 05:52:21 -07:00
|
|
|
channel_.reset(
|
|
|
|
|
engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
|
|
|
|
|
channel_->OnReadyToSend(true);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
AddSendStream();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2017-06-14 05:52:21 -07:00
|
|
|
VideoOptions options;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
2017-06-14 05:52:21 -07:00
|
|
|
cricket::VideoFormat capture_format = capturer.GetSupportedFormats()->front();
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
|
|
|
|
|
EXPECT_EQ(resolution_scaling_enabled,
|
|
|
|
|
send_stream->resolution_scaling_enabled());
|
|
|
|
|
EXPECT_EQ(fps_scaling_enabled, send_stream->framerate_scaling_enabled());
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2017-06-14 05:52:21 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
void WebRtcVideoChannelTest::TestCpuAdaptation(bool enable_overuse,
|
|
|
|
|
bool is_screenshare) {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
const int kDefaultFps = 30;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoCodec codec = GetEngineCodec("VP8");
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(codec);
|
2016-02-12 02:27:06 -08:00
|
|
|
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
MediaConfig media_config = GetMediaConfig();
|
|
|
|
|
if (enable_overuse) {
|
2018-01-18 15:25:12 +01:00
|
|
|
media_config.video.enable_cpu_adaptation = true;
|
2014-10-03 11:25:45 +00:00
|
|
|
}
|
2016-02-12 02:27:06 -08:00
|
|
|
channel_.reset(
|
|
|
|
|
engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
|
2016-11-22 16:08:30 -08:00
|
|
|
channel_->OnReadyToSend(true);
|
2016-02-12 02:27:06 -08:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2014-10-03 11:25:45 +00:00
|
|
|
|
|
|
|
|
AddSendStream();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2016-03-16 02:22:50 -07:00
|
|
|
VideoOptions options;
|
2017-11-16 11:09:55 +01:00
|
|
|
options.is_screencast = is_screenshare;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
2016-10-24 01:21:16 -07:00
|
|
|
cricket::VideoFormat capture_format = capturer.GetSupportedFormats()->front();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
capture_format.interval = rtc::kNumNanosecsPerSec / kDefaultFps;
|
2016-10-24 01:21:16 -07:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format));
|
2014-10-03 11:25:45 +00:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
|
2015-09-08 05:13:22 -07:00
|
|
|
FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
|
2016-02-29 00:04:41 -08:00
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
if (!enable_overuse) {
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_FALSE(send_stream->resolution_scaling_enabled());
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
EXPECT_FALSE(send_stream->framerate_scaling_enabled());
|
|
|
|
|
EXPECT_EQ(is_screenshare, send_stream->framerate_scaling_enabled());
|
2016-02-29 00:04:41 -08:00
|
|
|
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
|
2016-10-24 01:21:16 -07:00
|
|
|
EXPECT_EQ(capture_format.width, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(capture_format.height, send_stream->GetLastHeight());
|
2016-02-29 00:04:41 -08:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2016-02-29 00:04:41 -08:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
if (is_screenshare) {
|
|
|
|
|
EXPECT_FALSE(send_stream->resolution_scaling_enabled());
|
|
|
|
|
EXPECT_TRUE(send_stream->framerate_scaling_enabled());
|
|
|
|
|
} else {
|
|
|
|
|
EXPECT_TRUE(send_stream->resolution_scaling_enabled());
|
|
|
|
|
EXPECT_FALSE(send_stream->framerate_scaling_enabled());
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
// Trigger overuse.
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
|
|
|
|
|
|
|
|
|
|
rtc::VideoSinkWants wants;
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
if (is_screenshare) {
|
|
|
|
|
wants.max_framerate_fps = (kDefaultFps * 2) / 3;
|
|
|
|
|
} else {
|
|
|
|
|
wants.max_pixel_count = capture_format.width * capture_format.height - 1;
|
|
|
|
|
}
|
2016-11-01 11:45:46 -07:00
|
|
|
send_stream->InjectVideoSinkWants(wants);
|
|
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
for (int i = 0; i < kDefaultFps; ++i)
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
Reason for revert:
This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
Original issue's description:
> Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
>
> Reason for revert:
> Found issue with test case, will add fix to reland cl.
>
> Original issue's description:
> > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> >
> > Reason for revert:
> > Breaks perf tests:
> > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> >
> > Original issue's description:
> > > Add framerate to VideoSinkWants and ability to signal on overuse
> > >
> > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > current degradation preference is maintain-resolution rather than
> > > balanced.
> > >
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2716643002
> > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2764133002
> > Cr-Commit-Position: refs/heads/master@{#17331}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
>
> TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2781433002
> Cr-Commit-Position: refs/heads/master@{#17474}
> Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2783183003
Cr-Commit-Position: refs/heads/master@{#17477}
2017-03-30 10:44:38 -07:00
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
if (is_screenshare) {
|
|
|
|
|
// Drops every third frame.
|
|
|
|
|
EXPECT_EQ(kDefaultFps * 2 / 3, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
EXPECT_EQ(send_stream->GetLastWidth(), capture_format.width);
|
|
|
|
|
EXPECT_EQ(send_stream->GetLastHeight(), capture_format.height);
|
|
|
|
|
} else {
|
|
|
|
|
EXPECT_EQ(kDefaultFps, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
EXPECT_LT(send_stream->GetLastWidth(), capture_format.width);
|
|
|
|
|
EXPECT_LT(send_stream->GetLastHeight(), capture_format.height);
|
|
|
|
|
}
|
2014-10-03 11:25:45 +00:00
|
|
|
|
|
|
|
|
// Trigger underuse which should go back to normal resolution.
|
2017-02-10 07:04:27 -08:00
|
|
|
int last_pixel_count =
|
|
|
|
|
send_stream->GetLastWidth() * send_stream->GetLastHeight();
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
if (is_screenshare) {
|
|
|
|
|
wants.max_framerate_fps = kDefaultFps;
|
|
|
|
|
} else {
|
|
|
|
|
wants.max_pixel_count = last_pixel_count * 4;
|
|
|
|
|
wants.target_pixel_count.emplace((last_pixel_count * 5) / 3);
|
|
|
|
|
}
|
2016-11-01 11:45:46 -07:00
|
|
|
send_stream->InjectVideoSinkWants(wants);
|
|
|
|
|
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
for (int i = 0; i < kDefaultFps; ++i)
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
if (is_screenshare) {
|
|
|
|
|
EXPECT_EQ(kDefaultFps + (kDefaultFps * 2 / 3),
|
|
|
|
|
send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
} else {
|
|
|
|
|
EXPECT_EQ(kDefaultFps * 2, send_stream->GetNumberOfSwappedFrames());
|
|
|
|
|
}
|
2014-10-03 11:25:45 +00:00
|
|
|
|
2016-10-24 01:21:16 -07:00
|
|
|
EXPECT_EQ(capture_format.width, send_stream->GetLastWidth());
|
|
|
|
|
EXPECT_EQ(capture_format.height, send_stream->GetLastHeight());
|
2014-10-03 11:25:45 +00:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, EstimatesNtpStartTimeCorrectly) {
|
2015-01-27 09:57:01 +00:00
|
|
|
// Start at last timestamp to verify that wraparounds are estimated correctly.
|
|
|
|
|
static const uint32_t kInitialTimestamp = 0xFFFFFFFFu;
|
|
|
|
|
static const int64_t kInitialNtpTimeMs = 1247891230;
|
|
|
|
|
static const int kFrameOffsetMs = 20;
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
|
2015-01-23 14:55:00 +00:00
|
|
|
|
2015-01-27 09:57:01 +00:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
cricket::FakeVideoRenderer renderer;
|
2016-02-04 01:24:52 -08:00
|
|
|
EXPECT_TRUE(channel_->SetSink(last_ssrc_, &renderer));
|
2015-01-27 09:57:01 +00:00
|
|
|
|
Reland of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #1 id:1 of https://codereview.webrtc.org/2354223002/ )
Reason for revert:
Downstream application now fixed.
Original issue's description:
> Revert of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #14 id:260001 of https://codereview.webrtc.org/2278883002/ )
>
> Reason for revert:
> Broke downstream application.
>
> Original issue's description:
> > Move MutableDataY{,U,V} methods to I420Buffer only.
> >
> > Deleted from the VideoFrameBuffer base class.
> >
> > BUG=webrtc:5921
> >
> > Committed: https://crrev.com/5539ef6c03c273f39fadae41ace47fdc11ac6d60
> > Cr-Commit-Position: refs/heads/master@{#14317}
>
> TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5921
>
> Committed: https://crrev.com/776870a2599b8f43ad56987f9031690e3ccecde8
> Cr-Commit-Position: refs/heads/master@{#14325}
TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5921
Review-Url: https://codereview.webrtc.org/2372483002
Cr-Commit-Position: refs/heads/master@{#14389}
2016-09-27 00:17:25 -07:00
|
|
|
webrtc::VideoFrame video_frame(CreateBlackFrameBuffer(4, 4),
|
|
|
|
|
kInitialTimestamp, 0,
|
|
|
|
|
webrtc::kVideoRotation_0);
|
2015-01-27 09:57:01 +00:00
|
|
|
// Initial NTP time is not available on the first frame, but should still be
|
|
|
|
|
// able to be estimated.
|
2016-03-21 01:27:56 -07:00
|
|
|
stream->InjectFrame(video_frame);
|
2015-01-27 09:57:01 +00:00
|
|
|
|
|
|
|
|
EXPECT_EQ(1, renderer.num_rendered_frames());
|
|
|
|
|
|
|
|
|
|
// This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which
|
|
|
|
|
// triggers a constant-overflow warning, hence we're calculating it explicitly
|
|
|
|
|
// here.
|
|
|
|
|
video_frame.set_timestamp(kFrameOffsetMs * 90 - 1);
|
|
|
|
|
video_frame.set_ntp_time_ms(kInitialNtpTimeMs + kFrameOffsetMs);
|
2016-03-21 01:27:56 -07:00
|
|
|
stream->InjectFrame(video_frame);
|
2015-01-27 09:57:01 +00:00
|
|
|
|
|
|
|
|
EXPECT_EQ(2, renderer.num_rendered_frames());
|
|
|
|
|
|
|
|
|
|
// Verify that NTP time has been correctly deduced.
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
2015-01-27 09:57:01 +00:00
|
|
|
ASSERT_EQ(1u, info.receivers.size());
|
|
|
|
|
EXPECT_EQ(kInitialNtpTimeMs, info.receivers[0].capture_start_ntp_time_ms);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetDefaultSendCodecs) {
|
2018-05-14 09:48:06 +02:00
|
|
|
AssignDefaultAptRtxTypes();
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2014-05-13 11:07:01 +00:00
|
|
|
|
|
|
|
|
VideoCodec codec;
|
|
|
|
|
EXPECT_TRUE(channel_->GetSendCodec(&codec));
|
2014-06-13 09:34:13 +00:00
|
|
|
EXPECT_TRUE(codec.Matches(engine_.codecs()[0]));
|
2014-05-13 11:07:01 +00:00
|
|
|
|
|
|
|
|
// Using a RTX setup to verify that the default RTX payload type is good.
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
|
|
|
|
|
const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
|
2014-05-13 11:07:01 +00:00
|
|
|
FakeVideoSendStream* stream = AddSendStream(
|
|
|
|
|
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
|
2016-09-01 01:17:40 -07:00
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
2014-05-13 11:07:01 +00:00
|
|
|
|
|
|
|
|
// Make sure NACK and FEC are enabled on the correct payload types.
|
|
|
|
|
EXPECT_EQ(1000, config.rtp.nack.rtp_history_ms);
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("ulpfec").id, config.rtp.ulpfec.ulpfec_payload_type);
|
|
|
|
|
EXPECT_EQ(GetEngineCodec("red").id, config.rtp.ulpfec.red_payload_type);
|
2014-06-26 08:49:03 +00:00
|
|
|
|
|
|
|
|
EXPECT_EQ(1u, config.rtp.rtx.ssrcs.size());
|
|
|
|
|
EXPECT_EQ(kRtxSsrcs1[0], config.rtp.rtx.ssrcs[0]);
|
2015-04-21 20:24:50 +08:00
|
|
|
VerifySendStreamHasRtxTypes(config, default_apt_rtx_types_);
|
2014-05-13 11:07:01 +00:00
|
|
|
// TODO(juberti): Check RTCP, PLI, TMMBR.
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-19 05:47:46 -07:00
|
|
|
// The following four tests ensures that FlexFEC is not activated by default
|
|
|
|
|
// when the field trials are not enabled.
|
|
|
|
|
// TODO(brandtr): Remove or update these tests when FlexFEC _is_ enabled by
|
|
|
|
|
// default.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, FlexfecSendCodecWithoutSsrcNotExposedByDefault) {
|
2016-11-22 02:16:47 -08:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
|
2017-01-16 06:59:19 -08:00
|
|
|
EXPECT_EQ(-1, config.rtp.flexfec.payload_type);
|
2017-05-19 05:47:46 -07:00
|
|
|
EXPECT_EQ(0U, config.rtp.flexfec.ssrc);
|
|
|
|
|
EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty());
|
2016-11-22 02:16:47 -08:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, FlexfecSendCodecWithSsrcNotExposedByDefault) {
|
2016-11-22 02:16:47 -08:00
|
|
|
FakeVideoSendStream* stream = AddSendStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
|
2017-01-16 06:59:19 -08:00
|
|
|
EXPECT_EQ(-1, config.rtp.flexfec.payload_type);
|
2017-05-19 05:47:46 -07:00
|
|
|
EXPECT_EQ(0U, config.rtp.flexfec.ssrc);
|
|
|
|
|
EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, FlexfecRecvCodecWithoutSsrcNotExposedByDefault) {
|
|
|
|
|
AddRecvStream();
|
|
|
|
|
|
|
|
|
|
const std::vector<FakeFlexfecReceiveStream*>& streams =
|
|
|
|
|
fake_call_->GetFlexfecReceiveStreams();
|
|
|
|
|
EXPECT_TRUE(streams.empty());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, FlexfecRecvCodecWithSsrcNotExposedByDefault) {
|
2017-05-19 05:47:46 -07:00
|
|
|
AddRecvStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
|
|
|
|
|
const std::vector<FakeFlexfecReceiveStream*>& streams =
|
|
|
|
|
fake_call_->GetFlexfecReceiveStreams();
|
|
|
|
|
EXPECT_TRUE(streams.empty());
|
2016-11-22 02:16:47 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO(brandtr): When FlexFEC is no longer behind a field trial, merge all
|
|
|
|
|
// tests that use this test fixture into the corresponding "non-field trial"
|
|
|
|
|
// tests.
|
2017-06-12 01:16:46 -07:00
|
|
|
class WebRtcVideoChannelFlexfecRecvTest : public WebRtcVideoChannelTest {
|
2016-11-22 02:16:47 -08:00
|
|
|
public:
|
2017-06-12 01:16:46 -07:00
|
|
|
WebRtcVideoChannelFlexfecRecvTest()
|
|
|
|
|
: WebRtcVideoChannelTest("WebRTC-FlexFEC-03-Advertised/Enabled/") {}
|
2016-11-22 02:16:47 -08:00
|
|
|
};
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest,
|
2017-01-13 07:15:54 -08:00
|
|
|
DefaultFlexfecCodecHasTransportCcAndRembFeedbackParam) {
|
|
|
|
|
EXPECT_TRUE(cricket::HasTransportCc(GetEngineCodec("flexfec-03")));
|
|
|
|
|
EXPECT_TRUE(cricket::HasRemb(GetEngineCodec("flexfec-03")));
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetDefaultRecvCodecsWithoutSsrc) {
|
2017-05-19 05:47:46 -07:00
|
|
|
AddRecvStream();
|
|
|
|
|
|
|
|
|
|
const std::vector<FakeFlexfecReceiveStream*>& streams =
|
|
|
|
|
fake_call_->GetFlexfecReceiveStreams();
|
|
|
|
|
EXPECT_TRUE(streams.empty());
|
2018-02-05 09:51:47 +01:00
|
|
|
|
|
|
|
|
const std::vector<FakeVideoReceiveStream*>& video_streams =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1U, video_streams.size());
|
|
|
|
|
const FakeVideoReceiveStream& video_stream = *video_streams.front();
|
|
|
|
|
EXPECT_EQ(0, video_stream.GetNumAddedSecondarySinks());
|
|
|
|
|
EXPECT_EQ(0, video_stream.GetNumRemovedSecondarySinks());
|
2017-05-19 05:47:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetDefaultRecvCodecsWithSsrc) {
|
2017-05-19 05:47:46 -07:00
|
|
|
AddRecvStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
|
|
|
|
|
const std::vector<FakeFlexfecReceiveStream*>& streams =
|
|
|
|
|
fake_call_->GetFlexfecReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1U, streams.size());
|
|
|
|
|
const FakeFlexfecReceiveStream* stream = streams.front();
|
|
|
|
|
const webrtc::FlexfecReceiveStream::Config& config = stream->GetConfig();
|
|
|
|
|
EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.payload_type);
|
|
|
|
|
EXPECT_EQ(kFlexfecSsrc, config.remote_ssrc);
|
|
|
|
|
ASSERT_EQ(1U, config.protected_media_ssrcs.size());
|
|
|
|
|
EXPECT_EQ(kSsrcs1[0], config.protected_media_ssrcs[0]);
|
2017-09-22 00:26:25 -07:00
|
|
|
|
|
|
|
|
const std::vector<FakeVideoReceiveStream*>& video_streams =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1U, video_streams.size());
|
2018-02-05 09:51:47 +01:00
|
|
|
const FakeVideoReceiveStream& video_stream = *video_streams.front();
|
|
|
|
|
EXPECT_EQ(1, video_stream.GetNumAddedSecondarySinks());
|
2017-09-22 00:26:25 -07:00
|
|
|
const webrtc::VideoReceiveStream::Config& video_config =
|
2018-02-05 09:51:47 +01:00
|
|
|
video_stream.GetConfig();
|
2017-09-22 00:26:25 -07:00
|
|
|
EXPECT_TRUE(video_config.rtp.protected_by_flexfec);
|
2017-05-19 05:47:46 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest,
|
2017-05-30 01:31:37 -07:00
|
|
|
EnablingFlexfecDoesNotRecreateVideoReceiveStream) {
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
|
|
|
|
|
|
|
|
|
AddRecvStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
|
2018-02-05 09:51:47 +01:00
|
|
|
const std::vector<FakeVideoReceiveStream*>& video_streams =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1U, video_streams.size());
|
|
|
|
|
const FakeVideoReceiveStream& video_stream = *video_streams.front();
|
|
|
|
|
EXPECT_EQ(0, video_stream.GetNumAddedSecondarySinks());
|
|
|
|
|
EXPECT_EQ(0, video_stream.GetNumRemovedSecondarySinks());
|
2017-05-30 01:31:37 -07:00
|
|
|
|
|
|
|
|
// Enable FlexFEC.
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
|
|
|
|
EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams())
|
|
|
|
|
<< "Enabling FlexFEC should create FlexfecReceiveStream.";
|
|
|
|
|
EXPECT_EQ(1U, fake_call_->GetVideoReceiveStreams().size())
|
|
|
|
|
<< "Enabling FlexFEC should not create VideoReceiveStream.";
|
|
|
|
|
EXPECT_EQ(1U, fake_call_->GetFlexfecReceiveStreams().size())
|
|
|
|
|
<< "Enabling FlexFEC should create a single FlexfecReceiveStream.";
|
2018-02-05 09:51:47 +01:00
|
|
|
EXPECT_EQ(1, video_stream.GetNumAddedSecondarySinks());
|
|
|
|
|
EXPECT_EQ(0, video_stream.GetNumRemovedSecondarySinks());
|
2017-05-30 01:31:37 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest,
|
2017-05-30 01:31:37 -07:00
|
|
|
DisablingFlexfecDoesNotRecreateVideoReceiveStream) {
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
|
|
|
|
|
|
|
|
|
AddRecvStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams());
|
|
|
|
|
EXPECT_EQ(1U, fake_call_->GetFlexfecReceiveStreams().size());
|
2018-02-05 09:51:47 +01:00
|
|
|
const std::vector<FakeVideoReceiveStream*>& video_streams =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1U, video_streams.size());
|
|
|
|
|
const FakeVideoReceiveStream& video_stream = *video_streams.front();
|
|
|
|
|
EXPECT_EQ(1, video_stream.GetNumAddedSecondarySinks());
|
|
|
|
|
EXPECT_EQ(0, video_stream.GetNumRemovedSecondarySinks());
|
2017-05-30 01:31:37 -07:00
|
|
|
|
|
|
|
|
// Disable FlexFEC.
|
|
|
|
|
recv_parameters.codecs.clear();
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
|
|
|
|
EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams())
|
|
|
|
|
<< "Disabling FlexFEC should not recreate VideoReceiveStream.";
|
|
|
|
|
EXPECT_EQ(1U, fake_call_->GetVideoReceiveStreams().size())
|
|
|
|
|
<< "Disabling FlexFEC should not destroy VideoReceiveStream.";
|
|
|
|
|
EXPECT_TRUE(fake_call_->GetFlexfecReceiveStreams().empty())
|
|
|
|
|
<< "Disabling FlexFEC should destroy FlexfecReceiveStream.";
|
2018-02-05 09:51:47 +01:00
|
|
|
EXPECT_EQ(1, video_stream.GetNumAddedSecondarySinks());
|
|
|
|
|
EXPECT_EQ(1, video_stream.GetNumRemovedSecondarySinks());
|
2017-05-30 01:31:37 -07:00
|
|
|
}
|
|
|
|
|
|
2017-05-19 05:47:46 -07:00
|
|
|
// TODO(brandtr): When FlexFEC is no longer behind a field trial, merge all
|
|
|
|
|
// tests that use this test fixture into the corresponding "non-field trial"
|
|
|
|
|
// tests.
|
2017-06-12 01:16:46 -07:00
|
|
|
class WebRtcVideoChannelFlexfecSendRecvTest : public WebRtcVideoChannelTest {
|
2017-05-19 05:47:46 -07:00
|
|
|
public:
|
2017-06-12 01:16:46 -07:00
|
|
|
WebRtcVideoChannelFlexfecSendRecvTest()
|
|
|
|
|
: WebRtcVideoChannelTest(
|
2017-05-19 05:47:46 -07:00
|
|
|
"WebRTC-FlexFEC-03-Advertised/Enabled/WebRTC-FlexFEC-03/Enabled/") {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecSendRecvTest, SetDefaultSendCodecsWithoutSsrc) {
|
2016-11-22 02:16:47 -08:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
|
2017-01-16 06:59:19 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.rtp.flexfec.payload_type);
|
|
|
|
|
EXPECT_EQ(0U, config.rtp.flexfec.ssrc);
|
|
|
|
|
EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty());
|
2016-11-22 02:16:47 -08:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecSendRecvTest, SetDefaultSendCodecsWithSsrc) {
|
2016-11-22 02:16:47 -08:00
|
|
|
FakeVideoSendStream* stream = AddSendStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
|
2017-01-16 06:59:19 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.rtp.flexfec.payload_type);
|
|
|
|
|
EXPECT_EQ(kFlexfecSsrc, config.rtp.flexfec.ssrc);
|
|
|
|
|
ASSERT_EQ(1U, config.rtp.flexfec.protected_media_ssrcs.size());
|
|
|
|
|
EXPECT_EQ(kSsrcs1[0], config.rtp.flexfec.protected_media_ssrcs[0]);
|
2016-11-22 02:16:47 -08:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithoutFec) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
2016-09-01 01:17:40 -07:00
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
2014-05-13 11:07:01 +00:00
|
|
|
|
2016-10-04 23:28:39 -07:00
|
|
|
EXPECT_EQ(-1, config.rtp.ulpfec.ulpfec_payload_type);
|
|
|
|
|
EXPECT_EQ(-1, config.rtp.ulpfec.red_payload_type);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecSendRecvTest, SetSendCodecsWithoutFec) {
|
2016-11-22 02:16:47 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
|
2017-01-16 06:59:19 -08:00
|
|
|
EXPECT_EQ(-1, config.rtp.flexfec.payload_type);
|
2016-11-22 02:16:47 -08:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetRecvCodecsWithFec) {
|
2017-01-23 06:59:13 -08:00
|
|
|
AddRecvStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
2017-02-03 04:43:41 -08:00
|
|
|
|
|
|
|
|
const std::vector<FakeFlexfecReceiveStream*>& flexfec_streams =
|
|
|
|
|
fake_call_->GetFlexfecReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1U, flexfec_streams.size());
|
|
|
|
|
const FakeFlexfecReceiveStream* flexfec_stream = flexfec_streams.front();
|
|
|
|
|
const webrtc::FlexfecReceiveStream::Config& flexfec_stream_config =
|
|
|
|
|
flexfec_stream->GetConfig();
|
2017-01-23 06:59:13 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("flexfec-03").id,
|
2017-02-03 04:43:41 -08:00
|
|
|
flexfec_stream_config.payload_type);
|
|
|
|
|
EXPECT_EQ(kFlexfecSsrc, flexfec_stream_config.remote_ssrc);
|
|
|
|
|
ASSERT_EQ(1U, flexfec_stream_config.protected_media_ssrcs.size());
|
|
|
|
|
EXPECT_EQ(kSsrcs1[0], flexfec_stream_config.protected_media_ssrcs[0]);
|
|
|
|
|
const std::vector<FakeVideoReceiveStream*>& video_streams =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
const FakeVideoReceiveStream* video_stream = video_streams.front();
|
|
|
|
|
const webrtc::VideoReceiveStream::Config& video_stream_config =
|
|
|
|
|
video_stream->GetConfig();
|
|
|
|
|
EXPECT_EQ(video_stream_config.rtp.local_ssrc,
|
|
|
|
|
flexfec_stream_config.local_ssrc);
|
|
|
|
|
EXPECT_EQ(video_stream_config.rtp.rtcp_mode, flexfec_stream_config.rtcp_mode);
|
|
|
|
|
EXPECT_EQ(video_stream_config.rtcp_send_transport,
|
|
|
|
|
flexfec_stream_config.rtcp_send_transport);
|
|
|
|
|
// TODO(brandtr): Update this EXPECT when we set |transport_cc| in a
|
|
|
|
|
// spec-compliant way.
|
|
|
|
|
EXPECT_EQ(video_stream_config.rtp.transport_cc,
|
|
|
|
|
flexfec_stream_config.transport_cc);
|
|
|
|
|
EXPECT_EQ(video_stream_config.rtp.rtcp_mode, flexfec_stream_config.rtcp_mode);
|
|
|
|
|
EXPECT_EQ(video_stream_config.rtp.extensions,
|
|
|
|
|
flexfec_stream_config.rtp_header_extensions);
|
2017-01-23 06:59:13 -08:00
|
|
|
}
|
|
|
|
|
|
2017-05-19 05:47:46 -07:00
|
|
|
// We should not send FlexFEC, even if we advertise it, unless the right
|
|
|
|
|
// field trial is set.
|
|
|
|
|
// TODO(brandtr): Remove when FlexFEC is enabled by default.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest,
|
2017-05-19 05:47:46 -07:00
|
|
|
SetSendCodecsWithoutSsrcWithFecDoesNotEnableFec) {
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(-1, config.rtp.flexfec.payload_type);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(0u, config.rtp.flexfec.ssrc);
|
2017-05-19 05:47:46 -07:00
|
|
|
EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest,
|
2017-05-19 05:47:46 -07:00
|
|
|
SetSendCodecsWithSsrcWithFecDoesNotEnableFec) {
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(-1, config.rtp.flexfec.payload_type);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(0u, config.rtp.flexfec.ssrc);
|
2017-05-19 05:47:46 -07:00
|
|
|
EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2014-06-26 08:49:03 +00:00
|
|
|
SetSendCodecRejectsRtxWithoutAssociatedPayloadType) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
const int kUnusedPayloadType = 127;
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType));
|
|
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoCodec rtx_codec(kUnusedPayloadType, "rtx");
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs.push_back(rtx_codec);
|
|
|
|
|
EXPECT_FALSE(channel_->SetSendParameters(parameters))
|
2014-06-26 08:49:03 +00:00
|
|
|
<< "RTX codec without associated payload type should be rejected.";
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2014-06-26 08:49:03 +00:00
|
|
|
SetSendCodecRejectsRtxWithoutMatchingVideoCodec) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
const int kUnusedPayloadType1 = 126;
|
|
|
|
|
const int kUnusedPayloadType2 = 127;
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType1));
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType2));
|
|
|
|
|
{
|
|
|
|
|
cricket::VideoCodec rtx_codec = cricket::VideoCodec::CreateRtxCodec(
|
|
|
|
|
kUnusedPayloadType1, GetEngineCodec("VP8").id);
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(rtx_codec);
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
cricket::VideoCodec rtx_codec = cricket::VideoCodec::CreateRtxCodec(
|
|
|
|
|
kUnusedPayloadType1, kUnusedPayloadType2);
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(rtx_codec);
|
|
|
|
|
EXPECT_FALSE(channel_->SetSendParameters(parameters))
|
|
|
|
|
<< "RTX without matching video codec should be rejected.";
|
|
|
|
|
}
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithChangedRtxPayloadType) {
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
const int kUnusedPayloadType1 = 126;
|
|
|
|
|
const int kUnusedPayloadType2 = 127;
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType1));
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType2));
|
|
|
|
|
|
|
|
|
|
// SSRCs for RTX.
|
|
|
|
|
cricket::StreamParams params =
|
|
|
|
|
cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
|
|
|
|
|
params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]);
|
|
|
|
|
AddSendStream(params);
|
|
|
|
|
|
|
|
|
|
// Original payload type for RTX.
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
cricket::VideoCodec rtx_codec(kUnusedPayloadType1, "rtx");
|
|
|
|
|
rtx_codec.SetParam("apt", GetEngineCodec("VP8").id);
|
|
|
|
|
parameters.codecs.push_back(rtx_codec);
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
ASSERT_EQ(1U, fake_call_->GetVideoSendStreams().size());
|
|
|
|
|
const webrtc::VideoSendStream::Config& config_before =
|
|
|
|
|
fake_call_->GetVideoSendStreams()[0]->GetConfig();
|
|
|
|
|
EXPECT_EQ(kUnusedPayloadType1, config_before.rtp.rtx.payload_type);
|
|
|
|
|
ASSERT_EQ(1U, config_before.rtp.rtx.ssrcs.size());
|
|
|
|
|
EXPECT_EQ(kRtxSsrcs1[0], config_before.rtp.rtx.ssrcs[0]);
|
|
|
|
|
|
|
|
|
|
// Change payload type for RTX.
|
|
|
|
|
parameters.codecs[1].id = kUnusedPayloadType2;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
ASSERT_EQ(1U, fake_call_->GetVideoSendStreams().size());
|
|
|
|
|
const webrtc::VideoSendStream::Config& config_after =
|
|
|
|
|
fake_call_->GetVideoSendStreams()[0]->GetConfig();
|
|
|
|
|
EXPECT_EQ(kUnusedPayloadType2, config_after.rtp.rtx.payload_type);
|
|
|
|
|
ASSERT_EQ(1U, config_after.rtp.rtx.ssrcs.size());
|
|
|
|
|
EXPECT_EQ(kRtxSsrcs1[0], config_after.rtp.rtx.ssrcs[0]);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithoutFecDisablesFec) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("ulpfec"));
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2014-06-26 08:49:03 +00:00
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
2016-09-01 01:17:40 -07:00
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
2014-06-26 08:49:03 +00:00
|
|
|
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("ulpfec").id, config.rtp.ulpfec.ulpfec_payload_type);
|
2014-06-26 08:49:03 +00:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs.pop_back();
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2014-10-03 11:25:45 +00:00
|
|
|
stream = fake_call_->GetVideoSendStreams()[0];
|
2016-11-22 02:16:47 -08:00
|
|
|
ASSERT_TRUE(stream != nullptr);
|
2016-09-01 01:17:40 -07:00
|
|
|
config = stream->GetConfig().Copy();
|
2016-10-04 23:28:39 -07:00
|
|
|
EXPECT_EQ(-1, config.rtp.ulpfec.ulpfec_payload_type)
|
2016-11-22 02:16:47 -08:00
|
|
|
<< "SetSendCodec without ULPFEC should disable current ULPFEC.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecSendRecvTest,
|
2017-05-19 05:47:46 -07:00
|
|
|
SetSendCodecsWithoutFecDisablesFec) {
|
2016-11-22 02:16:47 -08:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
|
|
|
|
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
|
|
|
|
|
2017-01-16 06:59:19 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.rtp.flexfec.payload_type);
|
|
|
|
|
EXPECT_EQ(kFlexfecSsrc, config.rtp.flexfec.ssrc);
|
2016-11-22 02:16:47 -08:00
|
|
|
ASSERT_EQ(1U, config.rtp.flexfec.protected_media_ssrcs.size());
|
|
|
|
|
EXPECT_EQ(kSsrcs1[0], config.rtp.flexfec.protected_media_ssrcs[0]);
|
|
|
|
|
|
|
|
|
|
parameters.codecs.pop_back();
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
stream = fake_call_->GetVideoSendStreams()[0];
|
|
|
|
|
ASSERT_TRUE(stream != nullptr);
|
|
|
|
|
config = stream->GetConfig().Copy();
|
2017-01-16 06:59:19 -08:00
|
|
|
EXPECT_EQ(-1, config.rtp.flexfec.payload_type)
|
2016-11-22 02:16:47 -08:00
|
|
|
<< "SetSendCodec without FlexFEC should disable current FlexFEC.";
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsChangesExistingStreams) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
2016-10-24 01:21:16 -07:00
|
|
|
cricket::VideoCodec codec(100, "VP8");
|
|
|
|
|
codec.SetParam(kCodecParamMaxQuantization, kDefaultQpMax);
|
|
|
|
|
parameters.codecs.push_back(codec);
|
2016-10-02 23:45:26 -07:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2015-02-16 21:02:00 +00:00
|
|
|
channel_->SetSend(true);
|
2014-07-16 08:01:38 +00:00
|
|
|
|
2015-02-16 21:02:00 +00:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2015-02-16 21:02:00 +00:00
|
|
|
|
|
|
|
|
std::vector<webrtc::VideoStream> streams = stream->GetVideoStreams();
|
2016-10-02 23:45:26 -07:00
|
|
|
EXPECT_EQ(kDefaultQpMax, streams[0].max_qp);
|
2014-07-16 08:01:38 +00:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs.clear();
|
2016-10-24 01:21:16 -07:00
|
|
|
codec.SetParam(kCodecParamMaxQuantization, kDefaultQpMax + 1);
|
|
|
|
|
parameters.codecs.push_back(codec);
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2014-10-03 11:25:45 +00:00
|
|
|
streams = fake_call_->GetVideoSendStreams()[0]->GetVideoStreams();
|
2016-10-02 23:45:26 -07:00
|
|
|
EXPECT_EQ(kDefaultQpMax + 1, streams[0].max_qp);
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithBitrates) {
|
2014-11-25 14:03:34 +00:00
|
|
|
SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200",
|
|
|
|
|
200000);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithHighMaxBitrate) {
|
2015-03-23 22:29:39 +00:00
|
|
|
SetSendCodecsShouldWorkForBitrates("", 0, "", -1, "10000", 10000000);
|
|
|
|
|
std::vector<webrtc::VideoStream> streams = AddSendStream()->GetVideoStreams();
|
|
|
|
|
ASSERT_EQ(1u, streams.size());
|
|
|
|
|
EXPECT_EQ(10000000, streams[0].max_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2014-11-25 14:03:34 +00:00
|
|
|
SetSendCodecsWithoutBitratesUsesCorrectDefaults) {
|
2018-02-21 13:07:13 +01:00
|
|
|
SetSendCodecsShouldWorkForBitrates("", 0, "", -1, "", -1);
|
2014-11-25 14:03:34 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsCapsMinAndStartBitrate) {
|
2014-11-25 14:03:34 +00:00
|
|
|
SetSendCodecsShouldWorkForBitrates("-1", 0, "-100", -1, "", -1);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsRejectsMaxLessThanMinBitrate) {
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.codecs[0].params[kCodecParamMinBitrate] = "300";
|
|
|
|
|
send_parameters_.codecs[0].params[kCodecParamMaxBitrate] = "200";
|
|
|
|
|
EXPECT_FALSE(channel_->SetSendParameters(send_parameters_));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2016-04-26 17:15:23 -07:00
|
|
|
// Test that when both the codec-specific bitrate params and max_bandwidth_bps
|
|
|
|
|
// are present in the same send parameters, the settings are combined correctly.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithBitratesAndMaxSendBandwidth) {
|
2016-04-26 17:15:23 -07:00
|
|
|
send_parameters_.codecs[0].params[kCodecParamMinBitrate] = "100";
|
|
|
|
|
send_parameters_.codecs[0].params[kCodecParamStartBitrate] = "200";
|
|
|
|
|
send_parameters_.codecs[0].params[kCodecParamMaxBitrate] = "300";
|
|
|
|
|
send_parameters_.max_bandwidth_bps = 400000;
|
|
|
|
|
// We expect max_bandwidth_bps to take priority, if set.
|
2018-02-21 13:07:13 +01:00
|
|
|
ExpectSetBitrateParameters(100000, 200000, 400000);
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
// Since the codec isn't changing, start_bitrate_bps should be -1.
|
|
|
|
|
ExpectSetBitrateParameters(100000, -1, 350000);
|
2016-04-26 17:15:23 -07:00
|
|
|
|
|
|
|
|
// Decrease max_bandwidth_bps.
|
|
|
|
|
send_parameters_.max_bandwidth_bps = 350000;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
|
|
|
|
|
// Now try again with the values flipped around.
|
|
|
|
|
send_parameters_.codecs[0].params[kCodecParamMaxBitrate] = "400";
|
|
|
|
|
send_parameters_.max_bandwidth_bps = 300000;
|
2018-02-21 13:07:13 +01:00
|
|
|
ExpectSetBitrateParameters(100000, 200000, 300000);
|
2016-04-26 17:15:23 -07:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
|
|
|
|
|
// If we change the codec max, max_bandwidth_bps should still apply.
|
|
|
|
|
send_parameters_.codecs[0].params[kCodecParamMaxBitrate] = "350";
|
2018-02-21 13:07:13 +01:00
|
|
|
ExpectSetBitrateParameters(100000, 200000, 300000);
|
2016-04-26 17:15:23 -07:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-25 14:03:34 +00:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetMaxSendBandwidthShouldPreserveOtherBitrates) {
|
|
|
|
|
SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200",
|
|
|
|
|
200000);
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.max_bandwidth_bps = 300000;
|
2018-02-21 13:07:13 +01:00
|
|
|
// Setting max bitrate should keep previous min bitrate.
|
|
|
|
|
// Setting max bitrate should not reset start bitrate.
|
|
|
|
|
ExpectSetBitrateParameters(100000, -1, 300000);
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2014-11-25 14:03:34 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetMaxSendBandwidthShouldBeRemovable) {
|
2015-09-17 16:42:56 +02:00
|
|
|
send_parameters_.max_bandwidth_bps = 300000;
|
2018-02-21 13:07:13 +01:00
|
|
|
ExpectSetMaxBitrate(300000);
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2017-03-10 11:23:12 -08:00
|
|
|
// -1 means to disable max bitrate (set infinite).
|
|
|
|
|
send_parameters_.max_bandwidth_bps = -1;
|
2018-02-21 13:07:13 +01:00
|
|
|
ExpectSetMaxBitrate(-1);
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetMaxSendBandwidthAndAddSendStream) {
|
2016-10-02 23:45:26 -07:00
|
|
|
send_parameters_.max_bandwidth_bps = 99999;
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
2018-02-21 13:07:13 +01:00
|
|
|
ExpectSetMaxBitrate(send_parameters_.max_bandwidth_bps);
|
2016-10-02 23:45:26 -07:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
ASSERT_EQ(1u, stream->GetVideoStreams().size());
|
|
|
|
|
EXPECT_EQ(send_parameters_.max_bandwidth_bps,
|
|
|
|
|
stream->GetVideoStreams()[0].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
send_parameters_.max_bandwidth_bps = 77777;
|
2018-02-21 13:07:13 +01:00
|
|
|
ExpectSetMaxBitrate(send_parameters_.max_bandwidth_bps);
|
2016-10-02 23:45:26 -07:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
EXPECT_EQ(send_parameters_.max_bandwidth_bps,
|
|
|
|
|
stream->GetVideoStreams()[0].max_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-18 17:51:32 +02:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
|
|
|
|
MaxBitrateIsMinimumOfMaxSendBandwidthAndMaxEncodingBitrate) {
|
|
|
|
|
send_parameters_.max_bandwidth_bps = 99999;
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
ExpectSetMaxBitrate(send_parameters_.max_bandwidth_bps);
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
ASSERT_EQ(1u, stream->GetVideoStreams().size());
|
|
|
|
|
EXPECT_EQ(send_parameters_.max_bandwidth_bps,
|
|
|
|
|
stream->GetVideoStreams()[0].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
// Get and set the rtp encoding parameters.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(1u, parameters.encodings.size());
|
|
|
|
|
|
|
|
|
|
parameters.encodings[0].max_bitrate_bps = 99999 - 1;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
EXPECT_EQ(parameters.encodings[0].max_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[0].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
parameters.encodings[0].max_bitrate_bps = 99999 + 1;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
EXPECT_EQ(send_parameters_.max_bandwidth_bps,
|
|
|
|
|
stream->GetVideoStreams()[0].max_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetMaxSendBitrateCanIncreaseSenderBitrate) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2015-03-27 15:58:11 +01:00
|
|
|
channel_->SetSend(true);
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2016-01-27 16:45:21 +01:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
|
2015-03-27 15:58:11 +01:00
|
|
|
std::vector<webrtc::VideoStream> streams = stream->GetVideoStreams();
|
|
|
|
|
int initial_max_bitrate_bps = streams[0].max_bitrate_bps;
|
|
|
|
|
EXPECT_GT(initial_max_bitrate_bps, 0);
|
|
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.max_bandwidth_bps = initial_max_bitrate_bps * 2;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2016-01-27 16:45:21 +01:00
|
|
|
// Insert a frame to update the encoder config.
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2015-03-27 15:58:11 +01:00
|
|
|
streams = stream->GetVideoStreams();
|
|
|
|
|
EXPECT_EQ(initial_max_bitrate_bps * 2, streams[0].max_bitrate_bps);
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2015-03-27 15:58:11 +01:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2015-03-27 15:58:11 +01:00
|
|
|
SetMaxSendBitrateCanIncreaseSimulcastSenderBitrate) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2015-03-27 15:58:11 +01:00
|
|
|
channel_->SetSend(true);
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream(
|
|
|
|
|
cricket::CreateSimStreamParams("cname", MAKE_VECTOR(kSsrcs3)));
|
|
|
|
|
|
|
|
|
|
// Send a frame to make sure this scales up to >1 stream (simulcast).
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrcs3[0], nullptr, &capturer));
|
2015-03-27 15:58:11 +01:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
std::vector<webrtc::VideoStream> streams = stream->GetVideoStreams();
|
|
|
|
|
ASSERT_GT(streams.size(), 1u)
|
|
|
|
|
<< "Without simulcast this test doesn't make sense.";
|
2015-10-16 12:49:39 -07:00
|
|
|
int initial_max_bitrate_bps = GetTotalMaxBitrateBps(streams);
|
2015-03-27 15:58:11 +01:00
|
|
|
EXPECT_GT(initial_max_bitrate_bps, 0);
|
|
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.max_bandwidth_bps = initial_max_bitrate_bps * 2;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2016-01-27 16:45:21 +01:00
|
|
|
// Insert a frame to update the encoder config.
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2015-03-27 15:58:11 +01:00
|
|
|
streams = stream->GetVideoStreams();
|
2015-10-16 12:49:39 -07:00
|
|
|
int increased_max_bitrate_bps = GetTotalMaxBitrateBps(streams);
|
2015-03-27 15:58:11 +01:00
|
|
|
EXPECT_EQ(initial_max_bitrate_bps * 2, increased_max_bitrate_bps);
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(kSsrcs3[0], nullptr, nullptr));
|
2015-03-27 15:58:11 +01:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithMaxQuantization) {
|
2014-05-13 11:07:01 +00:00
|
|
|
static const char* kMaxQuantization = "21";
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs[0].params[kCodecParamMaxQuantization] = kMaxQuantization;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(atoi(kMaxQuantization),
|
2014-06-06 10:49:19 +00:00
|
|
|
AddSendStream()->GetVideoStreams().back().max_qp);
|
2014-05-13 11:07:01 +00:00
|
|
|
|
|
|
|
|
VideoCodec codec;
|
|
|
|
|
EXPECT_TRUE(channel_->GetSendCodec(&codec));
|
|
|
|
|
EXPECT_EQ(kMaxQuantization, codec.params[kCodecParamMaxQuantization]);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsRejectBadPayloadTypes) {
|
2014-05-13 11:07:01 +00:00
|
|
|
// TODO(pbos): Should we only allow the dynamic range?
|
2015-01-28 21:36:55 +00:00
|
|
|
static const int kIncorrectPayloads[] = {-2, -1, 128, 129};
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-01-28 21:36:55 +00:00
|
|
|
for (size_t i = 0; i < arraysize(kIncorrectPayloads); ++i) {
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs[0].id = kIncorrectPayloads[i];
|
|
|
|
|
EXPECT_FALSE(channel_->SetSendParameters(parameters))
|
2015-02-23 21:28:22 +00:00
|
|
|
<< "Bad payload type '" << kIncorrectPayloads[i] << "' accepted.";
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendCodecsAcceptAllValidPayloadTypes) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2016-11-12 09:53:04 -08:00
|
|
|
for (int payload_type = 96; payload_type <= 127; ++payload_type) {
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs[0].id = payload_type;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters))
|
2014-05-13 11:07:01 +00:00
|
|
|
<< "Payload type '" << payload_type << "' rejected.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-13 10:07:16 -07:00
|
|
|
// Test that setting the a different set of codecs but with an identical front
|
|
|
|
|
// codec doesn't result in the stream being recreated.
|
|
|
|
|
// This may happen when a subsequent negotiation includes fewer codecs, as a
|
|
|
|
|
// result of one of the codecs being rejected.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2016-04-13 10:07:16 -07:00
|
|
|
SetSendCodecsIdenticalFirstCodecDoesntRecreateStream) {
|
|
|
|
|
cricket::VideoSendParameters parameters1;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters1.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters1.codecs.push_back(GetEngineCodec("VP9"));
|
2016-04-13 10:07:16 -07:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters1));
|
|
|
|
|
|
|
|
|
|
AddSendStream();
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
|
|
|
|
|
|
|
|
|
|
cricket::VideoSendParameters parameters2;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters2.codecs.push_back(GetEngineCodec("VP8"));
|
2016-04-13 10:07:16 -07:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters2));
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsWithOnlyVp8) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2014-06-13 11:47:28 +00:00
|
|
|
// Test that we set our inbound RTX codecs properly.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsWithRtx) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
const int kUnusedPayloadType1 = 126;
|
|
|
|
|
const int kUnusedPayloadType2 = 127;
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType1));
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType2));
|
|
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
cricket::VideoCodec rtx_codec(kUnusedPayloadType1, "rtx");
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs.push_back(rtx_codec);
|
|
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(parameters))
|
2014-06-13 11:47:28 +00:00
|
|
|
<< "RTX codec without associated payload should be rejected.";
|
|
|
|
|
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs[1].SetParam("apt", kUnusedPayloadType2);
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(parameters))
|
2014-06-13 11:47:28 +00:00
|
|
|
<< "RTX codec with invalid associated payload type should be rejected.";
|
|
|
|
|
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs[1].SetParam("apt", GetEngineCodec("VP8").id);
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2014-06-13 11:47:28 +00:00
|
|
|
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
cricket::VideoCodec rtx_codec2(kUnusedPayloadType2, "rtx");
|
2014-06-13 11:47:28 +00:00
|
|
|
rtx_codec2.SetParam("apt", rtx_codec.id);
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs.push_back(rtx_codec2);
|
2014-06-13 11:47:28 +00:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(parameters))
|
|
|
|
|
<< "RTX codec with another RTX as associated payload type should be "
|
|
|
|
|
"rejected.";
|
2014-06-13 11:47:28 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsWithChangedRtxPayloadType) {
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
const int kUnusedPayloadType1 = 126;
|
|
|
|
|
const int kUnusedPayloadType2 = 127;
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType1));
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType2));
|
|
|
|
|
|
|
|
|
|
// SSRCs for RTX.
|
|
|
|
|
cricket::StreamParams params =
|
|
|
|
|
cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
|
|
|
|
|
params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]);
|
|
|
|
|
AddRecvStream(params);
|
|
|
|
|
|
|
|
|
|
// Original payload type for RTX.
|
|
|
|
|
cricket::VideoRecvParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
cricket::VideoCodec rtx_codec(kUnusedPayloadType1, "rtx");
|
|
|
|
|
rtx_codec.SetParam("apt", GetEngineCodec("VP8").id);
|
|
|
|
|
parameters.codecs.push_back(rtx_codec);
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
ASSERT_EQ(1U, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
const webrtc::VideoReceiveStream::Config& config_before =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams()[0]->GetConfig();
|
2017-08-25 04:44:25 -07:00
|
|
|
EXPECT_EQ(1U, config_before.rtp.rtx_associated_payload_types.size());
|
|
|
|
|
const int* payload_type_before = FindKeyByValue(
|
|
|
|
|
config_before.rtp.rtx_associated_payload_types, GetEngineCodec("VP8").id);
|
|
|
|
|
ASSERT_NE(payload_type_before, nullptr);
|
|
|
|
|
EXPECT_EQ(kUnusedPayloadType1, *payload_type_before);
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
EXPECT_EQ(kRtxSsrcs1[0], config_before.rtp.rtx_ssrc);
|
|
|
|
|
|
|
|
|
|
// Change payload type for RTX.
|
|
|
|
|
parameters.codecs[1].id = kUnusedPayloadType2;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
ASSERT_EQ(1U, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
const webrtc::VideoReceiveStream::Config& config_after =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams()[0]->GetConfig();
|
2017-08-25 04:44:25 -07:00
|
|
|
EXPECT_EQ(1U, config_after.rtp.rtx_associated_payload_types.size());
|
|
|
|
|
const int* payload_type_after = FindKeyByValue(
|
|
|
|
|
config_after.rtp.rtx_associated_payload_types, GetEngineCodec("VP8").id);
|
|
|
|
|
ASSERT_NE(payload_type_after, nullptr);
|
|
|
|
|
EXPECT_EQ(kUnusedPayloadType2, *payload_type_after);
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
EXPECT_EQ(kRtxSsrcs1[0], config_after.rtp.rtx_ssrc);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsDifferentPayloadType) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs[0].id = 99;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsAcceptDefaultCodecs) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
|
|
|
|
parameters.codecs = engine_.codecs();
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2014-07-11 13:02:54 +00:00
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
2016-06-10 17:58:01 +02:00
|
|
|
const webrtc::VideoReceiveStream::Config& config = stream->GetConfig();
|
2014-10-29 15:28:39 +00:00
|
|
|
EXPECT_EQ(engine_.codecs()[0].name, config.decoders[0].payload_name);
|
|
|
|
|
EXPECT_EQ(engine_.codecs()[0].id, config.decoders[0].payload_type);
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsRejectUnsupportedCodec) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2016-10-24 01:21:16 -07:00
|
|
|
parameters.codecs.push_back(VideoCodec(101, "WTF3"));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsAcceptsMultipleVideoCodecs) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsWithoutFecDisablesFec) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters send_parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
send_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
send_parameters.codecs.push_back(GetEngineCodec("red"));
|
|
|
|
|
send_parameters.codecs.push_back(GetEngineCodec("ulpfec"));
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
|
2014-07-18 09:35:58 +00:00
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("ulpfec").id,
|
2017-09-26 02:49:21 -07:00
|
|
|
stream->GetConfig().rtp.ulpfec_payload_type);
|
2014-07-18 09:35:58 +00:00
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
2014-10-03 11:25:45 +00:00
|
|
|
stream = fake_call_->GetVideoReceiveStreams()[0];
|
2016-11-22 02:16:47 -08:00
|
|
|
ASSERT_TRUE(stream != nullptr);
|
2017-09-26 02:49:21 -07:00
|
|
|
EXPECT_EQ(-1, stream->GetConfig().rtp.ulpfec_payload_type)
|
2016-11-22 02:16:47 -08:00
|
|
|
<< "SetSendCodec without ULPFEC should disable current ULPFEC.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetRecvParamsWithoutFecDisablesFec) {
|
2016-11-22 02:16:47 -08:00
|
|
|
AddRecvStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
2017-01-23 06:59:13 -08:00
|
|
|
const std::vector<FakeFlexfecReceiveStream*>& streams =
|
2016-11-22 02:16:47 -08:00
|
|
|
fake_call_->GetFlexfecReceiveStreams();
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(1U, streams.size());
|
2017-01-23 06:59:13 -08:00
|
|
|
const FakeFlexfecReceiveStream* stream = streams.front();
|
|
|
|
|
EXPECT_EQ(GetEngineCodec("flexfec-03").id, stream->GetConfig().payload_type);
|
|
|
|
|
EXPECT_EQ(kFlexfecSsrc, stream->GetConfig().remote_ssrc);
|
|
|
|
|
ASSERT_EQ(1U, stream->GetConfig().protected_media_ssrcs.size());
|
|
|
|
|
EXPECT_EQ(kSsrcs1[0], stream->GetConfig().protected_media_ssrcs[0]);
|
2016-11-22 02:16:47 -08:00
|
|
|
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
|
|
|
|
EXPECT_TRUE(streams.empty())
|
|
|
|
|
<< "SetSendCodec without FlexFEC should disable current FlexFEC.";
|
2014-06-26 08:49:03 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSendParamsWithFecEnablesFec) {
|
2016-05-17 16:33:30 +02:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("ulpfec").id,
|
2017-09-26 02:49:21 -07:00
|
|
|
stream->GetConfig().rtp.ulpfec_payload_type);
|
2016-05-17 16:33:30 +02:00
|
|
|
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("red"));
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("ulpfec"));
|
2016-05-17 16:33:30 +02:00
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
|
|
|
|
stream = fake_call_->GetVideoReceiveStreams()[0];
|
2016-11-22 02:16:47 -08:00
|
|
|
ASSERT_TRUE(stream != nullptr);
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("ulpfec").id,
|
2017-09-26 02:49:21 -07:00
|
|
|
stream->GetConfig().rtp.ulpfec_payload_type)
|
2016-11-22 02:16:47 -08:00
|
|
|
<< "ULPFEC should be enabled on the receive stream.";
|
2016-05-17 16:33:30 +02:00
|
|
|
|
|
|
|
|
cricket::VideoSendParameters send_parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
send_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
send_parameters.codecs.push_back(GetEngineCodec("red"));
|
|
|
|
|
send_parameters.codecs.push_back(GetEngineCodec("ulpfec"));
|
2016-05-17 16:33:30 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
|
|
|
|
|
stream = fake_call_->GetVideoReceiveStreams()[0];
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("ulpfec").id,
|
2017-09-26 02:49:21 -07:00
|
|
|
stream->GetConfig().rtp.ulpfec_payload_type)
|
2016-11-22 02:16:47 -08:00
|
|
|
<< "ULPFEC should be enabled on the receive stream.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecSendRecvTest,
|
2017-05-19 05:47:46 -07:00
|
|
|
SetSendRecvParamsWithFecEnablesFec) {
|
2016-11-22 02:16:47 -08:00
|
|
|
AddRecvStream(
|
|
|
|
|
CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
|
2017-01-23 06:59:13 -08:00
|
|
|
const std::vector<FakeFlexfecReceiveStream*>& streams =
|
2016-11-22 02:16:47 -08:00
|
|
|
fake_call_->GetFlexfecReceiveStreams();
|
|
|
|
|
|
|
|
|
|
cricket::VideoRecvParameters recv_parameters;
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
recv_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
|
|
|
|
ASSERT_EQ(1U, streams.size());
|
2017-01-23 06:59:13 -08:00
|
|
|
const FakeFlexfecReceiveStream* stream_with_recv_params = streams.front();
|
2016-11-22 02:16:47 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("flexfec-03").id,
|
2017-01-23 06:59:13 -08:00
|
|
|
stream_with_recv_params->GetConfig().payload_type);
|
|
|
|
|
EXPECT_EQ(kFlexfecSsrc, stream_with_recv_params->GetConfig().remote_ssrc);
|
2016-11-22 02:16:47 -08:00
|
|
|
EXPECT_EQ(1U,
|
2017-01-23 06:59:13 -08:00
|
|
|
stream_with_recv_params->GetConfig().protected_media_ssrcs.size());
|
2016-11-22 02:16:47 -08:00
|
|
|
EXPECT_EQ(kSsrcs1[0],
|
2017-01-23 06:59:13 -08:00
|
|
|
stream_with_recv_params->GetConfig().protected_media_ssrcs[0]);
|
2016-11-22 02:16:47 -08:00
|
|
|
|
|
|
|
|
cricket::VideoSendParameters send_parameters;
|
|
|
|
|
send_parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
send_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
|
|
|
|
|
ASSERT_EQ(1U, streams.size());
|
2017-01-23 06:59:13 -08:00
|
|
|
const FakeFlexfecReceiveStream* stream_with_send_params = streams.front();
|
2016-11-22 02:16:47 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("flexfec-03").id,
|
2017-01-23 06:59:13 -08:00
|
|
|
stream_with_send_params->GetConfig().payload_type);
|
|
|
|
|
EXPECT_EQ(kFlexfecSsrc, stream_with_send_params->GetConfig().remote_ssrc);
|
2016-11-22 02:16:47 -08:00
|
|
|
EXPECT_EQ(1U,
|
2017-01-23 06:59:13 -08:00
|
|
|
stream_with_send_params->GetConfig().protected_media_ssrcs.size());
|
2016-11-22 02:16:47 -08:00
|
|
|
EXPECT_EQ(kSsrcs1[0],
|
2017-01-23 06:59:13 -08:00
|
|
|
stream_with_send_params->GetConfig().protected_media_ssrcs[0]);
|
2016-05-17 16:33:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsRejectDuplicateFecPayloads) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("red"));
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs[1].id = parameters.codecs[0].id;
|
|
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest,
|
2017-05-19 05:47:46 -07:00
|
|
|
SetRecvCodecsRejectDuplicateFecPayloads) {
|
2016-11-22 02:16:47 -08:00
|
|
|
cricket::VideoRecvParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
|
|
|
|
|
parameters.codecs[1].id = parameters.codecs[0].id;
|
|
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRecvCodecsRejectDuplicateCodecPayloads) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs[1].id = parameters.codecs[0].id;
|
|
|
|
|
EXPECT_FALSE(channel_->SetRecvParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2014-05-13 11:07:01 +00:00
|
|
|
SetRecvCodecsAcceptSameCodecOnMultiplePayloadTypes) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
parameters.codecs[1].id += 1;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2016-04-13 10:07:16 -07:00
|
|
|
// Test that setting the same codecs but with a different order
|
2015-08-20 17:19:20 -07:00
|
|
|
// doesn't result in the stream being recreated.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2016-04-13 10:07:16 -07:00
|
|
|
SetRecvCodecsDifferentOrderDoesntRecreateStream) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters1;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters1.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters1.codecs.push_back(GetEngineCodec("red"));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters1));
|
2015-08-20 17:19:20 -07:00
|
|
|
|
|
|
|
|
AddRecvStream(cricket::StreamParams::CreateLegacy(123));
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
|
|
|
|
|
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoRecvParameters parameters2;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters2.codecs.push_back(GetEngineCodec("red"));
|
|
|
|
|
parameters2.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters2));
|
2015-08-20 17:19:20 -07:00
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SendStreamNotSendingByDefault) {
|
2014-05-13 11:07:01 +00:00
|
|
|
EXPECT_FALSE(AddSendStream()->IsSending());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, ReceiveStreamReceivingByDefault) {
|
2014-07-22 09:14:58 +00:00
|
|
|
EXPECT_TRUE(AddRecvStream()->IsReceiving());
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetSend) {
|
2014-07-17 08:51:46 +00:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
2014-05-13 11:07:01 +00:00
|
|
|
EXPECT_FALSE(stream->IsSending());
|
|
|
|
|
|
|
|
|
|
// false->true
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
EXPECT_TRUE(stream->IsSending());
|
|
|
|
|
// true->true
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
EXPECT_TRUE(stream->IsSending());
|
|
|
|
|
// true->false
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(false));
|
|
|
|
|
EXPECT_FALSE(stream->IsSending());
|
|
|
|
|
// false->false
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(false));
|
|
|
|
|
EXPECT_FALSE(stream->IsSending());
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
FakeVideoSendStream* new_stream = AddSendStream();
|
|
|
|
|
EXPECT_TRUE(new_stream->IsSending())
|
|
|
|
|
<< "Send stream created after SetSend(true) not sending initially.";
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-10 14:41:43 +00:00
|
|
|
// This test verifies DSCP settings are properly applied on video media channel.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, TestSetDscpOptions) {
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<cricket::FakeNetworkInterface> network_interface(
|
2014-11-10 14:41:43 +00:00
|
|
|
new cricket::FakeNetworkInterface);
|
2016-02-12 02:27:06 -08:00
|
|
|
MediaConfig config;
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel;
|
2016-02-12 02:27:06 -08:00
|
|
|
|
|
|
|
|
channel.reset(engine_.CreateChannel(call_.get(), config, VideoOptions()));
|
|
|
|
|
channel->SetInterface(network_interface.get());
|
|
|
|
|
// Default value when DSCP is disabled should be DSCP_DEFAULT.
|
|
|
|
|
EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp());
|
|
|
|
|
|
|
|
|
|
config.enable_dscp = true;
|
|
|
|
|
channel.reset(engine_.CreateChannel(call_.get(), config, VideoOptions()));
|
|
|
|
|
channel->SetInterface(network_interface.get());
|
2014-11-10 14:41:43 +00:00
|
|
|
EXPECT_EQ(rtc::DSCP_AF41, network_interface->dscp());
|
2016-02-12 02:27:06 -08:00
|
|
|
|
|
|
|
|
// Verify that setting the option to false resets the
|
|
|
|
|
// DiffServCodePoint.
|
|
|
|
|
config.enable_dscp = false;
|
|
|
|
|
channel.reset(engine_.CreateChannel(call_.get(), config, VideoOptions()));
|
|
|
|
|
channel->SetInterface(network_interface.get());
|
2014-11-10 14:41:43 +00:00
|
|
|
EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp());
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-09 12:37:51 -08:00
|
|
|
// This test verifies that the RTCP reduced size mode is properly applied to
|
|
|
|
|
// send video streams.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, TestSetSendRtcpReducedSize) {
|
2015-12-09 12:37:51 -08:00
|
|
|
// Create stream, expecting that default mode is "compound".
|
|
|
|
|
FakeVideoSendStream* stream1 = AddSendStream();
|
|
|
|
|
EXPECT_EQ(webrtc::RtcpMode::kCompound, stream1->GetConfig().rtp.rtcp_mode);
|
2018-05-24 16:24:21 +02:00
|
|
|
webrtc::RtpParameters rtp_parameters =
|
|
|
|
|
channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_FALSE(rtp_parameters.rtcp.reduced_size);
|
2015-12-09 12:37:51 -08:00
|
|
|
|
|
|
|
|
// Now enable reduced size mode.
|
|
|
|
|
send_parameters_.rtcp.reduced_size = true;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
stream1 = fake_call_->GetVideoSendStreams()[0];
|
|
|
|
|
EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream1->GetConfig().rtp.rtcp_mode);
|
2018-05-24 16:24:21 +02:00
|
|
|
rtp_parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_TRUE(rtp_parameters.rtcp.reduced_size);
|
2015-12-09 12:37:51 -08:00
|
|
|
|
|
|
|
|
// Create a new stream and ensure it picks up the reduced size mode.
|
|
|
|
|
FakeVideoSendStream* stream2 = AddSendStream();
|
|
|
|
|
EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream2->GetConfig().rtp.rtcp_mode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This test verifies that the RTCP reduced size mode is properly applied to
|
|
|
|
|
// receive video streams.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, TestSetRecvRtcpReducedSize) {
|
2015-12-09 12:37:51 -08:00
|
|
|
// Create stream, expecting that default mode is "compound".
|
|
|
|
|
FakeVideoReceiveStream* stream1 = AddRecvStream();
|
|
|
|
|
EXPECT_EQ(webrtc::RtcpMode::kCompound, stream1->GetConfig().rtp.rtcp_mode);
|
|
|
|
|
|
|
|
|
|
// Now enable reduced size mode.
|
2016-03-18 15:02:07 -07:00
|
|
|
// TODO(deadbeef): Once "recv_parameters" becomes "receiver_parameters",
|
|
|
|
|
// the reduced_size flag should come from that.
|
|
|
|
|
send_parameters_.rtcp.reduced_size = true;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-12-09 12:37:51 -08:00
|
|
|
stream1 = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream1->GetConfig().rtp.rtcp_mode);
|
|
|
|
|
|
|
|
|
|
// Create a new stream and ensure it picks up the reduced size mode.
|
|
|
|
|
FakeVideoReceiveStream* stream2 = AddRecvStream();
|
|
|
|
|
EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream2->GetConfig().rtp.rtcp_mode);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, OnReadyToSendSignalsNetworkState) {
|
2016-03-22 15:32:27 -07:00
|
|
|
EXPECT_EQ(webrtc::kNetworkUp,
|
|
|
|
|
fake_call_->GetNetworkState(webrtc::MediaType::VIDEO));
|
|
|
|
|
EXPECT_EQ(webrtc::kNetworkUp,
|
|
|
|
|
fake_call_->GetNetworkState(webrtc::MediaType::AUDIO));
|
2014-09-03 16:17:12 +00:00
|
|
|
|
|
|
|
|
channel_->OnReadyToSend(false);
|
2016-03-22 15:32:27 -07:00
|
|
|
EXPECT_EQ(webrtc::kNetworkDown,
|
|
|
|
|
fake_call_->GetNetworkState(webrtc::MediaType::VIDEO));
|
|
|
|
|
EXPECT_EQ(webrtc::kNetworkUp,
|
|
|
|
|
fake_call_->GetNetworkState(webrtc::MediaType::AUDIO));
|
2014-09-03 16:17:12 +00:00
|
|
|
|
|
|
|
|
channel_->OnReadyToSend(true);
|
2016-03-22 15:32:27 -07:00
|
|
|
EXPECT_EQ(webrtc::kNetworkUp,
|
|
|
|
|
fake_call_->GetNetworkState(webrtc::MediaType::VIDEO));
|
|
|
|
|
EXPECT_EQ(webrtc::kNetworkUp,
|
|
|
|
|
fake_call_->GetNetworkState(webrtc::MediaType::AUDIO));
|
2014-05-13 11:07:01 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsReportsSentCodecName) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
2015-03-26 16:28:31 +01:00
|
|
|
|
|
|
|
|
AddSendStream();
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ("VP8", info.senders[0].codec_name);
|
2015-03-26 16:28:31 +01:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsReportsEncoderImplementationName) {
|
2015-12-18 16:01:11 +01:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
|
|
|
|
stats.encoder_implementation_name = "encoder_implementation_name";
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
EXPECT_EQ(stats.encoder_implementation_name,
|
|
|
|
|
info.senders[0].encoder_implementation_name);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsReportsCpuOveruseMetrics) {
|
2015-02-26 12:19:31 +00:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
|
|
|
|
stats.avg_encode_time_ms = 13;
|
|
|
|
|
stats.encode_usage_percent = 42;
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
2015-02-26 12:19:31 +00:00
|
|
|
EXPECT_EQ(stats.avg_encode_time_ms, info.senders[0].avg_encode_ms);
|
|
|
|
|
EXPECT_EQ(stats.encode_usage_percent, info.senders[0].encode_usage_percent);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsReportsFramesEncoded) {
|
2016-10-24 01:46:43 -07:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
|
|
|
|
stats.frames_encoded = 13;
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
EXPECT_EQ(stats.frames_encoded, info.senders[0].frames_encoded);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsReportsQpSum) {
|
2016-10-31 06:53:47 -07:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
2017-11-16 11:09:55 +01:00
|
|
|
stats.qp_sum = 13;
|
2016-10-31 06:53:47 -07:00
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
EXPECT_EQ(stats.qp_sum, info.senders[0].qp_sum);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsReportsUpperResolution) {
|
2014-12-01 15:23:21 +00:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
2015-02-25 10:42:16 +00:00
|
|
|
stats.substreams[17].width = 123;
|
|
|
|
|
stats.substreams[17].height = 40;
|
|
|
|
|
stats.substreams[42].width = 80;
|
|
|
|
|
stats.substreams[42].height = 31;
|
|
|
|
|
stats.substreams[11].width = 20;
|
|
|
|
|
stats.substreams[11].height = 90;
|
2014-12-01 15:23:21 +00:00
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
2014-12-01 15:23:21 +00:00
|
|
|
ASSERT_EQ(1u, info.senders.size());
|
|
|
|
|
EXPECT_EQ(123, info.senders[0].send_frame_width);
|
|
|
|
|
EXPECT_EQ(90, info.senders[0].send_frame_height);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsReportsCpuAdaptationStats) {
|
2016-11-01 11:45:46 -07:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
|
|
|
|
stats.number_of_cpu_adapt_changes = 2;
|
|
|
|
|
stats.cpu_limited_resolution = true;
|
|
|
|
|
stream->SetStats(stats);
|
2015-02-26 10:03:39 +00:00
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
EXPECT_TRUE(channel_->GetStats(&info));
|
2015-02-26 10:03:39 +00:00
|
|
|
ASSERT_EQ(1U, info.senders.size());
|
2017-06-12 01:16:46 -07:00
|
|
|
EXPECT_EQ(WebRtcVideoChannel::ADAPTREASON_CPU, info.senders[0].adapt_reason);
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(stats.number_of_cpu_adapt_changes, info.senders[0].adapt_changes);
|
2015-02-26 10:03:39 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsReportsAdaptationAndBandwidthStats) {
|
2016-11-01 11:45:46 -07:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
2015-12-14 02:08:12 -08:00
|
|
|
webrtc::VideoSendStream::Stats stats;
|
2016-11-01 11:45:46 -07:00
|
|
|
stats.number_of_cpu_adapt_changes = 2;
|
|
|
|
|
stats.cpu_limited_resolution = true;
|
2015-12-14 02:08:12 -08:00
|
|
|
stats.bw_limited_resolution = true;
|
2016-11-01 11:45:46 -07:00
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-12-14 02:08:12 -08:00
|
|
|
EXPECT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
ASSERT_EQ(1U, info.senders.size());
|
2017-06-12 01:16:46 -07:00
|
|
|
EXPECT_EQ(WebRtcVideoChannel::ADAPTREASON_CPU |
|
|
|
|
|
WebRtcVideoChannel::ADAPTREASON_BANDWIDTH,
|
2015-12-14 02:08:12 -08:00
|
|
|
info.senders[0].adapt_reason);
|
2016-11-01 11:45:46 -07:00
|
|
|
EXPECT_EQ(stats.number_of_cpu_adapt_changes, info.senders[0].adapt_changes);
|
2015-12-14 02:08:12 -08:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2015-12-14 02:08:12 -08:00
|
|
|
GetStatsTranslatesBandwidthLimitedResolutionCorrectly) {
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
|
|
|
|
stats.bw_limited_resolution = true;
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
EXPECT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
ASSERT_EQ(1U, info.senders.size());
|
2017-06-12 01:16:46 -07:00
|
|
|
EXPECT_EQ(WebRtcVideoChannel::ADAPTREASON_BANDWIDTH,
|
2015-12-14 02:08:12 -08:00
|
|
|
info.senders[0].adapt_reason);
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-19 12:47:00 +00:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsTranslatesSendRtcpPacketTypesCorrectly) {
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
|
|
|
|
stats.substreams[17].rtcp_packet_type_counts.fir_packets = 2;
|
|
|
|
|
stats.substreams[17].rtcp_packet_type_counts.nack_packets = 3;
|
|
|
|
|
stats.substreams[17].rtcp_packet_type_counts.pli_packets = 4;
|
|
|
|
|
|
|
|
|
|
stats.substreams[42].rtcp_packet_type_counts.fir_packets = 5;
|
|
|
|
|
stats.substreams[42].rtcp_packet_type_counts.nack_packets = 7;
|
|
|
|
|
stats.substreams[42].rtcp_packet_type_counts.pli_packets = 9;
|
|
|
|
|
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
2015-02-19 12:47:00 +00:00
|
|
|
EXPECT_EQ(7, info.senders[0].firs_rcvd);
|
|
|
|
|
EXPECT_EQ(10, info.senders[0].nacks_rcvd);
|
|
|
|
|
EXPECT_EQ(13, info.senders[0].plis_rcvd);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2015-02-19 12:47:00 +00:00
|
|
|
GetStatsTranslatesReceiveRtcpPacketTypesCorrectly) {
|
|
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
webrtc::VideoReceiveStream::Stats stats;
|
|
|
|
|
stats.rtcp_packet_type_counts.fir_packets = 2;
|
|
|
|
|
stats.rtcp_packet_type_counts.nack_packets = 3;
|
|
|
|
|
stats.rtcp_packet_type_counts.pli_packets = 4;
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
2015-02-19 12:47:00 +00:00
|
|
|
EXPECT_EQ(stats.rtcp_packet_type_counts.fir_packets,
|
2018-05-30 15:31:29 +02:00
|
|
|
rtc::checked_cast<unsigned int>(info.receivers[0].firs_sent));
|
2015-02-19 12:47:00 +00:00
|
|
|
EXPECT_EQ(stats.rtcp_packet_type_counts.nack_packets,
|
2018-05-30 15:31:29 +02:00
|
|
|
rtc::checked_cast<unsigned int>(info.receivers[0].nacks_sent));
|
2015-02-19 12:47:00 +00:00
|
|
|
EXPECT_EQ(stats.rtcp_packet_type_counts.pli_packets,
|
2018-05-30 15:31:29 +02:00
|
|
|
rtc::checked_cast<unsigned int>(info.receivers[0].plis_sent));
|
2015-02-19 12:47:00 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsTranslatesDecodeStatsCorrectly) {
|
2015-02-25 10:42:16 +00:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
webrtc::VideoReceiveStream::Stats stats;
|
2015-12-18 16:01:11 +01:00
|
|
|
stats.decoder_implementation_name = "decoder_implementation_name";
|
2015-02-25 10:42:16 +00:00
|
|
|
stats.decode_ms = 2;
|
|
|
|
|
stats.max_decode_ms = 3;
|
|
|
|
|
stats.current_delay_ms = 4;
|
|
|
|
|
stats.target_delay_ms = 5;
|
|
|
|
|
stats.jitter_buffer_ms = 6;
|
|
|
|
|
stats.min_playout_delay_ms = 7;
|
|
|
|
|
stats.render_delay_ms = 8;
|
2016-08-30 00:45:45 -07:00
|
|
|
stats.width = 9;
|
|
|
|
|
stats.height = 10;
|
2017-01-20 03:56:50 -08:00
|
|
|
stats.frame_counts.key_frames = 11;
|
|
|
|
|
stats.frame_counts.delta_frames = 12;
|
2017-01-23 07:21:55 -08:00
|
|
|
stats.frames_rendered = 13;
|
|
|
|
|
stats.frames_decoded = 14;
|
2017-11-16 11:09:55 +01:00
|
|
|
stats.qp_sum = 15;
|
2015-02-25 10:42:16 +00:00
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
2015-12-18 16:01:11 +01:00
|
|
|
EXPECT_EQ(stats.decoder_implementation_name,
|
|
|
|
|
info.receivers[0].decoder_implementation_name);
|
2015-02-25 10:42:16 +00:00
|
|
|
EXPECT_EQ(stats.decode_ms, info.receivers[0].decode_ms);
|
|
|
|
|
EXPECT_EQ(stats.max_decode_ms, info.receivers[0].max_decode_ms);
|
|
|
|
|
EXPECT_EQ(stats.current_delay_ms, info.receivers[0].current_delay_ms);
|
|
|
|
|
EXPECT_EQ(stats.target_delay_ms, info.receivers[0].target_delay_ms);
|
|
|
|
|
EXPECT_EQ(stats.jitter_buffer_ms, info.receivers[0].jitter_buffer_ms);
|
|
|
|
|
EXPECT_EQ(stats.min_playout_delay_ms, info.receivers[0].min_playout_delay_ms);
|
|
|
|
|
EXPECT_EQ(stats.render_delay_ms, info.receivers[0].render_delay_ms);
|
2016-08-30 00:45:45 -07:00
|
|
|
EXPECT_EQ(stats.width, info.receivers[0].frame_width);
|
|
|
|
|
EXPECT_EQ(stats.height, info.receivers[0].frame_height);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<unsigned int>(stats.frame_counts.key_frames +
|
|
|
|
|
stats.frame_counts.delta_frames),
|
2017-01-20 03:56:50 -08:00
|
|
|
info.receivers[0].frames_received);
|
2017-01-23 07:21:55 -08:00
|
|
|
EXPECT_EQ(stats.frames_rendered, info.receivers[0].frames_rendered);
|
2016-10-26 07:09:24 -07:00
|
|
|
EXPECT_EQ(stats.frames_decoded, info.receivers[0].frames_decoded);
|
Reland of Add QP sum stats for received streams. (patchset #2 id:300001 of https://codereview.webrtc.org/2680893002/ )
Reason for revert:
Fix the problem.
Original issue's description:
> Revert of Add QP sum stats for received streams. (patchset #10 id:180001 of https://codereview.webrtc.org/2649133005/ )
>
> Reason for revert:
> Breaks downstream build.
>
> Original issue's description:
> > Add QP sum stats for received streams.
> >
> > This is not implemented yet in any of the decoders.
> >
> > BUG=webrtc:6541
> >
> > Review-Url: https://codereview.webrtc.org/2649133005
> > Cr-Commit-Position: refs/heads/master@{#16475}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/ff0e72fd165facac27f0313aa178648782e63bc4
>
> TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,sakal@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6541
>
> Review-Url: https://codereview.webrtc.org/2680893002 .
> Cr-Commit-Position: refs/heads/master@{#16480}
> Committed: https://chromium.googlesource.com/external/webrtc/+/69fb2cca4d54f3df7ceddcd1c3e9b0ad80fa849b
TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
BUG=webrtc:6541
Review-Url: https://codereview.webrtc.org/2681663005
Cr-Commit-Position: refs/heads/master@{#16511}
2017-02-09 04:53:45 -08:00
|
|
|
EXPECT_EQ(stats.qp_sum, info.receivers[0].qp_sum);
|
2015-02-25 10:42:16 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetStatsTranslatesReceivePacketStatsCorrectly) {
|
2015-04-22 14:52:45 +02:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
webrtc::VideoReceiveStream::Stats stats;
|
|
|
|
|
stats.rtp_stats.transmitted.payload_bytes = 2;
|
|
|
|
|
stats.rtp_stats.transmitted.header_bytes = 3;
|
|
|
|
|
stats.rtp_stats.transmitted.padding_bytes = 4;
|
|
|
|
|
stats.rtp_stats.transmitted.packets = 5;
|
2017-08-04 05:03:53 -07:00
|
|
|
stats.rtcp_stats.packets_lost = 6;
|
2015-04-22 14:52:45 +02:00
|
|
|
stats.rtcp_stats.fraction_lost = 7;
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
EXPECT_EQ(stats.rtp_stats.transmitted.payload_bytes +
|
|
|
|
|
stats.rtp_stats.transmitted.header_bytes +
|
|
|
|
|
stats.rtp_stats.transmitted.padding_bytes,
|
2018-05-30 15:31:29 +02:00
|
|
|
rtc::checked_cast<size_t>(info.receivers[0].bytes_rcvd));
|
2015-04-22 14:52:45 +02:00
|
|
|
EXPECT_EQ(stats.rtp_stats.transmitted.packets,
|
2018-05-30 15:31:29 +02:00
|
|
|
rtc::checked_cast<unsigned int>(info.receivers[0].packets_rcvd));
|
2017-08-04 05:03:53 -07:00
|
|
|
EXPECT_EQ(stats.rtcp_stats.packets_lost, info.receivers[0].packets_lost);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<float>(stats.rtcp_stats.fraction_lost) / (1 << 8),
|
2015-04-22 14:52:45 +02:00
|
|
|
info.receivers[0].fraction_lost);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, TranslatesCallStatsCorrectly) {
|
2014-12-11 13:26:09 +00:00
|
|
|
AddSendStream();
|
|
|
|
|
AddSendStream();
|
|
|
|
|
webrtc::Call::Stats stats;
|
|
|
|
|
stats.rtt_ms = 123;
|
|
|
|
|
fake_call_->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
2014-12-11 13:26:09 +00:00
|
|
|
ASSERT_EQ(2u, info.senders.size());
|
|
|
|
|
EXPECT_EQ(stats.rtt_ms, info.senders[0].rtt_ms);
|
|
|
|
|
EXPECT_EQ(stats.rtt_ms, info.senders[1].rtt_ms);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, TranslatesSenderBitrateStatsCorrectly) {
|
2015-02-23 16:39:07 +00:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats;
|
2015-02-26 13:15:22 +00:00
|
|
|
stats.target_media_bitrate_bps = 156;
|
2015-02-23 16:39:07 +00:00
|
|
|
stats.media_bitrate_bps = 123;
|
|
|
|
|
stats.substreams[17].total_bitrate_bps = 1;
|
|
|
|
|
stats.substreams[17].retransmit_bitrate_bps = 2;
|
|
|
|
|
stats.substreams[42].total_bitrate_bps = 3;
|
|
|
|
|
stats.substreams[42].retransmit_bitrate_bps = 4;
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream2 = AddSendStream();
|
|
|
|
|
webrtc::VideoSendStream::Stats stats2;
|
2015-02-26 13:15:22 +00:00
|
|
|
stats2.target_media_bitrate_bps = 200;
|
2015-02-23 16:39:07 +00:00
|
|
|
stats2.media_bitrate_bps = 321;
|
|
|
|
|
stats2.substreams[13].total_bitrate_bps = 5;
|
|
|
|
|
stats2.substreams[13].retransmit_bitrate_bps = 6;
|
|
|
|
|
stats2.substreams[21].total_bitrate_bps = 7;
|
|
|
|
|
stats2.substreams[21].retransmit_bitrate_bps = 8;
|
|
|
|
|
stream2->SetStats(stats2);
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
2015-03-04 08:54:32 +00:00
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
2015-02-23 16:39:07 +00:00
|
|
|
ASSERT_EQ(2u, info.senders.size());
|
2017-06-02 06:44:03 -07:00
|
|
|
BandwidthEstimationInfo bwe_info;
|
|
|
|
|
channel_->FillBitrateInfo(&bwe_info);
|
2015-02-23 16:39:07 +00:00
|
|
|
// Assuming stream and stream2 corresponds to senders[0] and [1] respectively
|
|
|
|
|
// is OK as std::maps are sorted and AddSendStream() gives increasing SSRCs.
|
|
|
|
|
EXPECT_EQ(stats.media_bitrate_bps, info.senders[0].nominal_bitrate);
|
|
|
|
|
EXPECT_EQ(stats2.media_bitrate_bps, info.senders[1].nominal_bitrate);
|
2015-02-26 13:15:22 +00:00
|
|
|
EXPECT_EQ(stats.target_media_bitrate_bps + stats2.target_media_bitrate_bps,
|
2017-06-02 06:44:03 -07:00
|
|
|
bwe_info.target_enc_bitrate);
|
2015-02-23 16:39:07 +00:00
|
|
|
EXPECT_EQ(stats.media_bitrate_bps + stats2.media_bitrate_bps,
|
2017-06-02 06:44:03 -07:00
|
|
|
bwe_info.actual_enc_bitrate);
|
|
|
|
|
EXPECT_EQ(1 + 3 + 5 + 7, bwe_info.transmit_bitrate)
|
2015-02-23 16:39:07 +00:00
|
|
|
<< "Bandwidth stats should take all streams into account.";
|
2017-06-02 06:44:03 -07:00
|
|
|
EXPECT_EQ(2 + 4 + 6 + 8, bwe_info.retransmit_bitrate)
|
2015-02-23 16:39:07 +00:00
|
|
|
<< "Bandwidth stats should take all streams into account.";
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, DefaultReceiveStreamReconfiguresToUseRtx) {
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-03-06 15:35:19 +00:00
|
|
|
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
|
|
|
|
|
const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
|
2015-03-06 15:35:19 +00:00
|
|
|
|
|
|
|
|
ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
const size_t kDataLength = 12;
|
|
|
|
|
uint8_t data[kDataLength];
|
|
|
|
|
memset(data, 0, sizeof(data));
|
|
|
|
|
rtc::SetBE32(&data[8], ssrcs[0]);
|
2016-03-20 06:15:43 -07:00
|
|
|
rtc::CopyOnWriteBuffer packet(data, kDataLength);
|
2015-03-06 15:35:19 +00:00
|
|
|
rtc::PacketTime packet_time;
|
|
|
|
|
channel_->OnPacketReceived(&packet, packet_time);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size())
|
|
|
|
|
<< "No default receive stream created.";
|
|
|
|
|
FakeVideoReceiveStream* recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
EXPECT_EQ(0u, recv_stream->GetConfig().rtp.rtx_ssrc)
|
2015-03-06 15:35:19 +00:00
|
|
|
<< "Default receive stream should not have configured RTX";
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(
|
|
|
|
|
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)));
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size())
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
<< "AddRecvStream should have reconfigured, not added a new receiver.";
|
2015-03-06 15:35:19 +00:00
|
|
|
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
2017-08-25 04:44:25 -07:00
|
|
|
EXPECT_FALSE(
|
|
|
|
|
recv_stream->GetConfig().rtp.rtx_associated_payload_types.empty());
|
Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3007303002/ )
Reason for revert:
Identified a configuration problem in the video quality tests. Intend to fix and reland.
Original issue's description:
> Revert of Use RtxReceiveStream. (patchset #5 id:320001 of https://codereview.webrtc.org/3006063002/ )
>
> Reason for revert:
> This change appears to break ulpfec, with severe regressions, e.g., for webrtc_perf_test FullStackTest.ForemanCifPlr5Ulpfec
>
> Original issue's description:
> > Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3010983002/ )
> >
> > Reason for revert:
> > Intend to fix perf failures and reland.
> >
> > Original issue's description:
> > > Revert of Use RtxReceiveStream. (patchset #5 id:80001 of https://codereview.webrtc.org/3008773002/ )
> > >
> > > Reason for revert:
> > > A few perf tests broken, including
> > >
> > > RampUpTest.UpDownUpAbsSendTimeSimulcastRedRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberPacketLoss
> > >
> > >
> > > Original issue's description:
> > > > Use RtxReceiveStream.
> > > >
> > > > This also has the beneficial side-effect that when a media stream
> > > > which is protected by FlexFEC receives an RTX retransmission, the
> > > > retransmitted media packet is passed into the FlexFEC machinery,
> > > > which should improve its ability to recover packets via FEC.
> > > >
> > > > BUG=webrtc:7135
> > > >
> > > > Review-Url: https://codereview.webrtc.org/3008773002
> > > > Cr-Commit-Position: refs/heads/master@{#19649}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/5c0f6c62ea3b1d2c43f8fc152961af27033475f7
> > >
> > > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:7135
> > >
> > > Review-Url: https://codereview.webrtc.org/3010983002
> > > Cr-Commit-Position: refs/heads/master@{#19653}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/3c39c0137afa274d1d524b150b50304b38a2847b
> >
> > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > BUG=webrtc:7135
> >
> > Review-Url: https://codereview.webrtc.org/3006063002
> > Cr-Commit-Position: refs/heads/master@{#19715}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/35713eaf565c0fef07c8afc158d7b8fdf7ec3d78
>
> TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:7135
>
> Review-Url: https://codereview.webrtc.org/3007303002
> Cr-Commit-Position: refs/heads/master@{#19744}
> Committed: https://chromium.googlesource.com/external/webrtc/+/8e7eee035178a7f10e19883681b5eaa4a7523107
TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7135
Review-Url: https://codereview.webrtc.org/3012963002
Cr-Commit-Position: refs/heads/master@{#19765}
2017-09-11 02:32:16 -07:00
|
|
|
EXPECT_TRUE(VerifyRtxReceiveAssociations(recv_stream->GetConfig()))
|
2016-05-12 16:44:36 +02:00
|
|
|
<< "RTX should be mapped for all decoders/payload types.";
|
Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3007303002/ )
Reason for revert:
Identified a configuration problem in the video quality tests. Intend to fix and reland.
Original issue's description:
> Revert of Use RtxReceiveStream. (patchset #5 id:320001 of https://codereview.webrtc.org/3006063002/ )
>
> Reason for revert:
> This change appears to break ulpfec, with severe regressions, e.g., for webrtc_perf_test FullStackTest.ForemanCifPlr5Ulpfec
>
> Original issue's description:
> > Reland of Use RtxReceiveStream. (patchset #1 id:1 of https://codereview.webrtc.org/3010983002/ )
> >
> > Reason for revert:
> > Intend to fix perf failures and reland.
> >
> > Original issue's description:
> > > Revert of Use RtxReceiveStream. (patchset #5 id:80001 of https://codereview.webrtc.org/3008773002/ )
> > >
> > > Reason for revert:
> > > A few perf tests broken, including
> > >
> > > RampUpTest.UpDownUpAbsSendTimeSimulcastRedRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberRtx
> > > RampUpTest.UpDownUpTransportSequenceNumberPacketLoss
> > >
> > >
> > > Original issue's description:
> > > > Use RtxReceiveStream.
> > > >
> > > > This also has the beneficial side-effect that when a media stream
> > > > which is protected by FlexFEC receives an RTX retransmission, the
> > > > retransmitted media packet is passed into the FlexFEC machinery,
> > > > which should improve its ability to recover packets via FEC.
> > > >
> > > > BUG=webrtc:7135
> > > >
> > > > Review-Url: https://codereview.webrtc.org/3008773002
> > > > Cr-Commit-Position: refs/heads/master@{#19649}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/5c0f6c62ea3b1d2c43f8fc152961af27033475f7
> > >
> > > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:7135
> > >
> > > Review-Url: https://codereview.webrtc.org/3010983002
> > > Cr-Commit-Position: refs/heads/master@{#19653}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/3c39c0137afa274d1d524b150b50304b38a2847b
> >
> > TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > BUG=webrtc:7135
> >
> > Review-Url: https://codereview.webrtc.org/3006063002
> > Cr-Commit-Position: refs/heads/master@{#19715}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/35713eaf565c0fef07c8afc158d7b8fdf7ec3d78
>
> TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:7135
>
> Review-Url: https://codereview.webrtc.org/3007303002
> Cr-Commit-Position: refs/heads/master@{#19744}
> Committed: https://chromium.googlesource.com/external/webrtc/+/8e7eee035178a7f10e19883681b5eaa4a7523107
TBR=brandtr@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org,magjed@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7135
Review-Url: https://codereview.webrtc.org/3012963002
Cr-Commit-Position: refs/heads/master@{#19765}
2017-09-11 02:32:16 -07:00
|
|
|
EXPECT_TRUE(HasRtxReceiveAssociation(recv_stream->GetConfig(),
|
|
|
|
|
GetEngineCodec("red").id))
|
|
|
|
|
<< "RTX should be mapped also for the RED payload type";
|
Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.
Transition made possible by https://codereview.webrtc.org/2655243006/.
Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/fe2bef39cd2a5c891a49f7320514fb04324dc66c
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: https://chromium.googlesource.com/external/webrtc/+/e4974953ce0d03a60fae7659b199a6a62a79fa30
TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011
Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 04:53:07 -08:00
|
|
|
EXPECT_EQ(rtx_ssrcs[0], recv_stream->GetConfig().rtp.rtx_ssrc);
|
2015-03-06 15:35:19 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RejectsAddingStreamsWithMissingSsrcsForRtx) {
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2014-12-10 09:01:18 +00:00
|
|
|
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
|
|
|
|
|
const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
|
2014-12-10 09:01:18 +00:00
|
|
|
|
2015-03-25 14:17:23 +01:00
|
|
|
StreamParams sp =
|
|
|
|
|
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs);
|
|
|
|
|
sp.ssrcs = ssrcs; // Without RTXs, this is the important part.
|
|
|
|
|
|
|
|
|
|
EXPECT_FALSE(channel_->AddSendStream(sp));
|
|
|
|
|
EXPECT_FALSE(channel_->AddRecvStream(sp));
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RejectsAddingStreamsWithOverlappingRtxSsrcs) {
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-03-26 16:23:04 +01:00
|
|
|
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
|
|
|
|
|
const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
|
2015-03-26 16:23:04 +01:00
|
|
|
|
|
|
|
|
StreamParams sp =
|
|
|
|
|
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(sp));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
|
|
|
|
|
|
|
|
|
// The RTX SSRC is already used in previous streams, using it should fail.
|
|
|
|
|
sp = cricket::StreamParams::CreateLegacy(rtx_ssrcs[0]);
|
|
|
|
|
EXPECT_FALSE(channel_->AddSendStream(sp));
|
|
|
|
|
EXPECT_FALSE(channel_->AddRecvStream(sp));
|
|
|
|
|
|
|
|
|
|
// After removing the original stream this should be fine to add (makes sure
|
|
|
|
|
// that RTX ssrcs are not forever taken).
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveSendStream(ssrcs[0]));
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveRecvStream(ssrcs[0]));
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(sp));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2015-03-26 16:23:04 +01:00
|
|
|
RejectsAddingStreamsWithOverlappingSimulcastSsrcs) {
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
static const uint32_t kFirstStreamSsrcs[] = {1, 2, 3};
|
|
|
|
|
static const uint32_t kOverlappingStreamSsrcs[] = {4, 3, 5};
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-03-26 16:23:04 +01:00
|
|
|
|
|
|
|
|
StreamParams sp =
|
|
|
|
|
cricket::CreateSimStreamParams("cname", MAKE_VECTOR(kFirstStreamSsrcs));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(sp));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
|
|
|
|
|
|
|
|
|
// One of the SSRCs is already used in previous streams, using it should fail.
|
|
|
|
|
sp = cricket::CreateSimStreamParams("cname",
|
|
|
|
|
MAKE_VECTOR(kOverlappingStreamSsrcs));
|
|
|
|
|
EXPECT_FALSE(channel_->AddSendStream(sp));
|
|
|
|
|
EXPECT_FALSE(channel_->AddRecvStream(sp));
|
|
|
|
|
|
|
|
|
|
// After removing the original stream this should be fine to add (makes sure
|
|
|
|
|
// that RTX ssrcs are not forever taken).
|
2015-05-22 18:48:36 +02:00
|
|
|
EXPECT_TRUE(channel_->RemoveSendStream(kFirstStreamSsrcs[0]));
|
|
|
|
|
EXPECT_TRUE(channel_->RemoveRecvStream(kFirstStreamSsrcs[0]));
|
2015-03-26 16:23:04 +01:00
|
|
|
EXPECT_TRUE(channel_->AddSendStream(sp));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, ReportsSsrcGroupsInStats) {
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-05-28 13:39:50 +02:00
|
|
|
|
|
|
|
|
static const uint32_t kSenderSsrcs[] = {4, 7, 10};
|
|
|
|
|
static const uint32_t kSenderRtxSsrcs[] = {5, 8, 11};
|
|
|
|
|
|
|
|
|
|
StreamParams sender_sp = cricket::CreateSimWithRtxStreamParams(
|
|
|
|
|
"cname", MAKE_VECTOR(kSenderSsrcs), MAKE_VECTOR(kSenderRtxSsrcs));
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->AddSendStream(sender_sp));
|
|
|
|
|
|
|
|
|
|
static const uint32_t kReceiverSsrcs[] = {3};
|
|
|
|
|
static const uint32_t kReceiverRtxSsrcs[] = {2};
|
|
|
|
|
|
|
|
|
|
StreamParams receiver_sp = cricket::CreateSimWithRtxStreamParams(
|
|
|
|
|
"cname", MAKE_VECTOR(kReceiverSsrcs), MAKE_VECTOR(kReceiverRtxSsrcs));
|
|
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(receiver_sp));
|
|
|
|
|
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(1u, info.senders.size());
|
|
|
|
|
ASSERT_EQ(1u, info.receivers.size());
|
|
|
|
|
|
|
|
|
|
EXPECT_NE(sender_sp.ssrc_groups, receiver_sp.ssrc_groups);
|
|
|
|
|
EXPECT_EQ(sender_sp.ssrc_groups, info.senders[0].ssrc_groups);
|
|
|
|
|
EXPECT_EQ(receiver_sp.ssrc_groups, info.receivers[0].ssrc_groups);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, MapsReceivedPayloadTypeToCodecName) {
|
2015-08-28 07:35:32 -07:00
|
|
|
FakeVideoReceiveStream* stream = AddRecvStream();
|
|
|
|
|
webrtc::VideoReceiveStream::Stats stats;
|
|
|
|
|
cricket::VideoMediaInfo info;
|
|
|
|
|
|
|
|
|
|
// Report no codec name before receiving.
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
EXPECT_STREQ("", info.receivers[0].codec_name.c_str());
|
|
|
|
|
|
|
|
|
|
// Report VP8 if we're receiving it.
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
stats.current_payload_type = GetEngineCodec("VP8").id;
|
2015-08-28 07:35:32 -07:00
|
|
|
stream->SetStats(stats);
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
EXPECT_STREQ(kVp8CodecName, info.receivers[0].codec_name.c_str());
|
|
|
|
|
|
|
|
|
|
// Report no codec name for unknown playload types.
|
|
|
|
|
stats.current_payload_type = 3;
|
|
|
|
|
stream->SetStats(stats);
|
|
|
|
|
ASSERT_TRUE(channel_->GetStats(&info));
|
|
|
|
|
EXPECT_STREQ("", info.receivers[0].codec_name.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-03 11:16:33 -07:00
|
|
|
// Tests that when we add a stream without SSRCs, but contains a stream_id
|
|
|
|
|
// that it is stored and its stream id is later used when the first packet
|
|
|
|
|
// arrives to properly create a receive stream with a sync label.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, RecvUnsignaledSsrcWithSignaledStreamId) {
|
|
|
|
|
const char kSyncLabel[] = "sync_label";
|
|
|
|
|
cricket::StreamParams unsignaled_stream;
|
|
|
|
|
unsignaled_stream.set_stream_ids({kSyncLabel});
|
|
|
|
|
ASSERT_TRUE(channel_->AddRecvStream(unsignaled_stream));
|
|
|
|
|
// The stream shouldn't have been created at this point because it doesn't
|
|
|
|
|
// have any SSRCs.
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
|
2018-04-03 11:16:33 -07:00
|
|
|
|
|
|
|
|
// Create and deliver packet.
|
|
|
|
|
const size_t kDataLength = 12;
|
|
|
|
|
uint8_t data[kDataLength];
|
|
|
|
|
memset(data, 0, sizeof(data));
|
|
|
|
|
rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc);
|
|
|
|
|
rtc::CopyOnWriteBuffer packet(data, kDataLength);
|
|
|
|
|
rtc::PacketTime packet_time;
|
|
|
|
|
channel_->OnPacketReceived(&packet, packet_time);
|
|
|
|
|
|
|
|
|
|
// The stream should now be created with the appropriate sync label.
|
|
|
|
|
EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
EXPECT_EQ(kSyncLabel,
|
|
|
|
|
fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group);
|
|
|
|
|
|
|
|
|
|
// Removing the unsignaled stream should clear the cache. This time when
|
|
|
|
|
// a default video receive stream is created it won't have a sync_group.
|
|
|
|
|
ASSERT_TRUE(channel_->RemoveRecvStream(0));
|
|
|
|
|
ASSERT_TRUE(channel_->RemoveRecvStream(kIncomingUnsignalledSsrc));
|
|
|
|
|
EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
|
|
|
|
|
channel_->OnPacketReceived(&packet, packet_time);
|
|
|
|
|
EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group.empty());
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
void WebRtcVideoChannelTest::TestReceiveUnsignaledSsrcPacket(
|
2015-07-10 11:27:55 -07:00
|
|
|
uint8_t payload_type,
|
|
|
|
|
bool expect_created_receive_stream) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
// kRedRtxPayloadType must currently be unused.
|
|
|
|
|
EXPECT_FALSE(FindCodecById(engine_.codecs(), kRedRtxPayloadType));
|
|
|
|
|
|
2015-07-10 11:27:55 -07:00
|
|
|
// Add a RED RTX codec.
|
|
|
|
|
VideoCodec red_rtx_codec =
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
VideoCodec::CreateRtxCodec(kRedRtxPayloadType, GetEngineCodec("red").id);
|
2015-09-17 16:42:56 +02:00
|
|
|
recv_parameters_.codecs.push_back(red_rtx_codec);
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
|
2015-07-10 11:27:55 -07:00
|
|
|
|
|
|
|
|
ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
const size_t kDataLength = 12;
|
|
|
|
|
uint8_t data[kDataLength];
|
|
|
|
|
memset(data, 0, sizeof(data));
|
|
|
|
|
|
|
|
|
|
rtc::Set8(data, 1, payload_type);
|
|
|
|
|
rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc);
|
2016-03-20 06:15:43 -07:00
|
|
|
rtc::CopyOnWriteBuffer packet(data, kDataLength);
|
2015-07-10 11:27:55 -07:00
|
|
|
rtc::PacketTime packet_time;
|
|
|
|
|
channel_->OnPacketReceived(&packet, packet_time);
|
|
|
|
|
|
|
|
|
|
if (expect_created_receive_stream) {
|
|
|
|
|
EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size())
|
|
|
|
|
<< "Should have created a receive stream for payload type: "
|
|
|
|
|
<< payload_type;
|
|
|
|
|
} else {
|
|
|
|
|
EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size())
|
|
|
|
|
<< "Shouldn't have created a receive stream for payload type: "
|
|
|
|
|
<< payload_type;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, Vp8PacketCreatesUnsignalledStream) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
TestReceiveUnsignaledSsrcPacket(GetEngineCodec("VP8").id,
|
|
|
|
|
true /* expect_created_receive_stream */);
|
2015-07-10 11:27:55 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, Vp9PacketCreatesUnsignalledStream) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
TestReceiveUnsignaledSsrcPacket(GetEngineCodec("VP9").id,
|
|
|
|
|
true /* expect_created_receive_stream */);
|
2015-07-10 11:27:55 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RtxPacketDoesntCreateUnsignalledStream) {
|
2018-05-14 09:48:06 +02:00
|
|
|
AssignDefaultAptRtxTypes();
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
const cricket::VideoCodec vp8 = GetEngineCodec("VP8");
|
|
|
|
|
const int rtx_vp8_payload_type = default_apt_rtx_types_[vp8.id];
|
|
|
|
|
TestReceiveUnsignaledSsrcPacket(rtx_vp8_payload_type,
|
|
|
|
|
false /* expect_created_receive_stream */);
|
2015-07-10 11:27:55 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, UlpfecPacketDoesntCreateUnsignalledStream) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
TestReceiveUnsignaledSsrcPacket(GetEngineCodec("ulpfec").id,
|
|
|
|
|
false /* expect_created_receive_stream */);
|
2015-07-10 11:27:55 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelFlexfecRecvTest,
|
2016-11-22 02:16:47 -08:00
|
|
|
FlexfecPacketDoesntCreateUnsignalledStream) {
|
|
|
|
|
TestReceiveUnsignaledSsrcPacket(GetEngineCodec("flexfec-03").id,
|
|
|
|
|
false /* expect_created_receive_stream */);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, RedRtxPacketDoesntCreateUnsignalledStream) {
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
TestReceiveUnsignaledSsrcPacket(kRedRtxPayloadType,
|
|
|
|
|
false /* expect_created_receive_stream */);
|
2015-07-10 11:27:55 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-17 15:46:43 -08:00
|
|
|
// Test that receiving any unsignalled SSRC works even if it changes.
|
|
|
|
|
// The first unsignalled SSRC received will create a default receive stream.
|
|
|
|
|
// Any different unsignalled SSRC received will replace the default.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, ReceiveDifferentUnsignaledSsrc) {
|
2017-02-17 15:46:43 -08:00
|
|
|
// Allow receiving VP8, VP9, H264 (if enabled).
|
|
|
|
|
cricket::VideoRecvParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
|
|
|
|
|
|
|
|
|
#if defined(WEBRTC_USE_H264)
|
|
|
|
|
cricket::VideoCodec H264codec(126, "H264");
|
|
|
|
|
parameters.codecs.push_back(H264codec);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
// No receive streams yet.
|
|
|
|
|
ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
cricket::FakeVideoRenderer renderer;
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(kDefaultRecvSsrc, &renderer));
|
|
|
|
|
|
|
|
|
|
// Receive VP8 packet on first SSRC.
|
|
|
|
|
uint8_t data[kMinRtpPacketLen];
|
|
|
|
|
cricket::RtpHeader rtpHeader;
|
|
|
|
|
rtpHeader.payload_type = GetEngineCodec("VP8").id;
|
|
|
|
|
rtpHeader.seq_num = rtpHeader.timestamp = 0;
|
|
|
|
|
rtpHeader.ssrc = kIncomingUnsignalledSsrc + 1;
|
|
|
|
|
cricket::SetRtpHeader(data, sizeof(data), rtpHeader);
|
|
|
|
|
rtc::CopyOnWriteBuffer packet(data, sizeof(data));
|
|
|
|
|
rtc::PacketTime packet_time;
|
|
|
|
|
channel_->OnPacketReceived(&packet, packet_time);
|
|
|
|
|
// VP8 packet should create default receive stream.
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
FakeVideoReceiveStream* recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc);
|
|
|
|
|
// Verify that the receive stream sinks to a renderer.
|
|
|
|
|
webrtc::VideoFrame video_frame(CreateBlackFrameBuffer(4, 4), 100, 0,
|
|
|
|
|
webrtc::kVideoRotation_0);
|
|
|
|
|
recv_stream->InjectFrame(video_frame);
|
|
|
|
|
EXPECT_EQ(1, renderer.num_rendered_frames());
|
|
|
|
|
|
|
|
|
|
// Receive VP9 packet on second SSRC.
|
|
|
|
|
rtpHeader.payload_type = GetEngineCodec("VP9").id;
|
|
|
|
|
rtpHeader.ssrc = kIncomingUnsignalledSsrc + 2;
|
|
|
|
|
cricket::SetRtpHeader(data, sizeof(data), rtpHeader);
|
|
|
|
|
rtc::CopyOnWriteBuffer packet2(data, sizeof(data));
|
|
|
|
|
channel_->OnPacketReceived(&packet2, packet_time);
|
|
|
|
|
// VP9 packet should replace the default receive SSRC.
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc);
|
|
|
|
|
// Verify that the receive stream sinks to a renderer.
|
|
|
|
|
webrtc::VideoFrame video_frame2(CreateBlackFrameBuffer(4, 4), 200, 0,
|
2017-04-11 10:34:31 -07:00
|
|
|
webrtc::kVideoRotation_0);
|
2017-02-17 15:46:43 -08:00
|
|
|
recv_stream->InjectFrame(video_frame2);
|
|
|
|
|
EXPECT_EQ(2, renderer.num_rendered_frames());
|
|
|
|
|
|
|
|
|
|
#if defined(WEBRTC_USE_H264)
|
|
|
|
|
// Receive H264 packet on third SSRC.
|
|
|
|
|
rtpHeader.payload_type = 126;
|
|
|
|
|
rtpHeader.ssrc = kIncomingUnsignalledSsrc + 3;
|
|
|
|
|
cricket::SetRtpHeader(data, sizeof(data), rtpHeader);
|
|
|
|
|
rtc::CopyOnWriteBuffer packet3(data, sizeof(data));
|
|
|
|
|
channel_->OnPacketReceived(&packet3, packet_time);
|
|
|
|
|
// H264 packet should replace the default receive SSRC.
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc);
|
|
|
|
|
// Verify that the receive stream sinks to a renderer.
|
|
|
|
|
webrtc::VideoFrame video_frame3(CreateBlackFrameBuffer(4, 4), 300, 0,
|
2017-04-11 10:34:31 -07:00
|
|
|
webrtc::kVideoRotation_0);
|
2017-02-17 15:46:43 -08:00
|
|
|
recv_stream->InjectFrame(video_frame3);
|
|
|
|
|
EXPECT_EQ(3, renderer.num_rendered_frames());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-29 23:33:31 -07:00
|
|
|
// This test verifies that when a new default stream is created for a new
|
|
|
|
|
// unsignaled SSRC, the new stream does not overwrite any old stream that had
|
|
|
|
|
// been the default receive stream before being properly signaled.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2017-05-29 23:33:31 -07:00
|
|
|
NewUnsignaledStreamDoesNotDestroyPreviouslyUnsignaledStream) {
|
|
|
|
|
cricket::VideoRecvParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
ASSERT_TRUE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
|
|
|
|
|
// No streams signaled and no packets received, so we should not have any
|
|
|
|
|
// stream objects created yet.
|
|
|
|
|
EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
|
|
|
|
|
// Receive packet on an unsignaled SSRC.
|
|
|
|
|
uint8_t data[kMinRtpPacketLen];
|
|
|
|
|
cricket::RtpHeader rtp_header;
|
|
|
|
|
rtp_header.payload_type = GetEngineCodec("VP8").id;
|
|
|
|
|
rtp_header.seq_num = rtp_header.timestamp = 0;
|
|
|
|
|
rtp_header.ssrc = kSsrcs3[0];
|
|
|
|
|
cricket::SetRtpHeader(data, sizeof(data), rtp_header);
|
|
|
|
|
rtc::CopyOnWriteBuffer packet(data, sizeof(data));
|
|
|
|
|
rtc::PacketTime packet_time;
|
|
|
|
|
channel_->OnPacketReceived(&packet, packet_time);
|
|
|
|
|
// Default receive stream should be created.
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
FakeVideoReceiveStream* recv_stream0 =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_EQ(kSsrcs3[0], recv_stream0->GetConfig().rtp.remote_ssrc);
|
|
|
|
|
|
|
|
|
|
// Signal the SSRC.
|
|
|
|
|
EXPECT_TRUE(
|
|
|
|
|
channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrcs3[0])));
|
|
|
|
|
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
recv_stream0 = fake_call_->GetVideoReceiveStreams()[0];
|
|
|
|
|
EXPECT_EQ(kSsrcs3[0], recv_stream0->GetConfig().rtp.remote_ssrc);
|
|
|
|
|
|
|
|
|
|
// Receive packet on a different unsignaled SSRC.
|
|
|
|
|
rtp_header.ssrc = kSsrcs3[1];
|
|
|
|
|
cricket::SetRtpHeader(data, sizeof(data), rtp_header);
|
|
|
|
|
packet.SetData(data, sizeof(data));
|
|
|
|
|
channel_->OnPacketReceived(&packet, packet_time);
|
|
|
|
|
// New default receive stream should be created, but old stream should remain.
|
|
|
|
|
ASSERT_EQ(2u, fake_call_->GetVideoReceiveStreams().size());
|
|
|
|
|
EXPECT_EQ(recv_stream0, fake_call_->GetVideoReceiveStreams()[0]);
|
|
|
|
|
FakeVideoReceiveStream* recv_stream1 =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams()[1];
|
|
|
|
|
EXPECT_EQ(kSsrcs3[1], recv_stream1->GetConfig().rtp.remote_ssrc);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-04 16:28:15 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, CanSetMaxBitrateForExistingStream) {
|
2016-03-16 19:07:43 -07:00
|
|
|
AddSendStream();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer));
|
2016-03-16 19:07:43 -07:00
|
|
|
cricket::VideoFormat capture_format_hd =
|
|
|
|
|
capturer.GetSupportedFormats()->front();
|
|
|
|
|
EXPECT_EQ(1280, capture_format_hd.width);
|
|
|
|
|
EXPECT_EQ(720, capture_format_hd.height);
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd));
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
2016-10-02 23:45:26 -07:00
|
|
|
capturer.CaptureFrame();
|
2016-03-16 19:07:43 -07:00
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
int default_encoder_bitrate = GetMaxEncoderBitrate();
|
2016-11-22 02:16:47 -08:00
|
|
|
EXPECT_GT(default_encoder_bitrate, 1000);
|
2016-03-16 19:07:43 -07:00
|
|
|
|
|
|
|
|
// TODO(skvlad): Resolve the inconsistency between the interpretation
|
|
|
|
|
// of the global bitrate limit for audio and video:
|
|
|
|
|
// - Audio: max_bandwidth_bps = 0 - fail the operation,
|
|
|
|
|
// max_bandwidth_bps = -1 - remove the bandwidth limit
|
|
|
|
|
// - Video: max_bandwidth_bps = 0 - remove the bandwidth limit,
|
2017-03-10 11:23:12 -08:00
|
|
|
// max_bandwidth_bps = -1 - remove the bandwidth limit
|
2016-03-16 19:07:43 -07:00
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
SetAndExpectMaxBitrate(1000, 0, 1000);
|
|
|
|
|
SetAndExpectMaxBitrate(1000, 800, 800);
|
|
|
|
|
SetAndExpectMaxBitrate(600, 800, 600);
|
|
|
|
|
SetAndExpectMaxBitrate(0, 800, 800);
|
|
|
|
|
SetAndExpectMaxBitrate(0, 0, default_encoder_bitrate);
|
2016-03-16 19:07:43 -07:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
2016-03-16 19:07:43 -07:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, CannotSetMaxBitrateForNonexistentStream) {
|
2016-03-16 19:07:43 -07:00
|
|
|
webrtc::RtpParameters nonexistent_parameters =
|
2016-05-16 11:40:30 -07:00
|
|
|
channel_->GetRtpSendParameters(last_ssrc_);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(0u, nonexistent_parameters.encodings.size());
|
2016-03-16 19:07:43 -07:00
|
|
|
|
|
|
|
|
nonexistent_parameters.encodings.push_back(webrtc::RtpEncodingParameters());
|
2016-05-16 11:40:30 -07:00
|
|
|
EXPECT_FALSE(
|
2018-01-23 15:02:36 -08:00
|
|
|
channel_->SetRtpSendParameters(last_ssrc_, nonexistent_parameters).ok());
|
2016-03-16 19:07:43 -07:00
|
|
|
}
|
|
|
|
|
|
2018-05-04 16:28:15 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
|
|
|
|
SetLowMaxBitrateOverwritesVideoStreamMinBitrate) {
|
|
|
|
|
AddSendStream();
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(1UL, parameters.encodings.size());
|
|
|
|
|
EXPECT_FALSE(parameters.encodings[0].max_bitrate_bps.has_value());
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
|
|
|
|
|
// Note that this is testing the behavior of the FakeVideoSendStream, which
|
|
|
|
|
// also calls to CreateEncoderStreams to get the VideoStreams, so essentially
|
|
|
|
|
// we are just testing the behavior of
|
|
|
|
|
// EncoderStreamFactory::CreateEncoderStreams.
|
|
|
|
|
std::vector<webrtc::VideoStream> video_streams =
|
|
|
|
|
fake_call_->GetVideoSendStreams().front()->GetVideoStreams();
|
|
|
|
|
ASSERT_EQ(1UL, video_streams.size());
|
|
|
|
|
EXPECT_EQ(kMinVideoBitrateBps, video_streams[0].min_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
// Set a low max bitrate & check that VideoStream.min_bitrate_bps is limited
|
|
|
|
|
// by this amount.
|
|
|
|
|
parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
int low_max_bitrate_bps = kMinVideoBitrateBps - 1000;
|
|
|
|
|
parameters.encodings[0].max_bitrate_bps = low_max_bitrate_bps;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
|
|
|
|
|
video_streams = fake_call_->GetVideoSendStreams().front()->GetVideoStreams();
|
|
|
|
|
ASSERT_EQ(1UL, video_streams.size());
|
|
|
|
|
EXPECT_GE(low_max_bitrate_bps, video_streams[0].min_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2016-05-16 11:40:30 -07:00
|
|
|
CannotSetRtpSendParametersWithIncorrectNumberOfEncodings) {
|
2016-03-16 19:07:43 -07:00
|
|
|
AddSendStream();
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
2016-03-16 19:07:43 -07:00
|
|
|
// Two or more encodings should result in failure.
|
|
|
|
|
parameters.encodings.push_back(webrtc::RtpEncodingParameters());
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2017-01-06 23:05:37 -08:00
|
|
|
// Zero encodings should also fail.
|
|
|
|
|
parameters.encodings.clear();
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2017-01-06 23:05:37 -08:00
|
|
|
}
|
|
|
|
|
|
2018-01-18 10:01:24 -08:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
|
|
|
|
CannotSetSimulcastRtpSendParametersWithIncorrectNumberOfEncodings) {
|
|
|
|
|
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
|
|
|
|
StreamParams sp = CreateSimStreamParams("cname", ssrcs);
|
|
|
|
|
AddSendStream(sp);
|
|
|
|
|
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
|
|
|
|
|
// Additional encodings should result in failure.
|
|
|
|
|
parameters.encodings.push_back(webrtc::RtpEncodingParameters());
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2018-01-18 10:01:24 -08:00
|
|
|
// Zero encodings should also fail.
|
|
|
|
|
parameters.encodings.clear();
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2018-01-18 10:01:24 -08:00
|
|
|
}
|
|
|
|
|
|
2017-01-06 23:05:37 -08:00
|
|
|
// Changing the SSRC through RtpParameters is not allowed.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, CannotSetSsrcInRtpSendParameters) {
|
2017-01-06 23:05:37 -08:00
|
|
|
AddSendStream();
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
2017-11-16 11:09:55 +01:00
|
|
|
parameters.encodings[0].ssrc = 0xdeadbeef;
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2016-03-16 19:07:43 -07:00
|
|
|
}
|
|
|
|
|
|
2017-12-22 09:36:42 -08:00
|
|
|
// Tests that when RTCRtpEncodingParameters.bitrate_priority gets set to
|
|
|
|
|
// a value <= 0, setting the parameters returns false.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRtpSendParametersInvalidBitratePriority) {
|
|
|
|
|
AddSendStream();
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(1UL, parameters.encodings.size());
|
|
|
|
|
EXPECT_EQ(webrtc::kDefaultBitratePriority,
|
|
|
|
|
parameters.encodings[0].bitrate_priority);
|
|
|
|
|
|
|
|
|
|
parameters.encodings[0].bitrate_priority = 0;
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2017-12-22 09:36:42 -08:00
|
|
|
parameters.encodings[0].bitrate_priority = -2;
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2017-12-22 09:36:42 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tests when the the RTCRtpEncodingParameters.bitrate_priority gets set
|
|
|
|
|
// properly on the VideoChannel and propogates down to the video encoder.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRtpSendParametersPriorityOneStream) {
|
|
|
|
|
AddSendStream();
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(1UL, parameters.encodings.size());
|
|
|
|
|
EXPECT_EQ(webrtc::kDefaultBitratePriority,
|
|
|
|
|
parameters.encodings[0].bitrate_priority);
|
|
|
|
|
|
|
|
|
|
// Change the value and set it on the VideoChannel.
|
|
|
|
|
double new_bitrate_priority = 2.0;
|
|
|
|
|
parameters.encodings[0].bitrate_priority = new_bitrate_priority;
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2017-12-22 09:36:42 -08:00
|
|
|
|
|
|
|
|
// Verify that the encoding parameters bitrate_priority is set for the
|
|
|
|
|
// VideoChannel.
|
|
|
|
|
parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(1UL, parameters.encodings.size());
|
|
|
|
|
EXPECT_EQ(new_bitrate_priority, parameters.encodings[0].bitrate_priority);
|
|
|
|
|
|
|
|
|
|
// Verify that the new value propagated down to the encoder.
|
|
|
|
|
std::vector<FakeVideoSendStream*> video_send_streams =
|
|
|
|
|
fake_call_->GetVideoSendStreams();
|
|
|
|
|
EXPECT_EQ(1UL, video_send_streams.size());
|
|
|
|
|
FakeVideoSendStream* video_send_stream = video_send_streams.front();
|
|
|
|
|
// Check that the WebRtcVideoSendStream updated the VideoEncoderConfig
|
|
|
|
|
// appropriately.
|
|
|
|
|
EXPECT_EQ(new_bitrate_priority,
|
|
|
|
|
video_send_stream->GetEncoderConfig().bitrate_priority);
|
|
|
|
|
// Check that the vector of VideoStreams also was propagated correctly. Note
|
|
|
|
|
// that this is testing the behavior of the FakeVideoSendStream, which mimics
|
|
|
|
|
// the calls to CreateEncoderStreams to get the VideoStreams.
|
2018-06-15 15:58:38 +02:00
|
|
|
EXPECT_EQ(absl::optional<double>(new_bitrate_priority),
|
2017-12-22 09:36:42 -08:00
|
|
|
video_send_stream->GetVideoStreams()[0].bitrate_priority);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tests that the RTCRtpEncodingParameters.bitrate_priority is set for the
|
|
|
|
|
// VideoChannel and the value propogates to the video encoder with all simulcast
|
|
|
|
|
// streams.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRtpSendParametersPrioritySimulcastStreams) {
|
|
|
|
|
// Create the stream params with multiple ssrcs for simulcast.
|
|
|
|
|
const int kNumSimulcastStreams = 3;
|
|
|
|
|
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
|
|
|
|
StreamParams stream_params = CreateSimStreamParams("cname", ssrcs);
|
|
|
|
|
AddSendStream(stream_params);
|
|
|
|
|
uint32_t primary_ssrc = stream_params.first_ssrc();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
// Using the FakeVideoCapturerWithTaskQueue, we manually send a full size
|
|
|
|
|
// frame. This creates multiple VideoStreams for all simulcast layers when
|
|
|
|
|
// reconfiguring, and allows us to test this behavior.
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2017-12-22 09:36:42 -08:00
|
|
|
VideoOptions options;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(primary_ssrc, &options, &capturer));
|
2017-12-22 09:36:42 -08:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(cricket::VideoFormat(
|
|
|
|
|
1920, 1080, cricket::VideoFormat::FpsToInterval(30),
|
|
|
|
|
cricket::FOURCC_I420)));
|
|
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
// Get and set the rtp encoding parameters.
|
|
|
|
|
webrtc::RtpParameters parameters =
|
|
|
|
|
channel_->GetRtpSendParameters(primary_ssrc);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
|
|
|
|
parameters.encodings.size());
|
2017-12-22 09:36:42 -08:00
|
|
|
EXPECT_EQ(webrtc::kDefaultBitratePriority,
|
|
|
|
|
parameters.encodings[0].bitrate_priority);
|
|
|
|
|
// Change the value and set it on the VideoChannel.
|
|
|
|
|
double new_bitrate_priority = 2.0;
|
|
|
|
|
parameters.encodings[0].bitrate_priority = new_bitrate_priority;
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(primary_ssrc, parameters).ok());
|
2017-12-22 09:36:42 -08:00
|
|
|
|
|
|
|
|
// Verify that the encoding parameters priority is set on the VideoChannel.
|
|
|
|
|
parameters = channel_->GetRtpSendParameters(primary_ssrc);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
|
|
|
|
parameters.encodings.size());
|
2017-12-22 09:36:42 -08:00
|
|
|
EXPECT_EQ(new_bitrate_priority, parameters.encodings[0].bitrate_priority);
|
|
|
|
|
|
|
|
|
|
// Verify that the new value propagated down to the encoder.
|
|
|
|
|
std::vector<FakeVideoSendStream*> video_send_streams =
|
|
|
|
|
fake_call_->GetVideoSendStreams();
|
|
|
|
|
EXPECT_EQ(1UL, video_send_streams.size());
|
|
|
|
|
FakeVideoSendStream* video_send_stream = video_send_streams.front();
|
|
|
|
|
// Check that the WebRtcVideoSendStream updated the VideoEncoderConfig
|
|
|
|
|
// appropriately.
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
2017-12-22 09:36:42 -08:00
|
|
|
video_send_stream->GetEncoderConfig().number_of_streams);
|
|
|
|
|
EXPECT_EQ(new_bitrate_priority,
|
|
|
|
|
video_send_stream->GetEncoderConfig().bitrate_priority);
|
|
|
|
|
// Check that the vector of VideoStreams also propagated correctly. The
|
|
|
|
|
// FakeVideoSendStream calls CreateEncoderStreams, and we are testing that
|
|
|
|
|
// these are created appropriately for the simulcast case.
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
|
|
|
|
video_send_stream->GetVideoStreams().size());
|
2018-06-15 15:58:38 +02:00
|
|
|
EXPECT_EQ(absl::optional<double>(new_bitrate_priority),
|
2017-12-22 09:36:42 -08:00
|
|
|
video_send_stream->GetVideoStreams()[0].bitrate_priority);
|
|
|
|
|
// Since we are only setting bitrate priority per-sender, the other
|
|
|
|
|
// VideoStreams should have a bitrate priority of 0.
|
2018-06-15 15:58:38 +02:00
|
|
|
EXPECT_EQ(absl::nullopt,
|
2017-12-22 09:36:42 -08:00
|
|
|
video_send_stream->GetVideoStreams()[1].bitrate_priority);
|
2018-06-15 15:58:38 +02:00
|
|
|
EXPECT_EQ(absl::nullopt,
|
2017-12-22 09:36:42 -08:00
|
|
|
video_send_stream->GetVideoStreams()[2].bitrate_priority);
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(primary_ssrc, nullptr, nullptr));
|
2017-12-22 09:36:42 -08:00
|
|
|
}
|
|
|
|
|
|
2018-06-18 17:51:32 +02:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetAndSetRtpSendParametersMinAndMaxBitrate) {
|
|
|
|
|
const size_t kNumSimulcastStreams = 3;
|
|
|
|
|
SetUpSimulcast(true, false);
|
|
|
|
|
|
|
|
|
|
// Get and set the rtp encoding parameters.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, parameters.encodings.size());
|
|
|
|
|
for (const auto& encoding : parameters.encodings) {
|
|
|
|
|
EXPECT_FALSE(encoding.min_bitrate_bps);
|
|
|
|
|
EXPECT_FALSE(encoding.max_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Change the value and set it on the VideoChannel.
|
|
|
|
|
parameters.encodings[0].min_bitrate_bps = 100000;
|
|
|
|
|
parameters.encodings[0].max_bitrate_bps = 200000;
|
|
|
|
|
parameters.encodings[1].min_bitrate_bps = 300000;
|
|
|
|
|
parameters.encodings[1].max_bitrate_bps = 400000;
|
|
|
|
|
parameters.encodings[2].min_bitrate_bps = 500000;
|
|
|
|
|
parameters.encodings[2].max_bitrate_bps = 600000;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
|
|
|
|
|
// Verify that the bitrates are set on the VideoChannel.
|
|
|
|
|
parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, parameters.encodings.size());
|
|
|
|
|
EXPECT_EQ(100000, parameters.encodings[0].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(200000, parameters.encodings[0].max_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(300000, parameters.encodings[1].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(400000, parameters.encodings[1].max_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(500000, parameters.encodings[2].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(600000, parameters.encodings[2].max_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRtpSendParametersFailsWithIncorrectBitrate) {
|
|
|
|
|
const size_t kNumSimulcastStreams = 3;
|
|
|
|
|
SetUpSimulcast(true, false);
|
|
|
|
|
|
|
|
|
|
// Get and set the rtp encoding parameters.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, parameters.encodings.size());
|
|
|
|
|
|
|
|
|
|
// Max bitrate lower than min bitrate should fail.
|
|
|
|
|
parameters.encodings[2].min_bitrate_bps = 100000;
|
|
|
|
|
parameters.encodings[2].max_bitrate_bps = 100000 - 1;
|
|
|
|
|
EXPECT_EQ(webrtc::RTCErrorType::INVALID_RANGE,
|
|
|
|
|
channel_->SetRtpSendParameters(last_ssrc_, parameters).type());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that min and max bitrate values set via RtpParameters are correctly
|
|
|
|
|
// propagated to the underlying encoder, and that the target is set to 3/4 of
|
|
|
|
|
// the maximum (3/4 was chosen because it's similar to the simulcast defaults
|
|
|
|
|
// that are used if no min/max are specified).
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, MinAndMaxSimulcastBitratePropagatedToEncoder) {
|
|
|
|
|
const size_t kNumSimulcastStreams = 3;
|
|
|
|
|
FakeVideoSendStream* stream = SetUpSimulcast(true, false);
|
|
|
|
|
|
|
|
|
|
// Send a full size frame so all simulcast layers are used when reconfiguring.
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
|
|
|
|
VideoOptions options;
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
// Get and set the rtp encoding parameters.
|
|
|
|
|
// Change the value and set it on the VideoChannel.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, parameters.encodings.size());
|
|
|
|
|
parameters.encodings[0].min_bitrate_bps = 100000;
|
|
|
|
|
parameters.encodings[0].max_bitrate_bps = 200000;
|
|
|
|
|
parameters.encodings[1].min_bitrate_bps = 300000;
|
|
|
|
|
parameters.encodings[1].max_bitrate_bps = 400000;
|
|
|
|
|
parameters.encodings[2].min_bitrate_bps = 500000;
|
|
|
|
|
parameters.encodings[2].max_bitrate_bps = 600000;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
|
|
|
|
|
// Verify that the new value propagated down to the encoder.
|
|
|
|
|
// Check that WebRtcVideoSendStream updates VideoEncoderConfig correctly.
|
|
|
|
|
EXPECT_EQ(2, stream->num_encoder_reconfigurations());
|
|
|
|
|
webrtc::VideoEncoderConfig encoder_config = stream->GetEncoderConfig().Copy();
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, encoder_config.number_of_streams);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, encoder_config.simulcast_layers.size());
|
|
|
|
|
EXPECT_EQ(100000, encoder_config.simulcast_layers[0].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(200000, encoder_config.simulcast_layers[0].max_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(300000, encoder_config.simulcast_layers[1].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(400000, encoder_config.simulcast_layers[1].max_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(500000, encoder_config.simulcast_layers[2].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(600000, encoder_config.simulcast_layers[2].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
// FakeVideoSendStream calls CreateEncoderStreams, test that the vector of
|
|
|
|
|
// VideoStreams are created appropriately for the simulcast case.
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, stream->GetVideoStreams().size());
|
|
|
|
|
// Target bitrate: 200000 * 3 / 4 = 150000.
|
|
|
|
|
EXPECT_EQ(100000, stream->GetVideoStreams()[0].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(150000, stream->GetVideoStreams()[0].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(200000, stream->GetVideoStreams()[0].max_bitrate_bps);
|
|
|
|
|
// Target bitrate: 400000 * 3 / 4 = 300000.
|
|
|
|
|
EXPECT_EQ(300000, stream->GetVideoStreams()[1].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(300000, stream->GetVideoStreams()[1].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(400000, stream->GetVideoStreams()[1].max_bitrate_bps);
|
|
|
|
|
// Target bitrate: 600000 * 3 / 4 = 450000, less than min -> max.
|
|
|
|
|
EXPECT_EQ(500000, stream->GetVideoStreams()[2].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(600000, stream->GetVideoStreams()[2].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(600000, stream->GetVideoStreams()[2].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
// No parameter changed, encoder should not be reconfigured.
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
EXPECT_EQ(2, stream->num_encoder_reconfigurations());
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test to only specify the min or max bitrate value for a layer via
|
|
|
|
|
// RtpParameters. The unspecified min/max and target value should be set to the
|
|
|
|
|
// simulcast default that is used if no min/max are specified.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, MinOrMaxSimulcastBitratePropagatedToEncoder) {
|
|
|
|
|
const size_t kNumSimulcastStreams = 3;
|
|
|
|
|
const std::vector<webrtc::VideoStream> kDefault = GetSimulcastBitrates720p();
|
|
|
|
|
FakeVideoSendStream* stream = SetUpSimulcast(true, false);
|
|
|
|
|
|
|
|
|
|
// Send a full size frame so all simulcast layers are used when reconfiguring.
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
|
|
|
|
VideoOptions options;
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
// Get and set the rtp encoding parameters.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, parameters.encodings.size());
|
|
|
|
|
|
|
|
|
|
// Change the value and set it on the VideoChannel.
|
|
|
|
|
// Layer 0: only configure min bitrate.
|
|
|
|
|
const int kMinBpsLayer0 = kDefault[0].min_bitrate_bps + 1;
|
|
|
|
|
parameters.encodings[0].min_bitrate_bps = kMinBpsLayer0;
|
|
|
|
|
// Layer 1: only configure max bitrate.
|
|
|
|
|
const int kMaxBpsLayer1 = kDefault[1].max_bitrate_bps - 1;
|
|
|
|
|
parameters.encodings[1].max_bitrate_bps = kMaxBpsLayer1;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
|
|
|
|
|
// Verify that the new value propagated down to the encoder.
|
|
|
|
|
// Check that WebRtcVideoSendStream updates VideoEncoderConfig correctly.
|
|
|
|
|
webrtc::VideoEncoderConfig encoder_config = stream->GetEncoderConfig().Copy();
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, encoder_config.number_of_streams);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, encoder_config.simulcast_layers.size());
|
|
|
|
|
EXPECT_EQ(kMinBpsLayer0, encoder_config.simulcast_layers[0].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(-1, encoder_config.simulcast_layers[0].max_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(-1, encoder_config.simulcast_layers[1].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kMaxBpsLayer1, encoder_config.simulcast_layers[1].max_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(-1, encoder_config.simulcast_layers[2].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(-1, encoder_config.simulcast_layers[2].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
// FakeVideoSendStream calls CreateEncoderStreams, test that the vector of
|
|
|
|
|
// VideoStreams are created appropriately for the simulcast case.
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, stream->GetVideoStreams().size());
|
|
|
|
|
// Layer 0: min configured bitrate should overwrite min default.
|
|
|
|
|
EXPECT_EQ(kMinBpsLayer0, stream->GetVideoStreams()[0].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kDefault[0].target_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[0].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kDefault[0].max_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[0].max_bitrate_bps);
|
|
|
|
|
// Layer 1: max configured bitrate should overwrite max default.
|
|
|
|
|
EXPECT_EQ(kDefault[1].min_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[1].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kDefault[1].target_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[1].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kMaxBpsLayer1, stream->GetVideoStreams()[1].max_bitrate_bps);
|
|
|
|
|
// Layer 2: min and max bitrate not configured, default expected.
|
|
|
|
|
EXPECT_EQ(kDefault[2].min_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[2].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kDefault[2].target_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[2].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kDefault[2].max_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[2].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that specifying the min (or max) bitrate value for a layer via
|
|
|
|
|
// RtpParameters above (or below) the simulcast default max (or min) adjusts the
|
|
|
|
|
// unspecified values accordingly.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, SetMinAndMaxSimulcastBitrateAboveBelowDefault) {
|
|
|
|
|
const size_t kNumSimulcastStreams = 3;
|
|
|
|
|
const std::vector<webrtc::VideoStream> kDefault = GetSimulcastBitrates720p();
|
|
|
|
|
FakeVideoSendStream* stream = SetUpSimulcast(true, false);
|
|
|
|
|
|
|
|
|
|
// Send a full size frame so all simulcast layers are used when reconfiguring.
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
|
|
|
|
VideoOptions options;
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
// Get and set the rtp encoding parameters.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, parameters.encodings.size());
|
|
|
|
|
|
|
|
|
|
// Change the value and set it on the VideoChannel.
|
|
|
|
|
// For layer 0, set the min bitrate above the default max.
|
|
|
|
|
const int kMinBpsLayer0 = kDefault[0].max_bitrate_bps + 1;
|
|
|
|
|
parameters.encodings[0].min_bitrate_bps = kMinBpsLayer0;
|
|
|
|
|
// For layer 1, set the max bitrate below the default min.
|
|
|
|
|
const int kMaxBpsLayer1 = kDefault[1].min_bitrate_bps - 1;
|
|
|
|
|
parameters.encodings[1].max_bitrate_bps = kMaxBpsLayer1;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
|
|
|
|
|
// Verify that the new value propagated down to the encoder.
|
|
|
|
|
// FakeVideoSendStream calls CreateEncoderStreams, test that the vector of
|
|
|
|
|
// VideoStreams are created appropriately for the simulcast case.
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, stream->GetVideoStreams().size());
|
|
|
|
|
// Layer 0: Min bitrate above default max (target/max should be adjusted).
|
|
|
|
|
EXPECT_EQ(kMinBpsLayer0, stream->GetVideoStreams()[0].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kMinBpsLayer0, stream->GetVideoStreams()[0].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kMinBpsLayer0, stream->GetVideoStreams()[0].max_bitrate_bps);
|
|
|
|
|
// Layer 1: Max bitrate below default min (min/target should be adjusted).
|
|
|
|
|
EXPECT_EQ(kMaxBpsLayer1, stream->GetVideoStreams()[1].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kMaxBpsLayer1, stream->GetVideoStreams()[1].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kMaxBpsLayer1, stream->GetVideoStreams()[1].max_bitrate_bps);
|
|
|
|
|
// Layer 2: min and max bitrate not configured, default expected.
|
|
|
|
|
EXPECT_EQ(kDefault[2].min_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[2].min_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kDefault[2].target_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[2].target_bitrate_bps);
|
|
|
|
|
EXPECT_EQ(kDefault[2].max_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[2].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, BandwidthAboveTotalMaxBitrateGivenToMaxLayer) {
|
|
|
|
|
const size_t kNumSimulcastStreams = 3;
|
|
|
|
|
const std::vector<webrtc::VideoStream> kDefault = GetSimulcastBitrates720p();
|
|
|
|
|
FakeVideoSendStream* stream = SetUpSimulcast(true, false);
|
|
|
|
|
|
|
|
|
|
// Send a full size frame so all simulcast layers are used when reconfiguring.
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
|
|
|
|
VideoOptions options;
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
// Set max bitrate for all but the highest layer.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, parameters.encodings.size());
|
|
|
|
|
parameters.encodings[0].max_bitrate_bps = kDefault[0].max_bitrate_bps;
|
|
|
|
|
parameters.encodings[1].max_bitrate_bps = kDefault[1].max_bitrate_bps;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
|
|
|
|
|
// Set max bandwidth equal to total max bitrate.
|
|
|
|
|
send_parameters_.max_bandwidth_bps =
|
|
|
|
|
GetTotalMaxBitrateBps(stream->GetVideoStreams());
|
|
|
|
|
ExpectSetMaxBitrate(send_parameters_.max_bandwidth_bps);
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
|
|
|
|
|
// No bitrate above the total max to give to the highest layer.
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, stream->GetVideoStreams().size());
|
|
|
|
|
EXPECT_EQ(kDefault[2].max_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[2].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
// Set max bandwidth above the total max bitrate.
|
|
|
|
|
send_parameters_.max_bandwidth_bps =
|
|
|
|
|
GetTotalMaxBitrateBps(stream->GetVideoStreams()) + 1;
|
|
|
|
|
ExpectSetMaxBitrate(send_parameters_.max_bandwidth_bps);
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
|
|
|
|
|
// The highest layer has no max bitrate set -> the bitrate above the total
|
|
|
|
|
// max should be given to the highest layer.
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, stream->GetVideoStreams().size());
|
|
|
|
|
EXPECT_EQ(send_parameters_.max_bandwidth_bps,
|
|
|
|
|
GetTotalMaxBitrateBps(stream->GetVideoStreams()));
|
|
|
|
|
EXPECT_EQ(kDefault[2].max_bitrate_bps + 1,
|
|
|
|
|
stream->GetVideoStreams()[2].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
|
|
|
|
BandwidthAboveTotalMaxBitrateNotGivenToMaxLayerIfMaxBitrateSet) {
|
|
|
|
|
const size_t kNumSimulcastStreams = 3;
|
|
|
|
|
const std::vector<webrtc::VideoStream> kDefault = GetSimulcastBitrates720p();
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, kDefault.size());
|
|
|
|
|
FakeVideoSendStream* stream = SetUpSimulcast(true, false);
|
|
|
|
|
|
|
|
|
|
// Send a full size frame so all simulcast layers are used when reconfiguring.
|
|
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
|
|
|
|
VideoOptions options;
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, &options, &capturer));
|
|
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(capturer.GetSupportedFormats()->front()));
|
|
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
// Set max bitrate for the highest layer.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, parameters.encodings.size());
|
|
|
|
|
parameters.encodings[2].max_bitrate_bps = kDefault[2].max_bitrate_bps;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
|
|
|
|
|
|
|
|
|
// Set max bandwidth above the total max bitrate.
|
|
|
|
|
send_parameters_.max_bandwidth_bps =
|
|
|
|
|
GetTotalMaxBitrateBps(stream->GetVideoStreams()) + 1;
|
|
|
|
|
ExpectSetMaxBitrate(send_parameters_.max_bandwidth_bps);
|
|
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
|
|
|
|
|
|
|
|
|
|
// The highest layer has the max bitrate set -> the bitrate above the total
|
|
|
|
|
// max should not be given to the highest layer.
|
|
|
|
|
EXPECT_EQ(kNumSimulcastStreams, stream->GetVideoStreams().size());
|
|
|
|
|
EXPECT_EQ(*parameters.encodings[2].max_bitrate_bps,
|
|
|
|
|
stream->GetVideoStreams()[2].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr));
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-07 17:16:54 -07:00
|
|
|
// Test that a stream will not be sending if its encoding is made inactive
|
|
|
|
|
// through SetRtpSendParameters.
|
2018-02-02 15:16:24 -08:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRtpSendParametersOneEncodingActive) {
|
2016-03-22 15:42:00 -07:00
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
EXPECT_TRUE(stream->IsSending());
|
|
|
|
|
|
|
|
|
|
// Get current parameters and change "active" to false.
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
2016-03-22 15:42:00 -07:00
|
|
|
ASSERT_EQ(1u, parameters.encodings.size());
|
|
|
|
|
ASSERT_TRUE(parameters.encodings[0].active);
|
|
|
|
|
parameters.encodings[0].active = false;
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2016-03-22 15:42:00 -07:00
|
|
|
EXPECT_FALSE(stream->IsSending());
|
|
|
|
|
|
|
|
|
|
// Now change it back to active and verify we resume sending.
|
|
|
|
|
parameters.encodings[0].active = true;
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2016-03-22 15:42:00 -07:00
|
|
|
EXPECT_TRUE(stream->IsSending());
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-02 15:16:24 -08:00
|
|
|
// Tests that when active is updated for any simulcast layer then the send
|
|
|
|
|
// stream's sending state will be updated and it will be reconfigured with the
|
|
|
|
|
// new appropriate active simulcast streams.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, SetRtpSendParametersMultipleEncodingsActive) {
|
|
|
|
|
// Create the stream params with multiple ssrcs for simulcast.
|
|
|
|
|
const int kNumSimulcastStreams = 3;
|
|
|
|
|
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
|
|
|
|
StreamParams stream_params = CreateSimStreamParams("cname", ssrcs);
|
|
|
|
|
FakeVideoSendStream* fake_video_send_stream = AddSendStream(stream_params);
|
|
|
|
|
uint32_t primary_ssrc = stream_params.first_ssrc();
|
|
|
|
|
|
2018-02-07 19:26:06 +01:00
|
|
|
// Using the FakeVideoCapturerWithTaskQueue, we manually send a full size
|
|
|
|
|
// frame. This allows us to test that ReconfigureEncoder is called
|
|
|
|
|
// appropriately.
|
|
|
|
|
cricket::FakeVideoCapturerWithTaskQueue capturer;
|
2018-02-02 15:16:24 -08:00
|
|
|
VideoOptions options;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(primary_ssrc, &options, &capturer));
|
2018-02-02 15:16:24 -08:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING,
|
|
|
|
|
capturer.Start(cricket::VideoFormat(
|
|
|
|
|
1920, 1080, cricket::VideoFormat::FpsToInterval(30),
|
|
|
|
|
cricket::FOURCC_I420)));
|
|
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
|
|
|
|
|
|
|
|
|
// Check that all encodings are initially active.
|
|
|
|
|
webrtc::RtpParameters parameters =
|
|
|
|
|
channel_->GetRtpSendParameters(primary_ssrc);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
|
|
|
|
parameters.encodings.size());
|
2018-02-02 15:16:24 -08:00
|
|
|
EXPECT_TRUE(parameters.encodings[0].active);
|
|
|
|
|
EXPECT_TRUE(parameters.encodings[1].active);
|
|
|
|
|
EXPECT_TRUE(parameters.encodings[2].active);
|
|
|
|
|
EXPECT_TRUE(fake_video_send_stream->IsSending());
|
|
|
|
|
|
|
|
|
|
// Only turn on only the middle stream.
|
|
|
|
|
parameters.encodings[0].active = false;
|
|
|
|
|
parameters.encodings[1].active = true;
|
|
|
|
|
parameters.encodings[2].active = false;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(primary_ssrc, parameters).ok());
|
|
|
|
|
// Verify that the active fields are set on the VideoChannel.
|
|
|
|
|
parameters = channel_->GetRtpSendParameters(primary_ssrc);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
|
|
|
|
parameters.encodings.size());
|
2018-02-02 15:16:24 -08:00
|
|
|
EXPECT_FALSE(parameters.encodings[0].active);
|
|
|
|
|
EXPECT_TRUE(parameters.encodings[1].active);
|
|
|
|
|
EXPECT_FALSE(parameters.encodings[2].active);
|
|
|
|
|
// Check that the VideoSendStream is updated appropriately. This means its
|
|
|
|
|
// send state was updated and it was reconfigured.
|
|
|
|
|
EXPECT_TRUE(fake_video_send_stream->IsSending());
|
|
|
|
|
std::vector<webrtc::VideoStream> simulcast_streams =
|
|
|
|
|
fake_video_send_stream->GetVideoStreams();
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
|
|
|
|
simulcast_streams.size());
|
2018-02-02 15:16:24 -08:00
|
|
|
EXPECT_FALSE(simulcast_streams[0].active);
|
|
|
|
|
EXPECT_TRUE(simulcast_streams[1].active);
|
|
|
|
|
EXPECT_FALSE(simulcast_streams[2].active);
|
|
|
|
|
|
|
|
|
|
// Turn off all streams.
|
|
|
|
|
parameters.encodings[0].active = false;
|
|
|
|
|
parameters.encodings[1].active = false;
|
|
|
|
|
parameters.encodings[2].active = false;
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(primary_ssrc, parameters).ok());
|
|
|
|
|
// Verify that the active fields are set on the VideoChannel.
|
|
|
|
|
parameters = channel_->GetRtpSendParameters(primary_ssrc);
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
|
|
|
|
parameters.encodings.size());
|
2018-02-02 15:16:24 -08:00
|
|
|
EXPECT_FALSE(parameters.encodings[0].active);
|
|
|
|
|
EXPECT_FALSE(parameters.encodings[1].active);
|
|
|
|
|
EXPECT_FALSE(parameters.encodings[2].active);
|
|
|
|
|
// Check that the VideoSendStream is off.
|
|
|
|
|
EXPECT_FALSE(fake_video_send_stream->IsSending());
|
|
|
|
|
simulcast_streams = fake_video_send_stream->GetVideoStreams();
|
2018-05-30 15:31:29 +02:00
|
|
|
EXPECT_EQ(rtc::checked_cast<size_t>(kNumSimulcastStreams),
|
|
|
|
|
simulcast_streams.size());
|
2018-02-02 15:16:24 -08:00
|
|
|
EXPECT_FALSE(simulcast_streams[0].active);
|
|
|
|
|
EXPECT_FALSE(simulcast_streams[1].active);
|
|
|
|
|
EXPECT_FALSE(simulcast_streams[2].active);
|
|
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(primary_ssrc, nullptr, nullptr));
|
2018-02-02 15:16:24 -08:00
|
|
|
}
|
|
|
|
|
|
2016-09-07 17:16:54 -07:00
|
|
|
// Test that if a stream is reconfigured (due to a codec change or other
|
|
|
|
|
// change) while its encoding is still inactive, it doesn't start sending.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest,
|
2016-09-07 17:16:54 -07:00
|
|
|
InactiveStreamDoesntStartSendingWhenReconfigured) {
|
|
|
|
|
// Set an initial codec list, which will be modified later.
|
|
|
|
|
cricket::VideoSendParameters parameters1;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters1.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters1.codecs.push_back(GetEngineCodec("VP9"));
|
2016-09-07 17:16:54 -07:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters1));
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* stream = AddSendStream();
|
|
|
|
|
EXPECT_TRUE(channel_->SetSend(true));
|
|
|
|
|
EXPECT_TRUE(stream->IsSending());
|
|
|
|
|
|
|
|
|
|
// Get current parameters and change "active" to false.
|
|
|
|
|
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
ASSERT_EQ(1u, parameters.encodings.size());
|
|
|
|
|
ASSERT_TRUE(parameters.encodings[0].active);
|
|
|
|
|
parameters.encodings[0].active = false;
|
|
|
|
|
EXPECT_EQ(1u, GetFakeSendStreams().size());
|
|
|
|
|
EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters).ok());
|
2016-09-07 17:16:54 -07:00
|
|
|
EXPECT_FALSE(stream->IsSending());
|
|
|
|
|
|
|
|
|
|
// Reorder the codec list, causing the stream to be reconfigured.
|
|
|
|
|
cricket::VideoSendParameters parameters2;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters2.codecs.push_back(GetEngineCodec("VP9"));
|
|
|
|
|
parameters2.codecs.push_back(GetEngineCodec("VP8"));
|
2016-09-07 17:16:54 -07:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters2));
|
|
|
|
|
auto new_streams = GetFakeSendStreams();
|
|
|
|
|
// Assert that a new underlying stream was created due to the codec change.
|
|
|
|
|
// Otherwise, this test isn't testing what it set out to test.
|
|
|
|
|
EXPECT_EQ(1u, GetFakeSendStreams().size());
|
|
|
|
|
EXPECT_EQ(2, fake_call_->GetNumCreatedSendStreams());
|
|
|
|
|
|
|
|
|
|
// Verify that we still are not sending anything, due to the inactive
|
|
|
|
|
// encoding.
|
|
|
|
|
EXPECT_FALSE(new_streams[0]->IsSending());
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-16 11:40:30 -07:00
|
|
|
// Test that GetRtpSendParameters returns the currently configured codecs.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetRtpSendParametersCodecs) {
|
2016-04-20 16:23:10 -07:00
|
|
|
AddSendStream();
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2016-04-20 16:23:10 -07:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters rtp_parameters =
|
|
|
|
|
channel_->GetRtpSendParameters(last_ssrc_);
|
2016-04-20 16:23:10 -07:00
|
|
|
ASSERT_EQ(2u, rtp_parameters.codecs.size());
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("VP8").ToCodecParameters(),
|
|
|
|
|
rtp_parameters.codecs[0]);
|
|
|
|
|
EXPECT_EQ(GetEngineCodec("VP9").ToCodecParameters(),
|
|
|
|
|
rtp_parameters.codecs[1]);
|
2016-04-20 16:23:10 -07:00
|
|
|
}
|
|
|
|
|
|
2018-05-24 16:24:21 +02:00
|
|
|
// Test that GetRtpSendParameters returns the currently configured RTCP CNAME.
|
|
|
|
|
TEST_F(WebRtcVideoChannelTest, GetRtpSendParametersRtcpCname) {
|
|
|
|
|
StreamParams params = StreamParams::CreateLegacy(kSsrc);
|
|
|
|
|
params.cname = "rtcpcname";
|
|
|
|
|
AddSendStream(params);
|
|
|
|
|
|
|
|
|
|
webrtc::RtpParameters rtp_parameters = channel_->GetRtpSendParameters(kSsrc);
|
|
|
|
|
EXPECT_STREQ("rtcpcname", rtp_parameters.rtcp.cname.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-06 23:05:37 -08:00
|
|
|
// Test that RtpParameters for send stream has one encoding and it has
|
|
|
|
|
// the correct SSRC.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetRtpSendParametersSsrc) {
|
2017-01-06 23:05:37 -08:00
|
|
|
AddSendStream();
|
|
|
|
|
|
|
|
|
|
webrtc::RtpParameters rtp_parameters =
|
|
|
|
|
channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
ASSERT_EQ(1u, rtp_parameters.encodings.size());
|
2017-11-16 11:09:55 +01:00
|
|
|
EXPECT_EQ(last_ssrc_, rtp_parameters.encodings[0].ssrc);
|
2017-01-06 23:05:37 -08:00
|
|
|
}
|
|
|
|
|
|
2018-06-12 18:33:49 +02:00
|
|
|
TEST_F(WebRtcVideoChannelTest, DetectRtpSendParameterHeaderExtensionsChange) {
|
|
|
|
|
AddSendStream();
|
|
|
|
|
|
|
|
|
|
webrtc::RtpParameters rtp_parameters =
|
|
|
|
|
channel_->GetRtpSendParameters(last_ssrc_);
|
|
|
|
|
rtp_parameters.header_extensions.emplace_back();
|
|
|
|
|
|
|
|
|
|
EXPECT_NE(0u, rtp_parameters.header_extensions.size());
|
|
|
|
|
|
|
|
|
|
webrtc::RTCError result =
|
|
|
|
|
channel_->SetRtpSendParameters(last_ssrc_, rtp_parameters);
|
|
|
|
|
EXPECT_EQ(webrtc::RTCErrorType::INVALID_MODIFICATION, result.type());
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-20 16:23:10 -07:00
|
|
|
// Test that if we set/get parameters multiple times, we get the same results.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetAndGetRtpSendParameters) {
|
2016-04-20 16:23:10 -07:00
|
|
|
AddSendStream();
|
|
|
|
|
cricket::VideoSendParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2016-04-20 16:23:10 -07:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
|
|
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters initial_params =
|
|
|
|
|
channel_->GetRtpSendParameters(last_ssrc_);
|
2016-04-20 16:23:10 -07:00
|
|
|
|
|
|
|
|
// We should be able to set the params we just got.
|
2018-01-23 15:02:36 -08:00
|
|
|
EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, initial_params).ok());
|
2016-04-20 16:23:10 -07:00
|
|
|
|
2016-05-16 11:40:30 -07:00
|
|
|
// ... And this shouldn't change the params returned by GetRtpSendParameters.
|
|
|
|
|
EXPECT_EQ(initial_params, channel_->GetRtpSendParameters(last_ssrc_));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that GetRtpReceiveParameters returns the currently configured codecs.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetRtpReceiveParametersCodecs) {
|
2016-05-16 11:40:30 -07:00
|
|
|
AddRecvStream();
|
|
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2016-05-16 11:40:30 -07:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
|
|
|
|
|
webrtc::RtpParameters rtp_parameters =
|
|
|
|
|
channel_->GetRtpReceiveParameters(last_ssrc_);
|
|
|
|
|
ASSERT_EQ(2u, rtp_parameters.codecs.size());
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
EXPECT_EQ(GetEngineCodec("VP8").ToCodecParameters(),
|
|
|
|
|
rtp_parameters.codecs[0]);
|
|
|
|
|
EXPECT_EQ(GetEngineCodec("VP9").ToCodecParameters(),
|
|
|
|
|
rtp_parameters.codecs[1]);
|
2016-05-16 11:40:30 -07:00
|
|
|
}
|
|
|
|
|
|
2016-08-26 02:59:47 -07:00
|
|
|
#if defined(WEBRTC_USE_H264)
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetRtpReceiveFmtpSprop) {
|
2016-08-26 02:59:47 -07:00
|
|
|
#else
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, DISABLED_GetRtpReceiveFmtpSprop) {
|
2016-08-26 02:59:47 -07:00
|
|
|
#endif
|
2016-08-05 09:19:25 -07:00
|
|
|
cricket::VideoRecvParameters parameters;
|
2016-10-24 01:21:16 -07:00
|
|
|
cricket::VideoCodec kH264sprop1(101, "H264");
|
2016-11-25 03:56:37 -08:00
|
|
|
kH264sprop1.SetParam(kH264FmtpSpropParameterSets, "uvw");
|
2016-08-05 09:19:25 -07:00
|
|
|
parameters.codecs.push_back(kH264sprop1);
|
2016-10-24 01:21:16 -07:00
|
|
|
cricket::VideoCodec kH264sprop2(102, "H264");
|
2016-11-25 03:56:37 -08:00
|
|
|
kH264sprop2.SetParam(kH264FmtpSpropParameterSets, "xyz");
|
2016-08-05 09:19:25 -07:00
|
|
|
parameters.codecs.push_back(kH264sprop2);
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* recv_stream = AddRecvStream();
|
|
|
|
|
const webrtc::VideoReceiveStream::Config& cfg = recv_stream->GetConfig();
|
|
|
|
|
webrtc::RtpParameters rtp_parameters =
|
|
|
|
|
channel_->GetRtpReceiveParameters(last_ssrc_);
|
|
|
|
|
ASSERT_EQ(2u, rtp_parameters.codecs.size());
|
|
|
|
|
EXPECT_EQ(kH264sprop1.ToCodecParameters(), rtp_parameters.codecs[0]);
|
|
|
|
|
ASSERT_EQ(2u, cfg.decoders.size());
|
|
|
|
|
EXPECT_EQ(101, cfg.decoders[0].payload_type);
|
|
|
|
|
EXPECT_EQ("H264", cfg.decoders[0].payload_name);
|
2016-11-25 03:56:37 -08:00
|
|
|
const auto it0 =
|
|
|
|
|
cfg.decoders[0].codec_params.find(kH264FmtpSpropParameterSets);
|
|
|
|
|
ASSERT_TRUE(it0 != cfg.decoders[0].codec_params.end());
|
|
|
|
|
EXPECT_EQ("uvw", it0->second);
|
2016-08-05 09:19:25 -07:00
|
|
|
|
|
|
|
|
EXPECT_EQ(102, cfg.decoders[1].payload_type);
|
|
|
|
|
EXPECT_EQ("H264", cfg.decoders[1].payload_name);
|
2016-11-25 03:56:37 -08:00
|
|
|
const auto it1 =
|
|
|
|
|
cfg.decoders[1].codec_params.find(kH264FmtpSpropParameterSets);
|
|
|
|
|
ASSERT_TRUE(it1 != cfg.decoders[1].codec_params.end());
|
|
|
|
|
EXPECT_EQ("xyz", it1->second);
|
2016-08-05 09:19:25 -07:00
|
|
|
}
|
|
|
|
|
|
2016-06-22 00:46:15 -07:00
|
|
|
// Test that RtpParameters for receive stream has one encoding and it has
|
|
|
|
|
// the correct SSRC.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetRtpReceiveParametersSsrc) {
|
2016-06-22 00:46:15 -07:00
|
|
|
AddRecvStream();
|
|
|
|
|
|
|
|
|
|
webrtc::RtpParameters rtp_parameters =
|
|
|
|
|
channel_->GetRtpReceiveParameters(last_ssrc_);
|
|
|
|
|
ASSERT_EQ(1u, rtp_parameters.encodings.size());
|
2017-11-16 11:09:55 +01:00
|
|
|
EXPECT_EQ(last_ssrc_, rtp_parameters.encodings[0].ssrc);
|
2016-06-22 00:46:15 -07:00
|
|
|
}
|
|
|
|
|
|
2016-05-16 11:40:30 -07:00
|
|
|
// Test that if we set/get parameters multiple times, we get the same results.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, SetAndGetRtpReceiveParameters) {
|
2016-05-16 11:40:30 -07:00
|
|
|
AddRecvStream();
|
|
|
|
|
cricket::VideoRecvParameters parameters;
|
Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
function removeVideoCodec(offerSdp) {
- offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
- 'a=rtpmap:100 XVP8/90000\r\n');
+ offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+ 'a=rtpmap:$1 XVP8/90000\r\n');
return offerSdp;
}
Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> > * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> > webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> > internally supported software codecs instead. The purpose is to
> > streamline the payload type assignment in webrtcvideoengine2.cc which
> > will now have two encoder factories of the same
> > WebRtcVideoEncoderFactory type; one internal and one external.
> > * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> > instead.
> > * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> > moves the create function to the internal encoder factory instead.
> > * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> > interface without any static functions.
> > * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> > the internal and external codecs and assigns them payload types
> > incrementally from 96 to 127.
> > * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> > what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}
TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705
Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 01:34:11 -08:00
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
2016-05-16 11:40:30 -07:00
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
|
|
|
|
|
webrtc::RtpParameters initial_params =
|
|
|
|
|
channel_->GetRtpReceiveParameters(last_ssrc_);
|
|
|
|
|
|
|
|
|
|
// We should be able to set the params we just got.
|
|
|
|
|
EXPECT_TRUE(channel_->SetRtpReceiveParameters(last_ssrc_, initial_params));
|
|
|
|
|
|
|
|
|
|
// ... And this shouldn't change the params returned by
|
|
|
|
|
// GetRtpReceiveParameters.
|
|
|
|
|
EXPECT_EQ(initial_params, channel_->GetRtpReceiveParameters(last_ssrc_));
|
2016-04-20 16:23:10 -07:00
|
|
|
}
|
|
|
|
|
|
2017-04-20 19:25:07 -07:00
|
|
|
// Test that GetRtpReceiveParameters returns parameters correctly when SSRCs
|
|
|
|
|
// aren't signaled. It should always return an empty "RtpEncodingParameters",
|
|
|
|
|
// even after a packet is received and the unsignaled SSRC is known.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, GetRtpReceiveParametersWithUnsignaledSsrc) {
|
2017-04-20 19:25:07 -07:00
|
|
|
// Call necessary methods to configure receiving a default stream as
|
|
|
|
|
// soon as it arrives.
|
|
|
|
|
cricket::VideoRecvParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP8"));
|
|
|
|
|
parameters.codecs.push_back(GetEngineCodec("VP9"));
|
|
|
|
|
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
|
|
|
|
|
|
|
|
|
|
// Call GetRtpReceiveParameters before configured to receive an unsignaled
|
|
|
|
|
// stream. Should return nothing.
|
|
|
|
|
EXPECT_EQ(webrtc::RtpParameters(), channel_->GetRtpReceiveParameters(0));
|
|
|
|
|
|
|
|
|
|
// Set a sink for an unsignaled stream.
|
|
|
|
|
cricket::FakeVideoRenderer renderer;
|
|
|
|
|
// Value of "0" means "unsignaled stream".
|
|
|
|
|
EXPECT_TRUE(channel_->SetSink(0, &renderer));
|
|
|
|
|
|
|
|
|
|
// Call GetRtpReceiveParameters before the SSRC is known. Value of "0"
|
|
|
|
|
// in this method means "unsignaled stream".
|
|
|
|
|
webrtc::RtpParameters rtp_parameters = channel_->GetRtpReceiveParameters(0);
|
|
|
|
|
ASSERT_EQ(1u, rtp_parameters.encodings.size());
|
|
|
|
|
EXPECT_FALSE(rtp_parameters.encodings[0].ssrc);
|
|
|
|
|
|
|
|
|
|
// Receive VP8 packet.
|
|
|
|
|
uint8_t data[kMinRtpPacketLen];
|
|
|
|
|
cricket::RtpHeader rtpHeader;
|
|
|
|
|
rtpHeader.payload_type = GetEngineCodec("VP8").id;
|
|
|
|
|
rtpHeader.seq_num = rtpHeader.timestamp = 0;
|
|
|
|
|
rtpHeader.ssrc = kIncomingUnsignalledSsrc;
|
|
|
|
|
cricket::SetRtpHeader(data, sizeof(data), rtpHeader);
|
|
|
|
|
rtc::CopyOnWriteBuffer packet(data, sizeof(data));
|
|
|
|
|
rtc::PacketTime packet_time;
|
|
|
|
|
channel_->OnPacketReceived(&packet, packet_time);
|
|
|
|
|
|
|
|
|
|
// The |ssrc| member should still be unset.
|
|
|
|
|
rtp_parameters = channel_->GetRtpReceiveParameters(0);
|
|
|
|
|
ASSERT_EQ(1u, rtp_parameters.encodings.size());
|
|
|
|
|
EXPECT_FALSE(rtp_parameters.encodings[0].ssrc);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
void WebRtcVideoChannelTest::TestReceiverLocalSsrcConfiguration(
|
2015-05-22 18:48:36 +02:00
|
|
|
bool receiver_first) {
|
2015-09-17 16:42:56 +02:00
|
|
|
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
|
2015-05-22 18:48:36 +02:00
|
|
|
|
|
|
|
|
const uint32_t kSenderSsrc = 0xC0FFEE;
|
2015-10-21 17:21:10 +02:00
|
|
|
const uint32_t kSecondSenderSsrc = 0xBADCAFE;
|
2015-05-22 18:48:36 +02:00
|
|
|
const uint32_t kReceiverSsrc = 0x4711;
|
2015-10-21 17:21:10 +02:00
|
|
|
const uint32_t kExpectedDefaultReceiverSsrc = 1;
|
2015-05-22 18:48:36 +02:00
|
|
|
|
|
|
|
|
if (receiver_first) {
|
|
|
|
|
AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc));
|
|
|
|
|
std::vector<FakeVideoReceiveStream*> receive_streams =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1u, receive_streams.size());
|
2015-10-21 17:21:10 +02:00
|
|
|
// Default local SSRC when we have no sender.
|
|
|
|
|
EXPECT_EQ(kExpectedDefaultReceiverSsrc,
|
|
|
|
|
receive_streams[0]->GetConfig().rtp.local_ssrc);
|
2015-05-22 18:48:36 +02:00
|
|
|
}
|
|
|
|
|
AddSendStream(StreamParams::CreateLegacy(kSenderSsrc));
|
|
|
|
|
if (!receiver_first)
|
|
|
|
|
AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc));
|
|
|
|
|
std::vector<FakeVideoReceiveStream*> receive_streams =
|
|
|
|
|
fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1u, receive_streams.size());
|
|
|
|
|
EXPECT_EQ(kSenderSsrc, receive_streams[0]->GetConfig().rtp.local_ssrc);
|
2015-10-21 17:21:10 +02:00
|
|
|
|
|
|
|
|
// Removing first sender should fall back to another (in this case the second)
|
|
|
|
|
// local send stream's SSRC.
|
|
|
|
|
AddSendStream(StreamParams::CreateLegacy(kSecondSenderSsrc));
|
|
|
|
|
ASSERT_TRUE(channel_->RemoveSendStream(kSenderSsrc));
|
|
|
|
|
receive_streams = fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1u, receive_streams.size());
|
|
|
|
|
EXPECT_EQ(kSecondSenderSsrc, receive_streams[0]->GetConfig().rtp.local_ssrc);
|
|
|
|
|
|
|
|
|
|
// Removing the last sender should fall back to default local SSRC.
|
|
|
|
|
ASSERT_TRUE(channel_->RemoveSendStream(kSecondSenderSsrc));
|
|
|
|
|
receive_streams = fake_call_->GetVideoReceiveStreams();
|
|
|
|
|
ASSERT_EQ(1u, receive_streams.size());
|
|
|
|
|
EXPECT_EQ(kExpectedDefaultReceiverSsrc,
|
|
|
|
|
receive_streams[0]->GetConfig().rtp.local_ssrc);
|
2015-05-22 18:48:36 +02:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, ConfiguresLocalSsrc) {
|
2015-05-22 18:48:36 +02:00
|
|
|
TestReceiverLocalSsrcConfiguration(false);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelTest, ConfiguresLocalSsrcOnExistingReceivers) {
|
2015-05-22 18:48:36 +02:00
|
|
|
TestReceiverLocalSsrcConfiguration(true);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
class WebRtcVideoChannelSimulcastTest : public testing::Test {
|
2014-12-10 09:01:18 +00:00
|
|
|
public:
|
2017-06-12 01:16:46 -07:00
|
|
|
WebRtcVideoChannelSimulcastTest()
|
2018-02-21 13:07:13 +01:00
|
|
|
: fake_call_(),
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_(new cricket::FakeWebRtcVideoEncoderFactory),
|
|
|
|
|
decoder_factory_(new cricket::FakeWebRtcVideoDecoderFactory),
|
2018-05-03 11:28:29 +02:00
|
|
|
engine_(std::unique_ptr<cricket::FakeWebRtcVideoEncoderFactory>(
|
2017-09-23 17:21:32 +02:00
|
|
|
encoder_factory_),
|
2018-05-03 11:28:29 +02:00
|
|
|
std::unique_ptr<cricket::FakeWebRtcVideoDecoderFactory>(
|
2017-09-23 17:21:32 +02:00
|
|
|
decoder_factory_)),
|
2017-09-12 04:42:15 -07:00
|
|
|
last_ssrc_(0) {}
|
2014-12-10 09:01:18 +00:00
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
void SetUp() override {
|
2018-05-14 09:48:06 +02:00
|
|
|
encoder_factory_->AddSupportedVideoCodecType("VP8");
|
2016-02-12 02:27:06 -08:00
|
|
|
channel_.reset(
|
Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.
Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: https://chromium.googlesource.com/external/webrtc/+/35fc2aa82fb5a562f3f76f2b91a55f05ebfd4874
TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953
Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 07:02:22 -08:00
|
|
|
engine_.CreateChannel(&fake_call_, GetMediaConfig(), VideoOptions()));
|
2016-11-22 16:08:30 -08:00
|
|
|
channel_->OnReadyToSend(true);
|
2014-12-10 09:01:18 +00:00
|
|
|
last_ssrc_ = 123;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void VerifySimulcastSettings(const VideoCodec& codec,
|
2016-10-24 01:21:16 -07:00
|
|
|
int capture_width,
|
|
|
|
|
int capture_height,
|
2014-12-10 09:01:18 +00:00
|
|
|
size_t num_configured_streams,
|
2017-01-26 06:12:26 -08:00
|
|
|
size_t expected_num_streams,
|
|
|
|
|
bool screenshare,
|
|
|
|
|
bool conference_mode) {
|
2015-09-17 16:42:56 +02:00
|
|
|
cricket::VideoSendParameters parameters;
|
|
|
|
|
parameters.codecs.push_back(codec);
|
2017-01-26 06:12:26 -08:00
|
|
|
parameters.conference_mode = conference_mode;
|
2015-09-17 16:42:56 +02:00
|
|
|
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
2014-12-10 09:01:18 +00:00
|
|
|
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK(num_configured_streams <= ssrcs.size());
|
2014-12-10 09:01:18 +00:00
|
|
|
ssrcs.resize(num_configured_streams);
|
|
|
|
|
|
2017-02-28 13:23:26 -08:00
|
|
|
AddSendStream(CreateSimStreamParams("cname", ssrcs));
|
2015-02-16 21:02:00 +00:00
|
|
|
// Send a full-size frame to trigger a stream reconfiguration to use all
|
|
|
|
|
// expected simulcast layers.
|
2018-02-07 19:26:06 +01:00
|
|
|
FakeVideoCapturerWithTaskQueue capturer;
|
2017-02-28 13:23:26 -08:00
|
|
|
VideoOptions options;
|
|
|
|
|
if (screenshare)
|
2017-11-16 11:09:55 +01:00
|
|
|
options.is_screencast = screenshare;
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(ssrcs.front(), &options, &capturer));
|
2017-02-28 13:23:26 -08:00
|
|
|
// Fetch the latest stream since SetVideoSend() may recreate it if the
|
|
|
|
|
// screen content setting is changed.
|
|
|
|
|
FakeVideoSendStream* stream = fake_call_.GetVideoSendStreams().front();
|
2015-02-16 21:02:00 +00:00
|
|
|
EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(cricket::VideoFormat(
|
2016-10-24 01:21:16 -07:00
|
|
|
capture_width, capture_height,
|
2015-02-16 21:02:00 +00:00
|
|
|
cricket::VideoFormat::FpsToInterval(30),
|
|
|
|
|
cricket::FOURCC_I420)));
|
|
|
|
|
channel_->SetSend(true);
|
|
|
|
|
EXPECT_TRUE(capturer.CaptureFrame());
|
2014-12-10 09:01:18 +00:00
|
|
|
|
2018-01-18 10:01:24 -08:00
|
|
|
auto rtp_parameters = channel_->GetRtpSendParameters(kSsrcs3[0]);
|
|
|
|
|
EXPECT_EQ(num_configured_streams, rtp_parameters.encodings.size());
|
|
|
|
|
|
2014-12-10 09:01:18 +00:00
|
|
|
std::vector<webrtc::VideoStream> video_streams = stream->GetVideoStreams();
|
|
|
|
|
ASSERT_EQ(expected_num_streams, video_streams.size());
|
|
|
|
|
|
2017-01-26 06:12:26 -08:00
|
|
|
std::vector<webrtc::VideoStream> expected_streams;
|
|
|
|
|
if (conference_mode) {
|
|
|
|
|
expected_streams = GetSimulcastConfig(
|
|
|
|
|
num_configured_streams, capture_width, capture_height, 0,
|
2017-12-22 09:36:42 -08:00
|
|
|
webrtc::kDefaultBitratePriority, kDefaultQpMax,
|
2018-06-21 13:41:01 +00:00
|
|
|
kDefaultVideoMaxFramerate, screenshare);
|
2017-02-16 07:35:22 -08:00
|
|
|
if (screenshare) {
|
|
|
|
|
for (const webrtc::VideoStream& stream : expected_streams) {
|
|
|
|
|
// Never scale screen content.
|
2018-06-08 11:04:04 +00:00
|
|
|
EXPECT_EQ(stream.width, rtc::checked_cast<size_t>(capture_width));
|
|
|
|
|
EXPECT_EQ(stream.height, rtc::checked_cast<size_t>(capture_height));
|
2017-02-16 07:35:22 -08:00
|
|
|
}
|
|
|
|
|
}
|
2017-01-26 06:12:26 -08:00
|
|
|
} else {
|
|
|
|
|
webrtc::VideoStream stream;
|
|
|
|
|
stream.width = capture_width;
|
|
|
|
|
stream.height = capture_height;
|
|
|
|
|
stream.max_framerate = kDefaultVideoMaxFramerate;
|
2017-11-13 10:16:47 +01:00
|
|
|
stream.min_bitrate_bps = cricket::kMinVideoBitrateBps;
|
2017-01-26 06:12:26 -08:00
|
|
|
int max_bitrate_kbps;
|
|
|
|
|
if (capture_width * capture_height <= 320 * 240) {
|
|
|
|
|
max_bitrate_kbps = 600;
|
|
|
|
|
} else if (capture_width * capture_height <= 640 * 480) {
|
|
|
|
|
max_bitrate_kbps = 1700;
|
|
|
|
|
} else if (capture_width * capture_height <= 960 * 540) {
|
|
|
|
|
max_bitrate_kbps = 2000;
|
|
|
|
|
} else {
|
|
|
|
|
max_bitrate_kbps = 2500;
|
|
|
|
|
}
|
|
|
|
|
stream.target_bitrate_bps = stream.max_bitrate_bps =
|
|
|
|
|
max_bitrate_kbps * 1000;
|
|
|
|
|
stream.max_qp = kDefaultQpMax;
|
|
|
|
|
expected_streams.push_back(stream);
|
|
|
|
|
}
|
2014-12-10 09:01:18 +00:00
|
|
|
|
|
|
|
|
ASSERT_EQ(expected_streams.size(), video_streams.size());
|
|
|
|
|
|
|
|
|
|
size_t num_streams = video_streams.size();
|
2015-02-23 16:39:07 +00:00
|
|
|
int total_max_bitrate_bps = 0;
|
2014-12-10 09:01:18 +00:00
|
|
|
for (size_t i = 0; i < num_streams; ++i) {
|
|
|
|
|
EXPECT_EQ(expected_streams[i].width, video_streams[i].width);
|
|
|
|
|
EXPECT_EQ(expected_streams[i].height, video_streams[i].height);
|
|
|
|
|
|
|
|
|
|
EXPECT_GT(video_streams[i].max_framerate, 0);
|
|
|
|
|
EXPECT_EQ(expected_streams[i].max_framerate,
|
|
|
|
|
video_streams[i].max_framerate);
|
|
|
|
|
|
|
|
|
|
EXPECT_GT(video_streams[i].min_bitrate_bps, 0);
|
|
|
|
|
EXPECT_EQ(expected_streams[i].min_bitrate_bps,
|
|
|
|
|
video_streams[i].min_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
EXPECT_GT(video_streams[i].target_bitrate_bps, 0);
|
|
|
|
|
EXPECT_EQ(expected_streams[i].target_bitrate_bps,
|
|
|
|
|
video_streams[i].target_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
EXPECT_GT(video_streams[i].max_bitrate_bps, 0);
|
|
|
|
|
EXPECT_EQ(expected_streams[i].max_bitrate_bps,
|
|
|
|
|
video_streams[i].max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
EXPECT_GT(video_streams[i].max_qp, 0);
|
|
|
|
|
EXPECT_EQ(expected_streams[i].max_qp, video_streams[i].max_qp);
|
|
|
|
|
|
2018-03-01 15:11:29 +01:00
|
|
|
EXPECT_EQ(conference_mode,
|
|
|
|
|
expected_streams[i].num_temporal_layers.has_value());
|
|
|
|
|
|
|
|
|
|
if (conference_mode) {
|
|
|
|
|
EXPECT_EQ(expected_streams[i].num_temporal_layers,
|
|
|
|
|
video_streams[i].num_temporal_layers);
|
|
|
|
|
}
|
2015-02-23 16:39:07 +00:00
|
|
|
|
|
|
|
|
if (i == num_streams - 1) {
|
|
|
|
|
total_max_bitrate_bps += video_streams[i].max_bitrate_bps;
|
|
|
|
|
} else {
|
|
|
|
|
total_max_bitrate_bps += video_streams[i].target_bitrate_bps;
|
|
|
|
|
}
|
2014-12-10 09:01:18 +00:00
|
|
|
}
|
2015-02-23 16:39:07 +00:00
|
|
|
|
2018-04-09 08:49:14 +02:00
|
|
|
EXPECT_TRUE(channel_->SetVideoSend(ssrcs.front(), nullptr, nullptr));
|
2014-12-10 09:01:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* AddSendStream() {
|
|
|
|
|
return AddSendStream(StreamParams::CreateLegacy(last_ssrc_++));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FakeVideoSendStream* AddSendStream(const StreamParams& sp) {
|
2015-09-15 12:26:33 +02:00
|
|
|
size_t num_streams = fake_call_.GetVideoSendStreams().size();
|
2014-12-10 09:01:18 +00:00
|
|
|
EXPECT_TRUE(channel_->AddSendStream(sp));
|
|
|
|
|
std::vector<FakeVideoSendStream*> streams =
|
2015-09-15 12:26:33 +02:00
|
|
|
fake_call_.GetVideoSendStreams();
|
2014-12-10 09:01:18 +00:00
|
|
|
EXPECT_EQ(num_streams + 1, streams.size());
|
|
|
|
|
return streams[streams.size() - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<FakeVideoSendStream*> GetFakeSendStreams() {
|
2015-09-15 12:26:33 +02:00
|
|
|
return fake_call_.GetVideoSendStreams();
|
2014-12-10 09:01:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* AddRecvStream() {
|
|
|
|
|
return AddRecvStream(StreamParams::CreateLegacy(last_ssrc_++));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FakeVideoReceiveStream* AddRecvStream(const StreamParams& sp) {
|
2015-09-15 12:26:33 +02:00
|
|
|
size_t num_streams = fake_call_.GetVideoReceiveStreams().size();
|
2014-12-10 09:01:18 +00:00
|
|
|
EXPECT_TRUE(channel_->AddRecvStream(sp));
|
|
|
|
|
std::vector<FakeVideoReceiveStream*> streams =
|
2015-09-15 12:26:33 +02:00
|
|
|
fake_call_.GetVideoReceiveStreams();
|
2014-12-10 09:01:18 +00:00
|
|
|
EXPECT_EQ(num_streams + 1, streams.size());
|
|
|
|
|
return streams[streams.size() - 1];
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-07 11:53:05 -07:00
|
|
|
webrtc::RtcEventLogNullImpl event_log_;
|
2015-09-15 12:26:33 +02:00
|
|
|
FakeCall fake_call_;
|
2017-09-23 17:21:32 +02:00
|
|
|
cricket::FakeWebRtcVideoEncoderFactory* encoder_factory_;
|
|
|
|
|
cricket::FakeWebRtcVideoDecoderFactory* decoder_factory_;
|
2017-06-12 01:16:46 -07:00
|
|
|
WebRtcVideoEngine engine_;
|
2016-02-26 03:00:35 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> channel_;
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
uint32_t last_ssrc_;
|
2014-12-10 09:01:18 +00:00
|
|
|
};
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsWith2SimulcastStreams) {
|
2017-01-26 06:12:26 -08:00
|
|
|
VerifySimulcastSettings(cricket::VideoCodec("VP8"), 640, 360, 2, 2, false,
|
|
|
|
|
true);
|
2014-12-10 09:01:18 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsWith3SimulcastStreams) {
|
2017-01-26 06:12:26 -08:00
|
|
|
VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3, false,
|
|
|
|
|
true);
|
2014-12-10 09:01:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test that we normalize send codec format size in simulcast.
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
|
2017-01-26 06:12:26 -08:00
|
|
|
VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2, false,
|
|
|
|
|
true);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsForScreenshare) {
|
2017-01-26 06:12:26 -08:00
|
|
|
VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true,
|
|
|
|
|
false);
|
2014-12-10 09:01:18 +00:00
|
|
|
}
|
2017-01-26 06:12:26 -08:00
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelSimulcastTest,
|
2017-01-26 06:12:26 -08:00
|
|
|
SetSendCodecsForConferenceModeScreenshare) {
|
|
|
|
|
VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true,
|
|
|
|
|
true);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsForSimulcastScreenshare) {
|
2017-01-26 06:12:26 -08:00
|
|
|
webrtc::test::ScopedFieldTrials override_field_trials_(
|
|
|
|
|
"WebRTC-SimulcastScreenshare/Enabled/");
|
|
|
|
|
VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true,
|
|
|
|
|
true);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 01:16:46 -07:00
|
|
|
TEST_F(WebRtcVideoChannelSimulcastTest,
|
2017-03-29 08:24:59 -07:00
|
|
|
NoSimulcastScreenshareWithoutConference) {
|
|
|
|
|
webrtc::test::ScopedFieldTrials override_field_trials_(
|
|
|
|
|
"WebRTC-SimulcastScreenshare/Enabled/");
|
|
|
|
|
VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true,
|
|
|
|
|
false);
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-13 11:07:01 +00:00
|
|
|
} // namespace cricket
|