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

Side by Side Diff: media/base/video_frame.cc

Issue 2640153004: Add mailbox-based Mojo VideoFrame variant. (Closed)
Patch Set: Rebase. Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « media/base/video_frame.h ('k') | media/mojo/clients/mojo_video_decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_ = release_mailbox_cb;
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
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
OLDNEW
« no previous file with comments | « media/base/video_frame.h ('k') | media/mojo/clients/mojo_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698