-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; |