Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1798>
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
-
/**
* SECTION:gstmpeg2decoder
* @title: GstMpeg2Decoder
#define GST_MPEG2_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_MPEG2_DECODER,GstMpeg2DecoderClass))
#define GST_IS_MPEG2_DECODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MPEG2_DECODER))
#define GST_IS_MPEG2_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEG2_DECODER))
-#define GST_MPEG2_DECODER_CAST(obj) ((GstMpeg2Decoder*)obj)
typedef struct _GstMpeg2Decoder GstMpeg2Decoder;
typedef struct _GstMpeg2DecoderClass GstMpeg2DecoderClass;
* GstMpeg2Decoder:
*
* The opaque #GstMpeg2Decoder data structure.
+ *
+ * Since: 1.20
*/
struct _GstMpeg2Decoder
{
* @seq_ext: a #GstMpegVideoSequenceExt
*
* Notifies subclass of SPS update
+ *
+ * Since: 1.20
*/
gboolean (*new_sequence) (GstMpeg2Decoder * decoder,
const GstMpegVideoSequenceHdr * seq,
* Optional. Called whenever new #GstMpeg2Picture is created.
* Subclass can set implementation specific user data
* on the #GstMpeg2Picture via gst_mpeg2_picture_set_user_data()
+ *
+ * Since: 1.20
*/
gboolean (*new_picture) (GstMpeg2Decoder * decoder,
GstVideoCodecFrame * frame,
*
* Optional. Called per one #GstMpeg2Picture to notify subclass to prepare
* decoding process for the #GstMpeg2Picture
+ *
+ * Since: 1.20
*/
gboolean (*start_picture) (GstMpeg2Decoder * decoder,
GstMpeg2Picture * picture,
*
* Provides per slice data with parsed slice header and required raw bitstream
* for subclass to decode it.
+ *
+ * Since: 1.20
*/
gboolean (*decode_slice) (GstMpeg2Decoder * decoder,
GstMpeg2Picture * picture,
*
* Optional. Called per one #GstMpeg2Picture to notify subclass to finish
* decoding process for the #GstMpeg2Picture
+ *
+ * Since: 1.20
*/
gboolean (*end_picture) (GstMpeg2Decoder * decoder,
GstMpeg2Picture * picture);
*
* Called with a #GstMpeg2Picture which is required to be outputted.
* The #GstVideoCodecFrame must be consumed by subclass.
+ *
+ * Since: 1.20
*/
GstFlowReturn (*output_picture) (GstMpeg2Decoder * decoder,
GstVideoCodecFrame * frame,
* Create new #GstMpeg2Picture
*
* Returns: a new #GstMpeg2Picture
+ *
+ * Since: 1.20
*/
GstMpeg2Picture *
gst_mpeg2_picture_new (void)
*
* If a @user_data was previously set, then the previous set @notify will be called
* before the @user_data is replaced.
+ *
+ * Since: 1.20
*/
void
gst_mpeg2_picture_set_user_data (GstMpeg2Picture * picture, gpointer user_data,
* gst_mpeg2_picture_set_user_data() previously.
*
* Returns: (transfer none): The previously set user_data
+ *
+ * Since: 1.20
*/
gpointer
gst_mpeg2_picture_get_user_data (GstMpeg2Picture * picture)
return picture->user_data;
}
-/*******************
- * GstMpeg2Dpb *
- *******************/
struct _GstMpeg2Dpb
{
GstMpeg2Picture *ref_pic_list[2];
* Create new #GstMpeg2Dpb
*
* Returns: a new #GstMpeg2Dpb
+ *
+ * Since: 1.20
*/
GstMpeg2Dpb *
gst_mpeg2_dpb_new (void)
* @dpb: a #GstMpeg2Dpb to free
*
* Free the @dpb
+ *
+ * Since: 1.20
*/
void
gst_mpeg2_dpb_free (GstMpeg2Dpb * dpb)
* @dpb: a #GstMpeg2Dpb
*
* Clear all stored #GstMpeg2Picture
+ *
+ * Since: 1.20
*/
void
gst_mpeg2_dpb_clear (GstMpeg2Dpb * dpb)
* @picture: (transfer full): a #GstMpeg2Picture
*
* Store the @picture
+ *
+ * Since: 1.20
*/
void
gst_mpeg2_dpb_add (GstMpeg2Dpb * dpb, GstMpeg2Picture * picture)
}
}
+/**
+ * gst_mpeg2_dpb_need_bump:
+ * @dpb: a #GstMpeg2Dpb
+ *
+ * Checks if @dbp has a new picture.
+ *
+ * Returns: #TRUE if @dpb needs to be bumped; otherwise, #FALSE
+ *
+ * Since: 1.20
+ */
gboolean
gst_mpeg2_dpb_need_bump (GstMpeg2Dpb * dpb)
{
return pic;
}
+/**
+ * gst_mpeg2_dpb_get_neighbours:
+ * @dpb: a #GstMpeg2Dpb
+ * @picture: current #GstMpeg2Picture
+ * @prev_picture_ptr: (transfer none) (out) (nullable): previuous
+ * #GstMpeg2Picture in @dpb
+ * @next_picture_ptr: (transfer none) (out) (nullable): next
+ * #GstMpeg2Picture in @dpb
+ *
+ * Gets the neighbours #GstMpeg2Picture of @picture in @dpb.
+ *
+ * Since: 1.20
+ */
void
gst_mpeg2_dpb_get_neighbours (GstMpeg2Dpb * dpb,
GstMpeg2Picture * picture, GstMpeg2Picture ** prev_picture_ptr,
G_BEGIN_DECLS
+/**
+ * GST_TYPE_MPEG2_PICTURE:
+ *
+ * Since: 1.20
+ */
#define GST_TYPE_MPEG2_PICTURE (gst_mpeg2_picture_get_type())
+/**
+ * GST_IS_MPEG2_PICTURE:
+ *
+ * Since: 1.20
+ */
#define GST_IS_MPEG2_PICTURE(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_MPEG2_PICTURE))
+/**
+ * GST_MPEG2_PICTURE:
+ *
+ * Since: 1.20
+ */
#define GST_MPEG2_PICTURE(obj) ((GstMpeg2Picture *)obj)
-#define GST_MPEG2_PICTURE_CAST(obj) (GST_MPEG2_PICTURE(obj))
typedef struct _GstMpeg2Slice GstMpeg2Slice;
+typedef struct _GstMpeg2Picture GstMpeg2Picture;
+/**
+ * GstMpeg2Slice:
+ *
+ * Since: 1.20
+ */
struct _GstMpeg2Slice
{
- /* The parameter set */
- GstMpegVideoQuantMatrixExt *quant_matrix;
+ /*< private >*/
+ GstMpegVideoQuantMatrixExt *quant_matrix; /* The parameter set */
GstMpegVideoPictureHdr *pic_hdr;
GstMpegVideoPictureExt *pic_ext;
GstMpegVideoPacket packet;
};
-typedef struct _GstMpeg2Picture GstMpeg2Picture;
-
+/**
+ * GstMpeg2Picture:
+ *
+ * Since: 1.20
+ */
struct _GstMpeg2Picture
{
/*< private >*/
GDestroyNotify notify;
};
+/**
+ * GST_MPEG2_PICTURE_IS_REF:
+ * @picture: a #GstMpeg2Picture
+ *
+ * Check whether @picture's type is I or P
+ *
+ * Since: 1.20
+ */
#define GST_MPEG2_PICTURE_IS_REF(picture) \
(((GstMpeg2Picture *) picture)->type == GST_MPEG_VIDEO_PICTURE_TYPE_I || \
((GstMpeg2Picture *) picture)->type == GST_MPEG_VIDEO_PICTURE_TYPE_P)
GST_CODECS_API
gpointer gst_mpeg2_picture_get_user_data (GstMpeg2Picture * picture);
+
+/**
+ * GstMpeg2Dpb:
+ *
+ * Since: 1.20
+ */
typedef struct _GstMpeg2Dpb GstMpeg2Dpb;
GST_CODECS_API