OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_ENCODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_GPU_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ | 6 #define MEDIA_GPU_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <list> | 11 #include <list> |
12 #include <queue> | 12 #include <queue> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
18 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
19 #include "base/tuple.h" | 19 #include "base/tuple.h" |
20 #include "content/common/content_export.h" | |
21 #include "media/base/android/sdk_media_codec_bridge.h" | 20 #include "media/base/android/sdk_media_codec_bridge.h" |
| 21 #include "media/gpu/media_gpu_export.h" |
22 #include "media/video/video_encode_accelerator.h" | 22 #include "media/video/video_encode_accelerator.h" |
23 | 23 |
24 namespace media { | 24 namespace media { |
25 class BitstreamBuffer; | 25 class BitstreamBuffer; |
26 } // namespace media | 26 } // namespace media |
27 | 27 |
28 namespace content { | 28 namespace media { |
29 | 29 |
30 // Android-specific implementation of media::VideoEncodeAccelerator, enabling | 30 // Android-specific implementation of media::VideoEncodeAccelerator, enabling |
31 // hardware-acceleration of video encoding, based on Android's MediaCodec class | 31 // hardware-acceleration of video encoding, based on Android's MediaCodec class |
32 // (http://developer.android.com/reference/android/media/MediaCodec.html). This | 32 // (http://developer.android.com/reference/android/media/MediaCodec.html). This |
33 // class expects to live and be called on a single thread (the GPU process' | 33 // class expects to live and be called on a single thread (the GPU process' |
34 // ChildThread). | 34 // ChildThread). |
35 class CONTENT_EXPORT AndroidVideoEncodeAccelerator | 35 class MEDIA_GPU_EXPORT AndroidVideoEncodeAccelerator |
36 : public media::VideoEncodeAccelerator { | 36 : public media::VideoEncodeAccelerator { |
37 public: | 37 public: |
38 AndroidVideoEncodeAccelerator(); | 38 AndroidVideoEncodeAccelerator(); |
39 ~AndroidVideoEncodeAccelerator() override; | 39 ~AndroidVideoEncodeAccelerator() override; |
40 | 40 |
41 // media::VideoEncodeAccelerator implementation. | 41 // media::VideoEncodeAccelerator implementation. |
42 media::VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() | 42 media::VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() |
43 override; | 43 override; |
44 bool Initialize(media::VideoPixelFormat format, | 44 bool Initialize(media::VideoPixelFormat format, |
45 const gfx::Size& input_visible_size, | 45 const gfx::Size& input_visible_size, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 // Resolution of input stream. Set once in initialization and not allowed to | 103 // Resolution of input stream. Set once in initialization and not allowed to |
104 // change after. | 104 // change after. |
105 gfx::Size frame_size_; | 105 gfx::Size frame_size_; |
106 | 106 |
107 uint32_t last_set_bitrate_; // In bps. | 107 uint32_t last_set_bitrate_; // In bps. |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(AndroidVideoEncodeAccelerator); | 109 DISALLOW_COPY_AND_ASSIGN(AndroidVideoEncodeAccelerator); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace content | 112 } // namespace media |
113 | 113 |
114 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ | 114 #endif // MEDIA_GPU_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |