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

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

Issue 14199002: Send hardware video frames with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No ifdefs Created 7 years, 8 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 | Annotate | Revision Log
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 GpuChannelHost* gpu_channel_host, 43 GpuChannelHost* gpu_channel_host,
44 const scoped_refptr<base::MessageLoopProxy>& message_loop, 44 const scoped_refptr<base::MessageLoopProxy>& message_loop,
45 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi); 45 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi);
46 46
47 // media::GpuVideoDecoder::Factories implementation. 47 // media::GpuVideoDecoder::Factories implementation.
48 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( 48 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
49 media::VideoCodecProfile profile, 49 media::VideoCodecProfile profile,
50 media::VideoDecodeAccelerator::Client* client) OVERRIDE; 50 media::VideoDecodeAccelerator::Client* client) OVERRIDE;
51 virtual bool CreateTextures(int32 count, const gfx::Size& size, 51 virtual bool CreateTextures(int32 count, const gfx::Size& size,
52 std::vector<uint32>* texture_ids, 52 std::vector<uint32>* texture_ids,
53 std::vector<gpu::Mailbox>* texture_mailboxes,
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;
56 virtual uint32 ProduceTextureToMailbox(const gpu::Mailbox& mailbox,
57 uint32 texture_id,
58 uint32 texture_target) OVERRIDE;
59 virtual void ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
60 uint32 texture_id,
61 uint32 texture_target,
62 uint32 sync_point) OVERRIDE;
55 virtual void ReadPixels(uint32 texture_id, 63 virtual void ReadPixels(uint32 texture_id,
56 uint32 texture_target, 64 uint32 texture_target,
57 const gfx::Size& size, 65 const gfx::Size& size,
58 const SkBitmap& pixels) OVERRIDE; 66 const SkBitmap& pixels) OVERRIDE;
59 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; 67 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
60 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE; 68 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE;
61 virtual void Abort() OVERRIDE; 69 virtual void Abort() OVERRIDE;
62 virtual bool IsAborted() OVERRIDE; 70 virtual bool IsAborted() OVERRIDE;
63 71
64 protected: 72 protected:
(...skipping 11 matching lines...) Expand all
76 // AsyncCreateSharedMemory runs on the renderer thread and the rest run on 84 // AsyncCreateSharedMemory runs on the renderer thread and the rest run on
77 // |message_loop_|. 85 // |message_loop_|.
78 // The AsyncCreateVideoDecodeAccelerator returns its output in the vda_ 86 // The AsyncCreateVideoDecodeAccelerator returns its output in the vda_
79 // member. 87 // member.
80 void AsyncCreateVideoDecodeAccelerator( 88 void AsyncCreateVideoDecodeAccelerator(
81 media::VideoCodecProfile profile, 89 media::VideoCodecProfile profile,
82 media::VideoDecodeAccelerator::Client* client); 90 media::VideoDecodeAccelerator::Client* client);
83 void AsyncCreateTextures(int32 count, const gfx::Size& size, 91 void AsyncCreateTextures(int32 count, const gfx::Size& size,
84 uint32 texture_target); 92 uint32 texture_target);
85 void AsyncDeleteTexture(uint32 texture_id); 93 void AsyncDeleteTexture(uint32 texture_id);
94 void AsyncProduceTextureToMailbox(const gpu::Mailbox& mailbox,
95 uint32 texture_id,
96 uint32 texture_target,
97 uint32* sync_point);
98 void AsyncConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
99 uint32 texture_id,
100 uint32 texture_target,
101 uint32 sync_point);
86 void AsyncReadPixels(uint32 texture_id, uint32 texture_target, 102 void AsyncReadPixels(uint32 texture_id, uint32 texture_target,
87 const gfx::Size& size); 103 const gfx::Size& size);
88 void AsyncCreateSharedMemory(size_t size); 104 void AsyncCreateSharedMemory(size_t size);
89 void AsyncDestroyVideoDecodeAccelerator(); 105 void AsyncDestroyVideoDecodeAccelerator();
90 106
91 scoped_refptr<base::MessageLoopProxy> message_loop_; 107 scoped_refptr<base::MessageLoopProxy> message_loop_;
92 scoped_refptr<GpuChannelHost> gpu_channel_host_; 108 scoped_refptr<GpuChannelHost> gpu_channel_host_;
93 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> context_; 109 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> context_;
94 110
95 // This event is signaled if we have been asked to Abort(). 111 // This event is signaled if we have been asked to Abort().
96 base::WaitableEvent aborted_waiter_; 112 base::WaitableEvent aborted_waiter_;
97 113
98 // This event is signaled by asynchronous tasks to indicate their completion. 114 // This event is signaled by asynchronous tasks to indicate their completion.
99 // e.g. AsyncCreateVideoDecodeAccelerator()/AsyncCreateTextures() etc. 115 // e.g. AsyncCreateVideoDecodeAccelerator()/AsyncCreateTextures() etc.
100 base::WaitableEvent async_waiter_; 116 base::WaitableEvent async_waiter_;
101 117
102 // The vda returned by the CreateVideoAcclelerator function. 118 // The vda returned by the CreateVideoAcclelerator function.
103 scoped_ptr<media::VideoDecodeAccelerator> vda_; 119 scoped_ptr<media::VideoDecodeAccelerator> vda_;
104 120
105 // Shared memory segment which is returned by the CreateSharedMemory() 121 // Shared memory segment which is returned by the CreateSharedMemory()
106 // function. 122 // function.
107 scoped_ptr<base::SharedMemory> shared_memory_segment_; 123 scoped_ptr<base::SharedMemory> shared_memory_segment_;
108 124
109 // Bitmap returned by ReadPixels(). 125 // Bitmap returned by ReadPixels().
110 SkBitmap read_pixels_bitmap_; 126 SkBitmap read_pixels_bitmap_;
111 127
112 // Textures returned by the CreateTexture() function. 128 // Textures returned by the CreateTexture() function.
113 std::vector<uint32> created_textures_; 129 std::vector<uint32> created_textures_;
130 std::vector<gpu::Mailbox> created_texture_mailboxes_;
114 131
115 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); 132 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories);
116 }; 133 };
117 134
118 } // namespace content 135 } // namespace content
119 136
120 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ 137 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698