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

Unified Diff: media/video/gpu_memory_buffer_video_frame_pool.h

Issue 1273943002: media: Make GpuMemoryBuffers VideoFrame copies asynchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reveman's and dalecurtis' comments. Disable GMB VideoFrames. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/test/pipeline_integration_test_base.cc ('k') | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/gpu_memory_buffer_video_frame_pool.h
diff --git a/media/video/gpu_memory_buffer_video_frame_pool.h b/media/video/gpu_memory_buffer_video_frame_pool.h
index e01c791aae9666f84816b660da79210191dcc78a..f41bbf7a175c6a3eff1677bb967fa9629c647d65 100644
--- a/media/video/gpu_memory_buffer_video_frame_pool.h
+++ b/media/video/gpu_memory_buffer_video_frame_pool.h
@@ -7,6 +7,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/task_runner.h"
#include "media/base/video_frame.h"
namespace base {
@@ -26,17 +27,24 @@ class GpuVideoAcceleratorFactories;
class MEDIA_EXPORT GpuMemoryBufferVideoFramePool {
public:
GpuMemoryBufferVideoFramePool(
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+ const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
+ const scoped_refptr<base::TaskRunner>& worker_task_runner,
const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories);
~GpuMemoryBufferVideoFramePool();
- // Returns a new VideoFrame containing only mailboxes to native resources.
- // The content of the returned object is copied from the software-allocated
+ // Callback used by MaybeCreateHardwareFrame to deliver a new VideoFrame
+ // after it has been copied to GpuMemoryBuffers.
+ typedef base::Callback<void(const scoped_refptr<VideoFrame>&)> FrameReadyCB;
+
+ // Calls |cb| on |media_worker_pool| with a new VideoFrame containing only
+ // mailboxes to native resources. |cb| will be destroyed on
+ // |media_worker_pool|.
+ // The content of the new object is copied from the software-allocated
// |video_frame|.
// If it's not possible to create a new hardware VideoFrame, |video_frame|
- // itself will be returned.
- scoped_refptr<VideoFrame> MaybeCreateHardwareFrame(
- const scoped_refptr<VideoFrame>& video_frame);
+ // itself will passed to |cb|.
+ void MaybeCreateHardwareFrame(const scoped_refptr<VideoFrame>& video_frame,
+ const FrameReadyCB& frame_ready_cb);
private:
class PoolImpl;
« no previous file with comments | « media/test/pipeline_integration_test_base.cc ('k') | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698