Lines Matching refs:config
164 c2_status_t err = mSurface->config({&eos}, C2_MAY_BLOCK, &failures); in signalEndOfInputStream()
171 status_t configure(Config &config __unused) { in configure()
258 status_t configure(Config &config) { in configure() argument
266 if (config.mMinFps > 0 && config.mMinFps != mConfig.mMinFps) { in configure()
267 int64_t us = 1e6 / config.mMinFps + 0.5; in configure()
269 status << " minFps=" << config.mMinFps << " => repeatDelayUs=" << us; in configure()
274 mConfig.mMinFps = config.mMinFps; in configure()
278 if (config.mMinAdjustedFps > 0 || config.mFixedAdjustedFps > 0) { in configure()
282 float gap = (config.mMinAdjustedFps > 0) in configure()
283 ? c2_min(INT32_MAX + 0., 1e6 / config.mMinAdjustedFps + 0.5) in configure()
284 : c2_max(0. - INT32_MAX, -1e6 / config.mFixedAdjustedFps - 0.5); in configure()
296 if ((config.mMaxFps > 0 || (config.mFixedAdjustedFps > 0 && config.mMaxFps == -1)) in configure()
297 && config.mMaxFps != mConfig.mMaxFps) { in configure()
298 status_t res = GetStatus(mSource->setMaxFps(config.mMaxFps)); in configure()
299 status << " maxFps=" << config.mMaxFps; in configure()
304 mConfig.mMaxFps = config.mMaxFps; in configure()
307 if (config.mTimeOffsetUs != mConfig.mTimeOffsetUs) { in configure()
308 status_t res = GetStatus(mSource->setTimeOffsetUs(config.mTimeOffsetUs)); in configure()
309 status << " timeOffset " << config.mTimeOffsetUs << "us"; in configure()
314 mConfig.mTimeOffsetUs = config.mTimeOffsetUs; in configure()
317 if (config.mCaptureFps != mConfig.mCaptureFps || config.mCodedFps != mConfig.mCodedFps) { in configure()
319 GetStatus(mSource->setTimeLapseConfig(config.mCodedFps, config.mCaptureFps)); in configure()
320 status << " timeLapse " << config.mCaptureFps << "fps as " << config.mCodedFps << "fps"; in configure()
325 mConfig.mCaptureFps = config.mCaptureFps; in configure()
326 mConfig.mCodedFps = config.mCodedFps; in configure()
329 if (config.mStartAtUs != mConfig.mStartAtUs in configure()
330 || (config.mStopped != mConfig.mStopped && !config.mStopped)) { in configure()
331 status_t res = GetStatus(mSource->setStartTimeUs(config.mStartAtUs)); in configure()
332 status << " start at " << config.mStartAtUs << "us"; in configure()
337 mConfig.mStartAtUs = config.mStartAtUs; in configure()
338 mConfig.mStopped = config.mStopped; in configure()
342 if (config.mSuspended != mConfig.mSuspended) { in configure()
343 status_t res = GetStatus(mSource->setSuspend(config.mSuspended, config.mSuspendAtUs)); in configure()
344 status << " " << (config.mSuspended ? "suspend" : "resume") in configure()
345 << " at " << config.mSuspendAtUs << "us"; in configure()
350 mConfig.mSuspended = config.mSuspended; in configure()
351 mConfig.mSuspendAtUs = config.mSuspendAtUs; in configure()
354 if (config.mStopped != mConfig.mStopped && config.mStopped) { in configure()
355 status_t res = GetStatus(mSource->setStopTimeUs(config.mStopAtUs)); in configure()
356 status << " stop at " << config.mStopAtUs << "us"; in configure()
362 res = GetStatus(mSource->getStopTimeOffsetUs(&config.mInputDelayUs)); in configure()
366 status << "=" << config.mInputDelayUs << "us"; in configure()
368 mConfig.mInputDelayUs = config.mInputDelayUs; in configure()
370 mConfig.mStopAtUs = config.mStopAtUs; in configure()
371 mConfig.mStopped = config.mStopped; in configure()
410 return mClient->config(params, C2_MAY_BLOCK, failures); in config_sm()
655 Mutexed<Config>::Locked config(mConfig); in allocate() local
656 status_t err = config->initialize(mClient, comp); in allocate()
661 config->queryConfiguration(comp); in allocate()
729 Mutexed<Config>::Locked config(mConfig); in configure() local
730 config->mUsingSurface = surface != nullptr; in configure()
735 if (config->mDomain & Config::IS_AUDIO) { in configure()
744 if ((config->mDomain & Config::IS_ENCODER) in configure()
752 if (config->mDomain & (Config::IS_IMAGE | Config::IS_VIDEO)) { in configure()
761 if ((config->mDomain & Config::IS_ENCODER) && (config->mDomain & Config::IS_VIDEO)) { in configure()
791 if ((config->mDomain & (Config::IS_VIDEO | Config::IS_IMAGE)) in configure()
792 && (config->mDomain & Config::IS_ENCODER)) { in configure()
793 config->mISConfig.reset(new InputSurfaceWrapper::Config{}); in configure()
795 config->mISConfig->mMinFps = 0; in configure()
798 config->mISConfig->mMinFps = 1e6 / value; in configure()
801 KEY_MAX_FPS_TO_ENCODER, &config->mISConfig->mMaxFps)) { in configure()
802 config->mISConfig->mMaxFps = -1; in configure()
804 config->mISConfig->mMinAdjustedFps = 0; in configure()
805 config->mISConfig->mFixedAdjustedFps = 0; in configure()
808 config->mISConfig->mFixedAdjustedFps = -1e6 / value; in configure()
809 config->mISConfig->mMaxFps = -1; in configure()
811 config->mISConfig->mMinAdjustedFps = 1e6 / value; in configure()
821 config->mISConfig->mCaptureFps = timeLapseFps; in configure()
824 config->mISConfig->mCaptureFps = captureRate; in configure()
828 (void)msg->findAsFloat(KEY_FRAME_RATE, &config->mISConfig->mCodedFps); in configure()
833 config->mISConfig->mSuspended = false; in configure()
834 config->mISConfig->mSuspendAtUs = -1; in configure()
837 config->mISConfig->mSuspended = true; in configure()
840 config->mISConfig->mUsage = 0; in configure()
846 if ((config->mDomain & (Config::IS_VIDEO | Config::IS_IMAGE))) { in configure()
853 if (!(config->mDomain & Config::IS_ENCODER)) { in configure()
872 status_t err = config->getConfigUpdateFromSdkParams( in configure()
879 if ((config->mDomain & Config::IS_ENCODER) in configure()
880 && (config->mDomain & Config::IS_VIDEO) in configure()
893 err = config->setParameters(comp, configUpdate, C2_DONT_BLOCK); in configure()
922 config->mInputFormat->setInt32("using-sw-read-often", true); in configure()
924 if (config->mISConfig) { in configure()
926 config->mISConfig->mUsage = androidUsage.asGrallocUsage(); in configure()
940 if (config->mDomain & Config::IS_AUDIO) { in configure()
948 if ((config->mDomain & Config::IS_DECODER) && maxInputSize.value > 0) { in configure()
958 if ((config->mDomain & Config::IS_DECODER) || (config->mDomain & Config::IS_AUDIO)) { in configure()
975 config->mInputFormat->setInt32( in configure()
982 if ((config->mDomain & Config::IS_VIDEO) in configure()
983 && (config->mDomain & Config::IS_ENCODER) in configure()
991 if ((config->mDomain & (Config::IS_VIDEO | Config::IS_IMAGE))) { in configure()
997 && !config->mOutputFormat->findBuffer(KEY_HDR_STATIC_INFO, &hdrInfo)) { in configure()
998 config->mOutputFormat->setBuffer(KEY_HDR_STATIC_INFO, hdrInfo); in configure()
1004 if (config->mDomain & Config::IS_ENCODER) { in configure()
1005 config->mInputFormat->setInt32(KEY_COLOR_FORMAT, format); in configure()
1007 config->mOutputFormat->setInt32(KEY_COLOR_FORMAT, format); in configure()
1013 if ((config->mDomain & Config::IS_DECODER) && (config->mDomain & Config::IS_AUDIO)) { in configure()
1016 config->mOutputFormat->setInt32("encoder-delay", delay); in configure()
1020 config->mOutputFormat->setInt32("encoder-padding", padding); in configure()
1025 if (config->mDomain & Config::IS_AUDIO) { in configure()
1028 if (config->mDomain & Config::IS_ENCODER) { in configure()
1029 config->mInputFormat->setInt32(KEY_CHANNEL_MASK, mask); in configure()
1031 config->mOutputFormat->setInt32(KEY_CHANNEL_MASK, mask); in configure()
1037 config->mInputFormat->debugString().c_str(), in configure()
1038 config->mOutputFormat->debugString().c_str()); in configure()
1045 Mutexed<Config>::Locked config(mConfig); in configure() local
1047 mCallback->onComponentConfigured(config->mInputFormat, config->mOutputFormat); in configure()
1121 Mutexed<Config>::Locked config(mConfig); in createInputSurface() local
1122 inputFormat = config->mInputFormat; in createInputSurface()
1123 outputFormat = config->mOutputFormat; in createInputSurface()
1124 usage = config->mISConfig ? config->mISConfig->mUsage : 0; in createInputSurface()
1165 Mutexed<Config>::Locked config(mConfig); in setupInputSurface() local
1166 config->mUsingSurface = true; in setupInputSurface()
1170 bool inputFormatChanged = config->updateFormats(config->IS_INPUT); in setupInputSurface()
1173 config->mInputFormat->debugString().c_str()); in setupInputSurface()
1178 (void)config->mInputFormat->findInt32("android._dataspace", (int32_t*)&dataSpace); in setupInputSurface()
1184 config->mUsingSurface = false; in setupInputSurface()
1185 (void)config->updateFormats(config->IS_INPUT); in setupInputSurface()
1188 config->mInputSurface = surface; in setupInputSurface()
1190 if (config->mISConfig) { in setupInputSurface()
1191 surface->configure(*config->mISConfig); in setupInputSurface()
1210 Mutexed<Config>::Locked config(mConfig); in setInputSurface() local
1211 inputFormat = config->mInputFormat; in setInputSurface()
1212 outputFormat = config->mOutputFormat; in setInputSurface()
1213 usage = config->mISConfig ? config->mISConfig->mUsage : 0; in setInputSurface()
1287 Mutexed<Config>::Locked config(mConfig); in start() local
1288 inputFormat = config->mInputFormat; in start()
1290 outputFormat = config->mOutputFormat = config->mOutputFormat->dup(); in start()
1291 if (config->mInputSurface) { in start()
1292 err2 = config->mInputSurface->start(); in start()
1376 Mutexed<Config>::Locked config(mConfig); in stop() local
1377 if (config->mInputSurface) { in stop()
1378 config->mInputSurface->disconnect(); in stop()
1379 config->mInputSurface = nullptr; in stop()
1424 Mutexed<Config>::Locked config(mConfig); in initiateRelease() local
1425 if (config->mInputSurface) { in initiateRelease()
1426 config->mInputSurface->disconnect(); in initiateRelease()
1427 config->mInputSurface = nullptr; in initiateRelease()
1545 Mutexed<Config>::Locked config(mConfig); in signalResume() local
1546 config->queryConfiguration(comp); in signalResume()
1588 Mutexed<Config>::Locked config(mConfig); in signalSetParameters() local
1593 if ((config->mDomain & (Config::IS_VIDEO | Config::IS_IMAGE)) in signalSetParameters()
1594 … && (config->mDomain & Config::IS_ENCODER) && config->mInputSurface && config->mISConfig) { in signalSetParameters()
1595 (void)params->findInt64(PARAMETER_KEY_OFFSET_TIME, &config->mISConfig->mTimeOffsetUs); in signalSetParameters()
1597 if (params->findInt64("skip-frames-before", &config->mISConfig->mStartAtUs)) { in signalSetParameters()
1598 config->mISConfig->mStopped = false; in signalSetParameters()
1599 } else if (params->findInt64("stop-time-us", &config->mISConfig->mStopAtUs)) { in signalSetParameters()
1600 config->mISConfig->mStopped = true; in signalSetParameters()
1605 config->mISConfig->mSuspended = value; in signalSetParameters()
1606 config->mISConfig->mSuspendAtUs = -1; in signalSetParameters()
1607 (void)params->findInt64(PARAMETER_KEY_SUSPEND_TIME, &config->mISConfig->mSuspendAtUs); in signalSetParameters()
1610 (void)config->mInputSurface->configure(*config->mISConfig); in signalSetParameters()
1611 if (config->mISConfig->mStopped) { in signalSetParameters()
1612 config->mInputFormat->setInt64( in signalSetParameters()
1613 "android._stop-time-offset-us", config->mISConfig->mInputDelayUs); in signalSetParameters()
1618 (void)config->getConfigUpdateFromSdkParams( in signalSetParameters()
1623 if (config->mInputSurface == nullptr in signalSetParameters()
1628 (void)config->setParameters(comp, configUpdate, C2_MAY_BLOCK); in signalSetParameters()
1647 Mutexed<Config>::Locked config(mConfig); in signalRequestIDRFrame() local
1651 config->setParameters(comp, params, C2_MAY_BLOCK); in signalRequestIDRFrame()
1666 Mutexed<Config>::Locked config(mConfig); in onInputBufferDone() local
1667 if (config->mInputSurface) { in onInputBufferDone()
1668 config->mInputSurface->onInputBufferDone(frameIndex); in onInputBufferDone()
1743 Mutexed<Config>::Locked config(mConfig); in onMessageReceived() local
1746 config->watch<C2StreamInitDataInfo::output>(); in onMessageReceived()
1779 if (config->updateConfiguration(updates, config->mOutputDomain)) { in onMessageReceived()
1800 config->getConfigParameterValue(ix.withStream(stream)); in onMessageReceived()
1811 if (config->mInputSurface) { in onMessageReceived()
1812 config->mInputSurface->onInputBufferDone(work->input.ordinal.frameIndex); in onMessageReceived()
1815 std::move(work), changed ? config->mOutputFormat : nullptr, in onMessageReceived()