All pastes #294824 Raw Edit

Someone

public text v1 · immutable
#294824 ·published 2006-12-28 21:19 UTC
rendered paste body
int Frame::ExtractYUV( void *yuv )
{
#if defined(HAVE_LIBAVCODEC)
        AVFrame *frame = avcodec_alloc_frame();;
        AVPicture output;
        int got_picture;

        avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
        if ( got_picture )
        {
                avpicture_fill( &output, static_cast<uint8_t*>( yuv ), PIX_FMT_YUV422, GetWidth(), GetHeight() );
                img_convert( &output, PIX_FMT_YUV422, (AVPicture *)frame, libavcodec->pix_fmt, GetWidth(), GetHei
        }
        av_free( frame );
#else
        unsigned char *pixels[ 3 ];
        int pitches[ 3 ];

        pixels[ 0 ] = ( unsigned char* ) yuv;
        pitches[ 0 ] = decoder->width * 2;

        dv_decode_full_frame( decoder, data, e_dv_color_yuv, pixels, pitches );
#endif

        return 0;
}