2 * Copyright (C) <2012> Edward Hervey <edward@collabora.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_MPEG_VIDEO_META_H__
21 #define __GST_MPEG_VIDEO_META_H__
23 #ifndef GST_USE_UNSTABLE_API
24 #warning "The Mpeg video parsing library is unstable API and may change in future."
25 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
29 #include <gst/codecparsers/gstmpegvideoparser.h>
33 typedef struct _GstMpegVideoMeta GstMpegVideoMeta;
35 GType gst_mpeg_video_meta_api_get_type (void);
36 #define GST_MPEG_VIDEO_META_API_TYPE (gst_mpeg_video_meta_api_get_type())
37 #define GST_MPEG_VIDEO_META_INFO (gst_mpeg_video_meta_get_info())
38 const GstMetaInfo * gst_mpeg_video_meta_get_info (void);
42 * @meta: parent #GstMeta
43 * @sequencehdr: the #GstMpegVideoSequenceHdr if present in the buffer
44 * @sequenceext: the #GstMpegVideoSequenceExt if present in the buffer
45 * @sequencedispext: the #GstMpegVideoSequenceDisplayExt if present in the
47 * @pichdr: the #GstMpegVideoPictureHdr if present in the buffer.
48 * @picext: the #GstMpegVideoPictureExt if present in the buffer.
49 * @quantext: the #GstMpegVideoQuantMatrixExt if present in the buffer
51 * Extra buffer metadata describing the contents of a MPEG1/2 Video frame
53 * Can be used by elements (mainly decoders) to avoid having to parse
54 * Mpeg video 1/2 packets if it can be done upstream.
56 * The various fields are only valid during the lifetime of the #GstMpegVideoMeta.
57 * If elements wish to use those for longer, they are required to make a copy.
61 struct _GstMpegVideoMeta {
64 GstMpegVideoSequenceHdr *sequencehdr;
65 GstMpegVideoSequenceExt *sequenceext;
66 GstMpegVideoSequenceDisplayExt *sequencedispext;
67 GstMpegVideoPictureHdr *pichdr;
68 GstMpegVideoPictureExt *picext;
69 GstMpegVideoQuantMatrixExt *quantext;
76 #define gst_buffer_get_mpeg_video_meta(b) ((GstMpegVideoMeta*)gst_buffer_get_meta((b),GST_MPEG_VIDEO_META_API_TYPE))
79 gst_buffer_add_mpeg_video_meta (GstBuffer * buffer,
80 const GstMpegVideoSequenceHdr *seq_hdr,
81 const GstMpegVideoSequenceExt *seq_ext,
82 const GstMpegVideoSequenceDisplayExt *disp_ext,
83 const GstMpegVideoPictureHdr *pic_hdr,
84 const GstMpegVideoPictureExt *pic_ext,
85 const GstMpegVideoQuantMatrixExt *quant_ext);