Revert 7698 "WebRtcVideoMediaChannel::SetSendParams: Don't cap r..."
Reason for revert is failed testcases: WebRtcVideoEngineExtendedTestFake.ResetSimulcastSendCodecOnNewFrameSize WebRtcVideoEngineExtendedTestFake.MultipleSendStreamsDifferentFormats > WebRtcVideoMediaChannel::SetSendParams: Don't cap resolution > > BUG=3936 > R=pthatcher@webrtc.org > > Review URL: https://webrtc-codereview.appspot.com/30039004 TBR=magjed@webrtc.org Review URL: https://webrtc-codereview.appspot.com/28009004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7700 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
a1f5b96351
commit
35c1ace185
@ -59,16 +59,10 @@ class FakeVideoCapturer : public cricket::VideoCapturer {
|
|||||||
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
||||||
formats.push_back(cricket::VideoFormat(640, 480,
|
formats.push_back(cricket::VideoFormat(640, 480,
|
||||||
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
||||||
formats.push_back(cricket::VideoFormat(640, 400,
|
|
||||||
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
|
||||||
formats.push_back(cricket::VideoFormat(320, 240,
|
formats.push_back(cricket::VideoFormat(320, 240,
|
||||||
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
||||||
formats.push_back(cricket::VideoFormat(320, 200,
|
|
||||||
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
|
||||||
formats.push_back(cricket::VideoFormat(160, 120,
|
formats.push_back(cricket::VideoFormat(160, 120,
|
||||||
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
||||||
formats.push_back(cricket::VideoFormat(160, 100,
|
|
||||||
cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
|
|
||||||
ResetSupportedFormats(formats);
|
ResetSupportedFormats(formats);
|
||||||
}
|
}
|
||||||
~FakeVideoCapturer() {
|
~FakeVideoCapturer() {
|
||||||
|
@ -341,7 +341,7 @@ TEST_F(VideoCapturerTest, TestResolutionMatch) {
|
|||||||
EXPECT_EQ(cricket::VideoFormat::FpsToInterval(30), best.interval);
|
EXPECT_EQ(cricket::VideoFormat::FpsToInterval(30), best.interval);
|
||||||
|
|
||||||
desired.width = 480;
|
desired.width = 480;
|
||||||
desired.height = 320;
|
desired.height = 270;
|
||||||
// Ask for HVGA. Get VGA.
|
// Ask for HVGA. Get VGA.
|
||||||
EXPECT_TRUE(capturer_.GetBestCaptureFormat(desired, &best));
|
EXPECT_TRUE(capturer_.GetBestCaptureFormat(desired, &best));
|
||||||
EXPECT_EQ(640, best.width);
|
EXPECT_EQ(640, best.width);
|
||||||
|
@ -3872,10 +3872,18 @@ bool WebRtcVideoMediaChannel::SetSendParams(
|
|||||||
CapturedFrameInfo frame;
|
CapturedFrameInfo frame;
|
||||||
send_channel->last_captured_frame_info().Get(&frame);
|
send_channel->last_captured_frame_info().Get(&frame);
|
||||||
|
|
||||||
const VideoFormat max = send_channel->adapt_format();
|
// TODO(pthatcher): This checking of the max height and width is
|
||||||
if (!send_channel->last_captured_frame_info().IsSet()) {
|
// only needed because some unit tests bypass the VideoAdapter, and
|
||||||
frame.width = static_cast<size_t>(max.width);
|
// others expect behavior from the adapter different than what it
|
||||||
frame.height = static_cast<size_t>(max.height);
|
// actually does. We should fix the tests and remove this block.
|
||||||
|
VideoFormat max = send_channel->adapt_format();
|
||||||
|
size_t max_width = static_cast<size_t>(max.width);
|
||||||
|
size_t max_height = static_cast<size_t>(max.height);
|
||||||
|
if (!send_channel->last_captured_frame_info().IsSet() ||
|
||||||
|
(!frame.screencast &&
|
||||||
|
(frame.width > max_width || frame.height > max_height))) {
|
||||||
|
frame.width = max_width;
|
||||||
|
frame.height = max_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
webrtc::VideoCodec codec;
|
webrtc::VideoCodec codec;
|
||||||
|
@ -677,10 +677,10 @@ TEST_F(WebRtcVideoEngineTestFake, ResetVieSendCodecOnNewFrameSize) {
|
|||||||
SendI420Frame(kVP8Codec.width / 2, kVP8Codec.height / 2);
|
SendI420Frame(kVP8Codec.width / 2, kVP8Codec.height / 2);
|
||||||
VerifyVP8SendCodec(channel_num, kVP8Codec.width / 2, kVP8Codec.height / 2);
|
VerifyVP8SendCodec(channel_num, kVP8Codec.width / 2, kVP8Codec.height / 2);
|
||||||
|
|
||||||
// Capture a bigger frame and verify vie send codec has been reset to
|
// Capture a frame bigger than send_codec_ and verify vie send codec has been
|
||||||
// the new size.
|
// reset (and clipped) to send_codec_.
|
||||||
SendI420Frame(kVP8Codec.width * 2, kVP8Codec.height * 2);
|
SendI420Frame(kVP8Codec.width * 2, kVP8Codec.height * 2);
|
||||||
VerifyVP8SendCodec(channel_num, kVP8Codec.width * 2, kVP8Codec.height * 2);
|
VerifyVP8SendCodec(channel_num, kVP8Codec.width, kVP8Codec.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that we set our inbound codecs properly.
|
// Test that we set our inbound codecs properly.
|
||||||
|
@ -215,13 +215,13 @@ TEST_F(ChannelManagerTest, DefaultCapturerAspectRatio) {
|
|||||||
VideoEncoderConfig config(codec, 1, 2);
|
VideoEncoderConfig config(codec, 1, 2);
|
||||||
EXPECT_TRUE(cm_->Init());
|
EXPECT_TRUE(cm_->Init());
|
||||||
// A capturer created before the default encoder config is set will have no
|
// A capturer created before the default encoder config is set will have no
|
||||||
// set aspect ratio, so it'll be 16:10 (based on the fake video capture impl).
|
// set aspect ratio, so it'll be 4:3 (based on the fake video capture impl).
|
||||||
VideoCapturer* capturer = cm_->CreateVideoCapturer();
|
VideoCapturer* capturer = cm_->CreateVideoCapturer();
|
||||||
ASSERT_TRUE(capturer != NULL);
|
ASSERT_TRUE(capturer != NULL);
|
||||||
EXPECT_EQ(CS_RUNNING, capturer->Start(format));
|
EXPECT_EQ(CS_RUNNING, capturer->Start(format));
|
||||||
GetCapturerFrameSize size(capturer);
|
GetCapturerFrameSize size(capturer);
|
||||||
EXPECT_EQ(640u, size.width);
|
EXPECT_EQ(640u, size.width);
|
||||||
EXPECT_EQ(400u, size.height);
|
EXPECT_EQ(480u, size.height);
|
||||||
delete capturer;
|
delete capturer;
|
||||||
// Try again, but with the encoder config set to 16:9.
|
// Try again, but with the encoder config set to 16:9.
|
||||||
EXPECT_TRUE(cm_->SetDefaultVideoEncoderConfig(config));
|
EXPECT_TRUE(cm_->SetDefaultVideoEncoderConfig(config));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user