decoder = GST_VP8_DEC (base_video_decoder);
+ if (decoder->output_state) {
+ gst_video_codec_state_unref (decoder->output_state);
+ decoder->output_state = NULL;
+ }
if (decoder->decoder_inited)
vpx_codec_destroy (&decoder->decoder);
decoder->decoder_inited = FALSE;
{
int stride, w, h, i;
guint8 *d;
- GstVideoCodecState *outputstate;
GstVideoInfo *info;
- outputstate = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (dec));
- info = &outputstate->info;
+ info = &dec->output_state->info;
d = GST_BUFFER_DATA (buffer) + GST_VIDEO_INFO_COMP_OFFSET (info, 0);
stride = GST_VIDEO_INFO_COMP_STRIDE (info, 0);
for (i = 0; i < h; i++)
memcpy (d + i * stride,
img->planes[VPX_PLANE_V] + i * img->stride[VPX_PLANE_V], w);
-
- gst_video_codec_state_unref (outputstate);
}
static GstFlowReturn
vpx_codec_caps_t caps;
GstVideoCodecState *state = dec->input_state;
vpx_codec_err_t status;
- GstVideoCodecState *output_state;
memset (&stream_info, 0, sizeof (stream_info));
stream_info.sz = sizeof (stream_info);
return GST_FLOW_OK;
}
- output_state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (dec),
+ g_assert (dec->output_state == NULL);
+ dec->output_state =
+ gst_video_decoder_set_output_state (GST_VIDEO_DECODER (dec),
GST_VIDEO_FORMAT_I420, stream_info.w, stream_info.h, state);
- gst_video_codec_state_unref (output_state);
gst_vp8_dec_send_tags (dec);
caps = vpx_codec_get_caps (&vpx_codec_vp8_dx_algo);
#define __GST_VP8_DEC_H__
#include <gst/gst.h>
-#include <gst/video/gstbasevideodecoder.h>
+#include <gst/video/gstvideodecoder.h>
/* FIXME: Undef HAVE_CONFIG_H because vpx_codec.h uses it,
* which causes compilation failures */
struct _GstVP8Dec
{
- GstBaseVideoDecoder base_video_decoder;
+ GstVideoDecoder base_video_decoder;
/* < private > */
vpx_codec_ctx_t decoder;
enum vp8_postproc_level post_processing_flags;
gint deblocking_level;
gint noise_level;
+
+ GstVideoCodecState *input_state;
+ GstVideoCodecState *output_state;
};
struct _GstVP8DecClass
{
- GstBaseVideoDecoderClass base_video_decoder_class;
+ GstVideoDecoderClass base_video_decoder_class;
};
GType gst_vp8_dec_get_type (void);