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

Unified Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.h

Issue 20632002: Add media::VideoEncodeAccelerator with WebRTC integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: d3982027 CQ nits. Created 7 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
Index: content/renderer/media/renderer_gpu_video_accelerator_factories.h
diff --git a/content/renderer/media/renderer_gpu_video_decoder_factories.h b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
similarity index 64%
rename from content/renderer/media/renderer_gpu_video_decoder_factories.h
rename to content/renderer/media/renderer_gpu_video_accelerator_factories.h
index 32f9bcdf227b8713cc0d603b69171d66752106b4..9db1c33546a75b7a54c6eda4a5e3e27f76ec9850 100644
--- a/content/renderer/media/renderer_gpu_video_decoder_factories.h
+++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
-#define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
+#ifndef CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_ACCELERATOR_FACTORIES_H_
+#define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_ACCELERATOR_FACTORIES_H_
#include <vector>
@@ -12,7 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "base/synchronization/waitable_event.h"
#include "content/common/content_export.h"
-#include "media/filters/gpu_video_decoder_factories.h"
+#include "media/filters/gpu_video_accelerator_factories.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/size.h"
@@ -25,7 +25,7 @@ namespace content {
class GpuChannelHost;
class WebGraphicsContext3DCommandBufferImpl;
-// Glue code to expose functionality needed by media::GpuVideoDecoder to
+// Glue code to expose functionality needed by media::GpuVideoAccelerator to
// RenderViewImpl. This class is entirely an implementation detail of
// RenderViewImpl and only has its own header to allow extraction of its
// implementation from render_view_impl.cc which is already far too large.
@@ -34,27 +34,31 @@ class WebGraphicsContext3DCommandBufferImpl;
// internally trampolined to the appropriate thread. GPU/GL-related calls go to
// the constructor-argument loop (the media thread), and shmem-related calls go
// to the render thread.
-class CONTENT_EXPORT RendererGpuVideoDecoderFactories
- : public media::GpuVideoDecoderFactories {
+class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories
+ : public media::GpuVideoAcceleratorFactories {
public:
// Takes a ref on |gpu_channel_host| and tests |context| for loss before each
// use.
- RendererGpuVideoDecoderFactories(
+ RendererGpuVideoAcceleratorFactories(
GpuChannelHost* gpu_channel_host,
const scoped_refptr<base::MessageLoopProxy>& message_loop,
WebGraphicsContext3DCommandBufferImpl* wgc3dcbi);
- // media::GpuVideoDecoderFactories implementation.
- virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
- media::VideoCodecProfile profile,
- media::VideoDecodeAccelerator::Client* client) OVERRIDE;
+ // media::GpuVideoAcceleratorFactories implementation.
+ virtual scoped_ptr<media::VideoDecodeAccelerator>
+ CreateVideoDecodeAccelerator(
+ media::VideoCodecProfile profile,
+ media::VideoDecodeAccelerator::Client* client) OVERRIDE;
+ virtual scoped_ptr<media::VideoEncodeAccelerator>
+ CreateVideoEncodeAccelerator(
+ media::VideoEncodeAccelerator::Client* client) OVERRIDE;
// Creates textures and produces them into mailboxes. Returns a sync point to
// wait on before using the mailboxes, or 0 on failure.
- virtual uint32 CreateTextures(
- int32 count, const gfx::Size& size,
- std::vector<uint32>* texture_ids,
- std::vector<gpu::Mailbox>* texture_mailboxes,
- uint32 texture_target) OVERRIDE;
+ virtual uint32 CreateTextures(int32 count,
+ const gfx::Size& size,
+ std::vector<uint32>* texture_ids,
+ std::vector<gpu::Mailbox>* texture_mailboxes,
+ uint32 texture_target) OVERRIDE;
virtual void DeleteTexture(uint32 texture_id) OVERRIDE;
virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE;
virtual void ReadPixels(uint32 texture_id,
@@ -65,16 +69,14 @@ class CONTENT_EXPORT RendererGpuVideoDecoderFactories
virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE;
virtual void Abort() OVERRIDE;
virtual bool IsAborted() OVERRIDE;
-
- // Makes a copy of |this|.
- scoped_refptr<media::GpuVideoDecoderFactories> Clone();
+ scoped_refptr<RendererGpuVideoAcceleratorFactories> Clone();
protected:
- friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>;
- virtual ~RendererGpuVideoDecoderFactories();
+ friend class base::RefCountedThreadSafe<RendererGpuVideoAcceleratorFactories>;
+ virtual ~RendererGpuVideoAcceleratorFactories();
private:
- RendererGpuVideoDecoderFactories();
+ RendererGpuVideoAcceleratorFactories();
// Helper for the constructor to acquire the ContentGLContext on
// |message_loop_|.
@@ -85,19 +87,25 @@ class CONTENT_EXPORT RendererGpuVideoDecoderFactories
// (except for DeleteTexture, which is fire-and-forget).
// AsyncCreateSharedMemory runs on the renderer thread and the rest run on
// |message_loop_|.
- // The AsyncCreateVideoDecodeAccelerator returns its output in the vda_
- // member.
+ // AsyncCreateVideoDecodeAccelerator returns its output in the |vda_| member.
+ // AsyncCreateVideoEncodeAccelerator returns its output in the |vea_| member.
void AsyncCreateVideoDecodeAccelerator(
media::VideoCodecProfile profile,
media::VideoDecodeAccelerator::Client* client);
- void AsyncCreateTextures(int32 count, const gfx::Size& size,
- uint32 texture_target, uint32* sync_point);
+ void AsyncCreateVideoEncodeAccelerator(
+ media::VideoEncodeAccelerator::Client* client);
+ void AsyncCreateTextures(int32 count,
+ const gfx::Size& size,
+ uint32 texture_target,
+ uint32* sync_point);
void AsyncDeleteTexture(uint32 texture_id);
void AsyncWaitSyncPoint(uint32 sync_point);
- void AsyncReadPixels(uint32 texture_id, uint32 texture_target,
+ void AsyncReadPixels(uint32 texture_id,
+ uint32 texture_target,
const gfx::Size& size);
void AsyncCreateSharedMemory(size_t size);
void AsyncDestroyVideoDecodeAccelerator();
+ void AsyncDestroyVideoEncodeAccelerator();
scoped_refptr<base::MessageLoopProxy> message_loop_;
scoped_refptr<base::MessageLoopProxy> main_message_loop_;
@@ -116,9 +124,12 @@ class CONTENT_EXPORT RendererGpuVideoDecoderFactories
// message loop to indicate their completion. e.g. AsyncCreateSharedMemory.
base::WaitableEvent render_thread_async_waiter_;
- // The vda returned by the CreateVideoAcclelerator function.
+ // The vda returned by the CreateVideoDecodeAccelerator function.
scoped_ptr<media::VideoDecodeAccelerator> vda_;
+ // The vea returned by the CreateVideoEncodeAccelerator function.
+ scoped_ptr<media::VideoEncodeAccelerator> vea_;
+
// Shared memory segment which is returned by the CreateSharedMemory()
// function.
scoped_ptr<base::SharedMemory> shared_memory_segment_;
@@ -130,9 +141,9 @@ class CONTENT_EXPORT RendererGpuVideoDecoderFactories
std::vector<uint32> created_textures_;
std::vector<gpu::Mailbox> created_texture_mailboxes_;
- DISALLOW_COPY_AND_ASSIGN(RendererGpuVideoDecoderFactories);
+ DISALLOW_COPY_AND_ASSIGN(RendererGpuVideoAcceleratorFactories);
};
} // namespace content
-#endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
+#endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_ACCELERATOR_FACTORIES_H_

Powered by Google App Engine
This is Rietveld 408576698