From 0f07334126048f16cf631e72e8708c2bf3c8a8e6 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 15 Jun 2006 20:18:21 +0000 Subject: Fixed the last pieces of the YUV drawin on the client, as well as a couple of huge memory leaks. --- lib/libdv_wrapper.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/libdv_wrapper.cc') diff --git a/lib/libdv_wrapper.cc b/lib/libdv_wrapper.cc index cb9cc7c..11c641d 100644 --- a/lib/libdv_wrapper.cc +++ b/lib/libdv_wrapper.cc @@ -100,7 +100,7 @@ Frame *LibDVWrapper::decode(Frame *input, DV::ColorSpace c) case DV::YUV: #ifdef COLORSPACE_YV12 size = width*height*2; - buf = (char*)malloc(size); + buf = new char[size]; type = VF_YV12; yuv[0] = (unsigned char*)buf; yuv[1] = (unsigned char*)yuv[0] + (width * height); @@ -111,7 +111,7 @@ Frame *LibDVWrapper::decode(Frame *input, DV::ColorSpace c) #else printf("!\n"); size = width*height*2; - buf = (char*)malloc(size); + buf = new char[size]; type = VF_YUV422; yuv[0] = (unsigned char*)buf; yuv[1] = yuv[2] = NULL; @@ -122,7 +122,7 @@ Frame *LibDVWrapper::decode(Frame *input, DV::ColorSpace c) case DV::RGB: size = width*height*3; - buf = (char*)malloc(size); + buf = new char[size]; type = VF_RGB; yuv[0] = (unsigned char*)buf; yuv[1] = yuv[2] = NULL; @@ -132,7 +132,7 @@ Frame *LibDVWrapper::decode(Frame *input, DV::ColorSpace c) case DV::BGR0: size = width*height*4; - buf = (char*)malloc(size); + buf = new char[size]; type = VF_BRG0; yuv[0] = (unsigned char*)buf; yuv[1] = yuv[2] = NULL; @@ -143,13 +143,11 @@ Frame *LibDVWrapper::decode(Frame *input, DV::ColorSpace c) dv_decode_full_frame(decoder, - (const uint8_t*)input, + (const uint8_t*)input->vframe, (dv_color_space_t)colorspace, yuv, pitches); - // memset(buf, 1, width*height); - // memset(buf+width*height, 100, width*height/2); - // memset(buf+width*height+width*height/2, 200, width*height/2); + Frame *frame = new Frame(buf, size, type, NULL, 0, AF_NONE); return frame; } -- cgit v1.2.3