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

Side by Side Diff: content/renderer/media/renderer_gpu_video_decoder_factories.h

Issue 13890012: Integrate VDA with WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 7 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
6 #define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ 6 #define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 13 matching lines...) Expand all
24 class GpuChannelHost; 24 class GpuChannelHost;
25 class WebGraphicsContext3DCommandBufferImpl; 25 class WebGraphicsContext3DCommandBufferImpl;
26 26
27 // Glue code to expose functionality needed by media::GpuVideoDecoder to 27 // Glue code to expose functionality needed by media::GpuVideoDecoder to
28 // RenderViewImpl. This class is entirely an implementation detail of 28 // RenderViewImpl. This class is entirely an implementation detail of
29 // RenderViewImpl and only has its own header to allow extraction of its 29 // RenderViewImpl and only has its own header to allow extraction of its
30 // implementation from render_view_impl.cc which is already far too large. 30 // implementation from render_view_impl.cc which is already far too large.
31 // 31 //
32 // The public methods of the class can be called from any thread, and are 32 // The public methods of the class can be called from any thread, and are
33 // internally trampolined to the appropriate thread. GPU/GL-related calls go to 33 // internally trampolined to the appropriate thread. GPU/GL-related calls go to
34 // the constructor-argument loop (mostly that's the compositor thread, or the 34 // the constructor-argument loop. Typically this is the compositor thread,
35 // renderer thread if threaded compositing is disabled), and shmem-related calls 35 // unless threaded-compositing is disabled, when it'll be the renderer thread,
36 // go to the render thread. 36 // or a special-purpose thread e.g. for WebRTC. shmem-related calls go to the
37 // render thread.
37 class CONTENT_EXPORT RendererGpuVideoDecoderFactories 38 class CONTENT_EXPORT RendererGpuVideoDecoderFactories
38 : public media::GpuVideoDecoder::Factories { 39 : public media::GpuVideoDecoder::Factories {
39 public: 40 public:
40 // Takes a ref on |gpu_channel_host| and tests |context| for loss before each 41 // Takes a ref on |gpu_channel_host| and tests |context| for loss before each
41 // use. 42 // use.
42 RendererGpuVideoDecoderFactories( 43 RendererGpuVideoDecoderFactories(
43 GpuChannelHost* gpu_channel_host, 44 GpuChannelHost* gpu_channel_host,
44 const scoped_refptr<base::MessageLoopProxy>& message_loop, 45 const scoped_refptr<base::MessageLoopProxy>& message_loop,
45 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi); 46 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi);
46 47
47 // media::GpuVideoDecoder::Factories implementation. 48 // media::GpuVideoDecoder::Factories implementation.
48 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( 49 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
49 media::VideoCodecProfile profile, 50 media::VideoCodecProfile profile,
50 media::VideoDecodeAccelerator::Client* client) OVERRIDE; 51 media::VideoDecodeAccelerator::Client* client) OVERRIDE;
51 virtual bool CreateTextures(int32 count, const gfx::Size& size, 52 virtual bool CreateTextures(int32 count, const gfx::Size& size,
52 std::vector<uint32>* texture_ids, 53 std::vector<uint32>* texture_ids,
53 uint32 texture_target) OVERRIDE; 54 uint32 texture_target) OVERRIDE;
54 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; 55 virtual void DeleteTexture(uint32 texture_id) OVERRIDE;
55 virtual void ReadPixels(uint32 texture_id, 56 virtual void ReadPixels(uint32 texture_id,
56 uint32 texture_target, 57 uint32 texture_target,
57 const gfx::Size& size, 58 const gfx::Size& size,
58 const SkBitmap& pixels) OVERRIDE; 59 const SkBitmap& pixels) OVERRIDE;
59 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; 60 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
60 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE; 61 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE;
61 virtual void Abort() OVERRIDE; 62 virtual void Abort() OVERRIDE;
62 virtual bool IsAborted() OVERRIDE; 63 virtual bool IsAborted() OVERRIDE;
63 64
65 // Makes a copy of |this|.
66 scoped_refptr<RendererGpuVideoDecoderFactories> Clone();
67
64 protected: 68 protected:
65 friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>; 69 friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>;
66 virtual ~RendererGpuVideoDecoderFactories(); 70 virtual ~RendererGpuVideoDecoderFactories();
67 71
68 private: 72 private:
69 // Helper for the constructor to acquire the ContentGLContext on the 73 // Helper for the constructor to acquire the ContentGLContext on the
70 // compositor thread (when it is enabled). 74 // compositor thread (when it is enabled).
71 void AsyncGetContext(WebGraphicsContext3DCommandBufferImpl* context); 75 void AsyncGetContext(WebGraphicsContext3DCommandBufferImpl* context);
72 76
73 // Async versions of the public methods. They use output parameters instead 77 // Async versions of the public methods. They use output parameters instead
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Shared memory segment which is returned by the CreateSharedMemory() 114 // Shared memory segment which is returned by the CreateSharedMemory()
111 // function. 115 // function.
112 scoped_ptr<base::SharedMemory> shared_memory_segment_; 116 scoped_ptr<base::SharedMemory> shared_memory_segment_;
113 117
114 // Bitmap returned by ReadPixels(). 118 // Bitmap returned by ReadPixels().
115 SkBitmap read_pixels_bitmap_; 119 SkBitmap read_pixels_bitmap_;
116 120
117 // Textures returned by the CreateTexture() function. 121 // Textures returned by the CreateTexture() function.
118 std::vector<uint32> created_textures_; 122 std::vector<uint32> created_textures_;
119 123
120 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); 124 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories);
Ami GONE FROM CHROMIUM 2013/06/13 20:10:03 Now that you have a no-arg ctor this is sort of a
wuchengli 2013/06/18 16:11:23 Done.
121 }; 125 };
122 126
123 } // namespace content 127 } // namespace content
124 128
125 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ 129 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698