|
From: salsaman <sal...@gm...> - 2008-09-20 16:52:35
|
Hi,
could somebody please explain how dv_decode_full_frame() works ?
I have the following code for example (for PAL), but it is crashing:
uint8_t fbuffer[144000];
int frame=1;
size_t bytes=144000;
int rowstrides[3];
if (cdata.palette==YUV420) {
rowstrides[0]=cdata.width;
rowstrides[1]=cdata.width>>1;
rowstrides[2]=cdata.width>>1;
}
else {
rowstrides[0]=cdata.width*6; // YUV411 - 6 bytes per pixel
}
lseek(fd,bytes,SEEK_SET);
if (read (fd, fbuffer, 144000) < 144000) return FALSE;
dv_parse_header(dv_dec, fbuffer);
//dv_parse_packs(dv_dec, fbuffer);
dv_decode_full_frame(dv_dec,fbuffer,e_dv_color_yuv,(uint8_t
**)pixel_data,rowstrides);
Here pixel_data is an array of pointers to the Y,U, and V planes for YUV420.
Also, do I need the dv_parse_header() and/or dv_parse_packs() ?
Regards,
Salsaman.
http://lives.sourceforge.net
|