1 /* GStreamer H.264 Parser
2 * Copyright (C) <2010> Collabora ltd
3 * Copyright (C) <2010> Nokia Corporation
4 * Copyright (C) <2011> Intel Corporation
6 * Copyright (C) <2010> Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
7 * Copyright (C) <2011> Thibault Saunier <thibault.saunier@collabora.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 #ifndef __GST_H264_PARSE_H__
26 #define __GST_H264_PARSE_H__
29 #include <gst/base/gstbaseparse.h>
30 #include <gst/codecparsers/gsth264parser.h>
34 typedef struct _H264Params H264Params;
36 #define GST_TYPE_H264_PARSE \
37 (gst_h264_parse_get_type())
38 #define GST_H264_PARSE(obj) \
39 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_H264_PARSE,GstH264Parse))
40 #define GST_H264_PARSE_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_H264_PARSE,GstH264ParseClass))
42 #define GST_IS_H264_PARSE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_H264_PARSE))
44 #define GST_IS_H264_PARSE_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_H264_PARSE))
47 GType gst_h264_parse_get_type (void);
49 typedef struct _GstH264Parse GstH264Parse;
50 typedef struct _GstH264ParseClass GstH264ParseClass;
54 GstBaseParse baseparse;
56 GstPadChainFunction parse_chain;
60 gint fps_num, fps_den;
61 gint aspect_ratio_idc;
62 gint sar_width, sar_height;
63 gint upstream_par_n, upstream_par_d;
64 GstBuffer *codec_data;
65 guint nal_length_size;
69 GstH264NalParser *nalparser;
73 gboolean packetized_last;
74 gboolean packetized_chunked;
76 GstClockTime last_report;
81 /* collected SPS and PPS NALUs */
82 GstBuffer *sps_nals[GST_H264_MAX_SPS_COUNT];
83 GstBuffer *pps_nals[GST_H264_MAX_PPS_COUNT];
85 /* Infos we need to keep track of */
86 guint32 sei_cpb_removal_delay;
87 guint8 sei_pic_struct;
88 guint8 sei_pic_struct_pres_flag;
91 /* cached timestamps */
92 /* (trying to) track upstream dts and interpolate */
94 /* dts at start of last buffering period */
95 GstClockTime ts_trn_nb;
99 /*guint last_nal_pos;*/
100 /*guint next_sc_pos;*/
101 gint idr_pos, sei_pos;
102 gboolean update_caps;
103 GstAdapter *frame_out;
105 gboolean frame_start;
107 gboolean picture_start;
110 gboolean split_packetized;
113 GstClockTime pending_key_unit_ts;
114 GstEvent *force_key_unit_event;
117 struct _GstH264ParseClass
119 GstBaseParseClass parent_class;