Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable video post processing after hw decoding #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mfx_omx_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ ifneq ($(filter $(MFX_ANDROID_VERSION), MFX_Q MFX_R),)
MFX_OMX_CFLAGS += -DENABLE_READ_SEI
endif

# Enable vpp for decoder
MFX_OMX_CFLAGS += -DENABLE_DECVPP

# Setting usual paths to include files
MFX_OMX_INCLUDES := $(LOCAL_PATH)/include

Expand Down
31 changes: 31 additions & 0 deletions omx_components/include/mfx_omx_vdec_component.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ enum MfxInitState {
MFX_INIT_COMPLETED
};

#ifdef OMX_ENABLE_DECVPP
#define DECODE_MAX_SRF_NUM 24
#define VPP_MAX_SRF_NUM 10
#define FIXED_VPP_OUTPUT
#define SCALED_WIDTH 1920
#define SCALED_HEIGHT 1080

// round up to a multiple of 16
#define MSDK_ALIGN16(value) (((value + 15) >> 4) << 4)
#endif

/*------------------------------------------------------------------------------*/

class MfxOmxVdecComponent : public MfxOmxComponent,
Expand Down Expand Up @@ -161,6 +172,14 @@ class MfxOmxVdecComponent : public MfxOmxComponent,
void UpdateHdrStaticInfo();
#endif

#ifdef OMX_ENABLE_DECVPP
mfxStatus InitVPP(void);
mfxStatus AllocateInternalSurfaces(void);
mfxStatus FreeInternalSurfaces(void);
mfxStatus FindOneAvailableSurface(mfxU32 &id);
mfxStatus ProcessFrameVpp(mfxFrameSurface1 *in_srf, mfxFrameSurface1 *out_srf);
#endif

protected:
mfxIMPL m_Implementation;
MFXVideoSession m_Session;
Expand Down Expand Up @@ -189,6 +208,18 @@ class MfxOmxVdecComponent : public MfxOmxComponent,
bool m_bEnableNativeBuffersReceived;
bool m_bInterlaced;

#ifdef OMX_ENABLE_DECVPP
MFXVideoVPP *m_pVPP;
bool m_bInitVPP;
bool m_bVPPDetermined;
bool m_bEnableScale;
mfxU32 m_nScaledWidth;
mfxU32 m_nScaledHeight;
mfxVideoParam m_vppParam;
mfxFrameSurface1 m_DecInterSrf[DECODE_MAX_SRF_NUM];
mfxFrameAllocResponse m_DecResponses;
#endif

MfxInitState m_InitState;
MfxOmxDev* m_pDevice;
OMX_BUFFERHEADERTYPE** m_pBufferHeaders;
Expand Down
Loading