OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 PPAPI_SHARED_IMPL_MEDIA_STREAM_BUFFER_MANAGER_H_ | 5 #ifndef PPAPI_SHARED_IMPL_MEDIA_STREAM_BUFFER_MANAGER_H_ |
6 #define PPAPI_SHARED_IMPL_MEDIA_STREAM_BUFFER_MANAGER_H_ | 6 #define PPAPI_SHARED_IMPL_MEDIA_STREAM_BUFFER_MANAGER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 explicit MediaStreamBufferManager(Delegate* delegate); | 48 explicit MediaStreamBufferManager(Delegate* delegate); |
49 | 49 |
50 ~MediaStreamBufferManager(); | 50 ~MediaStreamBufferManager(); |
51 | 51 |
52 int32_t number_of_buffers() const { return number_of_buffers_; } | 52 int32_t number_of_buffers() const { return number_of_buffers_; } |
53 | 53 |
54 int32_t buffer_size() const { return buffer_size_; } | 54 int32_t buffer_size() const { return buffer_size_; } |
55 | 55 |
56 // Initializes shared memory for buffers transmission. | 56 // Initializes shared memory for buffers transmission. |
57 bool SetBuffers(int32_t number_of_buffers, | 57 bool SetBuffers(int32_t number_of_buffers, |
58 int32_t buffer_size, | 58 int32_t buffer_size, |
59 scoped_ptr<base::SharedMemory> shm, | 59 scoped_ptr<base::SharedMemory> shm, |
60 bool enqueue_all_buffers); | 60 bool enqueue_all_buffers); |
61 | 61 |
62 // Dequeues a buffer from |buffer_queue_|. | 62 // Dequeues a buffer from |buffer_queue_|. |
63 int32_t DequeueBuffer(); | 63 int32_t DequeueBuffer(); |
64 | 64 |
65 // Puts a buffer into |buffer_queue_|. | 65 // Puts a buffer into |buffer_queue_|. |
66 void EnqueueBuffer(int32_t index); | 66 void EnqueueBuffer(int32_t index); |
67 | 67 |
68 // Gets the buffer address for the given buffer index. | 68 // Gets the buffer address for the given buffer index. |
69 MediaStreamBuffer* GetBufferPointer(int32_t index); | 69 MediaStreamBuffer* GetBufferPointer(int32_t index); |
70 | 70 |
(...skipping 14 matching lines...) Expand all Loading... |
85 | 85 |
86 // A memory block shared between renderer process and plugin process. | 86 // A memory block shared between renderer process and plugin process. |
87 scoped_ptr<base::SharedMemory> shm_; | 87 scoped_ptr<base::SharedMemory> shm_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(MediaStreamBufferManager); | 89 DISALLOW_COPY_AND_ASSIGN(MediaStreamBufferManager); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace ppapi | 92 } // namespace ppapi |
93 | 93 |
94 #endif // PPAPI_SHAERD_IMPL_MEDIA_STREAM_BUFFER_MANAGER_H_ | 94 #endif // PPAPI_SHAERD_IMPL_MEDIA_STREAM_BUFFER_MANAGER_H_ |
OLD | NEW |