decoder: Treat unsupported feature errors as fatal errors

This will ensure clips with supported bitdepth or unsupport color
formats are not attempted to be decoded till end of the sequence.

Bug: 130578045
Test: adb shell stagefright -s -S /sdcard/crowd422_h264.mp4
Test: Ensure decoder doesn't attemp decoding all frames

Change-Id: I118ef2141f77986f6ec65c91dfeaa7ef17646c43
This commit is contained in:
Harish Mahendrakar 2019-04-16 10:51:53 -07:00 committed by Ray Essick
parent fabba6afaf
commit 54160a6d3e
3 changed files with 9 additions and 5 deletions

View file

@ -50,6 +50,7 @@ extern "C" {
/*****************************************************************************/
/* Constant Macros */
/*****************************************************************************/
#define IVD_ERROR_MASK 0xFF
/*****************************************************************************/
/* Function Macros */

View file

@ -1549,7 +1549,7 @@ WORD32 ih264d_create(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
}
}
ps_create_op->s_ivd_create_op_t.u4_error_code = IVD_MEM_ALLOC_FAILED;
ps_create_op->s_ivd_create_op_t.u4_error_code = 1 << IVD_FATALERROR;
ps_create_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_FATALERROR;
return IV_FAIL;
}
@ -1591,6 +1591,8 @@ UWORD32 ih264d_map_error(UWORD32 i4_err_status)
case ERROR_PROFILE_NOT_SUPPORTED:
case ERROR_INIT_NOT_DONE:
case IVD_MEM_ALLOC_FAILED:
case ERROR_FEATURE_UNAVAIL:
case IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED:
temp = 1 << IVD_FATALERROR;
H264_DEC_DEBUG_PRINT("\nFatal Error\n");
break;
@ -1625,7 +1627,6 @@ UWORD32 ih264d_map_error(UWORD32 i4_err_status)
break;
case ERROR_NOT_SUPP_RESOLUTION:
case ERROR_FEATURE_UNAVAIL:
case ERROR_ACTUAL_LEVEL_GREATER_THAN_INIT:
temp = 1 << IVD_UNSUPPORTEDINPUT;
break;
@ -2260,6 +2261,8 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
|| (ret == ERROR_UNAVAIL_PICBUF_T)
|| (ret == ERROR_UNAVAIL_MVBUF_T)
|| (ret == ERROR_INV_SPS_PPS_T)
|| (ret == ERROR_FEATURE_UNAVAIL)
|| (ret == IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED)
|| (ret == IVD_DISP_FRM_ZERO_OP_BUF_SIZE))
{
ps_dec->u4_slice_start_code_found = 0;

View file

@ -608,7 +608,7 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
/* Monochrome is not supported */
if(ps_seq->i4_chroma_format_idc != 1)
{
return ERROR_INV_SPS_PPS_T;
return ERROR_FEATURE_UNAVAIL;
}
/* reading bit_depth_luma_minus8 */
@ -617,7 +617,7 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
if(ps_seq->i4_bit_depth_luma_minus8 != 0)
{
return ERROR_INV_SPS_PPS_T;
return ERROR_FEATURE_UNAVAIL;
}
/* reading bit_depth_chroma_minus8 */
@ -626,7 +626,7 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
if(ps_seq->i4_bit_depth_chroma_minus8 != 0)
{
return ERROR_INV_SPS_PPS_T;
return ERROR_FEATURE_UNAVAIL;
}
/* reading qpprime_y_zero_transform_bypass_flag */