static const gchar *sink_caps_str = "video/x-vp8";
-static gboolean
-gst_va_vp8_dec_negotiate (GstVideoDecoder * decoder)
-{
- GstCapsFeatures *capsfeatures = NULL;
- GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
- GstVaVp8Dec *self = GST_VA_VP8_DEC (decoder);
- GstVideoFormat format = GST_VIDEO_FORMAT_UNKNOWN;
- GstVp8Decoder *vp8dec = GST_VP8_DECODER (decoder);
-
- /* Ignore downstream renegotiation request. */
- if (!base->need_negotiation)
- return TRUE;
-
- base->need_negotiation = FALSE;
-
- if (gst_va_decoder_is_open (base->decoder)
- && !gst_va_decoder_close (base->decoder))
- return FALSE;
-
- if (!gst_va_decoder_open (base->decoder, base->profile, base->rt_format))
- return FALSE;
-
- if (!gst_va_decoder_set_frame_size (base->decoder, base->width, base->height))
- return FALSE;
-
- if (base->output_state)
- gst_video_codec_state_unref (base->output_state);
-
- gst_va_base_dec_get_preferred_format_and_caps_features (base, &format,
- &capsfeatures);
- if (format == GST_VIDEO_FORMAT_UNKNOWN)
- return FALSE;
-
- base->output_state =
- gst_video_decoder_set_output_state (decoder, format,
- base->width, base->height, vp8dec->input_state);
-
- base->output_state->caps = gst_video_info_to_caps (&base->output_state->info);
- if (capsfeatures)
- gst_caps_set_features_simple (base->output_state->caps, capsfeatures);
-
- GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT,
- base->output_state->caps);
-
- return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder);
-}
-
static VAProfile
_get_profile (GstVaVp8Dec * self, const GstVp8FrameHdr * frame_hdr)
{
{
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
GstVaVp8Dec *self = GST_VA_VP8_DEC (decoder);
+ GstVideoInfo *info = &base->output_info;
VAProfile profile;
guint rt_format;
gboolean negotiation_needed = FALSE;
if (!gst_va_decoder_config_is_equal (base->decoder, profile,
rt_format, frame_hdr->width, frame_hdr->height)) {
base->profile = profile;
- base->width = frame_hdr->width;
- base->height = frame_hdr->height;
+ GST_VIDEO_INFO_WIDTH (info) = base->width = frame_hdr->width;
+ GST_VIDEO_INFO_HEIGHT (info) = base->height = frame_hdr->height;
base->rt_format = rt_format;
negotiation_needed = TRUE;
}
base->min_buffers = 3 + 4; /* max num pic references + scratch surfaces */
-
base->need_negotiation = negotiation_needed;
+ g_clear_pointer (&base->input_state, gst_video_codec_state_unref);
+ base->input_state = gst_video_codec_state_ref (decoder->input_state);
return GST_FLOW_OK;
}
{
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;
- }
- }
-
- ret = gst_video_decoder_allocate_output_frame (vdec, frame);
+ ret = gst_va_base_dec_prepare_output_frame (base, frame);
if (ret != GST_FLOW_OK)
goto error;
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
GstVp8FrameHdr const *frame_hdr = &picture->frame_hdr;
GstVp8Segmentation *const seg = &parser->segmentation;
- VAIQMatrixBufferVP8 iq_matrix = { };
+ VAIQMatrixBufferVP8 iq_matrix = { 0, };
const gint8 QI_MAX = 127;
gint16 qi, qi_base;
gint i;
{
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
GstVp8FrameHdr const *frame_hdr = &picture->frame_hdr;
- VAProbabilityDataBufferVP8 prob_table = { };
+ VAProbabilityDataBufferVP8 prob_table = { 0, };
/* Fill in VAProbabilityDataBufferVP8 */
memcpy (prob_table.dct_coeff_probs, frame_hdr->token_probs.prob,
"Outputting picture %p (system_frame_number %d)",
picture, picture->system_frame_number);
- ret = gst_va_base_dec_process_output (base, frame, 0);
+ ret = gst_va_base_dec_process_output (base, frame, picture->discont_state, 0);
gst_vp8_picture_unref (picture);
if (ret)
GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
GstVp8DecoderClass *vp8decoder_class = GST_VP8_DECODER_CLASS (g_class);
- GstVideoDecoderClass *decoder_class = GST_VIDEO_DECODER_CLASS (g_class);
struct CData *cdata = class_data;
gchar *long_name;
gobject_class->dispose = gst_va_vp8_dec_dispose;
- decoder_class->negotiate = GST_DEBUG_FUNCPTR (gst_va_vp8_dec_negotiate);
-
vp8decoder_class->new_sequence =
GST_DEBUG_FUNCPTR (gst_va_vp8_dec_new_sequence);
vp8decoder_class->new_picture =