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