如何在android stagefright Media Player中调整高度和宽度

时间:2016-04-28 09:28:23

标签: android c++ stagefright

有没有办法调整视频文件的高度和宽度,类似于SoftAVC.Cpp ..

在我的代码中,特定视频的宽度和高度是固定的(即832 * 480)。但我想播放不同的视频我该怎么办?所以我可以播放不同的视频。

我的代码

IntdecHEVC::IntdecHEVC(
                           const char *name,
                           const OMX_CALLBACKTYPE *callbacks,
                           OMX_PTR appData,
                           OMX_COMPONENTTYPE **component)
    : SoftVideoDecoderOMXComponent(name, componentName, codingType,
                                   kProfileLevels, ARRAY_SIZE(kProfileLevels),

                                   832 /* width */, 480 /* height */, callbacks,
                                   appData, component),
    mFlushOutBuffer(NULL),
    mOmxColorFormat(OMX_COLOR_FormatYUV420Planar),
    mChangingResolution(false),
    mSignalledError(false),
    mIsInFlush(false),
    mReceivedEOS(false),


    mStride(mWidth) {
        const size_t kMinCompressionRatio = 4 /* compressionRatio (for Level 4+) */;
        const size_t kMaxOutputBufferSize = 2048 * 2048 * 3 / 2;

        m_lOriginalWidthY = 832;
        m_lHeightY = 480;
        m_lOriginalWidthUV = m_lOriginalWidthY/2;
        m_lHeightUV = m_lHeightY/2;


        // INPUT_BUF_SIZE is given by HEVC codec as minimum input size   changed by pooja 11-4
        initPorts(
                  kNumInputBuffers,INPUT_BUF_SIZE, kNumOutputBuffers, CODEC_MIME_TYPE);
    }

0 个答案:

没有答案