Loading camera/ndk/include/camera/NdkCameraMetadataTags.h +16 −1 Original line number Diff line number Diff line Loading @@ -3578,7 +3578,7 @@ typedef enum acamera_metadata_tag { * android.scaler.availableInputOutputFormatsMap.</p> * <p>The following table describes the minimum required output stream * configurations based on the hardware level * (ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL):</p> * (ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL), prior to Android 12:</p> * <p>Format | Size | Hardware Level | Notes * :-------------:|:--------------------------------------------:|:--------------:|:--------------: * JPEG | ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE | Any | Loading @@ -3589,6 +3589,21 @@ typedef enum acamera_metadata_tag { * YUV_420_888 | all output sizes available for JPEG | FULL | * YUV_420_888 | all output sizes available for JPEG, up to the maximum video size | LIMITED | * IMPLEMENTATION_DEFINED | same as YUV_420_888 | Any |</p> * <p>Starting from Android 12, the camera device may not support JPEG sizes smaller than the * minimum of 1080p and the camera sensor active array size. The requirements for * IMPLEMENTATION_DEFINED and YUV_420_888 stay the same. This new minimum required output * stream configurations are illustrated by the table below:</p> * <p>Format | Size | Hardware Level | Notes * :-------------:|:--------------------------------------------:|:--------------:|:--------------: * JPEG | ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE | Any | * JPEG | 1920x1080 (1080p) | Any | if 1080p <= activeArraySize * YUV_420_888 | ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE | FULL | * YUV_420_888 | 1920x1080 (1080p) | FULL | if 1080p <= activeArraySize * YUV_420_888 | 1280x720 (720) | FULL | if 720p <= activeArraySize * YUV_420_888 | 640x480 (480p) | FULL | if 480p <= activeArraySize * YUV_420_888 | 320x240 (240p) | FULL | if 240p <= activeArraySize * YUV_420_888 | all output sizes available for FULL hardware level, up to the maximum video size | LIMITED | * IMPLEMENTATION_DEFINED | same as YUV_420_888 | Any |</p> * <p>Refer to ACAMERA_REQUEST_AVAILABLE_CAPABILITIES for additional * mandatory stream configurations on a per-capability basis.</p> * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability for Loading media/codec2/sfplugin/C2OMXNode.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ public: } } void setPriority(int priority) { androidSetThreadPriority(getTid(), priority); } protected: bool threadLoop() override { constexpr nsecs_t kIntervalNs = nsecs_t(10) * 1000 * 1000; // 10ms Loading Loading @@ -529,4 +533,8 @@ android_dataspace C2OMXNode::getDataspace() { return *mDataspace.lock(); } void C2OMXNode::setPriority(int priority) { mQueueThread->setPriority(priority); } } // namespace android media/codec2/sfplugin/C2OMXNode.h +5 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,11 @@ struct C2OMXNode : public BnOMXNode { */ android_dataspace getDataspace(); /** * Sets priority of the queue thread. */ void setPriority(int priority); private: std::weak_ptr<Codec2Client::Component> mComp; sp<IOMXBufferSource> mBufferSource; Loading media/codec2/sfplugin/CCodec.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -397,6 +397,14 @@ public: // consumer usage is queried earlier. // priority if (mConfig.mPriority != config.mPriority) { if (config.mPriority != INT_MAX) { mNode->setPriority(config.mPriority); } mConfig.mPriority = config.mPriority; } if (status.str().empty()) { ALOGD("ISConfig not changed"); } else { Loading Loading @@ -944,6 +952,7 @@ void CCodec::configure(const sp<AMessage> &msg) { } } config->mISConfig->mUsage = 0; config->mISConfig->mPriority = INT_MAX; } /* Loading Loading @@ -1135,6 +1144,16 @@ void CCodec::configure(const sp<AMessage> &msg) { configUpdate.push_back(std::move(qp)); } int32_t background = 0; if ((config->mDomain & Config::IS_VIDEO) && msg->findInt32("android._background-mode", &background) && background) { androidSetThreadPriority(gettid(), ANDROID_PRIORITY_BACKGROUND); if (config->mISConfig) { config->mISConfig->mPriority = ANDROID_PRIORITY_BACKGROUND; } } err = config->setParameters(comp, configUpdate, C2_DONT_BLOCK); if (err != OK) { ALOGW("failed to configure c2 params"); Loading media/codec2/sfplugin/InputSurfaceWrapper.h +1 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ public: float mFixedAdjustedFps = 0.0; // fixed fps via PTS manipulation float mMinAdjustedFps = 0.0; // minimum fps via PTS manipulation uint64_t mUsage = 0; // consumer usage int mPriority = INT_MAX; // priority of queue thread (if any); INT_MAX for no-op }; /** Loading Loading
camera/ndk/include/camera/NdkCameraMetadataTags.h +16 −1 Original line number Diff line number Diff line Loading @@ -3578,7 +3578,7 @@ typedef enum acamera_metadata_tag { * android.scaler.availableInputOutputFormatsMap.</p> * <p>The following table describes the minimum required output stream * configurations based on the hardware level * (ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL):</p> * (ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL), prior to Android 12:</p> * <p>Format | Size | Hardware Level | Notes * :-------------:|:--------------------------------------------:|:--------------:|:--------------: * JPEG | ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE | Any | Loading @@ -3589,6 +3589,21 @@ typedef enum acamera_metadata_tag { * YUV_420_888 | all output sizes available for JPEG | FULL | * YUV_420_888 | all output sizes available for JPEG, up to the maximum video size | LIMITED | * IMPLEMENTATION_DEFINED | same as YUV_420_888 | Any |</p> * <p>Starting from Android 12, the camera device may not support JPEG sizes smaller than the * minimum of 1080p and the camera sensor active array size. The requirements for * IMPLEMENTATION_DEFINED and YUV_420_888 stay the same. This new minimum required output * stream configurations are illustrated by the table below:</p> * <p>Format | Size | Hardware Level | Notes * :-------------:|:--------------------------------------------:|:--------------:|:--------------: * JPEG | ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE | Any | * JPEG | 1920x1080 (1080p) | Any | if 1080p <= activeArraySize * YUV_420_888 | ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE | FULL | * YUV_420_888 | 1920x1080 (1080p) | FULL | if 1080p <= activeArraySize * YUV_420_888 | 1280x720 (720) | FULL | if 720p <= activeArraySize * YUV_420_888 | 640x480 (480p) | FULL | if 480p <= activeArraySize * YUV_420_888 | 320x240 (240p) | FULL | if 240p <= activeArraySize * YUV_420_888 | all output sizes available for FULL hardware level, up to the maximum video size | LIMITED | * IMPLEMENTATION_DEFINED | same as YUV_420_888 | Any |</p> * <p>Refer to ACAMERA_REQUEST_AVAILABLE_CAPABILITIES for additional * mandatory stream configurations on a per-capability basis.</p> * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability for Loading
media/codec2/sfplugin/C2OMXNode.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ public: } } void setPriority(int priority) { androidSetThreadPriority(getTid(), priority); } protected: bool threadLoop() override { constexpr nsecs_t kIntervalNs = nsecs_t(10) * 1000 * 1000; // 10ms Loading Loading @@ -529,4 +533,8 @@ android_dataspace C2OMXNode::getDataspace() { return *mDataspace.lock(); } void C2OMXNode::setPriority(int priority) { mQueueThread->setPriority(priority); } } // namespace android
media/codec2/sfplugin/C2OMXNode.h +5 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,11 @@ struct C2OMXNode : public BnOMXNode { */ android_dataspace getDataspace(); /** * Sets priority of the queue thread. */ void setPriority(int priority); private: std::weak_ptr<Codec2Client::Component> mComp; sp<IOMXBufferSource> mBufferSource; Loading
media/codec2/sfplugin/CCodec.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -397,6 +397,14 @@ public: // consumer usage is queried earlier. // priority if (mConfig.mPriority != config.mPriority) { if (config.mPriority != INT_MAX) { mNode->setPriority(config.mPriority); } mConfig.mPriority = config.mPriority; } if (status.str().empty()) { ALOGD("ISConfig not changed"); } else { Loading Loading @@ -944,6 +952,7 @@ void CCodec::configure(const sp<AMessage> &msg) { } } config->mISConfig->mUsage = 0; config->mISConfig->mPriority = INT_MAX; } /* Loading Loading @@ -1135,6 +1144,16 @@ void CCodec::configure(const sp<AMessage> &msg) { configUpdate.push_back(std::move(qp)); } int32_t background = 0; if ((config->mDomain & Config::IS_VIDEO) && msg->findInt32("android._background-mode", &background) && background) { androidSetThreadPriority(gettid(), ANDROID_PRIORITY_BACKGROUND); if (config->mISConfig) { config->mISConfig->mPriority = ANDROID_PRIORITY_BACKGROUND; } } err = config->setParameters(comp, configUpdate, C2_DONT_BLOCK); if (err != OK) { ALOGW("failed to configure c2 params"); Loading
media/codec2/sfplugin/InputSurfaceWrapper.h +1 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ public: float mFixedAdjustedFps = 0.0; // fixed fps via PTS manipulation float mMinAdjustedFps = 0.0; // minimum fps via PTS manipulation uint64_t mUsage = 0; // consumer usage int mPriority = INT_MAX; // priority of queue thread (if any); INT_MAX for no-op }; /** Loading