Example #1
0
PrivateDecoder* PrivateDecoder::Create(const QString &decoder,
                                       PlayerFlags flags,
                                       AVCodecContext *avctx)
{
#if defined(Q_OS_MACX)
    PrivateDecoderVDA *vda = new PrivateDecoderVDA();
    if (vda && vda->Init(decoder, flags, avctx))
        return vda;
    delete vda;
#endif

#ifdef USING_OPENMAX
    PrivateDecoderOMX *omx = new PrivateDecoderOMX;
    if (omx && omx->Init(decoder, flags, avctx))
        return omx;
    delete omx;
#endif

#ifdef USING_CRYSTALHD
    PrivateDecoderCrystalHD *chd = new PrivateDecoderCrystalHD();
    if (chd && chd->Init(decoder, flags, avctx))
        return chd;
    delete chd;
#endif

    return NULL;
}
Example #2
0
PrivateDecoder* PrivateDecoder::Create(const QString &decoder,
                                       bool no_hardware_decode,
                                       AVCodecContext *avctx)
{
#if defined(Q_OS_MACX)
    PrivateDecoderVDA *vda = new PrivateDecoderVDA();
    if (vda && vda->Init(decoder, no_hardware_decode, avctx))
        return vda;
    delete vda;
#endif

#ifdef USING_CRYSTALHD
    PrivateDecoderCrystalHD *chd = new PrivateDecoderCrystalHD();
    if (chd && chd->Init(decoder, no_hardware_decode, avctx))
        return chd;
    delete chd;
#endif

    return NULL;
}