James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | //#define LOG_NDEBUG 0 |
| 18 | #define LOG_TAG "AACEncoder" |
| 19 | #include <utils/Log.h> |
| 20 | |
| 21 | #include "AACEncoder.h" |
| 22 | #include "voAAC.h" |
| 23 | #include "cmnMemory.h" |
| 24 | |
James Dong | f1d5aa1 | 2012-02-06 23:46:37 -0800 | [diff] [blame] | 25 | #include <media/stagefright/foundation/ADebug.h> |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 26 | #include <media/stagefright/MediaBufferGroup.h> |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 27 | #include <media/stagefright/MediaDefs.h> |
| 28 | #include <media/stagefright/MediaErrors.h> |
| 29 | #include <media/stagefright/MetaData.h> |
| 30 | |
| 31 | namespace android { |
| 32 | |
| 33 | AACEncoder::AACEncoder(const sp<MediaSource> &source, const sp<MetaData> &meta) |
| 34 | : mSource(source), |
| 35 | mMeta(meta), |
| 36 | mStarted(false), |
| 37 | mBufferGroup(NULL), |
| 38 | mInputBuffer(NULL), |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 39 | mInputFrame(NULL), |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 40 | mEncoderHandle(NULL), |
| 41 | mApiHandle(NULL), |
| 42 | mMemOperator(NULL) { |
| 43 | } |
| 44 | |
| 45 | status_t AACEncoder::initCheck() { |
| 46 | CHECK(mApiHandle == NULL && mEncoderHandle == NULL); |
| 47 | CHECK(mMeta->findInt32(kKeySampleRate, &mSampleRate)); |
| 48 | CHECK(mMeta->findInt32(kKeyChannelCount, &mChannels)); |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 49 | CHECK(mChannels <= 2 && mChannels >= 1); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 50 | CHECK(mMeta->findInt32(kKeyBitRate, &mBitRate)); |
| 51 | |
| 52 | mApiHandle = new VO_AUDIO_CODECAPI; |
| 53 | CHECK(mApiHandle); |
| 54 | |
| 55 | if (VO_ERR_NONE != voGetAACEncAPI(mApiHandle)) { |
Steve Block | 29357bc | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 56 | ALOGE("Failed to get api handle"); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 57 | return UNKNOWN_ERROR; |
| 58 | } |
| 59 | |
| 60 | mMemOperator = new VO_MEM_OPERATOR; |
| 61 | CHECK(mMemOperator != NULL); |
| 62 | mMemOperator->Alloc = cmnMemAlloc; |
| 63 | mMemOperator->Copy = cmnMemCopy; |
| 64 | mMemOperator->Free = cmnMemFree; |
| 65 | mMemOperator->Set = cmnMemSet; |
| 66 | mMemOperator->Check = cmnMemCheck; |
| 67 | |
| 68 | VO_CODEC_INIT_USERDATA userData; |
| 69 | memset(&userData, 0, sizeof(userData)); |
| 70 | userData.memflag = VO_IMF_USERMEMOPERATOR; |
| 71 | userData.memData = (VO_PTR) mMemOperator; |
| 72 | if (VO_ERR_NONE != mApiHandle->Init(&mEncoderHandle, VO_AUDIO_CodingAAC, &userData)) { |
Steve Block | 29357bc | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 73 | ALOGE("Failed to init AAC encoder"); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 74 | return UNKNOWN_ERROR; |
| 75 | } |
| 76 | if (OK != setAudioSpecificConfigData()) { |
Steve Block | 29357bc | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 77 | ALOGE("Failed to configure AAC encoder"); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 78 | return UNKNOWN_ERROR; |
| 79 | } |
| 80 | |
| 81 | // Configure AAC encoder$ |
| 82 | AACENC_PARAM params; |
| 83 | memset(¶ms, 0, sizeof(params)); |
| 84 | params.sampleRate = mSampleRate; |
| 85 | params.bitRate = mBitRate; |
| 86 | params.nChannels = mChannels; |
James Dong | 760943b | 2011-03-21 14:29:38 -0700 | [diff] [blame] | 87 | params.adtsUsed = 0; // We add adts header in the file writer if needed. |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 88 | if (VO_ERR_NONE != mApiHandle->SetParam(mEncoderHandle, VO_PID_AAC_ENCPARAM, ¶ms)) { |
Steve Block | 29357bc | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 89 | ALOGE("Failed to set AAC encoder parameters"); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 90 | return UNKNOWN_ERROR; |
| 91 | } |
| 92 | |
| 93 | return OK; |
| 94 | } |
| 95 | |
| 96 | static status_t getSampleRateTableIndex(int32_t sampleRate, int32_t &index) { |
| 97 | static const int32_t kSampleRateTable[] = { |
| 98 | 96000, 88200, 64000, 48000, 44100, 32000, |
| 99 | 24000, 22050, 16000, 12000, 11025, 8000 |
| 100 | }; |
| 101 | const int32_t tableSize = sizeof(kSampleRateTable) / sizeof(kSampleRateTable[0]); |
| 102 | for (int32_t i = 0; i < tableSize; ++i) { |
| 103 | if (sampleRate == kSampleRateTable[i]) { |
| 104 | index = i; |
| 105 | return OK; |
| 106 | } |
| 107 | } |
| 108 | |
Steve Block | 29357bc | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 109 | ALOGE("Sampling rate %d bps is not supported", sampleRate); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 110 | return UNKNOWN_ERROR; |
| 111 | } |
| 112 | |
| 113 | status_t AACEncoder::setAudioSpecificConfigData() { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 114 | ALOGV("setAudioSpecificConfigData: %d hz, %d bps, and %d channels", |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 115 | mSampleRate, mBitRate, mChannels); |
| 116 | |
James Dong | f1d5aa1 | 2012-02-06 23:46:37 -0800 | [diff] [blame] | 117 | int32_t index = 0; |
| 118 | CHECK_EQ((status_t)OK, getSampleRateTableIndex(mSampleRate, index)); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 119 | if (mChannels > 2 || mChannels <= 0) { |
Steve Block | 29357bc | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 120 | ALOGE("Unsupported number of channels(%d)", mChannels); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 121 | return UNKNOWN_ERROR; |
| 122 | } |
| 123 | |
| 124 | // OMX_AUDIO_AACObjectLC |
| 125 | mAudioSpecificConfigData[0] = ((0x02 << 3) | (index >> 1)); |
| 126 | mAudioSpecificConfigData[1] = ((index & 0x01) << 7) | (mChannels << 3); |
| 127 | return OK; |
| 128 | } |
| 129 | |
| 130 | AACEncoder::~AACEncoder() { |
| 131 | if (mStarted) { |
| 132 | stop(); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | status_t AACEncoder::start(MetaData *params) { |
James Dong | d329e21 | 2010-06-29 16:29:19 -0700 | [diff] [blame] | 137 | if (mStarted) { |
Steve Block | 5ff1dd5 | 2012-01-05 23:22:43 +0000 | [diff] [blame] | 138 | ALOGW("Call start() when encoder already started"); |
James Dong | d329e21 | 2010-06-29 16:29:19 -0700 | [diff] [blame] | 139 | return OK; |
| 140 | } |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 141 | |
| 142 | mBufferGroup = new MediaBufferGroup; |
| 143 | mBufferGroup->add_buffer(new MediaBuffer(2048)); |
| 144 | |
James Dong | f1d5aa1 | 2012-02-06 23:46:37 -0800 | [diff] [blame] | 145 | CHECK_EQ((status_t)OK, initCheck()); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 146 | |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 147 | mNumInputSamples = 0; |
| 148 | mAnchorTimeUs = 0; |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 149 | mFrameCount = 0; |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 150 | |
| 151 | mInputFrame = new int16_t[mChannels * kNumSamplesPerFrame]; |
| 152 | CHECK(mInputFrame != NULL); |
| 153 | |
James Dong | eaae384 | 2011-01-25 12:37:43 -0800 | [diff] [blame] | 154 | status_t err = mSource->start(params); |
| 155 | if (err != OK) { |
Steve Block | 29357bc | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 156 | ALOGE("AudioSource is not available"); |
James Dong | eaae384 | 2011-01-25 12:37:43 -0800 | [diff] [blame] | 157 | return err; |
| 158 | } |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 159 | |
| 160 | mStarted = true; |
| 161 | |
| 162 | return OK; |
| 163 | } |
| 164 | |
| 165 | status_t AACEncoder::stop() { |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 166 | if (mInputBuffer) { |
| 167 | mInputBuffer->release(); |
| 168 | mInputBuffer = NULL; |
| 169 | } |
| 170 | |
| 171 | delete mBufferGroup; |
| 172 | mBufferGroup = NULL; |
| 173 | |
James Dong | eaae384 | 2011-01-25 12:37:43 -0800 | [diff] [blame] | 174 | if (mInputFrame) { |
| 175 | delete[] mInputFrame; |
| 176 | mInputFrame = NULL; |
| 177 | } |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 178 | |
James Dong | eaae384 | 2011-01-25 12:37:43 -0800 | [diff] [blame] | 179 | if (!mStarted) { |
Steve Block | 5ff1dd5 | 2012-01-05 23:22:43 +0000 | [diff] [blame] | 180 | ALOGW("Call stop() when encoder has not started"); |
James Dong | eaae384 | 2011-01-25 12:37:43 -0800 | [diff] [blame] | 181 | return ERROR_END_OF_STREAM; |
| 182 | } |
| 183 | |
| 184 | mSource->stop(); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 185 | if (mEncoderHandle) { |
James Dong | f1d5aa1 | 2012-02-06 23:46:37 -0800 | [diff] [blame] | 186 | CHECK_EQ((VO_U32)VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle)); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 187 | mEncoderHandle = NULL; |
| 188 | } |
| 189 | delete mApiHandle; |
| 190 | mApiHandle = NULL; |
| 191 | |
James Dong | 73870c9 | 2011-03-04 16:24:07 -0800 | [diff] [blame] | 192 | delete mMemOperator; |
| 193 | mMemOperator = NULL; |
| 194 | |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 195 | mStarted = false; |
| 196 | |
| 197 | return OK; |
| 198 | } |
| 199 | |
| 200 | sp<MetaData> AACEncoder::getFormat() { |
| 201 | sp<MetaData> srcFormat = mSource->getFormat(); |
| 202 | |
| 203 | mMeta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_AAC); |
| 204 | |
| 205 | int64_t durationUs; |
| 206 | if (srcFormat->findInt64(kKeyDuration, &durationUs)) { |
| 207 | mMeta->setInt64(kKeyDuration, durationUs); |
| 208 | } |
| 209 | |
| 210 | mMeta->setCString(kKeyDecoderComponent, "AACEncoder"); |
| 211 | |
| 212 | return mMeta; |
| 213 | } |
| 214 | |
| 215 | status_t AACEncoder::read( |
| 216 | MediaBuffer **out, const ReadOptions *options) { |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 217 | *out = NULL; |
| 218 | |
| 219 | int64_t seekTimeUs; |
Andreas Huber | abd1f4f | 2010-07-20 15:04:28 -0700 | [diff] [blame] | 220 | ReadOptions::SeekMode mode; |
| 221 | CHECK(options == NULL || !options->getSeekTo(&seekTimeUs, &mode)); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 222 | |
| 223 | MediaBuffer *buffer; |
James Dong | f1d5aa1 | 2012-02-06 23:46:37 -0800 | [diff] [blame] | 224 | CHECK_EQ(mBufferGroup->acquire_buffer(&buffer), (status_t)OK); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 225 | uint8_t *outPtr = (uint8_t *)buffer->data(); |
James Dong | d707fcb | 2010-09-01 18:48:35 -0700 | [diff] [blame] | 226 | bool readFromSource = false; |
James Dong | caa68a5 | 2010-09-03 12:01:55 -0700 | [diff] [blame] | 227 | int64_t wallClockTimeUs = -1; |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 228 | |
| 229 | if (mFrameCount == 0) { |
| 230 | memcpy(outPtr, mAudioSpecificConfigData, 2); |
| 231 | buffer->set_range(0, 2); |
| 232 | buffer->meta_data()->setInt32(kKeyIsCodecConfig, true); |
| 233 | *out = buffer; |
James Dong | a7d1a2d | 2010-06-10 12:28:15 -0700 | [diff] [blame] | 234 | ++mFrameCount; |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 235 | return OK; |
James Dong | a7d1a2d | 2010-06-10 12:28:15 -0700 | [diff] [blame] | 236 | } else if (mFrameCount == 1) { |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 237 | buffer->meta_data()->setInt32(kKeyIsCodecConfig, false); |
| 238 | } |
| 239 | |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 240 | const int32_t nSamples = mChannels * kNumSamplesPerFrame; |
| 241 | while (mNumInputSamples < nSamples) { |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 242 | if (mInputBuffer == NULL) { |
| 243 | if (mSource->read(&mInputBuffer, options) != OK) { |
| 244 | if (mNumInputSamples == 0) { |
James Dong | 542db5d | 2010-07-21 14:51:35 -0700 | [diff] [blame] | 245 | buffer->release(); |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 246 | return ERROR_END_OF_STREAM; |
| 247 | } |
| 248 | memset(&mInputFrame[mNumInputSamples], |
| 249 | 0, |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 250 | sizeof(int16_t) * (nSamples - mNumInputSamples)); |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 251 | mNumInputSamples = 0; |
| 252 | break; |
| 253 | } |
| 254 | |
| 255 | size_t align = mInputBuffer->range_length() % sizeof(int16_t); |
James Dong | f1d5aa1 | 2012-02-06 23:46:37 -0800 | [diff] [blame] | 256 | CHECK_EQ(align, (size_t)0); |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 257 | |
| 258 | int64_t timeUs; |
James Dong | caa68a5 | 2010-09-03 12:01:55 -0700 | [diff] [blame] | 259 | if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) { |
| 260 | wallClockTimeUs = timeUs; |
| 261 | } |
James Dong | 3c3763d | 2010-09-08 15:07:21 -0700 | [diff] [blame] | 262 | if (mInputBuffer->meta_data()->findInt64(kKeyAnchorTime, &timeUs)) { |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 263 | mAnchorTimeUs = timeUs; |
| 264 | } |
James Dong | d707fcb | 2010-09-01 18:48:35 -0700 | [diff] [blame] | 265 | readFromSource = true; |
| 266 | } else { |
| 267 | readFromSource = false; |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 268 | } |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 269 | size_t copy = (nSamples - mNumInputSamples) * sizeof(int16_t); |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 270 | |
| 271 | if (copy > mInputBuffer->range_length()) { |
| 272 | copy = mInputBuffer->range_length(); |
| 273 | } |
| 274 | |
| 275 | memcpy(&mInputFrame[mNumInputSamples], |
| 276 | (const uint8_t *) mInputBuffer->data() |
| 277 | + mInputBuffer->range_offset(), |
| 278 | copy); |
| 279 | |
| 280 | mInputBuffer->set_range( |
| 281 | mInputBuffer->range_offset() + copy, |
| 282 | mInputBuffer->range_length() - copy); |
| 283 | |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 284 | if (mInputBuffer->range_length() == 0) { |
| 285 | mInputBuffer->release(); |
| 286 | mInputBuffer = NULL; |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 287 | } |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 288 | mNumInputSamples += copy / sizeof(int16_t); |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 289 | if (mNumInputSamples >= nSamples) { |
| 290 | mNumInputSamples %= nSamples; |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 291 | break; |
| 292 | } |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 293 | } |
| 294 | |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 295 | VO_CODECBUFFER inputData; |
| 296 | memset(&inputData, 0, sizeof(inputData)); |
| 297 | inputData.Buffer = (unsigned char*) mInputFrame; |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 298 | inputData.Length = nSamples * sizeof(int16_t); |
James Dong | 065d1af | 2010-06-23 16:51:39 -0700 | [diff] [blame] | 299 | CHECK(VO_ERR_NONE == mApiHandle->SetInputData(mEncoderHandle,&inputData)); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 300 | |
| 301 | VO_CODECBUFFER outputData; |
| 302 | memset(&outputData, 0, sizeof(outputData)); |
| 303 | VO_AUDIO_OUTPUTINFO outputInfo; |
| 304 | memset(&outputInfo, 0, sizeof(outputInfo)); |
| 305 | |
| 306 | VO_U32 ret = VO_ERR_NONE; |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 307 | size_t nOutputBytes = 0; |
| 308 | do { |
| 309 | outputData.Buffer = outPtr; |
| 310 | outputData.Length = buffer->size() - nOutputBytes; |
| 311 | ret = mApiHandle->GetOutputData(mEncoderHandle, &outputData, &outputInfo); |
| 312 | if (ret == VO_ERR_NONE) { |
| 313 | outPtr += outputData.Length; |
| 314 | nOutputBytes += outputData.Length; |
| 315 | } |
| 316 | } while (ret != VO_ERR_INPUT_BUFFER_SMALL); |
| 317 | buffer->set_range(0, nOutputBytes); |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 318 | |
James Dong | d707fcb | 2010-09-01 18:48:35 -0700 | [diff] [blame] | 319 | int64_t mediaTimeUs = |
| 320 | ((mFrameCount - 1) * 1000000LL * kNumSamplesPerFrame) / mSampleRate; |
James Dong | 8fff6bb | 2010-11-15 14:24:37 -0800 | [diff] [blame] | 321 | |
James Dong | d707fcb | 2010-09-01 18:48:35 -0700 | [diff] [blame] | 322 | buffer->meta_data()->setInt64(kKeyTime, mAnchorTimeUs + mediaTimeUs); |
James Dong | caa68a5 | 2010-09-03 12:01:55 -0700 | [diff] [blame] | 323 | if (readFromSource && wallClockTimeUs != -1) { |
James Dong | d707fcb | 2010-09-01 18:48:35 -0700 | [diff] [blame] | 324 | buffer->meta_data()->setInt64(kKeyDriftTime, mediaTimeUs - wallClockTimeUs); |
| 325 | } |
James Dong | a7d1a2d | 2010-06-10 12:28:15 -0700 | [diff] [blame] | 326 | ++mFrameCount; |
James Dong | 956c553 | 2010-05-14 15:45:22 -0700 | [diff] [blame] | 327 | |
| 328 | *out = buffer; |
| 329 | return OK; |
| 330 | } |
| 331 | |
| 332 | } // namespace android |