| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_TRACKER_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_TRACKER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_TRACKER_H_ | 6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_TRACKER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| 11 #include "content/browser/renderer_host/media/video_capture_buffer_handle.h" | |
| 12 #include "media/base/video_capture_types.h" | 11 #include "media/base/video_capture_types.h" |
| 12 #include "media/capture/video/video_capture_buffer_handle.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace media { |
| 15 | 15 |
| 16 // Keeps track of the state of a given mappable resource. Each | 16 // Keeps track of the state of a given mappable resource. Each |
| 17 // VideoCaptureBufferTracker carries indication of pixel format and storage | 17 // VideoCaptureBufferTracker carries indication of pixel format and storage |
| 18 // type. This is a base class for implementations using different kinds of | 18 // type. This is a base class for implementations using different kinds of |
| 19 // storage. | 19 // storage. |
| 20 class VideoCaptureBufferTracker { | 20 class CAPTURE_EXPORT VideoCaptureBufferTracker { |
| 21 public: | 21 public: |
| 22 VideoCaptureBufferTracker() | 22 VideoCaptureBufferTracker() |
| 23 : max_pixel_count_(0), | 23 : max_pixel_count_(0), |
| 24 held_by_producer_(false), | 24 held_by_producer_(false), |
| 25 consumer_hold_count_(0) {} | 25 consumer_hold_count_(0) {} |
| 26 virtual bool Init(const gfx::Size& dimensions, | 26 virtual bool Init(const gfx::Size& dimensions, |
| 27 media::VideoPixelFormat format, | 27 media::VideoPixelFormat format, |
| 28 media::VideoPixelStorage storage_type, | 28 media::VideoPixelStorage storage_type, |
| 29 base::Lock* lock) = 0; | 29 base::Lock* lock) = 0; |
| 30 virtual ~VideoCaptureBufferTracker(){}; | 30 virtual ~VideoCaptureBufferTracker(){}; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Indicates whether this VideoCaptureBufferTracker is currently referenced by | 68 // Indicates whether this VideoCaptureBufferTracker is currently referenced by |
| 69 // the producer. | 69 // the producer. |
| 70 bool held_by_producer_; | 70 bool held_by_producer_; |
| 71 | 71 |
| 72 // Number of consumer processes which hold this VideoCaptureBufferTracker. | 72 // Number of consumer processes which hold this VideoCaptureBufferTracker. |
| 73 int consumer_hold_count_; | 73 int consumer_hold_count_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace content | 76 } // namespace content |
| 77 | 77 |
| 78 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_TRACKER_H_ | 78 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_TRACKER_H_ |
| OLD | NEW |