struct _GstVaVp8Dec
{
GstVaBaseDec parent;
-
- GstFlowReturn last_ret;
};
static GstElementClass *parent_class = NULL;
{
GstVaVp8Dec *self = GST_VA_VP8_DEC (decoder);
GstVaDecodePicture *pic;
- GstVideoDecoder *vdec = GST_VIDEO_DECODER (decoder);
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
+ GstFlowReturn ret;
- if (base->need_negotiation) {
- if (!gst_video_decoder_negotiate (vdec)) {
- GST_ERROR_OBJECT (self, "Failed to negotiate with downstream");
- return GST_FLOW_NOT_NEGOTIATED;
- }
- }
-
- self->last_ret = gst_video_decoder_allocate_output_frame (vdec, frame);
- if (self->last_ret != GST_FLOW_OK)
+ ret = gst_va_base_dec_prepare_output_frame (base, frame);
+ if (ret != GST_FLOW_OK)
goto error;
pic = gst_va_decode_picture_new (base->decoder, frame->output_buffer);
{
GST_WARNING_OBJECT (self,
"Failed to allocated output buffer, return %s",
- gst_flow_get_name (self->last_ret));
- return self->last_ret;
+ gst_flow_get_name (ret));
+ return ret;
}
}
"Outputting picture %p (system_frame_number %d)",
picture, picture->system_frame_number);
- if (self->last_ret != GST_FLOW_OK) {
- gst_vp8_picture_unref (picture);
- gst_video_decoder_drop_frame (vdec, frame);
- return self->last_ret;
- }
-
ret = gst_va_base_dec_process_output (base, frame, 0);
gst_vp8_picture_unref (picture);