Commit e977fbdc authored by nisse's avatar nisse Committed by Commit bot

Revert of Delete the class WebRtcVideoCapturerAdapter::MediaVideoFrameFactory...

Revert of Delete the class WebRtcVideoCapturerAdapter::MediaVideoFrameFactory (patchset #5 id:80001 of https://codereview.chromium.org/2244213002/ )

Reason for revert:
Somehow breaks timestamping. Reverting for investigation. To reproduce, run

./browser_tests --gtest_filter='WebRtcVideoQualityBrowserTests/WebRtcVideoQualityBrowserTest*' --run-manual --ui-test-action-max-timeout=200000

This produces lots of warnings like

[1:14:0822/153830:WARNING:video_capture_input.cc(79)] Same/old NTP timestamp (3680861906110 <= 3680861906110) for incoming frame. Dropping.
[1:14:0822/153830:WARNING:video_capture_input.cc(79)] Same/old NTP timestamp (3680861906042 <= 3680861906042) for incoming frame. Dropping.

Original issue's description:
> Delete the class WebRtcVideoCapturerAdapter::MediaVideoFrameFactory
>
> Instead, use the AdaptFrame and OnFrame methods of the VideoCapturer
> base class.
>
> This cl also applies the new timestamp aligner logic, to translate
> Chrome's camera timestamps into the timescale of rtc::TimeMicros(). No
> other change in behavior is intended.
>
> BUG=webrtc:5682, webrtc:5740, 516700
>
> Committed: https://crrev.com/5b9a4b339447b033ca52244a02c0bef17067385f
> Cr-Commit-Position: refs/heads/master@{#413093}

TBR=perkj@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5682, webrtc:5740, 516700

Review-Url: https://codereview.chromium.org/2263183002
Cr-Commit-Position: refs/heads/master@{#413444}
parent 9fff17d3
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "media/base/video_capture_types.h" #include "media/base/video_capture_types.h"
#include "media/base/video_frame.h" #include "media/base/video_frame.h"
#include "media/base/video_frame_pool.h"
#include "third_party/webrtc/media/base/videocapturer.h" #include "third_party/webrtc/media/base/videocapturer.h"
namespace content { namespace content {
...@@ -57,7 +56,7 @@ class CONTENT_EXPORT WebRtcVideoCapturerAdapter ...@@ -57,7 +56,7 @@ class CONTENT_EXPORT WebRtcVideoCapturerAdapter
const bool is_screencast_; const bool is_screencast_;
bool running_; bool running_;
media::VideoFramePool scaled_frame_pool_; class MediaVideoFrameFactory;
DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter); DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter);
}; };
......
...@@ -11,18 +11,17 @@ ...@@ -11,18 +11,17 @@
namespace content { namespace content {
class WebRtcVideoCapturerAdapterTest class WebRtcVideoCapturerAdapterTest
: public rtc::VideoSinkInterface<cricket::VideoFrame>, : public sigslot::has_slots<>,
public ::testing::Test { public ::testing::Test {
public: public:
WebRtcVideoCapturerAdapterTest() WebRtcVideoCapturerAdapterTest()
: adapter_(false), : adapter_(false),
output_frame_width_(0), output_frame_width_(0),
output_frame_height_(0) { output_frame_height_(0) {
adapter_.AddOrUpdateSink(this, rtc::VideoSinkWants()); adapter_.SignalFrameCaptured.connect(
} this, &WebRtcVideoCapturerAdapterTest::OnFrameCaptured);
~WebRtcVideoCapturerAdapterTest() override {
adapter_.RemoveSink(this);
} }
~WebRtcVideoCapturerAdapterTest() override {}
void TestSourceCropFrame(int capture_width, void TestSourceCropFrame(int capture_width,
int capture_height, int capture_height,
...@@ -43,11 +42,11 @@ class WebRtcVideoCapturerAdapterTest ...@@ -43,11 +42,11 @@ class WebRtcVideoCapturerAdapterTest
EXPECT_EQ(natural_width, output_frame_width_); EXPECT_EQ(natural_width, output_frame_width_);
EXPECT_EQ(natural_height, output_frame_height_); EXPECT_EQ(natural_height, output_frame_height_);
} }
protected:
// rtc::VideoSinkInterface void OnFrameCaptured(cricket::VideoCapturer* capturer,
void OnFrame(const cricket::VideoFrame& frame) override { const cricket::CapturedFrame* frame) {
output_frame_width_ = frame.width(); output_frame_width_ = frame->width;
output_frame_height_ = frame.height(); output_frame_height_ = frame->height;
} }
private: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment