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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // when configuring this video decoder you can optionally render the buffer. | 116 // when configuring this video decoder you can optionally render the buffer. |
117 void ReleaseOutputBuffer(int index, bool render); | 117 void ReleaseOutputBuffer(int index, bool render); |
118 | 118 |
119 // Gets output buffers from media codec and keeps them inside the java class. | 119 // Gets output buffers from media codec and keeps them inside the java class. |
120 // To access them, use DequeueOutputBuffer(). | 120 // To access them, use DequeueOutputBuffer(). |
121 void GetOutputBuffers(); | 121 void GetOutputBuffers(); |
122 | 122 |
123 static bool RegisterMediaCodecBridge(JNIEnv* env); | 123 static bool RegisterMediaCodecBridge(JNIEnv* env); |
124 | 124 |
125 protected: | 125 protected: |
126 explicit MediaCodecBridge(const std::string& mime); | 126 MediaCodecBridge(const std::string& mime, bool is_secure); |
127 | 127 |
128 // Calls start() against the media codec instance. Used in StartXXX() after | 128 // Calls start() against the media codec instance. Used in StartXXX() after |
129 // configuring media codec. | 129 // configuring media codec. |
130 void StartInternal(); | 130 void StartInternal(); |
131 | 131 |
132 jobject media_codec() { return j_media_codec_.obj(); } | 132 jobject media_codec() { return j_media_codec_.obj(); } |
133 | 133 |
134 private: | 134 private: |
135 // Fills a particular input buffer and returns the size of copied data. | 135 // Fills a particular input buffer and returns the size of copied data. |
136 size_t FillInputBuffer(int index, const uint8* data, int data_size); | 136 size_t FillInputBuffer(int index, const uint8* data, int data_size); |
(...skipping 27 matching lines...) Expand all Loading... |
164 | 164 |
165 // Configure the java MediaFormat object with the extra codec data passed in. | 165 // Configure the java MediaFormat object with the extra codec data passed in. |
166 bool ConfigureMediaFormat(jobject j_format, const AudioCodec codec, | 166 bool ConfigureMediaFormat(jobject j_format, const AudioCodec codec, |
167 const uint8* extra_data, size_t extra_data_size); | 167 const uint8* extra_data, size_t extra_data_size); |
168 }; | 168 }; |
169 | 169 |
170 class MEDIA_EXPORT VideoCodecBridge : public MediaCodecBridge { | 170 class MEDIA_EXPORT VideoCodecBridge : public MediaCodecBridge { |
171 public: | 171 public: |
172 // Returns an VideoCodecBridge instance if |codec| is supported, or a NULL | 172 // Returns an VideoCodecBridge instance if |codec| is supported, or a NULL |
173 // pointer otherwise. | 173 // pointer otherwise. |
174 static VideoCodecBridge* Create(const VideoCodec codec); | 174 static VideoCodecBridge* Create(const VideoCodec codec, bool is_secure); |
175 | 175 |
176 // Start the video codec bridge. | 176 // Start the video codec bridge. |
177 // TODO(qinmin): Pass codec specific data if available. | 177 // TODO(qinmin): Pass codec specific data if available. |
178 bool Start(const VideoCodec codec, const gfx::Size& size, jobject surface, | 178 bool Start(const VideoCodec codec, const gfx::Size& size, jobject surface, |
179 jobject media_crypto); | 179 jobject media_crypto); |
180 | 180 |
181 private: | 181 private: |
182 explicit VideoCodecBridge(const std::string& mime); | 182 explicit VideoCodecBridge(const std::string& mime, bool is_secure); |
183 }; | 183 }; |
184 | 184 |
185 } // namespace media | 185 } // namespace media |
186 | 186 |
187 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 187 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
188 | 188 |
OLD | NEW |