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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 int* index, | 52 int* index, |
53 size_t* offset, | 53 size_t* offset, |
54 size_t* size, | 54 size_t* size, |
55 base::TimeDelta* presentation_time, | 55 base::TimeDelta* presentation_time, |
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 CopyFromOutputBuffer(int index, | 62 MediaCodecStatus GetOutputBufferAddress(int index, |
63 size_t offset, | 63 size_t offset, |
64 void* dst, | 64 const uint8_t** addr, |
65 size_t num) override; | 65 size_t* capacity) override; |
66 | 66 |
67 protected: | 67 protected: |
68 NdkMediaCodecBridge(const std::string& mime, | 68 NdkMediaCodecBridge(const std::string& mime, |
69 bool is_secure, | 69 bool is_secure, |
70 MediaCodecDirection direction); | 70 MediaCodecDirection direction); |
71 | 71 |
72 private: | 72 private: |
73 struct AMediaCodecDeleter { | 73 struct AMediaCodecDeleter { |
74 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); } | 74 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); } |
75 }; | 75 }; |
76 | 76 |
77 std::unique_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_; | 77 std::unique_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge); | 79 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge); |
80 }; | 80 }; |
81 | 81 |
82 } // namespace media | 82 } // namespace media |
83 | 83 |
84 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ | 84 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ |
OLD | NEW |