vc1: review and report errors accordingly.

Use GST_ERROR() to report real errors instead of hiding them into
GST_DEBUG().
This commit is contained in:
Gwenole Beauchesne 2013-01-22 13:28:13 +01:00
parent b134a97d42
commit d69cb4389f

View file

@ -242,7 +242,7 @@ decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
seq_hdr seq_hdr
); );
if (result != GST_VC1_PARSER_OK) { if (result != GST_VC1_PARSER_OK) {
GST_DEBUG("failed to parse sequence layer"); GST_ERROR("failed to parse sequence layer");
return get_status(result); return get_status(result);
} }
@ -262,7 +262,7 @@ decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
case GST_VC1_PROFILE_ADVANCED: case GST_VC1_PROFILE_ADVANCED:
break; break;
default: default:
GST_DEBUG("unsupported profile %d", seq_hdr->profile); GST_ERROR("unsupported profile %d", seq_hdr->profile);
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
} }
@ -370,7 +370,7 @@ decode_entry_point(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu
seq_hdr seq_hdr
); );
if (result != GST_VC1_PARSER_OK) { if (result != GST_VC1_PARSER_OK) {
GST_DEBUG("failed to parse entrypoint layer"); GST_ERROR("failed to parse entrypoint layer");
return get_status(result); return get_status(result);
} }
@ -859,7 +859,7 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
priv->bitplanes priv->bitplanes
); );
if (result != GST_VC1_PARSER_OK) { if (result != GST_VC1_PARSER_OK) {
GST_DEBUG("failed to parse frame layer"); GST_ERROR("failed to parse frame layer");
return get_status(result); return get_status(result);
} }
@ -880,7 +880,7 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
picture->type = GST_VAAPI_PICTURE_TYPE_BI; picture->type = GST_VAAPI_PICTURE_TYPE_BI;
break; break;
default: default:
GST_DEBUG("unsupported picture type %d", frame_hdr->ptype); GST_ERROR("unsupported picture type %d", frame_hdr->ptype);
return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
} }
@ -909,7 +909,7 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
ebdu->size + ebdu->offset - ebdu->sc_offset ebdu->size + ebdu->offset - ebdu->sc_offset
); );
if (!slice) { if (!slice) {
GST_DEBUG("failed to allocate slice"); GST_ERROR("failed to allocate slice");
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
} }
gst_vaapi_picture_add_slice(picture, slice); gst_vaapi_picture_add_slice(picture, slice);
@ -1000,7 +1000,7 @@ decode_ebdu(GstVaapiDecoderVC1 *decoder, GstVC1BDU *ebdu)
status = decode_sequence_end(decoder); status = decode_sequence_end(decoder);
break; break;
default: default:
GST_DEBUG("unsupported BDU type %d", ebdu->type); GST_WARNING("unsupported BDU type %d", ebdu->type);
status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER;
break; break;
} }
@ -1051,14 +1051,14 @@ decode_codec_data(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer)
width = GST_VAAPI_DECODER_WIDTH(decoder); width = GST_VAAPI_DECODER_WIDTH(decoder);
height = GST_VAAPI_DECODER_HEIGHT(decoder); height = GST_VAAPI_DECODER_HEIGHT(decoder);
if (!width || !height) { if (!width || !height) {
GST_DEBUG("failed to parse size from codec-data"); GST_ERROR("failed to parse size from codec-data");
return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
} }
caps = GST_VAAPI_DECODER_CODEC_STATE(decoder)->caps; caps = GST_VAAPI_DECODER_CODEC_STATE(decoder)->caps;
structure = gst_caps_get_structure(caps, 0); structure = gst_caps_get_structure(caps, 0);
if (!gst_structure_get_fourcc(structure, "format", &format)) { if (!gst_structure_get_fourcc(structure, "format", &format)) {
GST_DEBUG("failed to parse profile from codec-data"); GST_ERROR("failed to parse profile from codec-data");
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC; return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC;
} }
@ -1238,20 +1238,20 @@ gst_vaapi_decoder_vc1_start_frame(GstVaapiDecoder *base_decoder,
status = ensure_context(decoder); status = ensure_context(decoder);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) {
GST_DEBUG("failed to reset context"); GST_ERROR("failed to reset context");
return status; return status;
} }
picture = GST_VAAPI_PICTURE_NEW(VC1, decoder); picture = GST_VAAPI_PICTURE_NEW(VC1, decoder);
if (!picture) { if (!picture) {
GST_DEBUG("failed to allocate picture"); GST_ERROR("failed to allocate picture");
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
} }
gst_vaapi_picture_replace(&priv->current_picture, picture); gst_vaapi_picture_replace(&priv->current_picture, picture);
gst_vaapi_picture_unref(picture); gst_vaapi_picture_unref(picture);
if (!gst_vc1_bitplanes_ensure_size(priv->bitplanes, &priv->seq_hdr)) { if (!gst_vc1_bitplanes_ensure_size(priv->bitplanes, &priv->seq_hdr)) {
GST_DEBUG("failed to allocate bitplanes"); GST_ERROR("failed to allocate bitplanes");
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
} }
return GST_VAAPI_DECODER_STATUS_SUCCESS; return GST_VAAPI_DECODER_STATUS_SUCCESS;