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

Side by Side Diff: media/video/gpu_memory_buffer_video_frame_pool.cc

Issue 1418923006: Carry over REFERENCE_TIME for the frames using GPU Memory Buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/video/gpu_memory_buffer_video_frame_pool.h" 5 #include "media/video/gpu_memory_buffer_video_frame_pool.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 case PIXEL_FORMAT_UYVY: 560 case PIXEL_FORMAT_UYVY:
561 frame = VideoFrame::WrapNativeTexture( 561 frame = VideoFrame::WrapNativeTexture(
562 output_format_, mailbox_holders[VideoFrame::kYPlane], 562 output_format_, mailbox_holders[VideoFrame::kYPlane],
563 release_mailbox_callback, size, gfx::Rect(size), 563 release_mailbox_callback, size, gfx::Rect(size),
564 video_frame->natural_size(), video_frame->timestamp()); 564 video_frame->natural_size(), video_frame->timestamp());
565 frame->metadata()->SetBoolean(VideoFrameMetadata::ALLOW_OVERLAY, true); 565 frame->metadata()->SetBoolean(VideoFrameMetadata::ALLOW_OVERLAY, true);
566 break; 566 break;
567 default: 567 default:
568 NOTREACHED(); 568 NOTREACHED();
569 } 569 }
570
571 base::TimeTicks render_time;
572 if (video_frame->metadata()->GetTimeTicks(VideoFrameMetadata::REFERENCE_TIME,
573 &render_time)) {
574 frame->metadata()->SetTimeTicks(VideoFrameMetadata::REFERENCE_TIME,
575 render_time);
576 }
577
570 frame_ready_cb.Run(frame); 578 frame_ready_cb.Run(frame);
571 } 579 }
572 580
573 // Destroy all the resources posting one task per FrameResources 581 // Destroy all the resources posting one task per FrameResources
574 // to the |media_task_runner_|. 582 // to the |media_task_runner_|.
575 GpuMemoryBufferVideoFramePool::PoolImpl::~PoolImpl() { 583 GpuMemoryBufferVideoFramePool::PoolImpl::~PoolImpl() {
576 // Delete all the resources on the media thread. 584 // Delete all the resources on the media thread.
577 while (!resources_pool_.empty()) { 585 while (!resources_pool_.empty()) {
578 FrameResources* frame_resources = resources_pool_.front(); 586 FrameResources* frame_resources = resources_pool_.front();
579 resources_pool_.pop_front(); 587 resources_pool_.pop_front();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 } 710 }
703 711
704 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( 712 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame(
705 const scoped_refptr<VideoFrame>& video_frame, 713 const scoped_refptr<VideoFrame>& video_frame,
706 const FrameReadyCB& frame_ready_cb) { 714 const FrameReadyCB& frame_ready_cb) {
707 DCHECK(video_frame); 715 DCHECK(video_frame);
708 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); 716 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb);
709 } 717 }
710 718
711 } // namespace media 719 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698