OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
18 #include "content/common/gpu/media/video_decode_accelerator_impl.h" | 18 #include "media/types/video_decode_accelerator_impl.h" |
19 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" | 19 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
20 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 20 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
21 #include "media/base/android/media_codec_bridge.h" | 21 #include "media/base/android/media_codec_bridge.h" |
22 #include "media/video/video_decode_accelerator.h" | 22 #include "media/video/video_decode_accelerator.h" |
23 | 23 |
24 namespace gfx { | 24 namespace gfx { |
25 class SurfaceTexture; | 25 class SurfaceTexture; |
26 } | 26 } |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 // A VideoDecodeAccelerator implementation for Android. | 29 // A VideoDecodeAccelerator implementation for Android. |
30 // This class decodes the input encoded stream by using Android's MediaCodec | 30 // This class decodes the input encoded stream by using Android's MediaCodec |
31 // class. http://developer.android.com/reference/android/media/MediaCodec.html | 31 // class. http://developer.android.com/reference/android/media/MediaCodec.html |
32 class CONTENT_EXPORT AndroidVideoDecodeAccelerator | 32 class CONTENT_EXPORT AndroidVideoDecodeAccelerator |
33 : public VideoDecodeAcceleratorImpl { | 33 : public media::VideoDecodeAcceleratorImpl { |
34 public: | 34 public: |
35 // Does not take ownership of |client| which must outlive |*this|. | 35 // Does not take ownership of |client| which must outlive |*this|. |
36 AndroidVideoDecodeAccelerator( | 36 AndroidVideoDecodeAccelerator( |
37 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, | 37 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, |
38 const base::Callback<bool(void)>& make_context_current); | 38 const base::Callback<bool(void)>& make_context_current); |
39 | 39 |
40 // media::VideoDecodeAccelerator implementation. | 40 // media::VideoDecodeAccelerator implementation. |
41 virtual bool Initialize(media::VideoCodecProfile profile, | 41 virtual bool Initialize(media::VideoCodecProfile profile, |
42 Client* client) OVERRIDE; | 42 Client* client) OVERRIDE; |
43 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; | 43 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 // WeakPtrFactory for posting tasks back to |this|. | 164 // WeakPtrFactory for posting tasks back to |this|. |
165 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 165 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
166 | 166 |
167 friend class AndroidVideoDecodeAcceleratorTest; | 167 friend class AndroidVideoDecodeAcceleratorTest; |
168 }; | 168 }; |
169 | 169 |
170 } // namespace content | 170 } // namespace content |
171 | 171 |
172 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 172 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |