blob: ac837a33ae54d039b7d2128bdd79e838959f09fc [file] [log] [blame]
Marco Nelissen0c3be872014-05-01 10:14:44 -07001/*
2 * Copyright (C) 2014 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
Marco Nelissenc7a11b22014-05-30 10:13:25 -070017//#define LOG_NDEBUG 0
Marco Nelissen0c3be872014-05-01 10:14:44 -070018#define LOG_TAG "NdkMediaExtractor"
19
20
Colin Cross7e8d4ba2017-05-04 16:17:42 -070021#include <media/NdkMediaError.h>
22#include <media/NdkMediaExtractor.h>
Robert Shih0df451b2017-12-08 14:16:50 -080023#include "NdkMediaDataSourcePriv.h"
Marco Nelissen0c3be872014-05-01 10:14:44 -070024#include "NdkMediaFormatPriv.h"
25
26
Aurimas Liutikas214c8332016-02-19 14:48:23 -080027#include <inttypes.h>
Marco Nelissen0c3be872014-05-01 10:14:44 -070028#include <utils/Log.h>
29#include <utils/StrongPointer.h>
Marco Nelissen050eb322014-05-09 15:10:23 -070030#include <media/hardware/CryptoAPI.h>
Marco Nelissen0c3be872014-05-01 10:14:44 -070031#include <media/stagefright/foundation/ABuffer.h>
32#include <media/stagefright/foundation/AMessage.h>
33#include <media/stagefright/MetaData.h>
34#include <media/stagefright/NuMediaExtractor.h>
35#include <media/IMediaHTTPService.h>
36#include <android_runtime/AndroidRuntime.h>
37#include <android_util_Binder.h>
38
39#include <jni.h>
40
41using namespace android;
42
Marco Nelissene419d7c2014-05-15 14:17:25 -070043static media_status_t translate_error(status_t err) {
Marco Nelissen0c3be872014-05-01 10:14:44 -070044 if (err == OK) {
Marco Nelissene419d7c2014-05-15 14:17:25 -070045 return AMEDIA_OK;
Robert Shihd83d4f42018-02-24 19:02:46 -080046 } else if (err == ERROR_END_OF_STREAM) {
47 return AMEDIA_ERROR_END_OF_STREAM;
48 } else if (err == ERROR_IO) {
49 return AMEDIA_ERROR_IO;
Marco Nelissen0c3be872014-05-01 10:14:44 -070050 }
Robert Shihd83d4f42018-02-24 19:02:46 -080051
Marco Nelissen0c3be872014-05-01 10:14:44 -070052 ALOGE("sf error code: %d", err);
Marco Nelissene419d7c2014-05-15 14:17:25 -070053 return AMEDIA_ERROR_UNKNOWN;
Marco Nelissen0c3be872014-05-01 10:14:44 -070054}
55
56struct AMediaExtractor {
57 sp<NuMediaExtractor> mImpl;
Marco Nelissen050eb322014-05-09 15:10:23 -070058 sp<ABuffer> mPsshBuf;
Marco Nelissen0c3be872014-05-01 10:14:44 -070059};
60
61extern "C" {
62
Marco Nelissen3425fd52014-05-14 11:12:46 -070063EXPORT
Marco Nelissen0c3be872014-05-01 10:14:44 -070064AMediaExtractor* AMediaExtractor_new() {
65 ALOGV("ctor");
66 AMediaExtractor *mData = new AMediaExtractor();
67 mData->mImpl = new NuMediaExtractor();
68 return mData;
69}
70
Marco Nelissen3425fd52014-05-14 11:12:46 -070071EXPORT
Marco Nelissene419d7c2014-05-15 14:17:25 -070072media_status_t AMediaExtractor_delete(AMediaExtractor *mData) {
Marco Nelissen0c3be872014-05-01 10:14:44 -070073 ALOGV("dtor");
74 delete mData;
Marco Nelissene419d7c2014-05-15 14:17:25 -070075 return AMEDIA_OK;
Marco Nelissen0c3be872014-05-01 10:14:44 -070076}
77
Marco Nelissen3425fd52014-05-14 11:12:46 -070078EXPORT
Glenn Kastenb187de12014-12-30 08:18:15 -080079media_status_t AMediaExtractor_setDataSourceFd(AMediaExtractor *mData, int fd, off64_t offset,
80 off64_t length) {
Aurimas Liutikas214c8332016-02-19 14:48:23 -080081 ALOGV("setDataSource(%d, %" PRId64 ", %" PRId64 ")", fd, offset, length);
Marco Nelissene419d7c2014-05-15 14:17:25 -070082 return translate_error(mData->mImpl->setDataSource(fd, offset, length));
Marco Nelissen0c3be872014-05-01 10:14:44 -070083}
84
Marco Nelissen3425fd52014-05-14 11:12:46 -070085EXPORT
Marco Nelissene419d7c2014-05-15 14:17:25 -070086media_status_t AMediaExtractor_setDataSource(AMediaExtractor *mData, const char *location) {
Marco Nelissen0c3be872014-05-01 10:14:44 -070087 ALOGV("setDataSource(%s)", location);
88 // TODO: add header support
89
90 JNIEnv *env = AndroidRuntime::getJNIEnv();
91 jobject service = NULL;
92 if (env == NULL) {
93 ALOGE("setDataSource(path) must be called from Java thread");
Marco Nelissene419d7c2014-05-15 14:17:25 -070094 return AMEDIA_ERROR_UNSUPPORTED;
Marco Nelissen0c3be872014-05-01 10:14:44 -070095 }
96
97 jclass mediahttpclass = env->FindClass("android/media/MediaHTTPService");
98 if (mediahttpclass == NULL) {
99 ALOGE("can't find MediaHttpService");
100 env->ExceptionClear();
Marco Nelissene419d7c2014-05-15 14:17:25 -0700101 return AMEDIA_ERROR_UNSUPPORTED;
Marco Nelissen0c3be872014-05-01 10:14:44 -0700102 }
103
104 jmethodID mediaHttpCreateMethod = env->GetStaticMethodID(mediahttpclass,
105 "createHttpServiceBinderIfNecessary", "(Ljava/lang/String;)Landroid/os/IBinder;");
106 if (mediaHttpCreateMethod == NULL) {
107 ALOGE("can't find method");
108 env->ExceptionClear();
Marco Nelissene419d7c2014-05-15 14:17:25 -0700109 return AMEDIA_ERROR_UNSUPPORTED;
Marco Nelissen0c3be872014-05-01 10:14:44 -0700110 }
111
112 jstring jloc = env->NewStringUTF(location);
113
114 service = env->CallStaticObjectMethod(mediahttpclass, mediaHttpCreateMethod, jloc);
115 env->DeleteLocalRef(jloc);
116
117 sp<IMediaHTTPService> httpService;
118 if (service != NULL) {
119 sp<IBinder> binder = ibinderForJavaObject(env, service);
120 httpService = interface_cast<IMediaHTTPService>(binder);
121 }
122
Marco Nelissene419d7c2014-05-15 14:17:25 -0700123 status_t err = mData->mImpl->setDataSource(httpService, location, NULL);
Marco Nelissen0c3be872014-05-01 10:14:44 -0700124 env->ExceptionClear();
Marco Nelissene419d7c2014-05-15 14:17:25 -0700125 return translate_error(err);
Marco Nelissen0c3be872014-05-01 10:14:44 -0700126}
127
Marco Nelissen3425fd52014-05-14 11:12:46 -0700128EXPORT
Robert Shih0df451b2017-12-08 14:16:50 -0800129media_status_t AMediaExtractor_setDataSourceCustom(AMediaExtractor* mData, AMediaDataSource *src) {
130 return translate_error(mData->mImpl->setDataSource(new NdkDataSource(src)));
131}
132
133EXPORT
Robert Shih30e3c7d2018-01-21 17:06:12 -0800134AMediaFormat* AMediaExtractor_getFileFormat(AMediaExtractor *mData) {
135 sp<AMessage> format;
136 mData->mImpl->getFileFormat(&format);
137 return AMediaFormat_fromMsg(&format);
138}
139
140EXPORT
Marco Nelissene419d7c2014-05-15 14:17:25 -0700141size_t AMediaExtractor_getTrackCount(AMediaExtractor *mData) {
Marco Nelissen0c3be872014-05-01 10:14:44 -0700142 return mData->mImpl->countTracks();
143}
144
Marco Nelissen3425fd52014-05-14 11:12:46 -0700145EXPORT
Marco Nelissen0c3be872014-05-01 10:14:44 -0700146AMediaFormat* AMediaExtractor_getTrackFormat(AMediaExtractor *mData, size_t idx) {
147 sp<AMessage> format;
148 mData->mImpl->getTrackFormat(idx, &format);
149 return AMediaFormat_fromMsg(&format);
150}
151
Marco Nelissen3425fd52014-05-14 11:12:46 -0700152EXPORT
Marco Nelissene419d7c2014-05-15 14:17:25 -0700153media_status_t AMediaExtractor_selectTrack(AMediaExtractor *mData, size_t idx) {
Mark Salyzyn98f28cd2014-06-18 16:32:50 -0700154 ALOGV("selectTrack(%zu)", idx);
Marco Nelissen0c3be872014-05-01 10:14:44 -0700155 return translate_error(mData->mImpl->selectTrack(idx));
156}
157
Marco Nelissen3425fd52014-05-14 11:12:46 -0700158EXPORT
Marco Nelissene419d7c2014-05-15 14:17:25 -0700159media_status_t AMediaExtractor_unselectTrack(AMediaExtractor *mData, size_t idx) {
Mark Salyzyn98f28cd2014-06-18 16:32:50 -0700160 ALOGV("unselectTrack(%zu)", idx);
Marco Nelissen0c3be872014-05-01 10:14:44 -0700161 return translate_error(mData->mImpl->unselectTrack(idx));
162}
163
Marco Nelissen3425fd52014-05-14 11:12:46 -0700164EXPORT
Marco Nelissen0c3be872014-05-01 10:14:44 -0700165bool AMediaExtractor_advance(AMediaExtractor *mData) {
166 //ALOGV("advance");
Robert Shih70452262016-09-16 16:43:49 -0700167 status_t err = mData->mImpl->advance();
168 if (err == ERROR_END_OF_STREAM) {
169 return false;
170 } else if (err != OK) {
171 ALOGE("sf error code: %d", err);
172 return false;
173 }
174 return true;
Marco Nelissen0c3be872014-05-01 10:14:44 -0700175}
176
Marco Nelissen3425fd52014-05-14 11:12:46 -0700177EXPORT
Marco Nelissen79e2b622014-05-16 08:07:28 -0700178media_status_t AMediaExtractor_seekTo(AMediaExtractor *ex, int64_t seekPosUs, SeekMode mode) {
179 android::MediaSource::ReadOptions::SeekMode sfmode;
180 if (mode == AMEDIAEXTRACTOR_SEEK_PREVIOUS_SYNC) {
181 sfmode = android::MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC;
182 } else if (mode == AMEDIAEXTRACTOR_SEEK_CLOSEST_SYNC) {
183 sfmode = android::MediaSource::ReadOptions::SEEK_CLOSEST_SYNC;
184 } else {
185 sfmode = android::MediaSource::ReadOptions::SEEK_NEXT_SYNC;
186 }
187
188 return translate_error(ex->mImpl->seekTo(seekPosUs, sfmode));
189}
190
191EXPORT
Marco Nelissene419d7c2014-05-15 14:17:25 -0700192ssize_t AMediaExtractor_readSampleData(AMediaExtractor *mData, uint8_t *buffer, size_t capacity) {
Marco Nelissen0c3be872014-05-01 10:14:44 -0700193 //ALOGV("readSampleData");
194 sp<ABuffer> tmp = new ABuffer(buffer, capacity);
195 if (mData->mImpl->readSampleData(tmp) == OK) {
196 return tmp->size();
197 }
198 return -1;
199}
200
Marco Nelissen3425fd52014-05-14 11:12:46 -0700201EXPORT
Robert Shih30e3c7d2018-01-21 17:06:12 -0800202ssize_t AMediaExtractor_getSampleSize(AMediaExtractor *mData) {
203 size_t sampleSize;
204 status_t err = mData->mImpl->getSampleSize(&sampleSize);
205 if (err != OK) {
206 return -1;
207 }
208 return sampleSize;
209}
210
211EXPORT
Marco Nelissene419d7c2014-05-15 14:17:25 -0700212uint32_t AMediaExtractor_getSampleFlags(AMediaExtractor *mData) {
Marco Nelissen0c3be872014-05-01 10:14:44 -0700213 int sampleFlags = 0;
214 sp<MetaData> meta;
215 status_t err = mData->mImpl->getSampleMeta(&meta);
216 if (err != OK) {
217 return -1;
218 }
219 int32_t val;
220 if (meta->findInt32(kKeyIsSyncFrame, &val) && val != 0) {
Marco Nelissene419d7c2014-05-15 14:17:25 -0700221 sampleFlags |= AMEDIAEXTRACTOR_SAMPLE_FLAG_SYNC;
Marco Nelissen0c3be872014-05-01 10:14:44 -0700222 }
223
224 uint32_t type;
225 const void *data;
226 size_t size;
227 if (meta->findData(kKeyEncryptedSizes, &type, &data, &size)) {
Marco Nelissene419d7c2014-05-15 14:17:25 -0700228 sampleFlags |= AMEDIAEXTRACTOR_SAMPLE_FLAG_ENCRYPTED;
Marco Nelissen0c3be872014-05-01 10:14:44 -0700229 }
230 return sampleFlags;
231}
232
Marco Nelissen3425fd52014-05-14 11:12:46 -0700233EXPORT
Marco Nelissen0c3be872014-05-01 10:14:44 -0700234int AMediaExtractor_getSampleTrackIndex(AMediaExtractor *mData) {
235 size_t idx;
236 if (mData->mImpl->getSampleTrackIndex(&idx) != OK) {
237 return -1;
238 }
239 return idx;
240}
241
Marco Nelissen3425fd52014-05-14 11:12:46 -0700242EXPORT
Marco Nelisseneb4860c2014-05-29 08:04:34 -0700243int64_t AMediaExtractor_getSampleTime(AMediaExtractor *mData) {
Marco Nelissen0c3be872014-05-01 10:14:44 -0700244 int64_t time;
245 if (mData->mImpl->getSampleTime(&time) != OK) {
246 return -1;
247 }
248 return time;
249}
250
Marco Nelissen3425fd52014-05-14 11:12:46 -0700251EXPORT
Marco Nelissen050eb322014-05-09 15:10:23 -0700252PsshInfo* AMediaExtractor_getPsshInfo(AMediaExtractor *ex) {
253
254 if (ex->mPsshBuf != NULL) {
255 return (PsshInfo*) ex->mPsshBuf->data();
256 }
257
258 sp<AMessage> format;
259 ex->mImpl->getFileFormat(&format);
260 sp<ABuffer> buffer;
261 if(!format->findBuffer("pssh", &buffer)) {
262 return NULL;
263 }
264
265 // the format of the buffer is 1 or more of:
266 // {
267 // 16 byte uuid
268 // 4 byte data length N
269 // N bytes of data
270 // }
271
272 // Determine the number of entries in the source data.
273 // Since we got the data from stagefright, we trust it is valid and properly formatted.
274 const uint8_t* data = buffer->data();
275 size_t len = buffer->size();
276 size_t numentries = 0;
277 while (len > 0) {
278 numentries++;
279
Marco Nelissen346bb512015-04-09 14:32:45 -0700280 if (len < 16) {
281 ALOGE("invalid PSSH data");
282 return NULL;
283 }
Marco Nelissen050eb322014-05-09 15:10:23 -0700284 // skip uuid
285 data += 16;
286 len -= 16;
287
288 // get data length
Marco Nelissen346bb512015-04-09 14:32:45 -0700289 if (len < 4) {
290 ALOGE("invalid PSSH data");
291 return NULL;
292 }
Marco Nelissen050eb322014-05-09 15:10:23 -0700293 uint32_t datalen = *((uint32_t*)data);
294 data += 4;
295 len -= 4;
296
Marco Nelissen346bb512015-04-09 14:32:45 -0700297 if (len < datalen) {
298 ALOGE("invalid PSSH data");
299 return NULL;
300 }
Marco Nelissen050eb322014-05-09 15:10:23 -0700301 // skip the data
302 data += datalen;
303 len -= datalen;
304 }
305
Marco Nelissen58344bc2014-10-23 11:36:38 -0700306 // there are <numentries> in the source buffer, we need
307 // (source buffer size) - (sizeof(uint32_t) * numentries) + sizeof(size_t)
308 // + ((sizeof(void*) + sizeof(size_t)) * numentries) bytes for the PsshInfo structure
309 // Or in other words, the data lengths in the source structure are replaced by size_t
310 // (which may be the same size or larger, for 64 bit), and in addition there is an
311 // extra pointer for each entry, and an extra size_t for the entire PsshInfo.
312 size_t newsize = buffer->size() - (sizeof(uint32_t) * numentries) + sizeof(size_t)
313 + ((sizeof(void*) + sizeof(size_t)) * numentries);
Marco Nelissen346bb512015-04-09 14:32:45 -0700314 if (newsize <= buffer->size()) {
315 ALOGE("invalid PSSH data");
316 return NULL;
317 }
Marco Nelissen050eb322014-05-09 15:10:23 -0700318 ex->mPsshBuf = new ABuffer(newsize);
319 ex->mPsshBuf->setRange(0, newsize);
320
321 // copy data
322 const uint8_t* src = buffer->data();
323 uint8_t* dst = ex->mPsshBuf->data();
Marco Nelissen58344bc2014-10-23 11:36:38 -0700324 uint8_t* dstdata = dst + sizeof(size_t) + numentries * sizeof(PsshEntry);
325 *((size_t*)dst) = numentries;
326 dst += sizeof(size_t);
Marco Nelissen050eb322014-05-09 15:10:23 -0700327 for (size_t i = 0; i < numentries; i++) {
328 // copy uuid
329 memcpy(dst, src, 16);
330 src += 16;
331 dst += 16;
332
333 // get/copy data length
334 uint32_t datalen = *((uint32_t*)src);
Marco Nelissen58344bc2014-10-23 11:36:38 -0700335 *((size_t*)dst) = datalen;
336 src += sizeof(uint32_t);
337 dst += sizeof(size_t);
Marco Nelissen050eb322014-05-09 15:10:23 -0700338
339 // the next entry in the destination is a pointer to the actual data, which we store
340 // after the array of PsshEntry
Marco Nelissen58344bc2014-10-23 11:36:38 -0700341 *((void**)dst) = dstdata;
342 dst += sizeof(void*);
Marco Nelissen050eb322014-05-09 15:10:23 -0700343
344 // copy the actual data
345 memcpy(dstdata, src, datalen);
346 dstdata += datalen;
347 src += datalen;
348 }
349
350 return (PsshInfo*) ex->mPsshBuf->data();
351}
352
Marco Nelissen3425fd52014-05-14 11:12:46 -0700353EXPORT
Marco Nelissen050eb322014-05-09 15:10:23 -0700354AMediaCodecCryptoInfo *AMediaExtractor_getSampleCryptoInfo(AMediaExtractor *ex) {
355 sp<MetaData> meta;
356 if(ex->mImpl->getSampleMeta(&meta) != 0) {
357 return NULL;
358 }
359
360 uint32_t type;
361 const void *crypteddata;
362 size_t cryptedsize;
363 if (!meta->findData(kKeyEncryptedSizes, &type, &crypteddata, &cryptedsize)) {
364 return NULL;
365 }
366 size_t numSubSamples = cryptedsize / sizeof(size_t);
367
368 const void *cleardata;
369 size_t clearsize;
370 if (meta->findData(kKeyPlainSizes, &type, &cleardata, &clearsize)) {
371 if (clearsize != cryptedsize) {
372 // The two must be of the same length.
373 return NULL;
374 }
375 }
376
377 const void *key;
378 size_t keysize;
Edwin Wongb2fb3c92016-08-29 14:57:47 -0700379 if (meta->findData(kKeyCryptoKey, &type, &key, &keysize)) {
Marco Nelissen050eb322014-05-09 15:10:23 -0700380 if (keysize != 16) {
Edwin Wongb2fb3c92016-08-29 14:57:47 -0700381 // Keys must be 16 bytes in length.
Marco Nelissen050eb322014-05-09 15:10:23 -0700382 return NULL;
383 }
384 }
385
386 const void *iv;
387 size_t ivsize;
388 if (meta->findData(kKeyCryptoIV, &type, &iv, &ivsize)) {
389 if (ivsize != 16) {
390 // IVs must be 16 bytes in length.
391 return NULL;
392 }
393 }
394
395 int32_t mode;
396 if (!meta->findInt32(kKeyCryptoMode, &mode)) {
397 mode = CryptoPlugin::kMode_AES_CTR;
398 }
399
400 return AMediaCodecCryptoInfo_new(
401 numSubSamples,
402 (uint8_t*) key,
403 (uint8_t*) iv,
Marco Nelissen79e2b622014-05-16 08:07:28 -0700404 (cryptoinfo_mode_t) mode,
Marco Nelissen050eb322014-05-09 15:10:23 -0700405 (size_t*) cleardata,
406 (size_t*) crypteddata);
407}
408
Robert Shih30e3c7d2018-01-21 17:06:12 -0800409EXPORT
410int64_t AMediaExtractor_getCachedDuration(AMediaExtractor *ex) {
411 bool eos;
412 int64_t durationUs;
413 if (ex->mImpl->getCachedDuration(&durationUs, &eos)) {
414 return durationUs;
415 }
416 return -1;
417}
Marco Nelissen0c3be872014-05-01 10:14:44 -0700418
Robert Shihd83d4f42018-02-24 19:02:46 -0800419EXPORT
420media_status_t AMediaExtractor_getSampleFormat(AMediaExtractor *ex, AMediaFormat *fmt) {
421 if (fmt == NULL) {
422 return AMEDIA_ERROR_INVALID_PARAMETER;
423 }
424
425 sp<MetaData> sampleMeta;
426 status_t err = ex->mImpl->getSampleMeta(&sampleMeta);
427 if (err != OK) {
428 return translate_error(err);
429 }
430
431 sp<AMessage> meta;
432 AMediaFormat_getFormat(fmt, &meta);
433 meta->clear();
434
435 int32_t layerId;
436 if (sampleMeta->findInt32(kKeyTemporalLayerId, &layerId)) {
437 meta->setInt32(AMEDIAFORMAT_KEY_TEMPORAL_LAYER_ID, layerId);
438 }
439
440 size_t trackIndex;
441 err = ex->mImpl->getSampleTrackIndex(&trackIndex);
442 if (err == OK) {
443 meta->setInt32(AMEDIAFORMAT_KEY_TRACK_INDEX, trackIndex);
444 sp<AMessage> trackFormat;
445 AString mime;
446 err = ex->mImpl->getTrackFormat(trackIndex, &trackFormat);
447 if (err == OK
448 && trackFormat != NULL
449 && trackFormat->findString(AMEDIAFORMAT_KEY_MIME, &mime)) {
450 meta->setString(AMEDIAFORMAT_KEY_MIME, mime);
451 }
452 }
453
454 int64_t durationUs;
455 if (sampleMeta->findInt64(kKeyDuration, &durationUs)) {
456 meta->setInt64(AMEDIAFORMAT_KEY_DURATION, durationUs);
457 }
458
459 uint32_t dataType; // unused
460 const void *seiData;
461 size_t seiLength;
462 if (sampleMeta->findData(kKeySEI, &dataType, &seiData, &seiLength)) {
463 sp<ABuffer> sei = ABuffer::CreateAsCopy(seiData, seiLength);;
464 meta->setBuffer(AMEDIAFORMAT_KEY_SEI, sei);
465 }
466
467 const void *mpegUserDataPointer;
468 size_t mpegUserDataLength;
469 if (sampleMeta->findData(
470 kKeyMpegUserData, &dataType, &mpegUserDataPointer, &mpegUserDataLength)) {
471 sp<ABuffer> mpegUserData = ABuffer::CreateAsCopy(mpegUserDataPointer, mpegUserDataLength);
472 meta->setBuffer(AMEDIAFORMAT_KEY_MPEG_USER_DATA, mpegUserData);
473 }
474
475 return AMEDIA_OK;
476}
477
Marco Nelissen0c3be872014-05-01 10:14:44 -0700478} // extern "C"
479