mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 11:29:55 +00:00
mpeg2dec: Port to GstVideoDecoder base class
Conflicts: ext/mpeg2dec/gstmpeg2dec.c ext/mpeg2dec/gstmpeg2dec.h Back to 0.10 state, needs to be ported to 0.11 again.
This commit is contained in:
parent
478410d595
commit
9dc1d53cac
2 changed files with 551 additions and 1111 deletions
File diff suppressed because it is too large
Load diff
|
@ -24,8 +24,7 @@
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideodecoder.h>
|
||||||
#include <gst/video/gstvideometa.h>
|
|
||||||
#include <mpeg2.h>
|
#include <mpeg2.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -55,12 +54,7 @@ typedef enum
|
||||||
} DiscontState;
|
} DiscontState;
|
||||||
|
|
||||||
struct _GstMpeg2dec {
|
struct _GstMpeg2dec {
|
||||||
GstElement element;
|
GstVideoDecoder element;
|
||||||
|
|
||||||
/* pads */
|
|
||||||
GstPad *sinkpad,
|
|
||||||
*srcpad,
|
|
||||||
*userdatapad;
|
|
||||||
|
|
||||||
mpeg2dec_t *decoder;
|
mpeg2dec_t *decoder;
|
||||||
const mpeg2_info_t *info;
|
const mpeg2_info_t *info;
|
||||||
|
@ -68,30 +62,28 @@ struct _GstMpeg2dec {
|
||||||
gboolean closed;
|
gboolean closed;
|
||||||
gboolean have_fbuf;
|
gboolean have_fbuf;
|
||||||
|
|
||||||
/* buffer management */
|
/* Buffer lifetime management */
|
||||||
guint ip_framepos;
|
GList *buffers;
|
||||||
GstVideoFrame ip_frame[4];
|
|
||||||
GstVideoFrame b_frame;
|
|
||||||
|
|
||||||
|
/* FIXME This should not be necessary. It is used to prevent image
|
||||||
|
* corruption when the parser does not behave the way it should.
|
||||||
|
* See https://bugzilla.gnome.org/show_bug.cgi?id=674238
|
||||||
|
*/
|
||||||
DiscontState discont_state;
|
DiscontState discont_state;
|
||||||
|
|
||||||
/* the timestamp of the next frame */
|
/* the timestamp of the next frame */
|
||||||
GstClockTime next_time;
|
GstClockTime next_time;
|
||||||
GstSegment segment;
|
|
||||||
|
|
||||||
/* whether we have a pixel aspect ratio from the sink caps */
|
|
||||||
gboolean have_par;
|
|
||||||
gint in_par_n;
|
|
||||||
gint in_par_d;
|
|
||||||
|
|
||||||
/* video state */
|
/* video state */
|
||||||
GstVideoInfo vinfo;
|
GstVideoCodecState *input_state;
|
||||||
GstVideoInfo cinfo;
|
gint width;
|
||||||
gboolean need_cropping;
|
gint height;
|
||||||
gboolean has_cropping;
|
gint decoded_width;
|
||||||
|
gint decoded_height;
|
||||||
|
gint pixel_width;
|
||||||
|
gint pixel_height;
|
||||||
gint64 frame_period;
|
gint64 frame_period;
|
||||||
gboolean interlaced;
|
gboolean interlaced;
|
||||||
GstBufferPool *pool;
|
|
||||||
|
|
||||||
gint size;
|
gint size;
|
||||||
gint u_offs;
|
gint u_offs;
|
||||||
|
@ -99,25 +91,20 @@ struct _GstMpeg2dec {
|
||||||
guint8 *dummybuf[4];
|
guint8 *dummybuf[4];
|
||||||
|
|
||||||
guint64 offset;
|
guint64 offset;
|
||||||
gboolean need_sequence;
|
gint fps_n;
|
||||||
|
gint fps_d;
|
||||||
|
|
||||||
|
GstIndex *index;
|
||||||
|
gint index_id;
|
||||||
|
|
||||||
gint error_count;
|
|
||||||
gboolean can_allocate_aligned;
|
gboolean can_allocate_aligned;
|
||||||
|
|
||||||
/* QoS stuff */ /* with LOCK*/
|
/* whether we have a pixel aspect ratio from the sink caps */
|
||||||
gdouble proportion;
|
gboolean have_par;
|
||||||
GstClockTime earliest_time;
|
|
||||||
guint64 processed;
|
|
||||||
guint64 dropped;
|
|
||||||
|
|
||||||
/* gather/decode queues for reverse playback */
|
|
||||||
GList *gather;
|
|
||||||
GList *decode;
|
|
||||||
GList *queued;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMpeg2decClass {
|
struct _GstMpeg2decClass {
|
||||||
GstElementClass parent_class;
|
GstVideoDecoderClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_mpeg2dec_get_type(void);
|
GType gst_mpeg2dec_get_type(void);
|
||||||
|
|
Loading…
Reference in a new issue