From 8619160ec89ac7c8aed300f1f644fc0f50a294e8 Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Fri, 5 Jun 2009 21:48:28 +0200 Subject: vdpaumpegdec: rename gstvdpmpegdecoder.[ch] to gstvdpmpegdec.[ch] --- sys/vdpau/gstvdpmpegdec.h | 93 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sys/vdpau/gstvdpmpegdec.h (limited to 'sys/vdpau/gstvdpmpegdec.h') diff --git a/sys/vdpau/gstvdpmpegdec.h b/sys/vdpau/gstvdpmpegdec.h new file mode 100644 index 00000000..b60c9f59 --- /dev/null +++ b/sys/vdpau/gstvdpmpegdec.h @@ -0,0 +1,93 @@ +/* + * GStreamer + * Copyright (C) 2009 Carl-Anton Ingmarsson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VDP_MPEG_DEC_H__ +#define __GST_VDP_MPEG_DEC_H__ + +#include +#include + +#include "gstvdpdevice.h" +#include "gstvdpvideobuffer.h" + +G_BEGIN_DECLS + +#define GST_TYPE_VDP_MPEG_DEC (gst_vdp_mpeg_dec_get_type()) +#define GST_VDP_MPEG_DEC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDP_MPEG_DEC,GstVdpMpegDec)) +#define GST_VDP_MPEG_DEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDP_MPEG_DEC,GstVdpMpegDecClass)) +#define GST_IS_VDPAU_MPEG_DEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDP_MPEG_DEC)) +#define GST_IS_VDPAU_MPEG_DEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDP_MPEG_DEC)) + +typedef struct _GstVdpMpegDec GstVdpMpegDec; +typedef struct _GstVdpMpegDecClass GstVdpMpegDecClass; + +struct _GstVdpMpegDec +{ + GstElement element; + + /* pads */ + GstPad *src; + GstPad *sink; + + gchar *display_name; + GstVdpDevice *device; + VdpDecoder decoder; + + /* stream info */ + gint width, height; + gint fps_n, fps_d; + gboolean interlaced; + gint version; + + /* currently decoded frame info */ + GstAdapter *adapter; + VdpPictureInfoMPEG1Or2 vdp_info; + guint64 frame_nr; + GstClockTime duration; + + /* frame_nr from GOP */ + guint64 gop_frame; + + /* forward and backward reference */ + GstBuffer *f_buffer; + GstBuffer *b_buffer; + + /* calculated timestamp, size and duration */ + GstClockTime next_timestamp; + guint64 accumulated_size; + guint64 accumulated_duration; + + /* seek data */ + GstSegment segment; + gboolean seeking; + gint64 byterate; + +}; + +struct _GstVdpMpegDecClass +{ + GstElementClass element_class; +}; + +GType gst_vdp_mpeg_dec_get_type (void); + +G_END_DECLS + +#endif /* __GST_VDP_MPEG_DEC_H__ */ -- cgit v1.2.1 From 636ae49bee677ee56f6c480c78f6f4eda8eeab51 Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Sun, 7 Jun 2009 01:12:50 +0200 Subject: vdpaumpegdec: use mutex to protect mpeg_dec->seeking from concurrent access --- sys/vdpau/gstvdpmpegdec.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/vdpau/gstvdpmpegdec.h') diff --git a/sys/vdpau/gstvdpmpegdec.h b/sys/vdpau/gstvdpmpegdec.h index b60c9f59..66a41805 100644 --- a/sys/vdpau/gstvdpmpegdec.h +++ b/sys/vdpau/gstvdpmpegdec.h @@ -78,6 +78,9 @@ struct _GstVdpMpegDec GstSegment segment; gboolean seeking; gint64 byterate; + + /* mutex */ + GMutex *mutex; }; -- cgit v1.2.1 From cee2394a0d60857ff0015a62bb8888ec18e40755 Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Sun, 7 Jun 2009 23:46:38 +0200 Subject: vdpau: s/IS_VDPAU/IS_VDP --- sys/vdpau/gstvdpmpegdec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/vdpau/gstvdpmpegdec.h') diff --git a/sys/vdpau/gstvdpmpegdec.h b/sys/vdpau/gstvdpmpegdec.h index 66a41805..9d4c791f 100644 --- a/sys/vdpau/gstvdpmpegdec.h +++ b/sys/vdpau/gstvdpmpegdec.h @@ -32,8 +32,8 @@ G_BEGIN_DECLS #define GST_TYPE_VDP_MPEG_DEC (gst_vdp_mpeg_dec_get_type()) #define GST_VDP_MPEG_DEC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDP_MPEG_DEC,GstVdpMpegDec)) #define GST_VDP_MPEG_DEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDP_MPEG_DEC,GstVdpMpegDecClass)) -#define GST_IS_VDPAU_MPEG_DEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDP_MPEG_DEC)) -#define GST_IS_VDPAU_MPEG_DEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDP_MPEG_DEC)) +#define GST_IS_VDP_MPEG_DEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDP_MPEG_DEC)) +#define GST_IS_VDP_MPEG_DEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDP_MPEG_DEC)) typedef struct _GstVdpMpegDec GstVdpMpegDec; typedef struct _GstVdpMpegDecClass GstVdpMpegDecClass; -- cgit v1.2.1 From 53a5272f73beaf87d33f99dc4a0d0dd0770934cc Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Mon, 8 Jun 2009 14:35:29 +0200 Subject: vdpaumpegdec: drop all frames before a GOP when we seek --- sys/vdpau/gstvdpmpegdec.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys/vdpau/gstvdpmpegdec.h') diff --git a/sys/vdpau/gstvdpmpegdec.h b/sys/vdpau/gstvdpmpegdec.h index 9d4c791f..fc36df5b 100644 --- a/sys/vdpau/gstvdpmpegdec.h +++ b/sys/vdpau/gstvdpmpegdec.h @@ -35,6 +35,12 @@ G_BEGIN_DECLS #define GST_IS_VDP_MPEG_DEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDP_MPEG_DEC)) #define GST_IS_VDP_MPEG_DEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDP_MPEG_DEC)) +typedef enum { + GST_VDP_MPEG_DEC_NEED_SEQUENCE, + GST_VDP_MPEG_DEC_NEED_GOP, + GST_VDP_MPEG_DEC_NEED_DATA +} GstVdpMpegDecState; + typedef struct _GstVdpMpegDec GstVdpMpegDec; typedef struct _GstVdpMpegDecClass GstVdpMpegDecClass; @@ -56,6 +62,9 @@ struct _GstVdpMpegDec gboolean interlaced; gint version; + /* decoder state */ + GstVdpMpegDecState state; + /* currently decoded frame info */ GstAdapter *adapter; VdpPictureInfoMPEG1Or2 vdp_info; -- cgit v1.2.1