static GstVaapiDecoderStatus decode_current_picture (GstVaapiDecoderJpeg * decoder) { GstVaapiDecoderJpegPrivate *const priv = &decoder->priv; GstVaapiPicture *const picture = priv->current_picture; if (!VALID_STATE (decoder, VALID_PICTURE)) goto drop_frame; priv->decoder_state = 0; if (!picture) return GST_VAAPI_DECODER_STATUS_SUCCESS; if (!gst_vaapi_picture_decode (picture)) goto error; if (!gst_vaapi_picture_output (picture)) goto error; gst_vaapi_picture_replace (&priv->current_picture, NULL); return GST_VAAPI_DECODER_STATUS_SUCCESS; /* ERRORS */ error: { gst_vaapi_picture_replace (&priv->current_picture, NULL); return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; } drop_frame: { priv->decoder_state = 0; return (GstVaapiDecoderStatus) GST_VAAPI_DECODER_STATUS_DROP_FRAME; } }
static GstVaapiDecoderStatus decode_current_picture (GstVaapiDecoderVp8 * decoder) { GstVaapiDecoderVp8Private *const priv = &decoder->priv; GstVaapiPicture *const picture = priv->current_picture; if (!picture) return GST_VAAPI_DECODER_STATUS_SUCCESS; update_ref_frames (decoder); if (!gst_vaapi_picture_decode (picture)) goto error; if (!gst_vaapi_picture_output (picture)) goto error; gst_vaapi_picture_replace (&priv->current_picture, NULL); return GST_VAAPI_DECODER_STATUS_SUCCESS; /* ERRORS */ error: { /* XXX: fix for cases where first field failed to be decoded */ gst_vaapi_picture_replace (&priv->current_picture, NULL); return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; } }
static gboolean decode_current_picture(GstVaapiDecoderJpeg *decoder) { GstVaapiDecoderJpegPrivate * const priv = decoder->priv; GstVaapiPicture * const picture = priv->current_picture; gboolean success = TRUE; if (picture) { if (!gst_vaapi_picture_decode(picture)) success = FALSE; else if (!gst_vaapi_picture_output(picture)) success = FALSE; gst_vaapi_picture_replace(&priv->current_picture, NULL); } return success; }
static gboolean decode_current_picture(GstVaapiDecoderVC1 *decoder) { GstVaapiDecoderVC1Private * const priv = decoder->priv; GstVaapiPicture * const picture = priv->current_picture; if (picture) { if (!gst_vaapi_picture_decode(picture)) return FALSE; if (GST_VAAPI_PICTURE_IS_COMPLETE(picture)) { if (!gst_vaapi_dpb_add(priv->dpb, picture)) return FALSE; gst_vaapi_picture_replace(&priv->current_picture, NULL); } } return TRUE; }