| 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> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 bool* end_of_stream, | 56 bool* end_of_stream, |
| 57 bool* key_frame) override; | 57 bool* key_frame) override; |
| 58 void ReleaseOutputBuffer(int index, bool render) override; | 58 void ReleaseOutputBuffer(int index, bool render) override; |
| 59 MediaCodecStatus GetInputBuffer(int input_buffer_index, | 59 MediaCodecStatus GetInputBuffer(int input_buffer_index, |
| 60 uint8_t** data, | 60 uint8_t** data, |
| 61 size_t* capacity) override; | 61 size_t* capacity) override; |
| 62 MediaCodecStatus GetOutputBufferAddress(int index, | 62 MediaCodecStatus GetOutputBufferAddress(int index, |
| 63 size_t offset, | 63 size_t offset, |
| 64 const uint8_t** addr, | 64 const uint8_t** addr, |
| 65 size_t* capacity) override; | 65 size_t* capacity) override; |
| 66 std::string GetName() override; |
| 66 | 67 |
| 67 protected: | 68 protected: |
| 68 NdkMediaCodecBridge(const std::string& mime, | 69 NdkMediaCodecBridge(const std::string& mime, |
| 69 bool is_secure, | 70 bool is_secure, |
| 70 MediaCodecDirection direction); | 71 MediaCodecDirection direction); |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 struct AMediaCodecDeleter { | 74 struct AMediaCodecDeleter { |
| 74 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); } | 75 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); } |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 std::unique_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_; | 78 std::unique_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_; |
| 78 | 79 |
| 79 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge); | 80 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge); |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 } // namespace media | 83 } // namespace media |
| 83 | 84 |
| 84 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ | 85 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ |
| OLD | NEW |