| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 // Copy |num| bytes from output buffer |index|'s |offset| into the memory | 154 // Copy |num| bytes from output buffer |index|'s |offset| into the memory |
| 155 // region pointed to by |dst|. To avoid overflows, the size of both source | 155 // region pointed to by |dst|. To avoid overflows, the size of both source |
| 156 // and destination must be at least |num| bytes, and should not overlap. | 156 // and destination must be at least |num| bytes, and should not overlap. |
| 157 // Returns MEDIA_CODEC_ERROR if an error occurs, or MEDIA_CODEC_OK otherwise. | 157 // Returns MEDIA_CODEC_ERROR if an error occurs, or MEDIA_CODEC_OK otherwise. |
| 158 virtual MediaCodecStatus CopyFromOutputBuffer(int index, | 158 virtual MediaCodecStatus CopyFromOutputBuffer(int index, |
| 159 size_t offset, | 159 size_t offset, |
| 160 void* dst, | 160 void* dst, |
| 161 size_t num) = 0; | 161 size_t num) = 0; |
| 162 | 162 |
| 163 // Get the component name. Before API level 18, this will return an empty |
| 164 // string. |
| 165 virtual std::string GetName() = 0; |
| 166 |
| 163 protected: | 167 protected: |
| 164 MediaCodecBridge(); | 168 MediaCodecBridge(); |
| 165 | 169 |
| 166 // Fills a particular input buffer; returns false if |data_size| exceeds the | 170 // Fills a particular input buffer; returns false if |data_size| exceeds the |
| 167 // input buffer's capacity (and doesn't touch the input buffer in that case). | 171 // input buffer's capacity (and doesn't touch the input buffer in that case). |
| 168 bool FillInputBuffer(int index, | 172 bool FillInputBuffer(int index, |
| 169 const uint8_t* data, | 173 const uint8_t* data, |
| 170 size_t data_size) WARN_UNUSED_RESULT; | 174 size_t data_size) WARN_UNUSED_RESULT; |
| 171 | 175 |
| 172 DISALLOW_COPY_AND_ASSIGN(MediaCodecBridge); | 176 DISALLOW_COPY_AND_ASSIGN(MediaCodecBridge); |
| 173 }; | 177 }; |
| 174 | 178 |
| 175 } // namespace media | 179 } // namespace media |
| 176 | 180 |
| 177 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 181 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| OLD | NEW |