Lines Matching refs:inputFrame

757         InputFrame& inputFrame(it->second);  in compilePendingInputLocked()  local
758 if (inputFrame.codecInputCounter < mGridRows * mGridCols) { in compilePendingInputLocked()
762 mGridRows * mGridCols - inputFrame.codecInputCounter); in compilePendingInputLocked()
765 { mCodecInputBuffers[0], mGridTimestampUs++, inputFrame.codecInputCounter }; in compilePendingInputLocked()
766 inputFrame.codecInputBuffers.push_back(inputInfo); in compilePendingInputLocked()
769 inputFrame.codecInputCounter++; in compilePendingInputLocked()
827 InputFrame &inputFrame) { in processInputFrame() argument
832 (inputFrame.appSegmentBuffer.data != nullptr || inputFrame.exifError) && in processInputFrame()
833 !inputFrame.appSegmentWritten && inputFrame.result != nullptr && in processInputFrame()
834 inputFrame.muxer != nullptr; in processInputFrame()
835 bool codecOutputReady = inputFrame.codecOutputBuffers.size() > 0; in processInputFrame()
836 bool codecInputReady = inputFrame.yuvBuffer.data != nullptr && in processInputFrame()
837 !inputFrame.codecInputBuffers.empty(); in processInputFrame()
838 bool hasOutputBuffer = inputFrame.muxer != nullptr || in processInputFrame()
844 inputFrame.timestamp); in processInputFrame()
848 res = processCodecInputFrame(inputFrame); in processInputFrame()
863 if (inputFrame.muxer == nullptr) { in processInputFrame()
864 res = startMuxerForInputFrame(frameNumber, inputFrame); in processInputFrame()
874 res = processAppSegment(frameNumber, inputFrame); in processInputFrame()
883 while (!inputFrame.codecOutputBuffers.empty()) { in processInputFrame()
884 res = processOneCodecOutputFrame(frameNumber, inputFrame); in processInputFrame()
892 if (inputFrame.pendingOutputTiles == 0) { in processInputFrame()
893 if (inputFrame.appSegmentWritten) { in processInputFrame()
894 res = processCompletedInputFrame(frameNumber, inputFrame); in processInputFrame()
910 status_t HeicCompositeStream::startMuxerForInputFrame(int64_t frameNumber, InputFrame &inputFrame) { in startMuxerForInputFrame() argument
913 auto res = outputANW->dequeueBuffer(mOutputSurface.get(), &inputFrame.anb, &inputFrame.fenceFd); in startMuxerForInputFrame()
925 inputFrame.fileFd = syscall(__NR_memfd_create, tempOutputFile.str().c_str(), MFD_CLOEXEC); in startMuxerForInputFrame()
926 if (inputFrame.fileFd < 0) { in startMuxerForInputFrame()
931 inputFrame.muxer = new MediaMuxer(inputFrame.fileFd, MediaMuxer::OUTPUT_FORMAT_HEIF); in startMuxerForInputFrame()
932 if (inputFrame.muxer == nullptr) { in startMuxerForInputFrame()
934 __FUNCTION__, inputFrame.fileFd); in startMuxerForInputFrame()
938 res = inputFrame.muxer->setOrientationHint(inputFrame.orientation); in startMuxerForInputFrame()
945 ssize_t trackId = inputFrame.muxer->addTrack(inputFrame.format); in startMuxerForInputFrame()
951 inputFrame.trackIndex = trackId; in startMuxerForInputFrame()
952 inputFrame.pendingOutputTiles = mNumOutputTiles; in startMuxerForInputFrame()
954 res = inputFrame.muxer->start(); in startMuxerForInputFrame()
966 status_t HeicCompositeStream::processAppSegment(int64_t frameNumber, InputFrame &inputFrame) { in processAppSegment() argument
969 if (!inputFrame.exifError) { in processAppSegment()
970 appSegmentSize = findAppSegmentsSize(inputFrame.appSegmentBuffer.data, in processAppSegment()
971 inputFrame.appSegmentBuffer.width * inputFrame.appSegmentBuffer.height, in processAppSegment()
980 auto exifRes = inputFrame.exifError ? in processAppSegment()
982 exifUtils->initialize(inputFrame.appSegmentBuffer.data, app1Size); in processAppSegment()
987 exifRes = exifUtils->setFromMetadata(*inputFrame.result, mStaticInfo, in processAppSegment()
993 exifRes = exifUtils->setOrientation(inputFrame.orientation); in processAppSegment()
1018 inputFrame.appSegmentBuffer.data + app1Size, appSegmentSize - app1Size); in processAppSegment()
1022 auto res = inputFrame.muxer->writeSampleData(aBuffer, inputFrame.trackIndex, in processAppSegment()
1023 inputFrame.timestamp, MediaCodec::BUFFER_FLAG_MUXER_DATA); in processAppSegment()
1033 __FUNCTION__, frameNumber, appSegmentSize, inputFrame.appSegmentBuffer.width, in processAppSegment()
1034 inputFrame.appSegmentBuffer.height, app1Size); in processAppSegment()
1036 inputFrame.appSegmentWritten = true; in processAppSegment()
1038 mAppSegmentConsumer->unlockBuffer(inputFrame.appSegmentBuffer); in processAppSegment()
1039 inputFrame.appSegmentBuffer.data = nullptr; in processAppSegment()
1040 inputFrame.exifError = false; in processAppSegment()
1046 status_t HeicCompositeStream::processCodecInputFrame(InputFrame &inputFrame) { in processCodecInputFrame() argument
1047 for (auto& inputBuffer : inputFrame.codecInputBuffers) { in processCodecInputFrame()
1069 res = copyOneYuvTile(buffer, inputFrame.yuvBuffer, top, left, width, height); in processCodecInputFrame()
1085 inputFrame.codecInputBuffers.clear(); in processCodecInputFrame()
1090 InputFrame &inputFrame) { in processOneCodecOutputFrame() argument
1091 auto it = inputFrame.codecOutputBuffers.begin(); in processOneCodecOutputFrame()
1106 res = inputFrame.muxer->writeSampleData( in processOneCodecOutputFrame()
1107 aBuffer, inputFrame.trackIndex, inputFrame.timestamp, 0 /*flags*/); in processOneCodecOutputFrame()
1115 if (inputFrame.pendingOutputTiles == 0) { in processOneCodecOutputFrame()
1118 inputFrame.pendingOutputTiles--; in processOneCodecOutputFrame()
1121 inputFrame.codecOutputBuffers.erase(inputFrame.codecOutputBuffers.begin()); in processOneCodecOutputFrame()
1129 InputFrame &inputFrame) { in processCompletedInputFrame() argument
1131 inputFrame.muxer->stop(); in processCompletedInputFrame()
1134 sp<GraphicBuffer> gb = GraphicBuffer::from(inputFrame.anb); in processCompletedInputFrame()
1136 auto res = gb->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, &dstBuffer, inputFrame.fenceFd); in processCompletedInputFrame()
1143 off_t fSize = lseek(inputFrame.fileFd, 0, SEEK_END); in processCompletedInputFrame()
1150 lseek(inputFrame.fileFd, 0, SEEK_SET); in processCompletedInputFrame()
1151 ssize_t bytesRead = read(inputFrame.fileFd, dstBuffer, fSize); in processCompletedInputFrame()
1157 close(inputFrame.fileFd); in processCompletedInputFrame()
1158 inputFrame.fileFd = -1; in processCompletedInputFrame()
1167 res = native_window_set_buffers_timestamp(mOutputSurface.get(), inputFrame.timestamp); in processCompletedInputFrame()
1174 res = outputANW->queueBuffer(mOutputSurface.get(), inputFrame.anb, /*fence*/ -1); in processCompletedInputFrame()
1180 inputFrame.anb = nullptr; in processCompletedInputFrame()
1190 InputFrame *inputFrame /*out*/) { in releaseInputFrameLocked() argument
1191 if (inputFrame == nullptr) { in releaseInputFrameLocked()
1195 if (inputFrame->appSegmentBuffer.data != nullptr) { in releaseInputFrameLocked()
1196 mAppSegmentConsumer->unlockBuffer(inputFrame->appSegmentBuffer); in releaseInputFrameLocked()
1197 inputFrame->appSegmentBuffer.data = nullptr; in releaseInputFrameLocked()
1200 while (!inputFrame->codecOutputBuffers.empty()) { in releaseInputFrameLocked()
1201 auto it = inputFrame->codecOutputBuffers.begin(); in releaseInputFrameLocked()
1204 inputFrame->codecOutputBuffers.erase(it); in releaseInputFrameLocked()
1207 if (inputFrame->yuvBuffer.data != nullptr) { in releaseInputFrameLocked()
1208 mMainImageConsumer->unlockBuffer(inputFrame->yuvBuffer); in releaseInputFrameLocked()
1209 inputFrame->yuvBuffer.data = nullptr; in releaseInputFrameLocked()
1213 while (!inputFrame->codecInputBuffers.empty()) { in releaseInputFrameLocked()
1214 auto it = inputFrame->codecInputBuffers.begin(); in releaseInputFrameLocked()
1215 inputFrame->codecInputBuffers.erase(it); in releaseInputFrameLocked()
1218 if (inputFrame->error || mErrorState) { in releaseInputFrameLocked()
1220 notifyError(frameNumber, inputFrame->requestId); in releaseInputFrameLocked()
1223 if (inputFrame->fileFd >= 0) { in releaseInputFrameLocked()
1224 close(inputFrame->fileFd); in releaseInputFrameLocked()
1225 inputFrame->fileFd = -1; in releaseInputFrameLocked()
1228 if (inputFrame->anb != nullptr) { in releaseInputFrameLocked()
1230 outputANW->cancelBuffer(mOutputSurface.get(), inputFrame->anb, /*fence*/ -1); in releaseInputFrameLocked()
1231 inputFrame->anb = nullptr; in releaseInputFrameLocked()
1241 auto& inputFrame = it->second; in releaseInputFramesLocked() local
1242 if (inputFrame.error || in releaseInputFramesLocked()
1243 (inputFrame.appSegmentWritten && inputFrame.pendingOutputTiles == 0)) { in releaseInputFramesLocked()
1244 releaseInputFrameLocked(it->first, &inputFrame); in releaseInputFramesLocked()
1756 for (const auto& inputFrame : mPendingInputFrames) { in onResultError() local
1757 if (inputFrame.first == resultExtras.frameNumber) { in onResultError()
1758 timestamp = inputFrame.second.timestamp; in onResultError()