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

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

Issue 1133563010: Add a GpuMemoryBuffer pool that creates hardware backed VideoFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dalecurtis' comments. Created 5 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
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_
6 #define MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "media/base/video_frame.h"
11
12 namespace base {
13 class SingleThreadTaskRunner;
14 }
15
16 namespace media {
17 class GpuVideoAcceleratorFactories;
18
19 // Interface to a pool of GpuMemoryBuffers/textues/images that can be used to
20 // transform software VideoFrames to VideoFrames backed by native textures.
21 // The resources used by the VideoFrame created by the pool will be
22 // automatically put back into the pool once the frame is destroyed.
23 // The pool recycles resources to a void unnecessarily allocating and
24 // destroying textures, images and GpuMemoryBuffer that could result
25 // in a rountrip to the browser/GPU process.
DaleCurtis 2015/05/14 18:52:13 round trip.
Daniele Castagna 2015/05/14 19:24:17 Done.
26 class MEDIA_EXPORT GpuMemoryBufferVideoFramePool {
27 public:
28 GpuMemoryBufferVideoFramePool(
29 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
30 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories);
31 ~GpuMemoryBufferVideoFramePool();
32
33 // Returns a new VideoFrame containing only mailboxes to native resources.
34 // The content of the returned object is copied from the software-allocated
35 // |video_frame|.
36 // If it's not possible to create a new hardware VideoFrame, |video_frame|
37 // itself will be returned.
38 scoped_refptr<VideoFrame> MaybeCreateHardwareFrame(
39 const scoped_refptr<VideoFrame>& video_frame);
40
41 private:
42 class PoolImpl;
43 scoped_refptr<PoolImpl> pool_impl_;
44
45 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferVideoFramePool);
46 };
47
48 } // namespace media
49
50 #endif // MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698