static gboolean daala_dec_stop (GstVideoDecoder * decoder);
static gboolean daala_dec_set_format (GstVideoDecoder * decoder,
GstVideoCodecState * state);
-static gboolean daala_dec_reset (GstVideoDecoder * decoder, gboolean hard);
+static gboolean daala_dec_flush (GstVideoDecoder * decoder);
static GstFlowReturn daala_dec_parse (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame, GstAdapter * adapter, gboolean at_eos);
static GstFlowReturn daala_dec_handle_frame (GstVideoDecoder * decoder,
video_decoder_class->start = GST_DEBUG_FUNCPTR (daala_dec_start);
video_decoder_class->stop = GST_DEBUG_FUNCPTR (daala_dec_stop);
- video_decoder_class->reset = GST_DEBUG_FUNCPTR (daala_dec_reset);
+ video_decoder_class->flush = GST_DEBUG_FUNCPTR (daala_dec_flush);
video_decoder_class->set_format = GST_DEBUG_FUNCPTR (daala_dec_set_format);
video_decoder_class->parse = GST_DEBUG_FUNCPTR (daala_dec_parse);
video_decoder_class->handle_frame =
}
static void
-gst_daala_dec_reset (GstDaalaDec * dec)
+daala_dec_reset (GstDaalaDec * dec)
{
dec->need_keyframe = TRUE;
}
daala_comment_clear (&dec->comment);
GST_DEBUG_OBJECT (dec, "Setting have_header to FALSE");
dec->have_header = FALSE;
- gst_daala_dec_reset (dec);
+ daala_dec_reset (dec);
return TRUE;
}
dec->setup = NULL;
daala_decode_free (dec->decoder);
dec->decoder = NULL;
- gst_daala_dec_reset (dec);
+ daala_dec_reset (dec);
if (dec->input_state) {
gst_video_codec_state_unref (dec->input_state);
dec->input_state = NULL;
return TRUE;
}
-/* FIXME : Do we want to handle hard resets differently ? */
-static gboolean
-daala_dec_reset (GstVideoDecoder * bdec, gboolean hard)
-{
- gst_daala_dec_reset (GST_DAALA_DEC (bdec));
- return TRUE;
-}
-
static GstFlowReturn
daala_dec_parse (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame, GstAdapter * adapter, gboolean at_eos)
/* If we have a default PAR, see if the decoder specified a different one */
if (par_num == 1 && par_den == 1 &&
- (dec->info.pixel_aspect_numerator != 0 && dec->info.pixel_aspect_denominator != 0)) {
+ (dec->info.pixel_aspect_numerator != 0
+ && dec->info.pixel_aspect_denominator != 0)) {
par_num = dec->info.pixel_aspect_numerator;
par_den = dec->info.pixel_aspect_denominator;
}
dec->info.plane_info[0].ydec == 0 &&
dec->info.plane_info[1].xdec == 1 &&
dec->info.plane_info[1].ydec == 1 &&
- dec->info.plane_info[2].xdec == 1 &&
- dec->info.plane_info[2].ydec == 1) {
+ dec->info.plane_info[2].xdec == 1 && dec->info.plane_info[2].ydec == 1) {
fmt = GST_VIDEO_FORMAT_I420;
} else if (dec->info.nplanes == 3 && dec->info.plane_info[0].xdec == 0 &&
dec->info.plane_info[0].ydec == 0 &&
dec->info.plane_info[1].xdec == 0 &&
dec->info.plane_info[1].ydec == 0 &&
- dec->info.plane_info[2].xdec == 0 &&
- dec->info.plane_info[2].ydec == 0) {
- fmt = GST_VIDEO_FORMAT_Y444;
+ dec->info.plane_info[2].xdec == 0 && dec->info.plane_info[2].ydec == 0) {
+ fmt = GST_VIDEO_FORMAT_Y444;
} else {
goto unsupported_format;
}
/* Allocate buffer and copy image data into Y444 format */
static GstFlowReturn
-daala_handle_image (GstDaalaDec * dec, od_img * img,
- GstVideoCodecFrame * frame)
+daala_handle_image (GstDaalaDec * dec, od_img * img, GstVideoCodecFrame * frame)
{
GstVideoDecoder *decoder = GST_VIDEO_DECODER (dec);
gint width, height, stride;
goto invalid_frame;
for (comp = 0; comp < 3; comp++) {
- width =
- GST_VIDEO_FRAME_COMP_WIDTH (&vframe, comp);
- height =
- GST_VIDEO_FRAME_COMP_HEIGHT (&vframe, comp);
+ width = GST_VIDEO_FRAME_COMP_WIDTH (&vframe, comp);
+ height = GST_VIDEO_FRAME_COMP_HEIGHT (&vframe, comp);
stride = GST_VIDEO_FRAME_COMP_STRIDE (&vframe, comp);
dest = GST_VIDEO_FRAME_COMP_DATA (&vframe, comp);
goto dropping_qos;
if (G_UNLIKELY ((img.width != dec->info.pic_width
- || img.height != dec->info.pic_height)))
+ || img.height != dec->info.pic_height)))
goto wrong_dimensions;
result = daala_handle_image (dec, &img, frame);
GstBufferPool *pool;
GstStructure *config;
- if (!GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (decoder, query))
+ if (!GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (decoder,
+ query))
return FALSE;
g_assert (gst_query_get_n_allocation_pools (query) > 0);
static gboolean daala_enc_start (GstVideoEncoder * enc);
static gboolean daala_enc_stop (GstVideoEncoder * enc);
+static gboolean daala_enc_flush (GstVideoEncoder * enc);
static gboolean daala_enc_set_format (GstVideoEncoder * enc,
GstVideoCodecState * state);
static GstFlowReturn daala_enc_handle_frame (GstVideoEncoder * enc,
gstvideo_encoder_class->start = GST_DEBUG_FUNCPTR (daala_enc_start);
gstvideo_encoder_class->stop = GST_DEBUG_FUNCPTR (daala_enc_stop);
+ gstvideo_encoder_class->flush = GST_DEBUG_FUNCPTR (daala_enc_flush);
gstvideo_encoder_class->set_format = GST_DEBUG_FUNCPTR (daala_enc_set_format);
gstvideo_encoder_class->handle_frame =
GST_DEBUG_FUNCPTR (daala_enc_handle_frame);
}
static void
-daala_enc_reset (GstDaalaEnc * enc)
+daala_enc_flush (GstDaalaEnc * enc)
{
int quant;
GST_DEBUG_OBJECT (benc, "start: init daala");
enc = GST_DAALA_ENC (benc);
- daala_info_init (&enc->info);
- daala_comment_init (&enc->comment);
enc->packetno = 0;
+ enc->initialised = FALSE;
return TRUE;
}
daala_comment_clear (&enc->comment);
daala_info_clear (&enc->info);
+ if (enc->input_state)
+ gst_video_codec_state_unref (enc->input_state);
+ enc->input_state = NULL;
+
enc->initialised = FALSE;
return TRUE;
gst_video_codec_state_unref (enc->input_state);
enc->input_state = gst_video_codec_state_ref (state);
- daala_enc_reset (enc);
+ daala_enc_flush (enc);
enc->initialised = TRUE;
return TRUE;
static gboolean gst_openjpeg_dec_stop (GstVideoDecoder * decoder);
static gboolean gst_openjpeg_dec_set_format (GstVideoDecoder * decoder,
GstVideoCodecState * state);
-static gboolean gst_openjpeg_dec_reset (GstVideoDecoder * decoder,
- gboolean hard);
static GstFlowReturn gst_openjpeg_dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame);
static gboolean gst_openjpeg_dec_decide_allocation (GstVideoDecoder * decoder,
video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_openjpeg_dec_start);
video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_openjpeg_dec_stop);
- video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_openjpeg_dec_reset);
video_decoder_class->set_format =
GST_DEBUG_FUNCPTR (gst_openjpeg_dec_set_format);
video_decoder_class->handle_frame =
return TRUE;
}
-static gboolean
-gst_openjpeg_dec_reset (GstVideoDecoder * decoder, gboolean hard)
-{
- GstOpenJPEGDec *self = GST_OPENJPEG_DEC (decoder);
-
- GST_DEBUG_OBJECT (self, "Resetting");
-
- if (self->output_state) {
- gst_video_codec_state_unref (self->output_state);
- self->output_state = NULL;
- }
-
- return TRUE;
-}
-
static void
fill_frame_packed8_4 (GstVideoFrame * frame, opj_image_t * image)
{
static gboolean gst_openjpeg_enc_stop (GstVideoEncoder * encoder);
static gboolean gst_openjpeg_enc_set_format (GstVideoEncoder * encoder,
GstVideoCodecState * state);
-static gboolean gst_openjpeg_enc_reset (GstVideoEncoder * encoder,
- gboolean hard);
static GstFlowReturn gst_openjpeg_enc_handle_frame (GstVideoEncoder * encoder,
GstVideoCodecFrame * frame);
static gboolean gst_openjpeg_enc_propose_allocation (GstVideoEncoder * encoder,
video_encoder_class->start = GST_DEBUG_FUNCPTR (gst_openjpeg_enc_start);
video_encoder_class->stop = GST_DEBUG_FUNCPTR (gst_openjpeg_enc_stop);
- video_encoder_class->reset = GST_DEBUG_FUNCPTR (gst_openjpeg_enc_reset);
video_encoder_class->set_format =
GST_DEBUG_FUNCPTR (gst_openjpeg_enc_set_format);
video_encoder_class->handle_frame =
return TRUE;
}
-static gboolean
-gst_openjpeg_enc_reset (GstVideoEncoder * encoder, gboolean hard)
-{
- GstOpenJPEGEnc *self = GST_OPENJPEG_ENC (encoder);
-
- GST_DEBUG_OBJECT (self, "Resetting");
-
- if (self->output_state) {
- gst_video_codec_state_unref (self->output_state);
- self->output_state = NULL;
- }
-
- return TRUE;
-}
-
static opj_image_t *
gst_openjpeg_enc_fill_image (GstOpenJPEGEnc * self, GstVideoFrame * frame)
{
#define gst_rsv_dec_parent_class parent_class
G_DEFINE_TYPE (GstRsvgDec, gst_rsvg_dec, GST_TYPE_VIDEO_DECODER);
-static gboolean gst_rsvg_dec_reset (GstVideoDecoder * decoder, gboolean hard);
-
static gboolean gst_rsvg_dec_stop (GstVideoDecoder * decoder);
static gboolean gst_rsvg_dec_set_format (GstVideoDecoder * decoder,
GstVideoCodecState * state);
gobject_class->finalize = gst_rsvg_dec_finalize;
video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_rsvg_dec_stop);
- video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_rsvg_dec_reset);
video_decoder_class->set_format = GST_DEBUG_FUNCPTR (gst_rsvg_dec_set_format);
video_decoder_class->parse = GST_DEBUG_FUNCPTR (gst_rsvg_dec_parse);
video_decoder_class->handle_frame =
}
static void
-dec_reset (GstRsvgDec * rsvg)
-{
- rsvg->fps_n = 0;
- rsvg->fps_d = 1;
-}
-
-static void
gst_rsvg_dec_init (GstRsvgDec * rsvg)
{
GstVideoDecoder *decoder = GST_VIDEO_DECODER (rsvg);
gst_video_decoder_set_packetized (decoder, FALSE);
- dec_reset (rsvg);
}
static void
}
-static gboolean
-gst_rsvg_dec_reset (GstVideoDecoder * decoder, gboolean hard)
-{
- GstRsvgDec *dec = GST_RSVG_DEC (decoder);
-
- dec_reset (dec);
-
- return TRUE;
-}
-
#define CAIRO_UNPREMULTIPLY(a,r,g,b) G_STMT_START { \
b = (a > 0) ? MIN ((b * 255 + a / 2) / a, 255) : 0; \
g = (a > 0) ? MIN ((g * 255 + a / 2) / a, 255) : 0; \
gst_rsvg_dec_stop (GstVideoDecoder * decoder)
{
GstRsvgDec *rsvg = GST_RSVG_DEC (decoder);
+
if (rsvg->input_state) {
gst_video_codec_state_unref (rsvg->input_state);
rsvg->input_state = NULL;
}
- gst_rsvg_dec_reset (decoder, TRUE);
-
return TRUE;
}
GList *pending_events;
- gint fps_n, fps_d;
GstClockTime first_timestamp;
guint64 frame_count;
static gboolean gst_schro_dec_start (GstVideoDecoder * dec);
static gboolean gst_schro_dec_stop (GstVideoDecoder * dec);
-static gboolean gst_schro_dec_reset (GstVideoDecoder * dec, gboolean hard);
+static gboolean gst_schro_dec_flush (GstVideoDecoder * dec);
static GstFlowReturn gst_schro_dec_parse (GstVideoDecoder *
base_video_decoder, GstVideoCodecFrame * frame, GstAdapter * adapter,
gboolean at_eos);
base_video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_schro_dec_start);
base_video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_schro_dec_stop);
- base_video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_schro_dec_reset);
+ base_video_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_schro_dec_flush);
base_video_decoder_class->parse = GST_DEBUG_FUNCPTR (gst_schro_dec_parse);
base_video_decoder_class->handle_frame =
GST_DEBUG_FUNCPTR (gst_schro_dec_handle_frame);
}
static gboolean
-gst_schro_dec_reset (GstVideoDecoder * dec, gboolean hard)
+gst_schro_dec_flush (GstVideoDecoder * dec)
{
GstSchroDec *schro_dec;
schro_dec = GST_SCHRO_DEC (dec);
- GST_DEBUG ("reset");
+ GST_DEBUG ("flush");
- if (schro_dec->decoder) {
+ if (schro_dec->decoder)
schro_decoder_reset (schro_dec->decoder);
- }
return TRUE;
}
static gboolean gst_amc_video_dec_stop (GstVideoDecoder * decoder);
static gboolean gst_amc_video_dec_set_format (GstVideoDecoder * decoder,
GstVideoCodecState * state);
-static gboolean gst_amc_video_dec_reset (GstVideoDecoder * decoder,
- gboolean hard);
+static gboolean gst_amc_video_dec_flush (GstVideoDecoder * decoder);
static GstFlowReturn gst_amc_video_dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame);
static GstFlowReturn gst_amc_video_dec_finish (GstVideoDecoder * decoder);
videodec_class->stop = GST_DEBUG_FUNCPTR (gst_amc_video_dec_stop);
videodec_class->open = GST_DEBUG_FUNCPTR (gst_amc_video_dec_open);
videodec_class->close = GST_DEBUG_FUNCPTR (gst_amc_video_dec_close);
- videodec_class->reset = GST_DEBUG_FUNCPTR (gst_amc_video_dec_reset);
+ videodec_class->flush = GST_DEBUG_FUNCPTR (gst_amc_video_dec_flush);
videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_amc_video_dec_set_format);
videodec_class->handle_frame =
GST_DEBUG_FUNCPTR (gst_amc_video_dec_handle_frame);
}
static gboolean
-gst_amc_video_dec_reset (GstVideoDecoder * decoder, gboolean hard)
+gst_amc_video_dec_flush (GstVideoDecoder * decoder)
{
GstAmcVideoDec *self;
self = GST_AMC_VIDEO_DEC (decoder);
- GST_DEBUG_OBJECT (self, "Resetting decoder");
+ GST_DEBUG_OBJECT (self, "Flushing decoder");
if (!self->started) {
GST_DEBUG_OBJECT (self, "Codec not started yet");
gst_pad_start_task (GST_VIDEO_DECODER_SRC_PAD (self),
(GstTaskFunction) gst_amc_video_dec_loop, decoder, NULL);
- GST_DEBUG_OBJECT (self, "Reset decoder");
+ GST_DEBUG_OBJECT (self, "Flushed decoder");
return TRUE;
}
static gboolean gst_mfc_dec_stop (GstVideoDecoder * decoder);
static gboolean gst_mfc_dec_set_format (GstVideoDecoder * decoder,
GstVideoCodecState * state);
-static gboolean gst_mfc_dec_reset (GstVideoDecoder * decoder, gboolean hard);
+static gboolean gst_mfc_dec_flush (GstVideoDecoder * decoder);
static GstFlowReturn gst_mfc_dec_finish (GstVideoDecoder * decoder);
static GstFlowReturn gst_mfc_dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame);
video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_mfc_dec_start);
video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_mfc_dec_stop);
video_decoder_class->finish = GST_DEBUG_FUNCPTR (gst_mfc_dec_finish);
- video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_mfc_dec_reset);
+ video_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_mfc_dec_flush);
video_decoder_class->set_format = GST_DEBUG_FUNCPTR (gst_mfc_dec_set_format);
video_decoder_class->negotiate = GST_DEBUG_FUNCPTR (gst_mfc_dec_negotiate);
video_decoder_class->decide_allocation =
}
static gboolean
-gst_mfc_dec_reset (GstVideoDecoder * decoder, gboolean hard)
+gst_mfc_dec_flush (GstVideoDecoder * decoder)
{
GstMFCDec *self = GST_MFC_DEC (decoder);
- GST_DEBUG_OBJECT (self, "Resetting");
+ GST_DEBUG_OBJECT (self, "Flushing");
if (self->context)
mfc_dec_flush (self->context);
static gboolean
-gst_vdp_h264_dec_reset (GstVideoDecoder * video_decoder, gboolean hard)
+gst_vdp_h264_dec_flush (GstVideoDecoder * video_decoder)
{
GstVdpH264Dec *h264_dec = GST_VDP_H264_DEC (video_decoder);
video_decoder_class->start = gst_vdp_h264_dec_start;
video_decoder_class->stop = gst_vdp_h264_dec_stop;
- video_decoder_class->reset = gst_vdp_h264_dec_reset;
+ video_decoder_class->flush = gst_vdp_h264_dec_flush;
video_decoder_class->set_format = gst_vdp_h264_dec_set_format;
}
static gboolean
-gst_vdp_mpeg_dec_reset (GstVideoDecoder * video_decoder, gboolean hard)
+gst_vdp_mpeg_dec_flush (GstVideoDecoder * video_decoder)
{
GstVdpMpegDec *mpeg_dec = GST_VDP_MPEG_DEC (video_decoder);
video_decoder_class->start = gst_vdp_mpeg_dec_start;
video_decoder_class->stop = gst_vdp_mpeg_dec_stop;
- video_decoder_class->reset = gst_vdp_mpeg_dec_reset;
+ video_decoder_class->flush = gst_vdp_mpeg_dec_flush;
video_decoder_class->handle_frame = gst_vdp_mpeg_dec_handle_frame;
video_decoder_class->set_format = gst_vdp_mpeg_dec_set_format;