diff options
Diffstat (limited to 'ext/mpeg2dec')
-rw-r--r-- | ext/mpeg2dec/Makefile.in | 19 | ||||
-rw-r--r-- | ext/mpeg2dec/gstmpeg2dec.c | 48 |
2 files changed, 46 insertions, 21 deletions
diff --git a/ext/mpeg2dec/Makefile.in b/ext/mpeg2dec/Makefile.in index c1971c7..2ad05dd 100644 --- a/ext/mpeg2dec/Makefile.in +++ b/ext/mpeg2dec/Makefile.in @@ -581,22 +581,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstmpeg2dec_la-gstmpeg2dec.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c index 46b6cec..03c8b4e 100644 --- a/ext/mpeg2dec/gstmpeg2dec.c +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -81,9 +81,11 @@ static void gst_mpeg2dec_finalize (GObject * object); /* GstVideoDecoder base class method */ static gboolean gst_mpeg2dec_open (GstVideoDecoder * decoder); static gboolean gst_mpeg2dec_close (GstVideoDecoder * decoder); +static gboolean gst_mpeg2dec_start (GstVideoDecoder * decoder); +static gboolean gst_mpeg2dec_stop (GstVideoDecoder * decoder); static gboolean gst_mpeg2dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state); -static gboolean gst_mpeg2dec_reset (GstVideoDecoder * decoder, gboolean hard); +static gboolean gst_mpeg2dec_flush (GstVideoDecoder * decoder); static GstFlowReturn gst_mpeg2dec_finish (GstVideoDecoder * decoder); static GstFlowReturn gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame); @@ -114,7 +116,9 @@ gst_mpeg2dec_class_init (GstMpeg2decClass * klass) video_decoder_class->open = GST_DEBUG_FUNCPTR (gst_mpeg2dec_open); video_decoder_class->close = GST_DEBUG_FUNCPTR (gst_mpeg2dec_close); - video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_mpeg2dec_reset); + video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_mpeg2dec_start); + video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_mpeg2dec_stop); + video_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_mpeg2dec_flush); video_decoder_class->set_format = GST_DEBUG_FUNCPTR (gst_mpeg2dec_set_format); video_decoder_class->handle_frame = GST_DEBUG_FUNCPTR (gst_mpeg2dec_handle_frame); @@ -194,26 +198,44 @@ gst_mpeg2dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state) } static gboolean -gst_mpeg2dec_reset (GstVideoDecoder * decoder, gboolean hard) +gst_mpeg2dec_start (GstVideoDecoder * decoder) { GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); - GST_DEBUG_OBJECT (mpeg2dec, "%s", hard ? "hard" : "soft"); + mpeg2dec->discont_state = MPEG2DEC_DISC_NEW_PICTURE; + + return TRUE; +} + +static gboolean +gst_mpeg2dec_stop (GstVideoDecoder * decoder) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); + + mpeg2_reset (mpeg2dec->decoder, 0); + mpeg2_skip (mpeg2dec->decoder, 1); + + gst_mpeg2dec_clear_buffers (mpeg2dec); + + if (mpeg2dec->input_state) + gst_video_codec_state_unref (mpeg2dec->input_state); + mpeg2dec->input_state = NULL; + + return TRUE; +} + +static gboolean +gst_mpeg2dec_flush (GstVideoDecoder * decoder) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); /* reset the initial video state */ mpeg2dec->discont_state = MPEG2DEC_DISC_NEW_PICTURE; - mpeg2_reset (mpeg2dec->decoder, hard); + mpeg2_reset (mpeg2dec->decoder, 1); mpeg2_skip (mpeg2dec->decoder, 1); gst_mpeg2dec_clear_buffers (mpeg2dec); - if (hard) { - if (mpeg2dec->input_state) { - gst_video_codec_state_unref (mpeg2dec->input_state); - mpeg2dec->input_state = NULL; - } - } - return TRUE; } @@ -983,7 +1005,7 @@ gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder, GST_VIDEO_DECODER_ERROR (decoder, 1, STREAM, DECODE, ("decoding error"), ("Bad sequence header"), ret); gst_video_decoder_drop_frame (decoder, frame); - gst_mpeg2dec_reset (decoder, FALSE); + gst_mpeg2dec_flush (decoder); goto done; } break; |