| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // TODO(qinmin): implement the logic to switch between NDK and SDK | 156 // TODO(qinmin): implement the logic to switch between NDK and SDK |
| 157 // MediaCodecBridge. | 157 // MediaCodecBridge. |
| 158 class MEDIA_EXPORT VideoCodecBridge : public SdkMediaCodecBridge { | 158 class MEDIA_EXPORT VideoCodecBridge : public SdkMediaCodecBridge { |
| 159 public: | 159 public: |
| 160 // See MediaCodecUtil::IsKnownUnaccelerated(). | 160 // See MediaCodecUtil::IsKnownUnaccelerated(). |
| 161 static bool IsKnownUnaccelerated(const VideoCodec& codec, | 161 static bool IsKnownUnaccelerated(const VideoCodec& codec, |
| 162 MediaCodecDirection direction); | 162 MediaCodecDirection direction); |
| 163 | 163 |
| 164 // Create, start, and return a VideoCodecBridge decoder or NULL on failure. | 164 // Create, start, and return a VideoCodecBridge decoder or NULL on failure. |
| 165 static VideoCodecBridge* CreateDecoder( | 165 static VideoCodecBridge* CreateDecoder( |
| 166 const VideoCodec& codec, // e.g. media::kCodecVP8 | 166 const VideoCodec& codec, |
| 167 bool is_secure, // Will be used with encrypted content. | 167 bool is_secure, // Will be used with encrypted content. |
| 168 const gfx::Size& size, // Output frame size. | 168 const gfx::Size& size, // Output frame size. |
| 169 jobject surface, // Output surface, optional. | 169 jobject surface, // Output surface, optional. |
| 170 jobject media_crypto, // MediaCrypto object, optional. | 170 jobject media_crypto, // MediaCrypto object, optional. |
| 171 const std::vector<uint8_t>& |
| 172 csd0, // Codec specific data. See MediaCodec docs. |
| 173 const std::vector<uint8_t>& csd1, |
| 171 bool allow_adaptive_playback = | 174 bool allow_adaptive_playback = |
| 172 true, // Should adaptive playback be allowed if supported. | 175 true, // Should adaptive playback be allowed if supported. |
| 173 bool require_software_codec = false); // Require software decoder? | 176 bool require_software_codec = false); |
| 174 | 177 |
| 175 // Create, start, and return a VideoCodecBridge encoder or NULL on failure. | 178 // Create, start, and return a VideoCodecBridge encoder or NULL on failure. |
| 176 static VideoCodecBridge* CreateEncoder( | 179 static VideoCodecBridge* CreateEncoder( |
| 177 const VideoCodec& codec, // e.g. media::kCodecVP8 | 180 const VideoCodec& codec, // e.g. media::kCodecVP8 |
| 178 const gfx::Size& size, // input frame size | 181 const gfx::Size& size, // input frame size |
| 179 int bit_rate, // bits/second | 182 int bit_rate, // bits/second |
| 180 int frame_rate, // frames/second | 183 int frame_rate, // frames/second |
| 181 int i_frame_interval, // count | 184 int i_frame_interval, // count |
| 182 int color_format); // MediaCodecInfo.CodecCapabilities. | 185 int color_format); // MediaCodecInfo.CodecCapabilities. |
| 183 | 186 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 203 bool is_secure, | 206 bool is_secure, |
| 204 MediaCodecDirection direction, | 207 MediaCodecDirection direction, |
| 205 bool require_software_codec); | 208 bool require_software_codec); |
| 206 | 209 |
| 207 int adaptive_playback_supported_for_testing_; | 210 int adaptive_playback_supported_for_testing_; |
| 208 }; | 211 }; |
| 209 | 212 |
| 210 } // namespace media | 213 } // namespace media |
| 211 | 214 |
| 212 #endif // MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ | 215 #endif // MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ |
| OLD | NEW |