Loading camera/ndk/include/camera/NdkCameraMetadataTags.h +20 −4 Original line number Diff line number Diff line Loading @@ -5092,12 +5092,26 @@ typedef enum acamera_metadata_tag { * the following code snippet can be used:</p> * <pre><code>// Returns true if the device supports the required hardware level, or better. * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) { * final int[] sortedHwLevels = { * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL, * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED, * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL, * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3 * }; * int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL); * if (deviceLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY) { * return requiredLevel == deviceLevel; * if (requiredLevel == deviceLevel) { * return true; * } * // deviceLevel is not LEGACY, can use numerical sort * return requiredLevel <= deviceLevel; * * for (int sortedlevel : sortedHwLevels) { * if (sortedlevel == requiredLevel) { * return true; * } else if (sortedlevel == deviceLevel) { * return false; * } * } * return false; // Should never reach here * } * </code></pre> * <p>At a high level, the levels are:</p> Loading @@ -5111,6 +5125,8 @@ typedef enum acamera_metadata_tag { * post-processing settings, and image capture at a high rate.</li> * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along * with additional output stream configurations.</li> * <li><code>EXTERNAL</code> devices are similar to <code>LIMITED</code> devices with exceptions like some sensor or * lens information not reorted or less stable framerates.</li> * </ul> * <p>See the individual level enums for full descriptions of the supported capabilities. The * ACAMERA_REQUEST_AVAILABLE_CAPABILITIES entry describes the device's capabilities at a Loading media/libstagefright/MediaCodec.cpp +14 −6 Original line number Diff line number Diff line Loading @@ -860,7 +860,15 @@ static CodecBase *CreateCCodec() { } //static sp<CodecBase> MediaCodec::GetCodecBase(const AString &name) { sp<CodecBase> MediaCodec::GetCodecBase(const AString &name, const char *owner) { if (owner) { if (strncmp(owner, "default", 8) == 0) { return new ACodec; } else if (strncmp(owner, "codec2", 7) == 0) { return CreateCCodec(); } } if (name.startsWithIgnoreCase("c2.")) { return CreateCCodec(); } else if (name.startsWithIgnoreCase("omx.")) { Loading @@ -884,11 +892,6 @@ status_t MediaCodec::init(const AString &name) { // we need to invest in an extra looper to free the main event // queue. mCodec = GetCodecBase(name); if (mCodec == NULL) { return NAME_NOT_FOUND; } mCodecInfo.clear(); bool secureCodec = false; Loading Loading @@ -922,6 +925,11 @@ status_t MediaCodec::init(const AString &name) { return NAME_NOT_FOUND; } mCodec = GetCodecBase(name, mCodecInfo->getOwnerName()); if (mCodec == NULL) { return NAME_NOT_FOUND; } if (mIsVideo) { // video codec needs dedicated looper if (mCodecLooper == NULL) { Loading media/libstagefright/include/media/stagefright/MediaCodec.h +1 −1 Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ private: MediaCodec(const sp<ALooper> &looper, pid_t pid, uid_t uid); static sp<CodecBase> GetCodecBase(const AString &name); static sp<CodecBase> GetCodecBase(const AString &name, const char *owner = nullptr); static status_t PostAndAwaitResponse( const sp<AMessage> &msg, sp<AMessage> *response); Loading Loading
camera/ndk/include/camera/NdkCameraMetadataTags.h +20 −4 Original line number Diff line number Diff line Loading @@ -5092,12 +5092,26 @@ typedef enum acamera_metadata_tag { * the following code snippet can be used:</p> * <pre><code>// Returns true if the device supports the required hardware level, or better. * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) { * final int[] sortedHwLevels = { * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL, * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED, * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL, * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3 * }; * int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL); * if (deviceLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY) { * return requiredLevel == deviceLevel; * if (requiredLevel == deviceLevel) { * return true; * } * // deviceLevel is not LEGACY, can use numerical sort * return requiredLevel <= deviceLevel; * * for (int sortedlevel : sortedHwLevels) { * if (sortedlevel == requiredLevel) { * return true; * } else if (sortedlevel == deviceLevel) { * return false; * } * } * return false; // Should never reach here * } * </code></pre> * <p>At a high level, the levels are:</p> Loading @@ -5111,6 +5125,8 @@ typedef enum acamera_metadata_tag { * post-processing settings, and image capture at a high rate.</li> * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along * with additional output stream configurations.</li> * <li><code>EXTERNAL</code> devices are similar to <code>LIMITED</code> devices with exceptions like some sensor or * lens information not reorted or less stable framerates.</li> * </ul> * <p>See the individual level enums for full descriptions of the supported capabilities. The * ACAMERA_REQUEST_AVAILABLE_CAPABILITIES entry describes the device's capabilities at a Loading
media/libstagefright/MediaCodec.cpp +14 −6 Original line number Diff line number Diff line Loading @@ -860,7 +860,15 @@ static CodecBase *CreateCCodec() { } //static sp<CodecBase> MediaCodec::GetCodecBase(const AString &name) { sp<CodecBase> MediaCodec::GetCodecBase(const AString &name, const char *owner) { if (owner) { if (strncmp(owner, "default", 8) == 0) { return new ACodec; } else if (strncmp(owner, "codec2", 7) == 0) { return CreateCCodec(); } } if (name.startsWithIgnoreCase("c2.")) { return CreateCCodec(); } else if (name.startsWithIgnoreCase("omx.")) { Loading @@ -884,11 +892,6 @@ status_t MediaCodec::init(const AString &name) { // we need to invest in an extra looper to free the main event // queue. mCodec = GetCodecBase(name); if (mCodec == NULL) { return NAME_NOT_FOUND; } mCodecInfo.clear(); bool secureCodec = false; Loading Loading @@ -922,6 +925,11 @@ status_t MediaCodec::init(const AString &name) { return NAME_NOT_FOUND; } mCodec = GetCodecBase(name, mCodecInfo->getOwnerName()); if (mCodec == NULL) { return NAME_NOT_FOUND; } if (mIsVideo) { // video codec needs dedicated looper if (mCodecLooper == NULL) { Loading
media/libstagefright/include/media/stagefright/MediaCodec.h +1 −1 Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ private: MediaCodec(const sp<ALooper> &looper, pid_t pid, uid_t uid); static sp<CodecBase> GetCodecBase(const AString &name); static sp<CodecBase> GetCodecBase(const AString &name, const char *owner = nullptr); static status_t PostAndAwaitResponse( const sp<AMessage> &msg, sp<AMessage> *response); Loading