| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 bool Start(const AudioCodec codec, int sample_rate, int channel_count, | 113 bool Start(const AudioCodec codec, int sample_rate, int channel_count, |
| 114 const uint8* extra_data, size_t extra_data_size, | 114 const uint8* extra_data, size_t extra_data_size, |
| 115 bool play_audio); | 115 bool play_audio); |
| 116 | 116 |
| 117 // Play the output buffer. This call must be called after | 117 // Play the output buffer. This call must be called after |
| 118 // DequeueOutputBuffer() and before ReleaseOutputBuffer. | 118 // DequeueOutputBuffer() and before ReleaseOutputBuffer. |
| 119 void PlayOutputBuffer(int index, size_t size); | 119 void PlayOutputBuffer(int index, size_t size); |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 explicit AudioCodecBridge(const char* mime); | 122 explicit AudioCodecBridge(const char* mime); |
| 123 |
| 124 // Configure the java MediaFormat object with the extra codec data passed in. |
| 125 bool ConfigureMediaFormat(jobject j_format, const AudioCodec codec, |
| 126 const uint8* extra_data, size_t extra_data_size); |
| 123 }; | 127 }; |
| 124 | 128 |
| 125 class VideoCodecBridge : public MediaCodecBridge { | 129 class VideoCodecBridge : public MediaCodecBridge { |
| 126 public: | 130 public: |
| 127 // Returns an VideoCodecBridge instance if |codec| is supported, or a NULL | 131 // Returns an VideoCodecBridge instance if |codec| is supported, or a NULL |
| 128 // pointer otherwise. | 132 // pointer otherwise. |
| 129 static VideoCodecBridge* Create(const VideoCodec codec); | 133 static VideoCodecBridge* Create(const VideoCodec codec); |
| 130 | 134 |
| 131 // Start the video codec bridge. | 135 // Start the video codec bridge. |
| 132 // TODO(qinmin): Pass codec specific data if available. | 136 // TODO(qinmin): Pass codec specific data if available. |
| 133 bool Start( | 137 bool Start( |
| 134 const VideoCodec codec, const gfx::Size& size, jobject surface); | 138 const VideoCodec codec, const gfx::Size& size, jobject surface); |
| 135 | 139 |
| 136 private: | 140 private: |
| 137 explicit VideoCodecBridge(const char* mime); | 141 explicit VideoCodecBridge(const char* mime); |
| 138 }; | 142 }; |
| 139 | 143 |
| 140 } // namespace media | 144 } // namespace media |
| 141 | 145 |
| 142 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 146 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| 143 | 147 |
| OLD | NEW |