From: James Hughes Date: Tue, 17 Jan 2017 10:33:40 +0000 (+0000) Subject: raspicam: Fix for Luma mode double sized files in timelapse X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1cde0e00dd54d2a31d34fd6d4804a102a75f48c;p=platform%2Fadaptation%2Fbroadcom%2Flibomxil-vc4.git raspicam: Fix for Luma mode double sized files in timelapse Implemented a fix provided by 6x9, ensures that zero or small camera callback buffer lengths are handled correctly Fix for issue 365 --- diff --git a/host_applications/linux/apps/raspicam/RaspiStillYUV.c b/host_applications/linux/apps/raspicam/RaspiStillYUV.c index 5f88e87..d95bafc 100644 --- a/host_applications/linux/apps/raspicam/RaspiStillYUV.c +++ b/host_applications/linux/apps/raspicam/RaspiStillYUV.c @@ -57,7 +57,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#define VERSION_STRING "v1.3.5" +#define VERSION_STRING "v1.3.6" #include "bcm_host.h" #include "interface/vcos/vcos.h" @@ -579,7 +579,7 @@ static void camera_buffer_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buff int bytes_to_write = buffer->length; if (pData->pstate->onlyLuma) - bytes_to_write = port->format->es->video.width * port->format->es->video.height; + bytes_to_write = vcos_min(buffer->length, port->format->es->video.width * port->format->es->video.height); if (bytes_to_write && pData->file_handle) { diff --git a/host_applications/linux/apps/raspicam/RaspiVidYUV.c b/host_applications/linux/apps/raspicam/RaspiVidYUV.c index 7838f12..af9c432 100644 --- a/host_applications/linux/apps/raspicam/RaspiVidYUV.c +++ b/host_applications/linux/apps/raspicam/RaspiVidYUV.c @@ -58,7 +58,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#define VERSION_STRING "v1.3.12" +#define VERSION_STRING "v1.3.13" #include "bcm_host.h" #include "interface/vcos/vcos.h" @@ -706,9 +706,8 @@ static void camera_buffer_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buff int bytes_written = 0; int bytes_to_write = buffer->length; - if (buffer->length && pData->pstate->onlyLuma) - bytes_to_write = port->format->es->video.width * port->format->es->video.height; - + if (pData->pstate->onlyLuma) + bytes_to_write = vcos_min(buffer->length, port->format->es->video.width * port->format->es->video.height); vcos_assert(pData->file_handle);