Lines Matching refs:mData
411 AMediaCodec *mData = new AMediaCodec(); in createAMediaCodec() local
412 mData->mLooper = new ALooper; in createAMediaCodec()
413 mData->mLooper->setName("NDK MediaCodec_looper"); in createAMediaCodec()
414 size_t res = mData->mLooper->start( in createAMediaCodec()
420 AMediaCodec_delete(mData); in createAMediaCodec()
424 mData->mCodec = android::MediaCodec::CreateByType( in createAMediaCodec()
425 mData->mLooper, in createAMediaCodec()
432 mData->mCodec = android::MediaCodec::CreateByComponentName( in createAMediaCodec()
433 mData->mLooper, in createAMediaCodec()
439 if (mData->mCodec == NULL) { // failed to create codec in createAMediaCodec()
440 AMediaCodec_delete(mData); in createAMediaCodec()
443 mData->mHandler = new CodecHandler(mData); in createAMediaCodec()
444 mData->mLooper->registerHandler(mData->mHandler); in createAMediaCodec()
445 mData->mGeneration = 1; in createAMediaCodec()
446 mData->mRequestedActivityNotification = false; in createAMediaCodec()
447 mData->mCallback = NULL; in createAMediaCodec()
449 mData->mAsyncCallback = {}; in createAMediaCodec()
450 mData->mAsyncCallbackUserData = NULL; in createAMediaCodec()
452 return mData; in createAMediaCodec()
492 media_status_t AMediaCodec_delete(AMediaCodec *mData) { in AMediaCodec_delete() argument
493 if (mData != NULL) { in AMediaCodec_delete()
494 if (mData->mCodec != NULL) { in AMediaCodec_delete()
495 mData->mCodec->release(); in AMediaCodec_delete()
496 mData->mCodec.clear(); in AMediaCodec_delete()
499 if (mData->mLooper != NULL) { in AMediaCodec_delete()
500 if (mData->mHandler != NULL) { in AMediaCodec_delete()
501 mData->mLooper->unregisterHandler(mData->mHandler->id()); in AMediaCodec_delete()
503 mData->mLooper->stop(); in AMediaCodec_delete()
504 mData->mLooper.clear(); in AMediaCodec_delete()
506 delete mData; in AMediaCodec_delete()
513 AMediaCodec *mData, in AMediaCodec_getName() argument
520 status_t err = mData->mCodec->getName(&compName); in AMediaCodec_getName()
539 AMediaCodec *mData, in AMediaCodec_configure() argument
554 status_t err = mData->mCodec->configure(dupNativeFormat, surface, in AMediaCodec_configure()
565 AMediaCodec *mData, in AMediaCodec_setAsyncNotifyCallback() argument
570 Mutex::Autolock _l(mData->mAsyncCallbackLock); in AMediaCodec_setAsyncNotifyCallback()
571 if (mData->mAsyncNotify == NULL) { in AMediaCodec_setAsyncNotifyCallback()
572 mData->mAsyncNotify = new AMessage(kWhatAsyncNotify, mData->mHandler); in AMediaCodec_setAsyncNotifyCallback()
577 mData->mAsyncCallback = callback; in AMediaCodec_setAsyncNotifyCallback()
578 mData->mAsyncCallbackUserData = userdata; in AMediaCodec_setAsyncNotifyCallback()
582 status_t err = mData->mCodec->setCallback(mData->mAsyncNotify); in AMediaCodec_setAsyncNotifyCallback()
586 Mutex::Autolock _l(mData->mAsyncCallbackLock); in AMediaCodec_setAsyncNotifyCallback()
587 mData->mAsyncCallback = {}; in AMediaCodec_setAsyncNotifyCallback()
588 mData->mAsyncCallbackUserData = nullptr; in AMediaCodec_setAsyncNotifyCallback()
599 AMediaCodec *mData, in AMediaCodec_setOnFrameRenderedCallback() argument
602 Mutex::Autolock _l(mData->mFrameRenderedCallbackLock); in AMediaCodec_setOnFrameRenderedCallback()
603 if (mData->mFrameRenderedNotify == NULL) { in AMediaCodec_setOnFrameRenderedCallback()
604 mData->mFrameRenderedNotify = new AMessage(kWhatFrameRenderedNotify, mData->mHandler); in AMediaCodec_setOnFrameRenderedCallback()
606 status_t err = mData->mCodec->setOnFrameRenderedNotification(mData->mFrameRenderedNotify); in AMediaCodec_setOnFrameRenderedCallback()
612 mData->mFrameRenderedCallback = callback; in AMediaCodec_setOnFrameRenderedCallback()
613 mData->mFrameRenderedCallbackUserData = userdata; in AMediaCodec_setOnFrameRenderedCallback()
619 media_status_t AMediaCodec_releaseCrypto(AMediaCodec *mData) { in AMediaCodec_releaseCrypto() argument
620 return translate_error(mData->mCodec->releaseCrypto()); in AMediaCodec_releaseCrypto()
624 media_status_t AMediaCodec_start(AMediaCodec *mData) { in AMediaCodec_start() argument
625 status_t ret = mData->mCodec->start(); in AMediaCodec_start()
629 mData->mActivityNotification = new AMessage(kWhatActivityNotify, mData->mHandler); in AMediaCodec_start()
630 mData->mActivityNotification->setInt32("generation", mData->mGeneration); in AMediaCodec_start()
631 requestActivityNotification(mData); in AMediaCodec_start()
636 media_status_t AMediaCodec_stop(AMediaCodec *mData) { in AMediaCodec_stop() argument
637 media_status_t ret = translate_error(mData->mCodec->stop()); in AMediaCodec_stop()
639 sp<AMessage> msg = new AMessage(kWhatStopActivityNotifications, mData->mHandler); in AMediaCodec_stop()
642 mData->mActivityNotification.clear(); in AMediaCodec_stop()
648 media_status_t AMediaCodec_flush(AMediaCodec *mData) { in AMediaCodec_flush() argument
649 return translate_error(mData->mCodec->flush()); in AMediaCodec_flush()
653 ssize_t AMediaCodec_dequeueInputBuffer(AMediaCodec *mData, int64_t timeoutUs) { in AMediaCodec_dequeueInputBuffer() argument
655 status_t ret = mData->mCodec->dequeueInputBuffer(&idx, timeoutUs); in AMediaCodec_dequeueInputBuffer()
656 requestActivityNotification(mData); in AMediaCodec_dequeueInputBuffer()
664 uint8_t* AMediaCodec_getInputBuffer(AMediaCodec *mData, size_t idx, size_t *out_size) { in AMediaCodec_getInputBuffer() argument
665 if (mData->mAsyncNotify != NULL) { in AMediaCodec_getInputBuffer()
668 if (mData->mCodec->getInputBuffer(idx, &abuf) != 0) { in AMediaCodec_getInputBuffer()
679 if (mData->mCodec->getInputBuffers(&abufs) == 0) { in AMediaCodec_getInputBuffer()
699 uint8_t* AMediaCodec_getOutputBuffer(AMediaCodec *mData, size_t idx, size_t *out_size) { in AMediaCodec_getOutputBuffer() argument
700 if (mData->mAsyncNotify != NULL) { in AMediaCodec_getOutputBuffer()
703 if (mData->mCodec->getOutputBuffer(idx, &abuf) != 0) { in AMediaCodec_getOutputBuffer()
714 if (mData->mCodec->getOutputBuffers(&abufs) == 0) { in AMediaCodec_getOutputBuffer()
730 media_status_t AMediaCodec_queueInputBuffer(AMediaCodec *mData, in AMediaCodec_queueInputBuffer() argument
734 status_t ret = mData->mCodec->queueInputBuffer(idx, offset, size, time, flags, &errorMsg); in AMediaCodec_queueInputBuffer()
739 ssize_t AMediaCodec_dequeueOutputBuffer(AMediaCodec *mData, in AMediaCodec_dequeueOutputBuffer() argument
746 status_t ret = mData->mCodec->dequeueOutputBuffer(&idx, &offset, &size, &presentationTimeUs, in AMediaCodec_dequeueOutputBuffer()
748 requestActivityNotification(mData); in AMediaCodec_dequeueOutputBuffer()
769 AMediaFormat* AMediaCodec_getOutputFormat(AMediaCodec *mData) { in AMediaCodec_getOutputFormat() argument
771 mData->mCodec->getOutputFormat(&format); in AMediaCodec_getOutputFormat()
776 AMediaFormat* AMediaCodec_getInputFormat(AMediaCodec *mData) { in AMediaCodec_getInputFormat() argument
778 mData->mCodec->getInputFormat(&format); in AMediaCodec_getInputFormat()
783 AMediaFormat* AMediaCodec_getBufferFormat(AMediaCodec *mData, size_t index) { in AMediaCodec_getBufferFormat() argument
785 mData->mCodec->getOutputFormat(index, &format); in AMediaCodec_getBufferFormat()
790 media_status_t AMediaCodec_releaseOutputBuffer(AMediaCodec *mData, size_t idx, bool render) { in AMediaCodec_releaseOutputBuffer() argument
792 return translate_error(mData->mCodec->renderOutputBufferAndRelease(idx)); in AMediaCodec_releaseOutputBuffer()
794 return translate_error(mData->mCodec->releaseOutputBuffer(idx)); in AMediaCodec_releaseOutputBuffer()
800 AMediaCodec *mData, size_t idx, int64_t timestampNs) { in AMediaCodec_releaseOutputBufferAtTime() argument
802 return translate_error(mData->mCodec->renderOutputBufferAndRelease(idx, timestampNs)); in AMediaCodec_releaseOutputBufferAtTime()
806 media_status_t AMediaCodec_setOutputSurface(AMediaCodec *mData, ANativeWindow* window) { in AMediaCodec_setOutputSurface() argument
811 return translate_error(mData->mCodec->setSurface(surface)); in AMediaCodec_setOutputSurface()
815 media_status_t AMediaCodec_createInputSurface(AMediaCodec *mData, ANativeWindow **surface) { in AMediaCodec_createInputSurface() argument
816 if (surface == NULL || mData == NULL) { in AMediaCodec_createInputSurface()
822 status_t err = mData->mCodec->createInputSurface(&igbp); in AMediaCodec_createInputSurface()
857 AMediaCodec *mData, ANativeWindow *surface) { in AMediaCodec_setInputSurface() argument
859 if (surface == NULL || mData == NULL) { in AMediaCodec_setInputSurface()
869 return translate_error(mData->mCodec->setInputSurface( in AMediaCodec_setInputSurface()
875 AMediaCodec *mData, const AMediaFormat* params) { in AMediaCodec_setParameters() argument
876 if (params == NULL || mData == NULL) { in AMediaCodec_setParameters()
883 return translate_error(mData->mCodec->setParameters(nativeParams)); in AMediaCodec_setParameters()
887 media_status_t AMediaCodec_signalEndOfInputStream(AMediaCodec *mData) { in AMediaCodec_signalEndOfInputStream() argument
889 if (mData == NULL) { in AMediaCodec_signalEndOfInputStream()
893 status_t err = mData->mCodec->signalEndOfInputStream(); in AMediaCodec_signalEndOfInputStream()
903 media_status_t AMediaCodec_setNotificationCallback(AMediaCodec *mData, OnCodecEvent callback, in AMediaCodec_setNotificationCallback() argument
905 mData->mCallback = callback; in AMediaCodec_setNotificationCallback()
906 mData->mCallbackUserData = userdata; in AMediaCodec_setNotificationCallback()