| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PEPPER_VIDEO_DECODER_SHIM_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ | 6 #define CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/message_loop/message_loop_proxy.h" | |
| 17 #include "gpu/command_buffer/common/mailbox.h" | 16 #include "gpu/command_buffer/common/mailbox.h" |
| 18 #include "media/base/video_decoder_config.h" | 17 #include "media/base/video_decoder_config.h" |
| 19 #include "media/video/video_decode_accelerator.h" | 18 #include "media/video/video_decode_accelerator.h" |
| 20 | 19 |
| 21 #include "ppapi/c/pp_codecs.h" | 20 #include "ppapi/c/pp_codecs.h" |
| 22 | 21 |
| 22 namespace base { |
| 23 class SingleThreadTaskRunner; |
| 24 } |
| 25 |
| 23 namespace gpu { | 26 namespace gpu { |
| 24 namespace gles2 { | 27 namespace gles2 { |
| 25 class GLES2Interface; | 28 class GLES2Interface; |
| 26 } | 29 } |
| 27 } | 30 } |
| 28 | 31 |
| 29 namespace media { | 32 namespace media { |
| 30 class DecoderBuffer; | 33 class DecoderBuffer; |
| 31 } | 34 } |
| 32 | 35 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 void DismissTexture(uint32_t texture_id); | 85 void DismissTexture(uint32_t texture_id); |
| 83 void DeleteTexture(uint32_t texture_id); | 86 void DeleteTexture(uint32_t texture_id); |
| 84 // Call this whenever we change GL state that the plugin relies on, such as | 87 // Call this whenever we change GL state that the plugin relies on, such as |
| 85 // creating picture textures. | 88 // creating picture textures. |
| 86 void FlushCommandBuffer(); | 89 void FlushCommandBuffer(); |
| 87 | 90 |
| 88 scoped_ptr<DecoderImpl> decoder_impl_; | 91 scoped_ptr<DecoderImpl> decoder_impl_; |
| 89 State state_; | 92 State state_; |
| 90 | 93 |
| 91 PepperVideoDecoderHost* host_; | 94 PepperVideoDecoderHost* host_; |
| 92 scoped_refptr<base::MessageLoopProxy> media_message_loop_; | 95 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; |
| 93 scoped_refptr<webkit::gpu::ContextProviderWebContext> context_provider_; | 96 scoped_refptr<webkit::gpu::ContextProviderWebContext> context_provider_; |
| 94 | 97 |
| 95 // The current decoded frame size. | 98 // The current decoded frame size. |
| 96 gfx::Size texture_size_; | 99 gfx::Size texture_size_; |
| 97 // Map that takes the plugin's GL texture id to the renderer's GL texture id. | 100 // Map that takes the plugin's GL texture id to the renderer's GL texture id. |
| 98 typedef base::hash_map<uint32_t, uint32_t> TextureIdMap; | 101 typedef base::hash_map<uint32_t, uint32_t> TextureIdMap; |
| 99 TextureIdMap texture_id_map_; | 102 TextureIdMap texture_id_map_; |
| 100 // Available textures (these are plugin ids.) | 103 // Available textures (these are plugin ids.) |
| 101 typedef base::hash_set<uint32_t> TextureIdSet; | 104 typedef base::hash_set<uint32_t> TextureIdSet; |
| 102 TextureIdSet available_textures_; | 105 TextureIdSet available_textures_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 120 uint32_t num_pending_decodes_; | 123 uint32_t num_pending_decodes_; |
| 121 | 124 |
| 122 base::WeakPtrFactory<VideoDecoderShim> weak_ptr_factory_; | 125 base::WeakPtrFactory<VideoDecoderShim> weak_ptr_factory_; |
| 123 | 126 |
| 124 DISALLOW_COPY_AND_ASSIGN(VideoDecoderShim); | 127 DISALLOW_COPY_AND_ASSIGN(VideoDecoderShim); |
| 125 }; | 128 }; |
| 126 | 129 |
| 127 } // namespace content | 130 } // namespace content |
| 128 | 131 |
| 129 #endif // CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ | 132 #endif // CONTENT_RENDERER_PEPPER_VIDEO_DECODER_SHIM_H_ |
| OLD | NEW |