OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ |
6 #define MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ |
7 | 7 |
8 #include <media/NdkMediaCodec.h> | 8 #include <media/NdkMediaCodec.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 | 11 |
| 12 #include <memory> |
| 13 |
12 #include "base/macros.h" | 14 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
15 #include "media/base/android/media_codec_bridge.h" | 16 #include "media/base/android/media_codec_bridge.h" |
16 #include "media/base/media_export.h" | 17 #include "media/base/media_export.h" |
17 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 class MEDIA_EXPORT NdkMediaCodecBridge : public MediaCodecBridge { | 22 class MEDIA_EXPORT NdkMediaCodecBridge : public MediaCodecBridge { |
22 public: | 23 public: |
23 ~NdkMediaCodecBridge() override; | 24 ~NdkMediaCodecBridge() override; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 protected: | 66 protected: |
66 NdkMediaCodecBridge(const std::string& mime, | 67 NdkMediaCodecBridge(const std::string& mime, |
67 bool is_secure, | 68 bool is_secure, |
68 MediaCodecDirection direction); | 69 MediaCodecDirection direction); |
69 | 70 |
70 private: | 71 private: |
71 struct AMediaCodecDeleter { | 72 struct AMediaCodecDeleter { |
72 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); } | 73 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); } |
73 }; | 74 }; |
74 | 75 |
75 scoped_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_; | 76 std::unique_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_; |
76 | 77 |
77 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge); | 78 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge); |
78 }; | 79 }; |
79 | 80 |
80 } // namespace media | 81 } // namespace media |
81 | 82 |
82 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ | 83 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ |
OLD | NEW |