author | Guosong Zhou <guosong.zhou@amlogic.com> | 2016-09-19 07:00:23 (GMT) |
---|---|---|
committer | Guosong Zhou <guosong.zhou@amlogic.com> | 2016-09-23 02:59:48 (GMT) |
commit | 15b005c1f2275a0fbf87bd0fafdb4820734ab7f4 (patch) | |
tree | f4d4dd8ff258e46cca0782c19324e499e90c1da3 | |
parent | 710b49191d094b8c89a819b29e965da3c32a6c9f (diff) | |
download | screen_source-15b005c1f2275a0fbf87bd0fafdb4820734ab7f4.zip screen_source-15b005c1f2275a0fbf87bd0fafdb4820734ab7f4.tar.gz screen_source-15b005c1f2275a0fbf87bd0fafdb4820734ab7f4.tar.bz2 |
PD#132006: screen_source: support RGB32
Change-Id: If5b9ccc4f92bab90749385ed2d6151824049c536
-rw-r--r-- | aml_screen.cpp | 3 | ||||
-rw-r--r-- | v4l2_vdin.cpp | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/aml_screen.cpp b/aml_screen.cpp index 48039f5..cbaa289 100644 --- a/aml_screen.cpp +++ b/aml_screen.cpp @@ -125,7 +125,8 @@ int screen_source_set_format(struct aml_screen_device* dev, int width, int heigh if ((width > 0) && (height > 0) && ((pix_format == V4L2_PIX_FMT_NV21) || (pix_format == V4L2_PIX_FMT_YUV420) || (pix_format == V4L2_PIX_FMT_RGB24) || - (pix_format == V4L2_PIX_FMT_RGB565X) )) { + (pix_format == V4L2_PIX_FMT_RGB565X) || + (pix_format == V4L2_PIX_FMT_RGB32))) { return gScreenHals[dev->device_id]->set_format(width, height, pix_format); } else { return gScreenHals[dev->device_id]->set_format(); diff --git a/v4l2_vdin.cpp b/v4l2_vdin.cpp index 38ae48a..54bbf10 100644 --- a/v4l2_vdin.cpp +++ b/v4l2_vdin.cpp @@ -217,9 +217,6 @@ int vdin_screen_source::init(int id){ return NO_MEMORY; } mBufferCount = 4; - for (int i = 0; i < mBufferCount; i++) { - src_temp[i] = NULL; - } mPixelFormat = V4L2_PIX_FMT_NV21; mNativeWindowPixelFormat = HAL_PIXEL_FORMAT_YCrCb_420_SP; mFrameWidth = 1280; @@ -469,6 +466,11 @@ int vdin_screen_source::set_format(int width, int height, int color_format) mVideoInfo->format.fmt.pix.height = height; mVideoInfo->format.fmt.pix.pixelformat = color_format; mPixelFormat = color_format; + if (mPixelFormat == V4L2_PIX_FMT_RGB32) + mBufferCount = 3; + for (int i = 0; i < mBufferCount; i++) { + src_temp[i] = NULL; + } mNativeWindowPixelFormat = getNativeWindowFormat(color_format); mFrameWidth = width; mFrameHeight = height; |