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 30 matching lines...) Expand all Loading... |
41 // object. | 41 // object. |
42 class MEDIA_EXPORT MediaCodecBridge { | 42 class MEDIA_EXPORT MediaCodecBridge { |
43 public: | 43 public: |
44 // Returns true if MediaCodec is available on the device. | 44 // Returns true if MediaCodec is available on the device. |
45 static bool IsAvailable(); | 45 static bool IsAvailable(); |
46 | 46 |
47 // Returns whether MediaCodecBridge has a decoder that |is_secure| and can | 47 // Returns whether MediaCodecBridge has a decoder that |is_secure| and can |
48 // decode |codec| type. | 48 // decode |codec| type. |
49 static bool CanDecode(const std::string& codec, bool is_secure); | 49 static bool CanDecode(const std::string& codec, bool is_secure); |
50 | 50 |
51 // Represents supported codecs on android. |secure_decoder_supported| is true | 51 // Represents supported codecs on android. |
52 // if secure decoder is available for the codec type. | |
53 // TODO(qinmin): Curretly the codecs string only contains one codec, do we | 52 // TODO(qinmin): Curretly the codecs string only contains one codec, do we |
54 // need more specific codecs separated by comma. (e.g. "vp8" -> "vp8, vp8.0") | 53 // need more specific codecs separated by comma. (e.g. "vp8" -> "vp8, vp8.0") |
55 struct CodecsInfo { | 54 struct CodecsInfo { |
56 std::string codecs; | 55 std::string codecs; |
57 std::string name; | 56 std::string name; |
58 bool secure_decoder_supported; | |
59 }; | 57 }; |
60 | 58 |
61 // Get a list of supported codecs. | 59 // Get a list of supported codecs. |
62 static void GetCodecsInfo(std::vector<CodecsInfo>* codecs_info); | 60 static void GetCodecsInfo(std::vector<CodecsInfo>* codecs_info); |
63 | 61 |
64 virtual ~MediaCodecBridge(); | 62 virtual ~MediaCodecBridge(); |
65 | 63 |
66 // Resets both input and output, all indices previously returned in calls to | 64 // Resets both input and output, all indices previously returned in calls to |
67 // DequeueInputBuffer() and DequeueOutputBuffer() become invalid. | 65 // DequeueInputBuffer() and DequeueOutputBuffer() become invalid. |
68 // Please note that this clears all the inputs in the media codec. In other | 66 // Please note that this clears all the inputs in the media codec. In other |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 bool Start(const VideoCodec& codec, const gfx::Size& size, jobject surface, | 205 bool Start(const VideoCodec& codec, const gfx::Size& size, jobject surface, |
208 jobject media_crypto); | 206 jobject media_crypto); |
209 | 207 |
210 private: | 208 private: |
211 VideoCodecBridge(const std::string& mime, bool is_secure); | 209 VideoCodecBridge(const std::string& mime, bool is_secure); |
212 }; | 210 }; |
213 | 211 |
214 } // namespace media | 212 } // namespace media |
215 | 213 |
216 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 214 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
OLD | NEW |