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_SDK_MEDIA_CODEC_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ |
6 #define MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 int* index, | 57 int* index, |
58 size_t* offset, | 58 size_t* offset, |
59 size_t* size, | 59 size_t* size, |
60 base::TimeDelta* presentation_time, | 60 base::TimeDelta* presentation_time, |
61 bool* end_of_stream, | 61 bool* end_of_stream, |
62 bool* key_frame) override; | 62 bool* key_frame) override; |
63 void ReleaseOutputBuffer(int index, bool render) override; | 63 void ReleaseOutputBuffer(int index, bool render) override; |
64 MediaCodecStatus GetInputBuffer(int input_buffer_index, | 64 MediaCodecStatus GetInputBuffer(int input_buffer_index, |
65 uint8_t** data, | 65 uint8_t** data, |
66 size_t* capacity) override; | 66 size_t* capacity) override; |
67 MediaCodecStatus CopyFromOutputBuffer(int index, | 67 MediaCodecStatus GetOutputBufferAddress(int index, |
68 size_t offset, | 68 size_t offset, |
69 void* dst, | 69 const uint8_t** addr, |
70 size_t num) override; | 70 size_t* capacity) override; |
71 | 71 |
72 static bool RegisterSdkMediaCodecBridge(JNIEnv* env); | 72 static bool RegisterSdkMediaCodecBridge(JNIEnv* env); |
73 | 73 |
74 protected: | 74 protected: |
75 SdkMediaCodecBridge(const std::string& mime, | 75 SdkMediaCodecBridge(const std::string& mime, |
76 bool is_secure, | 76 bool is_secure, |
77 MediaCodecDirection direction); | 77 MediaCodecDirection direction); |
78 | 78 |
79 // Called to get the buffer address given the output buffer index and offset. | |
80 // The size of available data to read is written to |*capacity| and the | |
81 // address to read from is written to |*addr|. | |
82 // Returns MEDIA_CODEC_ERROR if a error occurs, or MEDIA_CODEC_OK otherwise. | |
83 MediaCodecStatus GetOutputBufferAddress(int index, | |
84 size_t offset, | |
85 void** addr, | |
86 size_t* capacity); | |
87 | 79 |
88 jobject media_codec() { return j_media_codec_.obj(); } | 80 jobject media_codec() { return j_media_codec_.obj(); } |
89 MediaCodecDirection direction_; | 81 MediaCodecDirection direction_; |
90 | 82 |
91 private: | 83 private: |
92 // Java MediaCodec instance. | 84 // Java MediaCodec instance. |
93 base::android::ScopedJavaGlobalRef<jobject> j_media_codec_; | 85 base::android::ScopedJavaGlobalRef<jobject> j_media_codec_; |
94 | 86 |
95 DISALLOW_COPY_AND_ASSIGN(SdkMediaCodecBridge); | 87 DISALLOW_COPY_AND_ASSIGN(SdkMediaCodecBridge); |
96 }; | 88 }; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 VideoCodecBridge(const std::string& mime, | 198 VideoCodecBridge(const std::string& mime, |
207 bool is_secure, | 199 bool is_secure, |
208 MediaCodecDirection direction); | 200 MediaCodecDirection direction); |
209 | 201 |
210 int adaptive_playback_supported_for_testing_; | 202 int adaptive_playback_supported_for_testing_; |
211 }; | 203 }; |
212 | 204 |
213 } // namespace media | 205 } // namespace media |
214 | 206 |
215 #endif // MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ | 207 #endif // MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ |
OLD | NEW |