diff options
author | Michelle Yang <micya@google.com> | 2023-01-18 19:31:00 +0000 |
---|---|---|
committer | Michelle Yang <micya@google.com> | 2023-01-25 16:31:16 +0000 |
commit | 1dd8b9e446b2b391b16dbe36b92f2becb42fd53f (patch) | |
tree | 47733d6057f10386c96d6852e9841ed26887ef0e /libhwjpeg/ExynosJpegEncoderForCamera.cpp | |
parent | bb8081042d1af7daa8959fad350cc9cf159199fe (diff) |
libhwjpeg: add support for setting custom horizontal padding per plane
Input buffers may already have horizontal padding applied (see
ImageFormat.YV12 for example). pa/2371678 and pa/2375202 adds
functionality to set horizontal padding in pixels through
VIDIOC_S_EXT_CTRLS. This CL updates V4L2 library.
Bug: 265156559
Test: checked output image when applying ag/20576841
Change-Id: I432dcdfd4103222c7df10c7a974ab2ebd0afbbfd
Diffstat (limited to 'libhwjpeg/ExynosJpegEncoderForCamera.cpp')
-rw-r--r-- | libhwjpeg/ExynosJpegEncoderForCamera.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libhwjpeg/ExynosJpegEncoderForCamera.cpp b/libhwjpeg/ExynosJpegEncoderForCamera.cpp index 741e05e..dd12721 100644 --- a/libhwjpeg/ExynosJpegEncoderForCamera.cpp +++ b/libhwjpeg/ExynosJpegEncoderForCamera.cpp @@ -23,12 +23,14 @@ #include <hardware/exynos/ion.h> #include <system/graphics.h> +// This header is non-hermetic and needs to be after videodev2.h #include <ExynosJpegEncoderForCamera.h> #include "hwjpeg-internal.h" +// This header is non-hermetic and needs to be after hwjpeg-internal.h #include "AppMarkerWriter.h" -#include "ThumbnailScaler.h" #include "IFDWriter.h" +#include "ThumbnailScaler.h" // Data length written by H/W without the scan data. #define NECESSARY_JPEG_LENGTH (0x24B + 2 * JPEG_MARKER_SIZE) @@ -171,6 +173,11 @@ int ExynosJpegEncoderForCamera::setThumbnailQuality(int quality) return GetCompressor().SetQuality(0, m_nThumbQuality) ? 0 : -1; } +int ExynosJpegEncoderForCamera::setThumbnailPadding(unsigned char *padding, + unsigned int num_planes) { + return GetCompressor().SetPadding2(padding, num_planes) ? 0 : -1; +} + bool ExynosJpegEncoderForCamera::EnsureFormatIsApplied() { if (TestStateEither(STATE_PIXFMT_CHANGED | STATE_SIZE_CHANGED | STATE_THUMBSIZE_CHANGED)) { int thumb_width = m_nThumbWidth; |