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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 virtual ~MediaCodecBridge(); | 51 virtual ~MediaCodecBridge(); |
52 | 52 |
53 // Resets both input and output, all indices previously returned in calls to | 53 // Resets both input and output, all indices previously returned in calls to |
54 // DequeueInputBuffer() and DequeueOutputBuffer() become invalid. | 54 // DequeueInputBuffer() and DequeueOutputBuffer() become invalid. |
55 // Please note that this clears all the inputs in the media codec. In other | 55 // Please note that this clears all the inputs in the media codec. In other |
56 // words, there will be no outputs until new input is provided. | 56 // words, there will be no outputs until new input is provided. |
57 void Reset(); | 57 // Returns MEDIA_CODEC_ERROR if an unexpected error happens, or Media_CODEC_OK |
| 58 // otherwise. |
| 59 MediaCodecStatus Reset(); |
58 | 60 |
59 // Finishes the decode/encode session. The instance remains active | 61 // Finishes the decode/encode session. The instance remains active |
60 // and ready to be StartAudio/Video()ed again. HOWEVER, due to the buggy | 62 // and ready to be StartAudio/Video()ed again. HOWEVER, due to the buggy |
61 // vendor's implementation , b/8125974, Stop() -> StartAudio/Video() may not | 63 // vendor's implementation , b/8125974, Stop() -> StartAudio/Video() may not |
62 // work on some devices. For reliability, Stop() -> delete and recreate new | 64 // work on some devices. For reliability, Stop() -> delete and recreate new |
63 // instance -> StartAudio/Video() is recommended. | 65 // instance -> StartAudio/Video() is recommended. |
64 void Stop(); | 66 void Stop(); |
65 | 67 |
66 // Used for getting output format. This is valid after DequeueInputBuffer() | 68 // Used for getting output format. This is valid after DequeueInputBuffer() |
67 // returns a format change by returning INFO_OUTPUT_FORMAT_CHANGED | 69 // returns a format change by returning INFO_OUTPUT_FORMAT_CHANGED |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 jobject media_crypto); | 179 jobject media_crypto); |
178 | 180 |
179 private: | 181 private: |
180 explicit VideoCodecBridge(const std::string& mime); | 182 explicit VideoCodecBridge(const std::string& mime); |
181 }; | 183 }; |
182 | 184 |
183 } // namespace media | 185 } // namespace media |
184 | 186 |
185 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 187 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
186 | 188 |
OLD | NEW |