| 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 MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_POOL_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_POOL_H_ |
| 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_POOL_H_ | 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_POOL_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "media/capture/capture_export.h" | 9 #include "media/capture/capture_export.h" |
| 10 #include "media/capture/video_capture_types.h" | 10 #include "media/capture/video_capture_types.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // producer) until ownership is transferred either to the consumer via | 57 // producer) until ownership is transferred either to the consumer via |
| 58 // HoldForConsumers(), or back to the pool with | 58 // HoldForConsumers(), or back to the pool with |
| 59 // RelinquishProducerReservation(). | 59 // RelinquishProducerReservation(). |
| 60 // | 60 // |
| 61 // On occasion, this call will decide to free an old buffer to make room for a | 61 // On occasion, this call will decide to free an old buffer to make room for a |
| 62 // new allocation at a larger size. If so, the ID of the destroyed buffer is | 62 // new allocation at a larger size. If so, the ID of the destroyed buffer is |
| 63 // returned via |buffer_id_to_drop|. | 63 // returned via |buffer_id_to_drop|. |
| 64 virtual int ReserveForProducer(const gfx::Size& dimensions, | 64 virtual int ReserveForProducer(const gfx::Size& dimensions, |
| 65 media::VideoPixelFormat format, | 65 media::VideoPixelFormat format, |
| 66 media::VideoPixelStorage storage, | 66 media::VideoPixelStorage storage, |
| 67 int frame_feedback_id, |
| 67 int* buffer_id_to_drop) = 0; | 68 int* buffer_id_to_drop) = 0; |
| 68 | 69 |
| 69 // Indicate that a buffer held for the producer should be returned back to the | 70 // Indicate that a buffer held for the producer should be returned back to the |
| 70 // pool without passing on to the consumer. This effectively is the opposite | 71 // pool without passing on to the consumer. This effectively is the opposite |
| 71 // of ReserveForProducer(). | 72 // of ReserveForProducer(). |
| 72 virtual void RelinquishProducerReservation(int buffer_id) = 0; | 73 virtual void RelinquishProducerReservation(int buffer_id) = 0; |
| 73 | 74 |
| 74 // Attempt to reserve the same buffer that was relinquished in the last call | 75 // Attempt to reserve the same buffer that was relinquished in the last call |
| 75 // to RelinquishProducerReservation(). If the buffer is not still being | 76 // to RelinquishProducerReservation(). If the buffer is not still being |
| 76 // consumed, and has not yet been re-used since being consumed, and the | 77 // consumed, and has not yet been re-used since being consumed, and the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 100 protected: | 101 protected: |
| 101 virtual ~VideoCaptureBufferPool() {} | 102 virtual ~VideoCaptureBufferPool() {} |
| 102 | 103 |
| 103 private: | 104 private: |
| 104 friend class base::RefCountedThreadSafe<VideoCaptureBufferPool>; | 105 friend class base::RefCountedThreadSafe<VideoCaptureBufferPool>; |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 } // namespace media | 108 } // namespace media |
| 108 | 109 |
| 109 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_POOL_H_ | 110 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_POOL_H_ |
| OLD | NEW |