From 1ee62bbac06097c162f0fbcb47e28edc714c9a5d Mon Sep 17 00:00:00 2001 From: "dmaclach@chromium.org" Date: Fri, 19 Nov 2010 22:56:53 +0000 Subject: Fix up mac capturer Make it so that it sets the pixel type correctly, and initializes the video buffers properly. BUG=NONE TEST=BUILD Review URL: http://codereview.chromium.org/5159004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66834 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/capturer_mac.cc | 2 ++ remoting/host/capturer_mac_unittest.cc | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'remoting/host') diff --git a/remoting/host/capturer_mac.cc b/remoting/host/capturer_mac.cc index 2ed4c65..7b5d942 100644 --- a/remoting/host/capturer_mac.cc +++ b/remoting/host/capturer_mac.cc @@ -25,6 +25,7 @@ CapturerMac::CapturerMac(MessageLoop* message_loop) err = CGDisplayRegisterReconfigurationCallback( CapturerMac::DisplaysReconfiguredCallback, this); DCHECK_EQ(err, kCGErrorSuccess); + ScreenConfigurationChanged(); } CapturerMac::~CapturerMac() { @@ -48,6 +49,7 @@ void CapturerMac::ScreenConfigurationChanged() { width_ = CGDisplayPixelsWide(mainDevice); height_ = CGDisplayPixelsHigh(mainDevice); + pixel_format_ = media::VideoFrame::RGB32; bytes_per_row_ = width_ * sizeof(uint32_t); size_t buffer_size = height() * bytes_per_row_; for (int i = 0; i < kNumBuffers; ++i) { diff --git a/remoting/host/capturer_mac_unittest.cc b/remoting/host/capturer_mac_unittest.cc index f1f0d6c..02db8da 100644 --- a/remoting/host/capturer_mac_unittest.cc +++ b/remoting/host/capturer_mac_unittest.cc @@ -18,7 +18,6 @@ class CapturerMacTest : public testing::Test { protected: virtual void SetUp() { capturer_.reset(new CapturerMac(NULL)); - capturer_->ScreenConfigurationChanged(); rects_.insert(gfx::Rect(0, 0, 10, 10)); } -- cgit v1.1