Chromium Code Reviews| Index: media/filters/gpu_video_decoder_factories.h |
| diff --git a/media/filters/gpu_video_decoder_factories.h b/media/filters/gpu_video_decoder_factories.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e2e30610f21f7279d6dfec704b8c522031c825d0 |
| --- /dev/null |
| +++ b/media/filters/gpu_video_decoder_factories.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_FACTORIES_H_ |
| +#define MEDIA_FILTERS_GPU_VIDEO_DECODER_FACTORIES_H_ |
| + |
| +#include "media/video/video_decode_accelerator.h" |
| + |
| +template <class T> |
| +class scoped_refptr; |
|
scherkus (not reviewing)
2013/07/19 18:00:54
don't think you need to fwd decl considering you'r
wuchengli
2013/07/20 03:15:47
Good eyes. :) I didn't really look at the original
|
| + |
| +namespace base { |
| +class MessageLoopProxy; |
| +class SharedMemory; |
| +} |
| + |
| +class SkBitmap; |
| + |
| +namespace media { |
| + |
| +// Helper interface for specifying factories needed to instantiate a hardware |
| +// video decoder. |
| +class MEDIA_EXPORT GpuVideoDecoderFactories |
| + : public base::RefCountedThreadSafe<GpuVideoDecoderFactories> { |
| + public: |
| + // Caller owns returned pointer. |
| + virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
| + VideoCodecProfile profile, |
| + VideoDecodeAccelerator::Client* client) = 0; |
| + |
| + // Allocate & delete native textures. |
| + virtual uint32 CreateTextures(int32 count, |
| + const gfx::Size& size, |
| + std::vector<uint32>* texture_ids, |
| + std::vector<gpu::Mailbox>* texture_mailboxes, |
| + uint32 texture_target) = 0; |
| + virtual void DeleteTexture(uint32 texture_id) = 0; |
| + |
| + virtual void WaitSyncPoint(uint32 sync_point) = 0; |
| + |
| + // Read pixels from a native texture and store into |pixels| as RGBA. |
| + virtual void ReadPixels(uint32 texture_id, |
| + uint32 texture_target, |
| + const gfx::Size& size, |
| + const SkBitmap& pixels) = 0; |
| + |
| + // Allocate & return a shared memory segment. Caller is responsible for |
| + // Close()ing the returned pointer. |
| + virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; |
| + |
| + // Returns the message loop the VideoDecodeAccelerator runs on. |
| + virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; |
| + |
| + // Abort any outstanding factory operations and error any future |
| + // attempts at factory operations |
| + virtual void Abort() = 0; |
| + |
| + // Returns true if Abort() has been called. |
| + virtual bool IsAborted() = 0; |
| + |
| + protected: |
| + friend class base::RefCountedThreadSafe<GpuVideoDecoderFactories>; |
| + virtual ~GpuVideoDecoderFactories(); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_FACTORIES_H_ |