summaryrefslogtreecommitdiff
path: root/libhwjpeg/ExynosJpegEncoderForCamera.cpp
diff options
context:
space:
mode:
authorCho KyongHo <pullip.cho@samsung.com>2019-08-14 17:13:47 +0900
committerCho KyongHo <pullip.cho@samsung.com>2020-02-20 21:34:34 -0800
commita6b44cc59409195144498eb568742a59983c2571 (patch)
tree8ca60c3938933e2194976931bfb9607a6d56890a /libhwjpeg/ExynosJpegEncoderForCamera.cpp
parente926c5b48784a36a4be9483f5798563adc2a0103 (diff)
libhwjpeg: use buffer size instead of payload
ExynosJpegEncoderForCamera has the lengths of mage buffers to LibScalerForJpeg but it does not get informed about the lengths. Instead LibScalerForJpeg feeds VIDIOC_QBUF the required payloads of images studied by VIDOC_S_FMT as the buffer length which is not the length of the buffer. Change-Id: Id51f3a6e4f701fdb5f33bf84d17045448ab5f97a Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Diffstat (limited to 'libhwjpeg/ExynosJpegEncoderForCamera.cpp')
-rw-r--r--libhwjpeg/ExynosJpegEncoderForCamera.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libhwjpeg/ExynosJpegEncoderForCamera.cpp b/libhwjpeg/ExynosJpegEncoderForCamera.cpp
index bb4dc2c..39e877e 100644
--- a/libhwjpeg/ExynosJpegEncoderForCamera.cpp
+++ b/libhwjpeg/ExynosJpegEncoderForCamera.cpp
@@ -595,24 +595,24 @@ bool ExynosJpegEncoderForCamera::GenerateThumbnailImage()
bool okay = false;
if (checkInBufType() == JPEG_BUF_TYPE_USER_PTR) {
- char *bufs[3];
- int len_srcbufs[3];
+ char *bufs[SCALER_MAX_PLANES];
+ int len_srcbufs[SCALER_MAX_PLANES];
- if (getInBuf(bufs, len_srcbufs, 3) < 0) {
+ if (getInBuf(bufs, len_srcbufs, SCALER_MAX_PLANES) < 0) {
ALOGE("Failed to retrieve the main image buffers");
return false;
}
- okay = m_pLibScaler.RunStream(bufs, m_fdIONThumbImgBuffer);
+ okay = m_pLibScaler.RunStream(bufs, len_srcbufs, m_fdIONThumbImgBuffer, m_szIONThumbImgBuffer);
} else { // mainbuftype == JPEG_BUF_TYPE_DMA_BUF
- int bufs[3];
- int len_srcbufs[3];
+ int bufs[SCALER_MAX_PLANES];
+ int len_srcbufs[SCALER_MAX_PLANES];
- if (getInBuf(bufs, len_srcbufs, 3) < 0) {
+ if (getInBuf(bufs, len_srcbufs, SCALER_MAX_PLANES) < 0) {
ALOGE("Failed to retrieve the main image buffers");
return false;
}
- okay = m_pLibScaler.RunStream(bufs, m_fdIONThumbImgBuffer);
+ okay = m_pLibScaler.RunStream(bufs, len_srcbufs, m_fdIONThumbImgBuffer, m_szIONThumbImgBuffer);
}
if (!okay) {