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

Unified Diff: ppapi/shared_impl/media_stream_buffer_manager.cc

Issue 150403006: [PPAPI][MediaStream] Support configure for video input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build errors Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.h ('k') | ppapi/shared_impl/media_stream_video_track_shared.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/media_stream_buffer_manager.cc
diff --git a/ppapi/shared_impl/media_stream_buffer_manager.cc b/ppapi/shared_impl/media_stream_buffer_manager.cc
index 37277fce7afe6c95b85e84d1bfc6f386c3ef9130..d6c4b0d597e22db3ff670eabc49552ceb5feec4e 100644
--- a/ppapi/shared_impl/media_stream_buffer_manager.cc
+++ b/ppapi/shared_impl/media_stream_buffer_manager.cc
@@ -26,7 +26,6 @@ bool MediaStreamBufferManager::SetBuffers(int32_t number_of_buffers,
scoped_ptr<base::SharedMemory> shm,
bool enqueue_all_buffers) {
DCHECK(shm);
- DCHECK(!shm_);
DCHECK_GT(number_of_buffers, 0);
DCHECK_GT(buffer_size,
static_cast<int32_t>(sizeof(MediaStreamBuffer::Header)));
@@ -35,11 +34,13 @@ bool MediaStreamBufferManager::SetBuffers(int32_t number_of_buffers,
number_of_buffers_ = number_of_buffers;
buffer_size_ = buffer_size;
- int32_t size = number_of_buffers_ * buffer_size;
+ size_t size = number_of_buffers_ * buffer_size;
shm_ = shm.Pass();
if (!shm_->Map(size))
return false;
+ buffer_queue_.clear();
+ buffers_.clear();
uint8_t* p = reinterpret_cast<uint8_t*>(shm_->memory());
for (int32_t i = 0; i < number_of_buffers; ++i) {
if (enqueue_all_buffers)
@@ -59,15 +60,16 @@ int32_t MediaStreamBufferManager::DequeueBuffer() {
}
void MediaStreamBufferManager::EnqueueBuffer(int32_t index) {
- DCHECK_GE(index, 0);
- DCHECK_LT(index, number_of_buffers_);
+ CHECK_GE(index, 0) << "Invalid buffer index";
+ CHECK_LT(index, number_of_buffers_) << "Invalid buffer index";
buffer_queue_.push_back(index);
delegate_->OnNewBufferEnqueued();
}
-MediaStreamBuffer* MediaStreamBufferManager::GetBufferPointer(int32_t index) {
- DCHECK_GE(index, 0);
- DCHECK_LT(index, number_of_buffers_);
+MediaStreamBuffer* MediaStreamBufferManager::GetBufferPointer(
+ int32_t index) {
+ CHECK_GE(index, 0) << "Invalid buffer index";
+ CHECK_LT(index, number_of_buffers_) << "Invalid buffer index";
return buffers_[index];
}
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.h ('k') | ppapi/shared_impl/media_stream_video_track_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698