Logo Search packages:      
Sourcecode: blender version File versions

int avcodec_decode_video ( AVCodecContext avctx,
AVFrame picture,
int *  got_picture_ptr,
uint8_t *  buf,
int  buf_size 

decode a frame.

buf bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE larger then the actual read bytes because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
buf_size the size of the buffer in bytes
got_picture_ptr zero if no frame could be decompressed, Otherwise, it is non zero
-1 if error, otherwise return the number of bytes used.

Definition at line 941 of file utils.c.

References avcodec_decode_video(), AVCodec::capabilities, AVCodecContext::codec, CODEC_CAP_DELAY, AVCodecContext::coded_height, AVCodecContext::coded_width, AVCodec::decode, emms_c, and AVCodecContext::frame_number.

Referenced by avcodec_decode_video().

    int ret;

    *got_picture_ptr= 0;
    if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
        return -1;
    if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
        ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
                                buf, buf_size);

        emms_c(); //needed to avoid an emms_c() call before every return;

        if (*got_picture_ptr)
        ret= 0;

    return ret;

Generated by  Doxygen 1.6.0   Back to index