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

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

Issue 2378943002: Let clients interact with VideoCaptureDeviceClient instead of VideoCaptureDevice (Closed)
Patch Set: mcasas comments Created 4 years, 2 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_contents_video_capture_device.h" 5 #include "content/browser/media/capture/web_contents_video_capture_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 size_t mapped_size() const override { 441 size_t mapped_size() const override {
442 return buffer_handle_->mapped_size(); 442 return buffer_handle_->mapped_size();
443 } 443 }
444 void* data(int plane) override { return buffer_handle_->data(plane); } 444 void* data(int plane) override { return buffer_handle_->data(plane); }
445 ClientBuffer AsClientBuffer(int plane) override { return nullptr; } 445 ClientBuffer AsClientBuffer(int plane) override { return nullptr; }
446 #if defined(OS_POSIX) && !defined(OS_MACOSX) 446 #if defined(OS_POSIX) && !defined(OS_MACOSX)
447 base::FileDescriptor AsPlatformFile() override { 447 base::FileDescriptor AsPlatformFile() override {
448 return base::FileDescriptor(); 448 return base::FileDescriptor();
449 } 449 }
450 #endif 450 #endif
451 bool IsBackedByVideoFrame() const override {
452 return buffer_handle_->IsBackedByVideoFrame();
453 }
454 scoped_refptr<media::VideoFrame> GetVideoFrame() override {
455 return buffer_handle_->GetVideoFrame();
456 }
451 457
452 private: 458 private:
453 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } 459 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); }
454 460
455 const int id_; 461 const int id_;
456 const scoped_refptr<media::VideoCaptureBufferPool> pool_; 462 const scoped_refptr<media::VideoCaptureBufferPool> pool_;
457 const std::unique_ptr<media::VideoCaptureBufferHandle> buffer_handle_; 463 const std::unique_ptr<media::VideoCaptureBufferHandle> buffer_handle_;
458 }; 464 };
459 465
460 scoped_refptr<media::VideoCaptureBufferPool> buffer_pool_; 466 scoped_refptr<media::VideoCaptureBufferPool> buffer_pool_;
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 for (int i = 0; i < 3; ++i) { 1261 for (int i = 0; i < 3; ++i) {
1256 SimulateRefreshFrameRequest(); 1262 SimulateRefreshFrameRequest();
1257 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); 1263 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN));
1258 } 1264 }
1259 1265
1260 device()->StopAndDeAllocate(); 1266 device()->StopAndDeAllocate();
1261 } 1267 }
1262 1268
1263 } // namespace 1269 } // namespace
1264 } // namespace content 1270 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698