OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ |
| 7 |
| 8 #include <list> |
| 9 #include <map> |
| 10 #include <queue> |
| 11 #include <string> |
| 12 #include <vector> |
| 13 |
| 14 #include "base/compiler_specific.h" |
| 15 #include "base/threading/thread_checker.h" |
| 16 #include "content/common/content_export.h" |
| 17 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 18 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
| 19 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 20 |
| 21 namespace content { |
| 22 // A BackingStrategy implementation that copies images to PictureBuffer |
| 23 // textures via gpu texture copy. |
| 24 class CONTENT_EXPORT AndroidCopyingBackingStrategy |
| 25 : public AndroidVideoDecodeAccelerator::BackingStrategy { |
| 26 public: |
| 27 AndroidCopyingBackingStrategy(); |
| 28 ~AndroidCopyingBackingStrategy() override; |
| 29 |
| 30 // AndroidVideoDecodeAccelerator::BackingStrategy |
| 31 void SetStateProvider(AndroidVideoDecodeAccelerator::StateProvider*) override; |
| 32 void Cleanup() override; |
| 33 uint32 GetNumPictureBuffers() const override; |
| 34 uint32 GetTextureTarget() const override; |
| 35 // TODO(liberato): should we just send in the state provider to Assign? |
| 36 // zero copy has an additional callback. |
| 37 void AssignCurrentSurfaceToPictureBuffer(int32 codec_buffer_index, |
| 38 const media::PictureBuffer&) override; |
| 39 |
| 40 private: |
| 41 // Used for copy the texture from surface texture to picture buffers. |
| 42 scoped_ptr<gpu::CopyTextureCHROMIUMResourceManager> copier_; |
| 43 |
| 44 AndroidVideoDecodeAccelerator::StateProvider* state_provider_; |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 |
| 49 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_ |
OLD | NEW |