summaryrefslogtreecommitdiff
path: root/gst-libs/gst/codecparsers/gsth264meta.h
blob: df222f36c5fc21774145fb460def3c8e888eadf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* Gstreamer
 * Copyright (C) <2012> Edward Hervey <edward@collabora.com>
 *
 * 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_H264_META_H__
#define __GST_H264_META_H__

#ifndef GST_USE_UNSTABLE_API
#warning "The h264 video parsing library is unstable API and may change in future."
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
#endif

#include <gst/gst.h>
#include <gst/codecparsers/gsth264parser.h>

G_BEGIN_DECLS

typedef struct _GstH264Meta GstH264Meta;

GType gst_h264_meta_api_get_type (void);
#define GST_H264_META_API_TYPE  (gst_h264_meta_api_get_type())
#define GST_H264_META_INFO  (gst_h264_meta_get_info())
const GstMetaInfo * gst_h264_meta_get_info (void);

/**
 * GstH264Meta:
 * @meta: parent #GstMeta
 * @sps: List of #GstH264SPS present in the buffer
 * @pps: List of #Gsth264PPS present in the buffer
 * @sei: List of #GstH264SEIMessage present in the buffer
 * @slices: List of #GstH264SliceHdr present in the buffer
 * @slice_offset: List of offset (as #gsize) present in the buffer, the
 *      order and index of the offset is the same as the @slices.
 *
 * Extra buffer metadata describing the contents of a H264 Video frame.
 *
 * Can be used by elements (mainly decoders) to avoid having to parse
 * H264 packets if it can be done upstream.
 *
 * The contents of the @sps, @pps, @sei, @slices, @slice_offset lists are
 * only valid during the lifetime of the #GstH264Meta. If elements wish
 * to use those for longer, they are required to make a copy.
 */
struct _GstH264Meta {
  GstMeta meta;

  GList   *sps;
  GList   *pps;
  GList   *sei;

  GList   *slices;
  GList   *slice_offsets;
};


#define gst_buffer_get_h264_meta(b) ((GstH264Meta*)gst_buffer_get_meta((b),GST_H264_META_API_TYPE))

GstH264Meta *
gst_buffer_add_h264_meta (GstBuffer * buffer);
void gst_h264_meta_add_sps (GstH264Meta *meta, const GstH264SPS *sps);
void gst_h264_meta_add_pps (GstH264Meta *meta, const GstH264PPS *pps);
void gst_h264_meta_add_sei (GstH264Meta *meta, const GstH264SEIMessage *sei);
void gst_h264_meta_add_slice (GstH264Meta *meta, const GstH264SliceHdr *slice,
			      gsize offset);

G_END_DECLS

#endif