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

Side by Side Diff: cc/resources/video_resource_updater.cc

Issue 2006893002: Video Gmb Pool: Plumb GpuMemoryBufferId through to compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add gmb ID support to unittests Created 4 years, 7 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 | « no previous file | media/base/video_frame.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/resources/video_resource_updater.h" 5 #include "cc/resources/video_resource_updater.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 const size_t num_planes = media::VideoFrame::NumPlanes(video_frame->format()); 691 const size_t num_planes = media::VideoFrame::NumPlanes(video_frame->format());
692 for (size_t i = 0; i < num_planes; ++i) { 692 for (size_t i = 0; i < num_planes; ++i) {
693 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(i); 693 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(i);
694 if (mailbox_holder.mailbox.IsZero()) 694 if (mailbox_holder.mailbox.IsZero())
695 break; 695 break;
696 696
697 if (video_frame->metadata()->IsTrue( 697 if (video_frame->metadata()->IsTrue(
698 media::VideoFrameMetadata::COPY_REQUIRED)) { 698 media::VideoFrameMetadata::COPY_REQUIRED)) {
699 CopyPlaneTexture(video_frame.get(), mailbox_holder, &external_resources); 699 CopyPlaneTexture(video_frame.get(), mailbox_holder, &external_resources);
700 } else { 700 } else {
701 external_resources.mailboxes.push_back( 701 external_resources.mailboxes.push_back(TextureMailbox(
702 TextureMailbox(mailbox_holder.mailbox, mailbox_holder.sync_token, 702 mailbox_holder.mailbox, mailbox_holder.sync_token,
703 mailbox_holder.texture_target, 703 mailbox_holder.texture_target, video_frame->coded_size(),
704 video_frame->coded_size(), gfx::GpuMemoryBufferId(), 704 video_frame->texture_gpu_memory_buffer_id(i),
705 video_frame->metadata()->IsTrue( 705 video_frame->metadata()->IsTrue(
706 media::VideoFrameMetadata::ALLOW_OVERLAY), 706 media::VideoFrameMetadata::ALLOW_OVERLAY),
707 false)); 707 false));
708 708
709 external_resources.release_callbacks.push_back( 709 external_resources.release_callbacks.push_back(
710 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame)); 710 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame));
711 } 711 }
712 } 712 }
713 return external_resources; 713 return external_resources;
714 } 714 }
715 715
716 // static 716 // static
717 void VideoResourceUpdater::RecycleResource( 717 void VideoResourceUpdater::RecycleResource(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 plane_resource.plane_index == 0; 765 plane_resource.plane_index == 0;
766 }); 766 });
767 if (resource_it == updater->all_resources_.end()) 767 if (resource_it == updater->all_resources_.end())
768 return; 768 return;
769 769
770 resource_it->destructed = true; 770 resource_it->destructed = true;
771 } 771 }
772 #endif 772 #endif
773 773
774 } // namespace cc 774 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698