{C_FLAGS (VP8_DEBLOCK), "Deblock", "deblock"},
{C_FLAGS (VP8_DEMACROBLOCK), "Demacroblock", "demacroblock"},
{C_FLAGS (VP8_ADDNOISE), "Add noise", "addnoise"},
+#ifndef HAVE_VPX_1_8
{C_FLAGS (VP8_DEBUG_TXT_FRAME_INFO),
"Print frame information",
"visualize-frame-info"},
{C_FLAGS (VP8_DEBUG_TXT_RATE_INFO),
"Print video rate info",
"visualize-rate-info"},
+#endif
{C_FLAGS (VP8_MFQE), "Multi-frame quality enhancement", "mfqe"},
{0, NULL, NULL}
};
gst_event_new_tag (list));
}
-#ifdef HAVE_VPX_1_4
struct Frame
{
GstMapInfo info;
return 0;
}
-#endif
static void
gst_vpx_dec_image_to_buffer (GstVPXDec * dec, const vpx_image_t * img,
GST_WARNING_OBJECT (dec, "No keyframe, skipping");
return GST_FLOW_CUSTOM_SUCCESS_1;
}
+ if (stream_info.w == 0 || stream_info.h == 0) {
+ /* For VP8 it's possible to signal width or height to be 0, but it does
+ * not make sense to do so. For VP9 it's impossible. Hence, we most likely
+ * have a corrupt stream if width or height is 0. */
+ GST_INFO_OBJECT (dec, "Invalid resolution %d x %d", stream_info.w,
+ stream_info.h);
+ return GST_FLOW_CUSTOM_SUCCESS_1;
+ }
gst_vpx_dec_set_stream_info (dec, &stream_info);
gst_vpx_dec_set_default_format (dec, GST_VIDEO_FORMAT_I420, stream_info.w,
gst_vpx_error_name (status));
}
}
-#ifdef HAVE_VPX_1_4
vpx_codec_set_frame_buffer_functions (&dec->decoder,
gst_vpx_dec_get_buffer_cb, gst_vpx_dec_release_buffer_cb, dec);
-#endif
dec->decoder_inited = TRUE;
gst_video_decoder_drop_frame (decoder, frame);
} else {
gst_vpx_dec_handle_resolution_change (dec, img, fmt);
-#ifdef HAVE_VPX_1_4
if (img->fb_priv && dec->have_video_meta) {
frame->output_buffer = gst_vpx_dec_prepare_image (dec, img);
ret = gst_video_decoder_finish_frame (decoder, frame);
- } else
-#endif
- {
+ } else {
ret = gst_video_decoder_allocate_output_frame (decoder, frame);
if (ret == GST_FLOW_OK) {