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

Side by Side Diff: content/browser/media/capture/desktop_capture_device_unittest.cc

Issue 1179323002: Video Capture: extract storage info from pixel format in VideoCaptureFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/media/capture/desktop_capture_device.h" 5 #include "content/browser/media/capture/desktop_capture_device.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 size_t v_stride, 71 size_t v_stride,
72 const media::VideoCaptureFormat& frame_format, 72 const media::VideoCaptureFormat& frame_format,
73 int clockwise_rotation, 73 int clockwise_rotation,
74 const base::TimeTicks& timestamp)); 74 const base::TimeTicks& timestamp));
75 MOCK_METHOD0(DoReserveOutputBuffer, void(void)); 75 MOCK_METHOD0(DoReserveOutputBuffer, void(void));
76 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); 76 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void));
77 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); 77 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void));
78 MOCK_METHOD1(OnError, void(const std::string& reason)); 78 MOCK_METHOD1(OnError, void(const std::string& reason));
79 79
80 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>. 80 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>.
81 scoped_ptr<Buffer> ReserveOutputBuffer(media::VideoPixelFormat format, 81 scoped_ptr<Buffer> ReserveOutputBuffer(
82 const gfx::Size& dimensions) override { 82 const media::VideoCaptureFormat& frame_format) override {
83 DoReserveOutputBuffer(); 83 DoReserveOutputBuffer();
84 return scoped_ptr<Buffer>(); 84 return scoped_ptr<Buffer>();
85 } 85 }
86 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, 86 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer,
87 const media::VideoCaptureFormat& frame_format, 87 const media::VideoCaptureFormat& frame_format,
88 const base::TimeTicks& timestamp) override { 88 const base::TimeTicks& timestamp) override {
89 DoOnIncomingCapturedBuffer(); 89 DoOnIncomingCapturedBuffer();
90 } 90 }
91 void OnIncomingCapturedVideoFrame( 91 void OnIncomingCapturedVideoFrame(
92 scoped_ptr<Buffer> buffer, 92 scoped_ptr<Buffer> buffer,
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 frame_size); 512 frame_size);
513 for (int i = 0; i < output_frame_->size().height(); ++i) { 513 for (int i = 0; i < output_frame_->size().height(); ++i) {
514 EXPECT_EQ(0, 514 EXPECT_EQ(0,
515 memcmp(inverted_frame->data() + i * inverted_frame->stride(), 515 memcmp(inverted_frame->data() + i * inverted_frame->stride(),
516 output_frame_->data() + i * output_frame_->stride(), 516 output_frame_->data() + i * output_frame_->stride(),
517 output_frame_->stride())); 517 output_frame_->stride()));
518 } 518 }
519 } 519 }
520 520
521 } // namespace content 521 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698