diff options
Diffstat (limited to 'services/camera/libcameraservice/api1/client2/Parameters.h')
-rw-r--r-- | services/camera/libcameraservice/api1/client2/Parameters.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/services/camera/libcameraservice/api1/client2/Parameters.h b/services/camera/libcameraservice/api1/client2/Parameters.h index e628a7e..972d007 100644 --- a/services/camera/libcameraservice/api1/client2/Parameters.h +++ b/services/camera/libcameraservice/api1/client2/Parameters.h @@ -166,6 +166,9 @@ struct Parameters { bool previewCallbackSurface; bool zslMode; + // Whether the jpeg stream is slower than 30FPS and can slow down preview. + // When slowJpegMode is true, zslMode must be false to avoid slowing down preview. + bool slowJpegMode; // Overall camera state enum State { @@ -190,6 +193,8 @@ struct Parameters { static const int MAX_INITIAL_PREVIEW_HEIGHT = 1080; // Aspect ratio tolerance static const CONSTEXPR float ASPECT_RATIO_TOLERANCE = 0.001; + // Threshold for slow jpeg mode + static const int64_t kSlowJpegModeThreshold = 33400000LL; // 33.4 ms // Full static camera info, object owned by someone else, such as // Camera2Device. @@ -271,21 +276,16 @@ struct Parameters { // if video snapshot size is currently overridden bool isJpegSizeOverridden(); - // Calculate the crop region rectangle based on current stream sizes + // Calculate the crop region rectangle, either tightly about the preview + // resolution, or a region just based on the active array; both take + // into account the current zoom level. struct CropRegion { float left; float top; float width; float height; - - enum Outputs { - OUTPUT_PREVIEW = 0x01, - OUTPUT_VIDEO = 0x02, - OUTPUT_JPEG_THUMBNAIL = 0x04, - OUTPUT_PICTURE = 0x08, - }; }; - CropRegion calculateCropRegion(CropRegion::Outputs outputs) const; + CropRegion calculateCropRegion(bool previewOnly) const; // Calculate the field of view of the high-resolution JPEG capture status_t calculatePictureFovs(float *horizFov, float *vertFov) const; @@ -382,15 +382,23 @@ private: int32_t height; int32_t isInput; }; + // Helper function extract available stream configuration // Only valid since device HAL version 3.2 // returns an empty Vector if device HAL version does support it Vector<StreamConfiguration> getStreamConfigurations(); + // Helper function to get minimum frame duration for a jpeg size + // return -1 if input jpeg size cannot be found in supported size list + int64_t getJpegStreamMinFrameDurationNs(Parameters::Size size); + // Helper function to get non-duplicated available output formats SortedVector<int32_t> getAvailableOutputFormats(); // Helper function to get available output jpeg sizes Vector<Size> getAvailableJpegSizes(); + // Helper function to get maximum size in input Size vector. + // The maximum size is defined by comparing width first, when width ties comparing height. + Size getMaxSize(const Vector<Size>& sizes); int mDeviceVersion; }; |