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

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

Issue 955253002: Add metadata to media::VideoFrame and plumb it through IPC/MediaStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tommi's nits addressed Created 5 years, 9 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 <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 public: 55 public:
56 MOCK_METHOD5(OnIncomingCapturedData, 56 MOCK_METHOD5(OnIncomingCapturedData,
57 void(const uint8* data, 57 void(const uint8* data,
58 int length, 58 int length,
59 const media::VideoCaptureFormat& frame_format, 59 const media::VideoCaptureFormat& frame_format,
60 int rotation, 60 int rotation,
61 const base::TimeTicks& timestamp)); 61 const base::TimeTicks& timestamp));
62 MOCK_METHOD2(ReserveOutputBuffer, 62 MOCK_METHOD2(ReserveOutputBuffer,
63 scoped_refptr<Buffer>(media::VideoFrame::Format format, 63 scoped_refptr<Buffer>(media::VideoFrame::Format format,
64 const gfx::Size& dimensions)); 64 const gfx::Size& dimensions));
65 MOCK_METHOD4(OnIncomingCapturedVideoFrame, 65 MOCK_METHOD3(OnIncomingCapturedVideoFrame,
66 void(const scoped_refptr<Buffer>& buffer, 66 void(const scoped_refptr<Buffer>& buffer,
67 const media::VideoCaptureFormat& buffer_format,
68 const scoped_refptr<media::VideoFrame>& frame, 67 const scoped_refptr<media::VideoFrame>& frame,
69 const base::TimeTicks& timestamp)); 68 const base::TimeTicks& timestamp));
70 MOCK_METHOD1(OnError, void(const std::string& reason)); 69 MOCK_METHOD1(OnError, void(const std::string& reason));
71 }; 70 };
72 71
73 // Creates a DesktopFrame that has the first pixel bytes set to 72 // Creates a DesktopFrame that has the first pixel bytes set to
74 // kFakePixelValueFirst, and the rest of the bytes set to kFakePixelValue, for 73 // kFakePixelValueFirst, and the rest of the bytes set to kFakePixelValue, for
75 // UnpackedFrame and InvertedFrame verification. 74 // UnpackedFrame and InvertedFrame verification.
76 webrtc::BasicDesktopFrame* CreateBasicFrame(const webrtc::DesktopSize& size) { 75 webrtc::BasicDesktopFrame* CreateBasicFrame(const webrtc::DesktopSize& size) {
77 webrtc::BasicDesktopFrame* frame = new webrtc::BasicDesktopFrame(size);; 76 webrtc::BasicDesktopFrame* frame = new webrtc::BasicDesktopFrame(size);;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 frame_size); 412 frame_size);
414 for (int i = 0; i < output_frame_->size().height(); ++i) { 413 for (int i = 0; i < output_frame_->size().height(); ++i) {
415 EXPECT_EQ(0, 414 EXPECT_EQ(0,
416 memcmp(inverted_frame->data() + i * inverted_frame->stride(), 415 memcmp(inverted_frame->data() + i * inverted_frame->stride(),
417 output_frame_->data() + i * output_frame_->stride(), 416 output_frame_->data() + i * output_frame_->stride(),
418 output_frame_->stride())); 417 output_frame_->stride()));
419 } 418 }
420 } 419 }
421 420
422 } // namespace content 421 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698