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

Side by Side Diff: content/browser/renderer_host/media/video_capture_device_client.cc

Issue 2343423003: Extract nested and private classes from VideoCaptureBufferPool (Closed)
Patch Set: Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/renderer_host/media/video_capture_device_client.h" 5 #include "content/browser/renderer_host/media/video_capture_device_client.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 base::FileDescriptor AsPlatformFile() override { 51 base::FileDescriptor AsPlatformFile() override {
52 return buffer_handle_->AsPlatformFile(); 52 return buffer_handle_->AsPlatformFile();
53 } 53 }
54 #endif 54 #endif
55 55
56 private: 56 private:
57 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } 57 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); }
58 58
59 const int id_; 59 const int id_;
60 const scoped_refptr<VideoCaptureBufferPool> pool_; 60 const scoped_refptr<VideoCaptureBufferPool> pool_;
61 const std::unique_ptr<VideoCaptureBufferPoolBufferHandle> buffer_handle_; 61 const std::unique_ptr<VideoCaptureBufferHandle> buffer_handle_;
62 }; 62 };
63 63
64 VideoCaptureDeviceClient::VideoCaptureDeviceClient( 64 VideoCaptureDeviceClient::VideoCaptureDeviceClient(
65 std::unique_ptr<VideoFrameReceiver> receiver, 65 std::unique_ptr<VideoFrameReceiver> receiver,
66 const scoped_refptr<VideoCaptureBufferPool>& buffer_pool, 66 const scoped_refptr<VideoCaptureBufferPool>& buffer_pool,
67 const VideoCaptureJpegDecoderFactoryCB& jpeg_decoder_factory) 67 const VideoCaptureJpegDecoderFactoryCB& jpeg_decoder_factory)
68 : receiver_(std::move(receiver)), 68 : receiver_(std::move(receiver)),
69 jpeg_decoder_factory_callback_(jpeg_decoder_factory), 69 jpeg_decoder_factory_callback_(jpeg_decoder_factory),
70 external_jpeg_decoder_initialized_(false), 70 external_jpeg_decoder_initialized_(false),
71 buffer_pool_(buffer_pool), 71 buffer_pool_(buffer_pool),
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 reinterpret_cast<uint8_t*>(buffer->data(VideoFrame::kUPlane)); 405 reinterpret_cast<uint8_t*>(buffer->data(VideoFrame::kUPlane));
406 *v_plane_data = 406 *v_plane_data =
407 reinterpret_cast<uint8_t*>(buffer->data(VideoFrame::kVPlane)); 407 reinterpret_cast<uint8_t*>(buffer->data(VideoFrame::kVPlane));
408 return buffer; 408 return buffer;
409 } 409 }
410 NOTREACHED(); 410 NOTREACHED();
411 return std::unique_ptr<Buffer>(); 411 return std::unique_ptr<Buffer>();
412 } 412 }
413 413
414 } // namespace content 414 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698