Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Unified Diff: remoting/codec/video_encoder_vp8_unittest.cc

Issue 13983010: Use webrtc::DesktopCapturer for screen capturer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/codec/video_encoder_vp8.cc ('k') | remoting/host/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/codec/video_encoder_vp8_unittest.cc
diff --git a/remoting/codec/video_encoder_vp8_unittest.cc b/remoting/codec/video_encoder_vp8_unittest.cc
index 9a32fe2a6d1513a30fbaa05d2cccd2b036e1bc59..684910d0088d3fc866c80f69d6c7bb1cadeb18f1 100644
--- a/remoting/codec/video_encoder_vp8_unittest.cc
+++ b/remoting/codec/video_encoder_vp8_unittest.cc
@@ -10,10 +10,10 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
-#include "media/video/capture/screen/screen_capture_data.h"
#include "remoting/codec/codec_test.h"
#include "remoting/proto/video.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
namespace {
@@ -39,25 +39,21 @@ class VideoEncoderCallback {
TEST(VideoEncoderVp8Test, TestSizeChangeNoLeak) {
int height = 1000;
int width = 1000;
- const int kBytesPerPixel = 4;
VideoEncoderVp8 encoder;
VideoEncoderCallback callback;
- std::vector<uint8> buffer(width * height * kBytesPerPixel);
- scoped_refptr<media::ScreenCaptureData> capture_data(
- new media::ScreenCaptureData(&buffer.front(), width * kBytesPerPixel,
- SkISize::Make(width, height)));
- encoder.Encode(capture_data, false,
- base::Bind(&VideoEncoderCallback::DataAvailable,
- base::Unretained(&callback)));
+ scoped_ptr<webrtc::DesktopFrame> frame(new webrtc::BasicDesktopFrame(
+ webrtc::DesktopSize(width, height)));
+
+ encoder.Encode(frame.get(), base::Bind(&VideoEncoderCallback::DataAvailable,
+ base::Unretained(&callback)));
height /= 2;
- capture_data = new media::ScreenCaptureData(
- &buffer.front(), width * kBytesPerPixel, SkISize::Make(width, height));
- encoder.Encode(capture_data, false,
- base::Bind(&VideoEncoderCallback::DataAvailable,
- base::Unretained(&callback)));
+ frame.reset(new webrtc::BasicDesktopFrame(
+ webrtc::DesktopSize(width, height)));
+ encoder.Encode(frame.get(), base::Bind(&VideoEncoderCallback::DataAvailable,
+ base::Unretained(&callback)));
}
class VideoEncoderDpiCallback {
@@ -73,17 +69,14 @@ class VideoEncoderDpiCallback {
TEST(VideoEncoderVp8Test, TestDpiPropagation) {
int height = 32;
int width = 32;
- const int kBytesPerPixel = 4;
VideoEncoderVp8 encoder;
VideoEncoderDpiCallback callback;
- std::vector<uint8> buffer(width * height * kBytesPerPixel);
- scoped_refptr<media::ScreenCaptureData> capture_data(
- new media::ScreenCaptureData(&buffer.front(), width * kBytesPerPixel,
- SkISize::Make(width, height)));
- capture_data->set_dpi(SkIPoint::Make(96, 97));
- encoder.Encode(capture_data, false,
+ scoped_ptr<webrtc::DesktopFrame> frame(new webrtc::BasicDesktopFrame(
+ webrtc::DesktopSize(width, height)));
+ frame->set_dpi(webrtc::DesktopVector(96, 97));
+ encoder.Encode(frame.get(),
base::Bind(&VideoEncoderDpiCallback::DataAvailable,
base::Unretained(&callback)));
}
« no previous file with comments | « remoting/codec/video_encoder_vp8.cc ('k') | remoting/host/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698