Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/base/video_frame.h" | 5 #include "media/base/video_frame.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <climits> | 8 #include <climits> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 761 storage_type_ = STORAGE_SHMEM; | 761 storage_type_ = STORAGE_SHMEM; |
| 762 shared_memory_handle_ = handle; | 762 shared_memory_handle_ = handle; |
| 763 } | 763 } |
| 764 | 764 |
| 765 #if defined(OS_MACOSX) | 765 #if defined(OS_MACOSX) |
| 766 CVPixelBufferRef VideoFrame::cv_pixel_buffer() const { | 766 CVPixelBufferRef VideoFrame::cv_pixel_buffer() const { |
| 767 return cv_pixel_buffer_.get(); | 767 return cv_pixel_buffer_.get(); |
| 768 } | 768 } |
| 769 #endif | 769 #endif |
| 770 | 770 |
| 771 void VideoFrame::SetReleaseMailboxCB( | |
| 772 const ReleaseMailboxCB& release_mailbox_cb) { | |
| 773 DCHECK(!release_mailbox_cb.is_null()); | |
| 774 DCHECK(mailbox_holders_release_cb_.is_null()); | |
| 775 mailbox_holders_release_cb_ = std::move(release_mailbox_cb); | |
|
xhwang
2017/01/25 18:25:09
OOC nit, not related to your CL: do we need to wor
sandersd (OOO until July 31)
2017/01/26 23:49:05
I suppose we do. I added a warning to the header;
| |
| 776 } | |
| 777 | |
| 771 void VideoFrame::AddDestructionObserver(const base::Closure& callback) { | 778 void VideoFrame::AddDestructionObserver(const base::Closure& callback) { |
| 772 DCHECK(!callback.is_null()); | 779 DCHECK(!callback.is_null()); |
| 773 done_callbacks_.push_back(callback); | 780 done_callbacks_.push_back(callback); |
| 774 } | 781 } |
| 775 | 782 |
| 776 void VideoFrame::UpdateReleaseSyncToken(SyncTokenClient* client) { | 783 void VideoFrame::UpdateReleaseSyncToken(SyncTokenClient* client) { |
| 777 DCHECK(HasTextures()); | 784 DCHECK(HasTextures()); |
| 778 base::AutoLock locker(release_sync_token_lock_); | 785 base::AutoLock locker(release_sync_token_lock_); |
| 779 // Must wait on the previous sync point before inserting a new sync point so | 786 // Must wait on the previous sync point before inserting a new sync point so |
| 780 // that |mailbox_holders_release_cb_| guarantees the previous sync point | 787 // that |mailbox_holders_release_cb_| guarantees the previous sync point |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1152 if (zero_initialize_memory) | 1159 if (zero_initialize_memory) |
| 1153 memset(data, 0, data_size); | 1160 memset(data, 0, data_size); |
| 1154 | 1161 |
| 1155 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) | 1162 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) |
| 1156 data_[plane] = data + offset[plane]; | 1163 data_[plane] = data + offset[plane]; |
| 1157 | 1164 |
| 1158 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); | 1165 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); |
| 1159 } | 1166 } |
| 1160 | 1167 |
| 1161 } // namespace media | 1168 } // namespace media |
| OLD | NEW |