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

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

Issue 1686123004: Post GpuMemoryBufferVideoFramePool deletion on media thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using WeakPtr Created 4 years, 10 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
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 #ifndef MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_ 5 #ifndef MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_
6 #define MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_ 6 #define MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h"
10 #include "base/task_runner.h" 11 #include "base/task_runner.h"
11 #include "media/base/video_frame.h" 12 #include "media/base/video_frame.h"
12 13
13 namespace base { 14 namespace base {
14 class SingleThreadTaskRunner; 15 class SingleThreadTaskRunner;
15 } 16 }
16 17
17 namespace media { 18 namespace media {
18 class GpuVideoAcceleratorFactories; 19 class GpuVideoAcceleratorFactories;
19 20
(...skipping 21 matching lines...) Expand all
41 // mailboxes to native resources. |cb| will be destroyed on 42 // mailboxes to native resources. |cb| will be destroyed on
42 // |media_worker_pool|. 43 // |media_worker_pool|.
43 // The content of the new object is copied from the software-allocated 44 // The content of the new object is copied from the software-allocated
44 // |video_frame|. 45 // |video_frame|.
45 // If it's not possible to create a new hardware VideoFrame, |video_frame| 46 // If it's not possible to create a new hardware VideoFrame, |video_frame|
46 // itself will passed to |cb|. 47 // itself will passed to |cb|.
47 virtual void MaybeCreateHardwareFrame( 48 virtual void MaybeCreateHardwareFrame(
48 const scoped_refptr<VideoFrame>& video_frame, 49 const scoped_refptr<VideoFrame>& video_frame,
49 const FrameReadyCB& frame_ready_cb); 50 const FrameReadyCB& frame_ready_cb);
50 51
52 base::WeakPtr<GpuMemoryBufferVideoFramePool> GetWeakPtr();
mcasas 2016/02/11 15:40:41 nit: for cases like this you can also make the cla
53
51 private: 54 private:
52 class PoolImpl; 55 class PoolImpl;
53 scoped_refptr<PoolImpl> pool_impl_; 56 scoped_refptr<PoolImpl> pool_impl_;
57 base::WeakPtrFactory<GpuMemoryBufferVideoFramePool> weak_ptr_factory_;
54 58
55 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferVideoFramePool); 59 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferVideoFramePool);
56 }; 60 };
57 61
58 } // namespace media 62 } // namespace media
59 63
60 #endif // MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_ 64 #endif // MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698