Exemplo n.º 1
0
static int GetBuffer(struct AVCodecContext *Context, AVFrame *Frame)
{
    if (!Context->codec)
        return -1;

    if (!(Context->codec->capabilities & CODEC_CAP_DR1))
        return avcodec_default_get_buffer(Context, Frame);

    VideoDecoder *parent = static_cast<VideoDecoder*>(Context->opaque);
    if (parent)
        return parent->GetAVBuffer(Context, Frame);

    LOG(VB_GENERAL, LOG_ERR, "Invalid context");
    return -1;
}