From c748f2223b08917174d5cc78a83aa7e9bf52ceab Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Tue, 30 Jul 2024 02:43:03 +0000 Subject: [PATCH 1/2] add rotate for camera Signed-off-by: kerongfeng --- multimedia/camera_framework/dif.diff | 106 +++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 multimedia/camera_framework/dif.diff diff --git a/multimedia/camera_framework/dif.diff b/multimedia/camera_framework/dif.diff new file mode 100644 index 000000000..061b6f1e9 --- /dev/null +++ b/multimedia/camera_framework/dif.diff @@ -0,0 +1,106 @@ +From cfac062ab4b86dad0f21480ee514bb44e5d7cd58 Mon Sep 17 00:00:00 2001 +From: w00599949 +Date: Tue, 30 Jul 2024 10:19:51 +0800 +Subject: [PATCH] TicketN:DTS2024072913270 Description:provide get/set rotation + angle methods Team:OTHERS Feature or Bugfix:Bugfix Binary Source:No + PrivateCode(Yes/No):No + +Change-Id: I979845f9e7e3b3db629672da79b6df681e5d2558 +--- + multimedia/camera_framework/photo_output.h | 14 ++++++++++ + multimedia/camera_framework/preview_output.h | 28 ++++++++++++++++++++ + multimedia/camera_framework/video_output.h | 14 ++++++++++ + 3 files changed, 56 insertions(+) + +diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h +index 3c32b97..fa36b13 100644 +--- a/multimedia/camera_framework/photo_output.h ++++ b/multimedia/camera_framework/photo_output.h +@@ -194,6 +194,20 @@ Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput); + */ + Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported); + ++/** ++ * @brief Gets the photo rotation angle. ++ * ++ * @param photoOutput the {@link Camera_PhotoOutput} instance which used to get the photo rotation angle. ++ * @param deviceDegree the current device rotation degree. ++ * @param imageRotation the {@link Camera_ImageRotation} result of photo rotation angle. ++ * @return {@link #CAMERA_OK} if the method call succeeds. ++ * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. ++ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. ++ * @since 12 ++ */ ++Camera_ErrorCode OH_PhotoOutput_GetPhotoRotation(Camera_PhotoOutput* photoOutput, int deviceDegree, ++ Camera_ImageRotation* imageRotation); ++ + #ifdef __cplusplus + } + #endif +diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h +index 96b267f..a9706e8 100644 +--- a/multimedia/camera_framework/preview_output.h ++++ b/multimedia/camera_framework/preview_output.h +@@ -167,6 +167,34 @@ Camera_ErrorCode OH_PreviewOutput_Stop(Camera_PreviewOutput* previewOutput); + */ + Camera_ErrorCode OH_PreviewOutput_Release(Camera_PreviewOutput* previewOutput); + ++/** ++ * @brief Gets the preview rotation angle. ++ * ++ * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get the preview rotation angle. ++ * @param displayRotation the current display rotation angle. ++ * @param imageRotation the {@link Camera_ImageRotation} result of preview rotation angle. ++ * @return {@link #CAMERA_OK} if the method call succeeds. ++ * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. ++ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. ++ * @since 12 ++ */ ++Camera_ErrorCode OH_PreviewOutput_GetPreviewRotation(Camera_PreviewOutput* previewOutput, int displayRotation, ++ Camera_ImageRotation* imageRotation); ++ ++/** ++ * @brief Sets the preview rotation angle. ++ * ++ * @param previewOutput the {@link Camera_PreviewOutput} instance which used to set the preview rotation angle. ++ * @param imageRotation the {@link Camera_ImageRotation} of preview display rotation angle. ++ * @param isDisplayLocked TRUE means the display is locked. ++ * @return {@link #CAMERA_OK} if the method call succeeds. ++ * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. ++ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. ++ * @since 12 ++ */ ++Camera_ErrorCode OH_PreviewOutput_SetPreviewRotation(Camera_PreviewOutput* previewOutput, ++ Camera_ImageRotation imageRotation, bool isDisplayLocked); ++ + #ifdef __cplusplus + } + #endif +diff --git a/multimedia/camera_framework/video_output.h b/multimedia/camera_framework/video_output.h +index 8b50c44..d6e6b8f 100644 +--- a/multimedia/camera_framework/video_output.h ++++ b/multimedia/camera_framework/video_output.h +@@ -165,6 +165,20 @@ Camera_ErrorCode OH_VideoOutput_Stop(Camera_VideoOutput* videoOutput); + */ + Camera_ErrorCode OH_VideoOutput_Release(Camera_VideoOutput* videoOutput); + ++/** ++ * @brief Gets the video rotation angle. ++ * ++ * @param videoOutput the {@link Camera_VideoOutput} instance which used to get the video rotation angle. ++ * @param deviceDegree the current device rotation degree. ++ * @param imageRotation the {@link Camera_ImageRotation} result of video rotation angle. ++ * @return {@link #CAMERA_OK} if the method call succeeds. ++ * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. ++ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. ++ * @since 12 ++ */ ++Camera_ErrorCode OH_VideoOutput_GetVideoRotation(Camera_VideoOutput* videoOutput, int deviceDegree, ++ Camera_ImageRotation* imageRotation); ++ + #ifdef __cplusplus + } + #endif +-- +2.40.1.huawei.4 + -- Gitee From 4ad8b71ed63f2a8636667ebf639131ec24bf7013 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Tue, 30 Jul 2024 11:02:50 +0800 Subject: [PATCH 2/2] add rotation for camera Signed-off-by: kerongfeng --- multimedia/camera_framework/dif.diff | 106 ------------------- multimedia/camera_framework/photo_output.h | 14 +++ multimedia/camera_framework/preview_output.h | 28 +++++ multimedia/camera_framework/video_output.h | 14 +++ 4 files changed, 56 insertions(+), 106 deletions(-) delete mode 100644 multimedia/camera_framework/dif.diff diff --git a/multimedia/camera_framework/dif.diff b/multimedia/camera_framework/dif.diff deleted file mode 100644 index 061b6f1e9..000000000 --- a/multimedia/camera_framework/dif.diff +++ /dev/null @@ -1,106 +0,0 @@ -From cfac062ab4b86dad0f21480ee514bb44e5d7cd58 Mon Sep 17 00:00:00 2001 -From: w00599949 -Date: Tue, 30 Jul 2024 10:19:51 +0800 -Subject: [PATCH] TicketN:DTS2024072913270 Description:provide get/set rotation - angle methods Team:OTHERS Feature or Bugfix:Bugfix Binary Source:No - PrivateCode(Yes/No):No - -Change-Id: I979845f9e7e3b3db629672da79b6df681e5d2558 ---- - multimedia/camera_framework/photo_output.h | 14 ++++++++++ - multimedia/camera_framework/preview_output.h | 28 ++++++++++++++++++++ - multimedia/camera_framework/video_output.h | 14 ++++++++++ - 3 files changed, 56 insertions(+) - -diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h -index 3c32b97..fa36b13 100644 ---- a/multimedia/camera_framework/photo_output.h -+++ b/multimedia/camera_framework/photo_output.h -@@ -194,6 +194,20 @@ Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput); - */ - Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported); - -+/** -+ * @brief Gets the photo rotation angle. -+ * -+ * @param photoOutput the {@link Camera_PhotoOutput} instance which used to get the photo rotation angle. -+ * @param deviceDegree the current device rotation degree. -+ * @param imageRotation the {@link Camera_ImageRotation} result of photo rotation angle. -+ * @return {@link #CAMERA_OK} if the method call succeeds. -+ * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. -+ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. -+ * @since 12 -+ */ -+Camera_ErrorCode OH_PhotoOutput_GetPhotoRotation(Camera_PhotoOutput* photoOutput, int deviceDegree, -+ Camera_ImageRotation* imageRotation); -+ - #ifdef __cplusplus - } - #endif -diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h -index 96b267f..a9706e8 100644 ---- a/multimedia/camera_framework/preview_output.h -+++ b/multimedia/camera_framework/preview_output.h -@@ -167,6 +167,34 @@ Camera_ErrorCode OH_PreviewOutput_Stop(Camera_PreviewOutput* previewOutput); - */ - Camera_ErrorCode OH_PreviewOutput_Release(Camera_PreviewOutput* previewOutput); - -+/** -+ * @brief Gets the preview rotation angle. -+ * -+ * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get the preview rotation angle. -+ * @param displayRotation the current display rotation angle. -+ * @param imageRotation the {@link Camera_ImageRotation} result of preview rotation angle. -+ * @return {@link #CAMERA_OK} if the method call succeeds. -+ * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. -+ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. -+ * @since 12 -+ */ -+Camera_ErrorCode OH_PreviewOutput_GetPreviewRotation(Camera_PreviewOutput* previewOutput, int displayRotation, -+ Camera_ImageRotation* imageRotation); -+ -+/** -+ * @brief Sets the preview rotation angle. -+ * -+ * @param previewOutput the {@link Camera_PreviewOutput} instance which used to set the preview rotation angle. -+ * @param imageRotation the {@link Camera_ImageRotation} of preview display rotation angle. -+ * @param isDisplayLocked TRUE means the display is locked. -+ * @return {@link #CAMERA_OK} if the method call succeeds. -+ * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. -+ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. -+ * @since 12 -+ */ -+Camera_ErrorCode OH_PreviewOutput_SetPreviewRotation(Camera_PreviewOutput* previewOutput, -+ Camera_ImageRotation imageRotation, bool isDisplayLocked); -+ - #ifdef __cplusplus - } - #endif -diff --git a/multimedia/camera_framework/video_output.h b/multimedia/camera_framework/video_output.h -index 8b50c44..d6e6b8f 100644 ---- a/multimedia/camera_framework/video_output.h -+++ b/multimedia/camera_framework/video_output.h -@@ -165,6 +165,20 @@ Camera_ErrorCode OH_VideoOutput_Stop(Camera_VideoOutput* videoOutput); - */ - Camera_ErrorCode OH_VideoOutput_Release(Camera_VideoOutput* videoOutput); - -+/** -+ * @brief Gets the video rotation angle. -+ * -+ * @param videoOutput the {@link Camera_VideoOutput} instance which used to get the video rotation angle. -+ * @param deviceDegree the current device rotation degree. -+ * @param imageRotation the {@link Camera_ImageRotation} result of video rotation angle. -+ * @return {@link #CAMERA_OK} if the method call succeeds. -+ * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. -+ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. -+ * @since 12 -+ */ -+Camera_ErrorCode OH_VideoOutput_GetVideoRotation(Camera_VideoOutput* videoOutput, int deviceDegree, -+ Camera_ImageRotation* imageRotation); -+ - #ifdef __cplusplus - } - #endif --- -2.40.1.huawei.4 - diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 273455d17..8066af7a8 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -194,6 +194,20 @@ Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput); */ Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported); +/** + * @brief Gets the photo rotation angle. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to get the photo rotation angle. + * @param deviceDegree the current device rotation degree. + * @param imageRotation the {@link Camera_ImageRotation} result of photo rotation angle. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_GetPhotoRotation(Camera_PhotoOutput* photoOutput, int deviceDegree, + Camera_ImageRotation* imageRotation); + /** * @brief Get active profiles. * diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h index 3fa3dcced..4a4cd3ad0 100644 --- a/multimedia/camera_framework/preview_output.h +++ b/multimedia/camera_framework/preview_output.h @@ -167,6 +167,34 @@ Camera_ErrorCode OH_PreviewOutput_Stop(Camera_PreviewOutput* previewOutput); */ Camera_ErrorCode OH_PreviewOutput_Release(Camera_PreviewOutput* previewOutput); +/** + * @brief Gets the preview rotation angle. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get the preview rotation angle. + * @param displayRotation the current display rotation angle. + * @param imageRotation the {@link Camera_ImageRotation} result of preview rotation angle. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_GetPreviewRotation(Camera_PreviewOutput* previewOutput, int displayRotation, + Camera_ImageRotation* imageRotation); + +/** + * @brief Sets the preview rotation angle. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance which used to set the preview rotation angle. + * @param imageRotation the {@link Camera_ImageRotation} of preview display rotation angle. + * @param isDisplayLocked TRUE means the display is locked. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_SetPreviewRotation(Camera_PreviewOutput* previewOutput, + Camera_ImageRotation imageRotation, bool isDisplayLocked); + /** * @brief Get active profiles. * diff --git a/multimedia/camera_framework/video_output.h b/multimedia/camera_framework/video_output.h index 07bee9ceb..d7f2d9dcb 100644 --- a/multimedia/camera_framework/video_output.h +++ b/multimedia/camera_framework/video_output.h @@ -165,6 +165,20 @@ Camera_ErrorCode OH_VideoOutput_Stop(Camera_VideoOutput* videoOutput); */ Camera_ErrorCode OH_VideoOutput_Release(Camera_VideoOutput* videoOutput); +/** + * @brief Gets the video rotation angle. + * + * @param videoOutput the {@link Camera_VideoOutput} instance which used to get the video rotation angle. + * @param deviceDegree the current device rotation degree. + * @param imageRotation the {@link Camera_ImageRotation} result of video rotation angle. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_VideoOutput_GetVideoRotation(Camera_VideoOutput* videoOutput, int deviceDegree, + Camera_ImageRotation* imageRotation); + /** * @brief Get active profiles. * -- Gitee