diff options
| author | Rajesh Poornachandran <rajesh.poornachandran@intel.com> | 2013-09-17 16:13:56 -0700 |
|---|---|---|
| committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:02:53 -0700 |
| commit | 7911d688c9493f94c2cf58b83550c3fade4eb955 (patch) | |
| tree | 05dd9669417566bdc9ffff14a03f84482aaa3f1e /videocodec/securevideo | |
| parent | cd1d4040d73018cba0de8a4061ccf7129446945d (diff) | |
| download | android_hardware_intel_common_omx-components-7911d688c9493f94c2cf58b83550c3fade4eb955.tar.gz android_hardware_intel_common_omx-components-7911d688c9493f94c2cf58b83550c3fade4eb955.tar.bz2 android_hardware_intel_common_omx-components-7911d688c9493f94c2cf58b83550c3fade4eb955.zip | |
[PORT FROM R42B-STABLE] BYT-DRM-WV-OMX: Support HDMI HPD and Auto-tear-down
BZ: 128589
- Use pavp_is_session_alive to check PAVP Session status for each frame
- Destroy PAVP session if pavp_is_session_alive reports session is invalid and recreate new session
- Drop frames until session is active
- Handle errors from PAVP & SEC during HDCP Auto-tear-down gracefully
- Tiled output format for BYT
Change-Id: I403c01ee6c4a706d36d2892f13f8e68c2e29c5ff
Signed-off-by: Rajesh Poornachandran <rajesh.poornachandran@intel.com>
Reviewed-on: http://android.intel.com:8080/132665
Reviewed-by: Sun, Hang L <hang.l.sun@intel.com>
Tested-by: Sun, Hang L <hang.l.sun@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
Diffstat (limited to 'videocodec/securevideo')
| -rw-r--r-- | videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp | 54 | ||||
| -rw-r--r-- | videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.h | 1 |
2 files changed, 43 insertions, 12 deletions
diff --git a/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp b/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp index 467b084..48f75b3 100644 --- a/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp +++ b/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp @@ -267,17 +267,19 @@ OMX_ERRORTYPE OMXVideoDecoderAVCSecure::PrepareDecodeBuffer(OMX_BUFFERHEADERTYPE pavp_lib_session::pavp_lib_code rc = pavp_lib_session::status_ok; uint32_t parse_size = 0; - if(!mpLibInstance && secBuffer->pLibInstance) - { + if(!mpLibInstance && secBuffer->pLibInstance) { pavp_lib_session::pavp_lib_code rc = pavp_lib_session::status_ok; - LOGE("PAVP Heavy session creation...\n"); + LOGE("PAVP Heavy session creation..."); rc = secBuffer->pLibInstance->pavp_create_session(true); if (rc != pavp_lib_session::status_ok) { - LOGE("PAVP Heavy: pavp_create_session failed with error 0x%x\n", rc); + LOGE("PAVP Heavy: pavp_create_session failed with error 0x%x", rc); + secBuffer->size = 0; + ret = OMX_ErrorNotReady; } else { + LOGE("PAVP Heavy session created succesfully"); mpLibInstance = secBuffer->pLibInstance; } - { + if ( ret == OMX_ErrorNone) { pavp_lib_session::pavp_lib_code rc = pavp_lib_session::status_ok; wv_set_xcript_key_in input; wv_set_xcript_key_out output; @@ -296,13 +298,36 @@ OMX_ERRORTYPE OMXVideoDecoderAVCSecure::PrepareDecodeBuffer(OMX_BUFFERHEADERTYPE } if (rc != pavp_lib_session::status_ok) - LOGE("sec_pass_through:wv_set_xcript_key() failed with error 0x%x\n", rc); + LOGE("sec_pass_through:wv_set_xcript_key() failed with error 0x%x", rc); - if (output.Header.Status) - LOGE("SEC failed: wv_set_xcript_key() returned 0x%x\n", output.Header.Status); + if (output.Header.Status) { + LOGE("SEC failed: wv_set_xcript_key() FAILED 0x%x", output.Header.Status); + secBuffer->size = 0; + ret = OMX_ErrorNotReady; + } } } - { + + if(mpLibInstance) { + bool balive = false; + pavp_lib_session::pavp_lib_code rc = pavp_lib_session::status_ok; + rc = mpLibInstance->pavp_is_session_alive(&balive); + if (rc != pavp_lib_session::status_ok) + LOGE("pavp_is_session_alive failed with error 0x%x", rc); + if (balive == false || (ret == OMX_ErrorNotReady)) { + LOGE("PAVP session is %s", balive?"active":"in-active"); + secBuffer->size = 0; + ret = OMX_ErrorNotReady; + //Destroy & re-create + LOGI("Destroying the PAVP session..."); + rc = mpLibInstance->pavp_destroy_session(); + if (rc != pavp_lib_session::status_ok) + LOGE("pavp_destroy_session failed with error 0x%x", rc); + + mpLibInstance = NULL; + } + } + if ( ret == OMX_ErrorNone) { wv_heci_process_video_frame_in input; wv_heci_process_video_frame_out output; sec_wv_packet_metadata metadata; @@ -347,10 +372,10 @@ OMX_ERRORTYPE OMXVideoDecoderAVCSecure::PrepareDecodeBuffer(OMX_BUFFERHEADERTYPE } if (rc != pavp_lib_session::status_ok) - LOGE(" sec_pass_through failed with error 0x%x\n", rc); + LOGE(" sec_pass_through failed with error 0x%x", rc); - if (output.Header.Status != 0x0){ - LOGE(" SEC failed for wv_process_video_frame() returned 0x%x\n", output.Header.Status); + if (output.Header.Status != 0x0) { + LOGE(" SEC failed for wv_process_video_frame() returned 0x%x", output.Header.Status); } else { memcpy((unsigned char *)(secBuffer->data), (const unsigned int*) (mVADmaBase + (1024*512)), buffer->nFilledLen); parse_size = output.parsed_data_size; @@ -394,6 +419,11 @@ OMX_ERRORTYPE OMXVideoDecoderAVCSecure::PrepareDecodeBuffer(OMX_BUFFERHEADERTYPE return ret; } +OMX_COLOR_FORMATTYPE OMXVideoDecoderAVCSecure::GetOutputColorFormat(int width, int height) { + // BYT HWC expects Tiled output color format for all resolution + return OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled; +} + OMX_ERRORTYPE OMXVideoDecoderAVCSecure::BuildHandlerList(void) { OMXVideoDecoderBase::BuildHandlerList(); AddHandler(OMX_IndexParamVideoAvc, GetParamVideoAvc, SetParamVideoAvc); diff --git a/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.h b/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.h index 040dee4..f2a8cb9 100644 --- a/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.h +++ b/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.h @@ -46,6 +46,7 @@ protected: virtual OMX_ERRORTYPE PrepareConfigBuffer(VideoConfigBuffer *p); virtual OMX_ERRORTYPE PrepareDecodeBuffer(OMX_BUFFERHEADERTYPE *buffer, buffer_retain_t *retain, VideoDecodeBuffer *p); + virtual OMX_COLOR_FORMATTYPE GetOutputColorFormat(int width, int height); virtual OMX_ERRORTYPE BuildHandlerList(void); DECLARE_HANDLER(OMXVideoDecoderAVCSecure, ParamVideoAvc); |
