]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9266 #resolve
authorSeven Du <dujinfang@gmail.com>
Wed, 15 Jun 2016 01:34:26 +0000 (09:34 +0800)
committerSeven Du <dujinfang@gmail.com>
Wed, 15 Jun 2016 01:34:26 +0000 (09:34 +0800)
src/include/switch_core_video.h
src/mod/applications/mod_cv/mod_cv.cpp
src/mod/formats/mod_vlc/mod_vlc.c
src/switch_core_video.c

index 068a1381070fd3cdacb4f075b82bc3b20810148d..babe865f4e6fcae813d3f56775b0e0937288f26e 100644 (file)
@@ -352,10 +352,10 @@ SWITCH_DECLARE(void) switch_img_find_position(switch_img_position_t pos, int sw,
 *
 * \param[in]    src       The image descriptor
 * \param[in]    dest      The target memory address
-* \param[in]    size      The size of target memory address used for bounds check
+* \param[in]    stride    Bytes in a row for the destination. Pass 0 if the buffer has contiguous rows. Can be negative. A multiple of 16 is optimal.
 * \param[in]    fmt       The target format
 */
-SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *dest, switch_size_t size, switch_img_fmt_t fmt);
+SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *dest, int stride, switch_img_fmt_t fmt);
 /*!\brief convert raw memory to switch_img_t
 *
 * if dest is NULL then a new img is created, user should destroy it later,
index 5c10b8d42bcddd034bb5995171f9457f04b8cc98..76cf155a6ecd73c2a1670155d7efb4df0e9526cc 100644 (file)
@@ -720,7 +720,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi
             switch_assert(context->rawImage->width * 3 == context->rawImage->widthStep);
         }
 
-        switch_img_to_raw(frame->img, context->rawImage->imageData, context->rawImage->widthStep * context->h, SWITCH_IMG_FMT_RGB24);
+        switch_img_to_raw(frame->img, context->rawImage->imageData, context->rawImage->widthStep, SWITCH_IMG_FMT_RGB24);
         detectAndDraw(context);
 
         if (context->detected.simo_count > 20) {
index dbacf4e5134d324e6da90fdebb494e1fd4f27c57..3cd8a2cebb58292373f812527c176fa3de301cf5 100644 (file)
@@ -1659,7 +1659,7 @@ int  vlc_write_video_imem_get_callback(void *data, const char *cookie, int64_t *
                }
                
                *output = context->video_frame_buffer;
-               switch_img_to_raw(img, *output, *size, SWITCH_IMG_FMT_YUY2);
+               switch_img_to_raw(img, *output, 0, SWITCH_IMG_FMT_YUY2);
                switch_img_free(&img);
                return 0;
        }
index 4a32027fed3e5c8981e475e20c472a6b06b74393..e4cb5f1ad37b74401c68de57fea0f38dbc8ff1be 100644 (file)
@@ -2031,7 +2031,7 @@ static inline uint32_t switch_img_fmt2fourcc(switch_img_fmt_t fmt)
 }
 #endif
 
-SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *dest, switch_size_t size, switch_img_fmt_t fmt)
+SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *dest, int stride, switch_img_fmt_t fmt)
 {
 #ifdef SWITCH_HAVE_YUV
        uint32_t fourcc;
@@ -2050,7 +2050,7 @@ SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *des
        ret = ConvertFromI420(src->planes[0], src->stride[0],
                                        src->planes[1], src->stride[1],
                                        src->planes[2], src->stride[2],
-                                       dest, size,
+                                       dest, stride,
                                        src->d_w, src->d_h,
                                        fourcc);