static gboolean gst_jpeg_dec_set_format (GstVideoDecoder * dec,
GstVideoCodecState * state);
+static gboolean gst_jpeg_dec_start (GstVideoDecoder * bdec);
static gboolean gst_jpeg_dec_stop (GstVideoDecoder * bdec);
-static gboolean gst_jpeg_dec_reset (GstVideoDecoder * bdec, gboolean hard);
+static gboolean gst_jpeg_dec_flush (GstVideoDecoder * bdec);
static GstFlowReturn gst_jpeg_dec_parse (GstVideoDecoder * bdec,
GstVideoCodecFrame * frame, GstAdapter * adapter, gboolean at_eos);
static GstFlowReturn gst_jpeg_dec_handle_frame (GstVideoDecoder * bdec,
"Codec/Decoder/Image",
"Decode images from JPEG format", "Wim Taymans <wim@fluendo.com>");
+ vdec_class->start = gst_jpeg_dec_start;
vdec_class->stop = gst_jpeg_dec_stop;
- vdec_class->reset = gst_jpeg_dec_reset;
+ vdec_class->flush = gst_jpeg_dec_flush;
vdec_class->parse = gst_jpeg_dec_parse;
vdec_class->set_format = gst_jpeg_dec_set_format;
vdec_class->handle_frame = gst_jpeg_dec_handle_frame;
}
static gboolean
-gst_jpeg_dec_reset (GstVideoDecoder * bdec, gboolean hard)
+gst_jpeg_dec_start (GstVideoDecoder * bdec)
{
GstJpegDec *dec = (GstJpegDec *) bdec;
- jpeg_abort_decompress (&dec->cinfo);
+ dec->saw_header = FALSE;
dec->parse_entropy_len = 0;
dec->parse_resync = FALSE;
- dec->saw_header = FALSE;
- if (hard) {
- dec->parse_entropy_len = 0;
- dec->parse_resync = FALSE;
+ gst_video_decoder_set_packetized (bdec, FALSE);
- gst_video_decoder_set_packetized (bdec, FALSE);
- }
+ return TRUE;
+}
+
+static gboolean
+gst_jpeg_dec_flush (GstVideoDecoder * bdec)
+{
+ GstJpegDec *dec = (GstJpegDec *) bdec;
+
+ jpeg_abort_decompress (&dec->cinfo);
+ dec->parse_entropy_len = 0;
+ dec->parse_resync = FALSE;
+ dec->saw_header = FALSE;
return TRUE;
}
static gboolean gst_jpegenc_start (GstVideoEncoder * benc);
static gboolean gst_jpegenc_stop (GstVideoEncoder * benc);
-static gboolean gst_jpegenc_reset (GstVideoEncoder * benc, gboolean hard);
static gboolean gst_jpegenc_set_format (GstVideoEncoder * encoder,
GstVideoCodecState * state);
static GstFlowReturn gst_jpegenc_handle_frame (GstVideoEncoder * encoder,
venc_class->start = gst_jpegenc_start;
venc_class->stop = gst_jpegenc_stop;
- venc_class->reset = gst_jpegenc_reset;
venc_class->set_format = gst_jpegenc_set_format;
venc_class->handle_frame = gst_jpegenc_handle_frame;
venc_class->propose_allocation = gst_jpegenc_propose_allocation;
jpegenc->idct_method = JPEG_DEFAULT_IDCT_METHOD;
}
-static gboolean
-gst_jpegenc_reset (GstVideoEncoder * benc, gboolean hard)
-{
- GstJpegEnc *enc = (GstJpegEnc *) benc;
-
- enc->sof_marker = -1;
-
- return TRUE;
-}
-
static void
gst_jpegenc_finalize (GObject * object)
{
enc->line[0] = NULL;
enc->line[1] = NULL;
enc->line[2] = NULL;
+ enc->sof_marker = -1;
return TRUE;
}
#define GST_CAT_DEFAULT pngdec_debug
static gboolean gst_pngdec_libpng_init (GstPngDec * pngdec);
-static gboolean gst_pngdec_reset (GstVideoDecoder * decoder, gboolean hard);
static GstFlowReturn gst_pngdec_caps_create_and_set (GstPngDec * pngdec);
static gboolean gst_pngdec_start (GstVideoDecoder * decoder);
static gboolean gst_pngdec_stop (GstVideoDecoder * decoder);
+static gboolean gst_pngdec_flush (GstVideoDecoder * decoder);
static gboolean gst_pngdec_set_format (GstVideoDecoder * Decoder,
GstVideoCodecState * state);
static GstFlowReturn gst_pngdec_parse (GstVideoDecoder * decoder,
vdec_class->start = gst_pngdec_start;
vdec_class->stop = gst_pngdec_stop;
- vdec_class->reset = gst_pngdec_reset;
+ vdec_class->flush = gst_pngdec_flush;
vdec_class->set_format = gst_pngdec_set_format;
vdec_class->parse = gst_pngdec_parse;
vdec_class->handle_frame = gst_pngdec_handle_frame;
pngdec->current_frame_map.data, pngdec->current_frame_map.size);
if (pngdec->image_ready) {
- if (1) {
- /* Reset ourselves for the next frame */
- gst_pngdec_reset (decoder, TRUE);
- GST_LOG_OBJECT (pngdec, "setting up callbacks for next frame");
- png_set_progressive_read_fn (pngdec->png, pngdec,
- user_info_callback, user_endrow_callback, user_end_callback);
- } else {
- GST_LOG_OBJECT (pngdec, "sending EOS");
- pngdec->ret = GST_FLOW_EOS;
- }
+ /* Reset ourselves for the next frame */
+ gst_pngdec_flush (decoder);
+ GST_LOG_OBJECT (pngdec, "setting up callbacks for next frame");
+ png_set_progressive_read_fn (pngdec->png, pngdec,
+ user_info_callback, user_endrow_callback, user_end_callback);
pngdec->image_ready = FALSE;
} else {
/* An error happened and we have to unmap */
/* Clean up the libpng structures */
static gboolean
-gst_pngdec_reset (GstVideoDecoder * decoder, gboolean hard)
+gst_pngdec_flush (GstVideoDecoder * decoder)
{
gst_pngdec_libpng_clear ((GstPngDec *) decoder);
gst_pngdec_libpng_init ((GstPngDec *) decoder);
static gboolean gst_vp8_dec_stop (GstVideoDecoder * decoder);
static gboolean gst_vp8_dec_set_format (GstVideoDecoder * decoder,
GstVideoCodecState * state);
-static gboolean gst_vp8_dec_reset (GstVideoDecoder * decoder, gboolean hard);
+static gboolean gst_vp8_dec_flush (GstVideoDecoder * decoder);
static GstFlowReturn gst_vp8_dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame);
static gboolean gst_vp8_dec_decide_allocation (GstVideoDecoder * decoder,
base_video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_vp8_dec_start);
base_video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_vp8_dec_stop);
- base_video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_vp8_dec_reset);
+ base_video_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_vp8_dec_flush);
base_video_decoder_class->set_format =
GST_DEBUG_FUNCPTR (gst_vp8_dec_set_format);
base_video_decoder_class->handle_frame =
}
static gboolean
-gst_vp8_dec_reset (GstVideoDecoder * base_video_decoder, gboolean hard)
+gst_vp8_dec_flush (GstVideoDecoder * base_video_decoder)
{
GstVP8Dec *decoder;
- GST_DEBUG_OBJECT (base_video_decoder, "reset");
+ GST_DEBUG_OBJECT (base_video_decoder, "flush");
decoder = GST_VP8_DEC (base_video_decoder);
static gboolean gst_vp9_dec_stop (GstVideoDecoder * decoder);
static gboolean gst_vp9_dec_set_format (GstVideoDecoder * decoder,
GstVideoCodecState * state);
-static gboolean gst_vp9_dec_reset (GstVideoDecoder * decoder, gboolean hard);
+static gboolean gst_vp9_dec_flush (GstVideoDecoder * decoder);
static GstFlowReturn gst_vp9_dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame);
static gboolean gst_vp9_dec_decide_allocation (GstVideoDecoder * decoder,
base_video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_vp9_dec_start);
base_video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_vp9_dec_stop);
- base_video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_vp9_dec_reset);
+ base_video_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_vp9_dec_flush);
base_video_decoder_class->set_format =
GST_DEBUG_FUNCPTR (gst_vp9_dec_set_format);
base_video_decoder_class->handle_frame =
}
static gboolean
-gst_vp9_dec_reset (GstVideoDecoder * base_video_decoder, gboolean hard)
+gst_vp9_dec_flush (GstVideoDecoder * base_video_decoder)
{
GstVP9Dec *decoder;
- GST_DEBUG_OBJECT (base_video_decoder, "reset");
+ GST_DEBUG_OBJECT (base_video_decoder, "flush");
decoder = GST_VP9_DEC (base_video_decoder);