Chromium Code Reviews| 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 <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 // and ready to be StartAudio/Video()ed again. HOWEVER, due to the buggy | 95 // and ready to be StartAudio/Video()ed again. HOWEVER, due to the buggy |
| 96 // vendor's implementation , b/8125974, Stop() -> StartAudio/Video() may not | 96 // vendor's implementation , b/8125974, Stop() -> StartAudio/Video() may not |
| 97 // work on some devices. For reliability, Stop() -> delete and recreate new | 97 // work on some devices. For reliability, Stop() -> delete and recreate new |
| 98 // instance -> StartAudio/Video() is recommended. | 98 // instance -> StartAudio/Video() is recommended. |
| 99 void Stop(); | 99 void Stop(); |
| 100 | 100 |
| 101 // Used for getting output format. This is valid after DequeueInputBuffer() | 101 // Used for getting output format. This is valid after DequeueInputBuffer() |
| 102 // returns a format change by returning INFO_OUTPUT_FORMAT_CHANGED | 102 // returns a format change by returning INFO_OUTPUT_FORMAT_CHANGED |
| 103 void GetOutputFormat(int* width, int* height); | 103 void GetOutputFormat(int* width, int* height); |
| 104 | 104 |
| 105 // Returns the number of input buffers used by the codec. | |
| 106 int GetInputBuffersCount(); | |
| 107 | |
| 108 // Submits a byte array to the given input buffer. Call this after getting an | 105 // Submits a byte array to the given input buffer. Call this after getting an |
| 109 // available buffer from DequeueInputBuffer(). If |data| is NULL, assume the | 106 // available buffer from DequeueInputBuffer(). If |data| is NULL, assume the |
| 110 // input buffer has already been populated (but still obey |size|). | 107 // input buffer has already been populated (but still obey |size|). |
| 111 // |data_size| must be less than kint32max (because Java). | 108 // |data_size| must be less than kint32max (because Java). |
| 112 MediaCodecStatus QueueInputBuffer(int index, | 109 MediaCodecStatus QueueInputBuffer(int index, |
| 113 const uint8* data, | 110 const uint8* data, |
| 114 size_t data_size, | 111 size_t data_size, |
| 115 const base::TimeDelta& presentation_time); | 112 const base::TimeDelta& presentation_time); |
| 116 | 113 |
| 117 // Similar to the above call, but submits a buffer that is encrypted. Note: | 114 // Similar to the above call, but submits a buffer that is encrypted. Note: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 size_t* size, | 154 size_t* size, |
| 158 base::TimeDelta* presentation_time, | 155 base::TimeDelta* presentation_time, |
| 159 bool* end_of_stream, | 156 bool* end_of_stream, |
| 160 bool* key_frame); | 157 bool* key_frame); |
| 161 | 158 |
| 162 // Returns the buffer to the codec. If you previously specified a surface when | 159 // Returns the buffer to the codec. If you previously specified a surface when |
| 163 // configuring this video decoder you can optionally render the buffer. | 160 // configuring this video decoder you can optionally render the buffer. |
| 164 void ReleaseOutputBuffer(int index, bool render); | 161 void ReleaseOutputBuffer(int index, bool render); |
| 165 | 162 |
| 166 // Returns the number of output buffers used by the codec. | 163 // Returns the number of output buffers used by the codec. |
| 164 // TODO(qinmin): this call is deprecated in Lollicap. | |
|
mcasas
2014/10/23 07:19:28
s/Lollicap/Lollipop/
qinmin
2014/10/23 22:42:52
Done.
| |
| 167 int GetOutputBuffersCount(); | 165 int GetOutputBuffersCount(); |
| 168 | 166 |
| 169 // Returns the capacity of each output buffer used by the codec. | 167 // Returns the capacity of each output buffer used by the codec. |
| 168 // TODO(qinmin): this call is deprecated in Lollicap. | |
|
mcasas
2014/10/23 07:19:28
Idem.
qinmin
2014/10/23 22:42:52
Done.
| |
| 170 size_t GetOutputBuffersCapacity(); | 169 size_t GetOutputBuffersCapacity(); |
| 171 | 170 |
| 172 // Gets output buffers from media codec and keeps them inside the java class. | |
| 173 // To access them, use DequeueOutputBuffer(). Returns whether output buffers | |
| 174 // were successfully obtained. | |
| 175 bool GetOutputBuffers() WARN_UNUSED_RESULT; | |
| 176 | |
| 177 // Returns an input buffer's base pointer and capacity. | 171 // Returns an input buffer's base pointer and capacity. |
| 178 void GetInputBuffer(int input_buffer_index, uint8** data, size_t* capacity); | 172 void GetInputBuffer(int input_buffer_index, uint8** data, size_t* capacity); |
| 179 | 173 |
| 180 // Copy |dst_size| bytes from output buffer |index|'s |offset| onwards into | 174 // Copy |dst_size| bytes from output buffer |index|'s |offset| onwards into |
| 181 // |*dst|. | 175 // |*dst|. |
| 182 bool CopyFromOutputBuffer(int index, size_t offset, void* dst, int dst_size); | 176 bool CopyFromOutputBuffer(int index, size_t offset, void* dst, int dst_size); |
| 183 | 177 |
| 184 static bool RegisterMediaCodecBridge(JNIEnv* env); | 178 static bool RegisterMediaCodecBridge(JNIEnv* env); |
| 185 | 179 |
| 186 protected: | 180 protected: |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 VideoCodecBridge(const std::string& mime, | 282 VideoCodecBridge(const std::string& mime, |
| 289 bool is_secure, | 283 bool is_secure, |
| 290 MediaCodecDirection direction); | 284 MediaCodecDirection direction); |
| 291 | 285 |
| 292 int adaptive_playback_supported_for_testing_; | 286 int adaptive_playback_supported_for_testing_; |
| 293 }; | 287 }; |
| 294 | 288 |
| 295 } // namespace media | 289 } // namespace media |
| 296 | 290 |
| 297 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 291 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| OLD | NEW |