Commit d69cb438 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne

vc1: review and report errors accordingly.

Use GST_ERROR() to report real errors instead of hiding them into
GST_DEBUG().
parent b134a97d
......@@ -242,7 +242,7 @@ decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
seq_hdr
);
if (result != GST_VC1_PARSER_OK) {
GST_DEBUG("failed to parse sequence layer");
GST_ERROR("failed to parse sequence layer");
return get_status(result);
}
......@@ -262,7 +262,7 @@ decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
case GST_VC1_PROFILE_ADVANCED:
break;
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;
}
......@@ -370,7 +370,7 @@ decode_entry_point(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu
seq_hdr
);
if (result != GST_VC1_PARSER_OK) {
GST_DEBUG("failed to parse entrypoint layer");
GST_ERROR("failed to parse entrypoint layer");
return get_status(result);
}
......@@ -859,7 +859,7 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
priv->bitplanes
);
if (result != GST_VC1_PARSER_OK) {
GST_DEBUG("failed to parse frame layer");
GST_ERROR("failed to parse frame layer");
return get_status(result);
}
......@@ -880,7 +880,7 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
picture->type = GST_VAAPI_PICTURE_TYPE_BI;
break;
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;
}
......@@ -909,7 +909,7 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
ebdu->size + ebdu->offset - ebdu->sc_offset
);
if (!slice) {
GST_DEBUG("failed to allocate slice");
GST_ERROR("failed to allocate slice");
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
}
gst_vaapi_picture_add_slice(picture, slice);
......@@ -1000,7 +1000,7 @@ decode_ebdu(GstVaapiDecoderVC1 *decoder, GstVC1BDU *ebdu)
status = decode_sequence_end(decoder);
break;
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;
break;
}
......@@ -1051,14 +1051,14 @@ decode_codec_data(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer)
width = GST_VAAPI_DECODER_WIDTH(decoder);
height = GST_VAAPI_DECODER_HEIGHT(decoder);
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;
}
caps = GST_VAAPI_DECODER_CODEC_STATE(decoder)->caps;
structure = gst_caps_get_structure(caps, 0);
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;
}
......@@ -1238,20 +1238,20 @@ gst_vaapi_decoder_vc1_start_frame(GstVaapiDecoder *base_decoder,
status = ensure_context(decoder);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) {
GST_DEBUG("failed to reset context");
GST_ERROR("failed to reset context");
return status;
}
picture = GST_VAAPI_PICTURE_NEW(VC1, decoder);
if (!picture) {
GST_DEBUG("failed to allocate picture");
GST_ERROR("failed to allocate picture");
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
}
gst_vaapi_picture_replace(&priv->current_picture, picture);
gst_vaapi_picture_unref(picture);
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_SUCCESS;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment