2 * Copyright (C) <2011> Intel Corporation
3 * Copyright (C) <2011> Collabora Ltd.
4 * Copyright (C) <2011> Thibault Saunier <thibault.saunier@collabora.com>
6 * Some bits C-c,C-v'ed and s/4/3 from h264parse and videoparsers/h264parse.c:
7 * Copyright (C) <2010> Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
8 * Copyright (C) <2010> Collabora Multimedia
9 * Copyright (C) <2010> Nokia Corporation
11 * (C) 2005 Michal Benes <michal.benes@itonis.tv>
12 * (C) 2008 Wim Taymans <wim.taymans@gmail.com>
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the
26 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
27 * Boston, MA 02110-1301, USA.
30 #ifndef __GST_H264_PARSER_H__
31 #define __GST_H264_PARSER_H__
33 #ifndef GST_USE_UNSTABLE_API
34 #warning "The H.264 parsing library is unstable API and may change in future."
35 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
42 #define GST_H264_MAX_SPS_COUNT 32
43 #define GST_H264_MAX_PPS_COUNT 256
45 #define GST_H264_IS_P_SLICE(slice) (((slice)->type % 5) == GST_H264_P_SLICE)
46 #define GST_H264_IS_B_SLICE(slice) (((slice)->type % 5) == GST_H264_B_SLICE)
47 #define GST_H264_IS_I_SLICE(slice) (((slice)->type % 5) == GST_H264_I_SLICE)
48 #define GST_H264_IS_SP_SLICE(slice) (((slice)->type % 5) == GST_H264_SP_SLICE)
49 #define GST_H264_IS_SI_SLICE(slice) (((slice)->type % 5) == GST_H264_SI_SLICE)
53 * @GST_H264_NAL_UNKNOWN: Unknown nal type
54 * @GST_H264_NAL_SLICE: Slice nal
55 * @GST_H264_NAL_SLICE_DPA: DPA slice nal
56 * @GST_H264_NAL_SLICE_DPB: DPB slice nal
57 * @GST_H264_NAL_SLICE_DPC: DPC slice nal
58 * @GST_H264_NAL_SLICE_IDR: DPR slice nal
59 * @GST_H264_NAL_SEI: Supplemental enhancement information (SEI) nal unit
60 * @GST_H264_NAL_SPS: Sequence parameter set (SPS) nal unit
61 * @GST_H264_NAL_PPS: Picture parameter set (PPS) nal unit
62 * @GST_H264_NAL_AU_DELIMITER: Access unit (AU) delimiter nal unit
63 * @GST_H264_NAL_SEQ_END: End of sequence nal unit
64 * @GST_H264_NAL_STREAM_END: End of stream nal unit
65 * @GST_H264_NAL_FILLER_DATA: Filler data nal lunit
67 * Indicates the type of H264 Nal Units
71 GST_H264_NAL_UNKNOWN = 0,
72 GST_H264_NAL_SLICE = 1,
73 GST_H264_NAL_SLICE_DPA = 2,
74 GST_H264_NAL_SLICE_DPB = 3,
75 GST_H264_NAL_SLICE_DPC = 4,
76 GST_H264_NAL_SLICE_IDR = 5,
80 GST_H264_NAL_AU_DELIMITER = 9,
81 GST_H264_NAL_SEQ_END = 10,
82 GST_H264_NAL_STREAM_END = 11,
83 GST_H264_NAL_FILLER_DATA = 12
87 * GstH264ParserResult:
88 * @GST_H264_PARSER_OK: The parsing succeded
89 * @GST_H264_PARSER_BROKEN_DATA: The data to parse is broken
90 * @GST_H264_PARSER_BROKEN_LINK: The link to structure needed for the parsing couldn't be found
91 * @GST_H264_PARSER_ERROR: An error accured when parsing
92 * @GST_H264_PARSER_NO_NAL: No nal found during the parsing
93 * @GST_H264_PARSER_NO_NAL_END: Start of the nal found, but not the end.
95 * The result of parsing H264 data.
100 GST_H264_PARSER_BROKEN_DATA,
101 GST_H264_PARSER_BROKEN_LINK,
102 GST_H264_PARSER_ERROR,
103 GST_H264_PARSER_NO_NAL,
104 GST_H264_PARSER_NO_NAL_END
105 } GstH264ParserResult;
108 * GstH264SEIPayloadType:
109 * @GST_H264_SEI_BUF_PERIOD: Buffering Period SEI Message
110 * @GST_H264_SEI_PIC_TIMING: Picture Timing SEI Message
113 * The type of SEI message.
117 GST_H264_SEI_BUF_PERIOD = 0,
118 GST_H264_SEI_PIC_TIMING = 1
120 } GstH264SEIPayloadType;
123 * GstH264SEIPicStructType:
124 * @GST_H264_SEI_PIC_STRUCT_FRAME: Picture is a frame
125 * @GST_H264_SEI_PIC_STRUCT_TOP_FIELD: Top field of frame
126 * @GST_H264_SEI_PIC_STRUCT_BOTTOM_FIELD: Botom field of frame
127 * @GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM: Top bottom field of frame
128 * @GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP: bottom top field of frame
129 * @GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP: top bottom top field of frame
130 * @GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: bottom top bottom field of frame
131 * @GST_H264_SEI_PIC_STRUCT_FRAME_DOUBLING: indicates that the frame should
132 * be displayed two times consecutively
133 * @GST_H264_SEI_PIC_STRUCT_FRAME_TRIPLING: indicates that the frame should be
134 * displayed three times consecutively
136 * SEI pic_struct type
140 GST_H264_SEI_PIC_STRUCT_FRAME = 0,
141 GST_H264_SEI_PIC_STRUCT_TOP_FIELD = 1,
142 GST_H264_SEI_PIC_STRUCT_BOTTOM_FIELD = 2,
143 GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM = 3,
144 GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP = 4,
145 GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5,
146 GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6,
147 GST_H264_SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
148 GST_H264_SEI_PIC_STRUCT_FRAME_TRIPLING = 8
149 } GstH264SEIPicStructType;
154 * Type of Picture slice
159 GST_H264_P_SLICE = 0,
160 GST_H264_B_SLICE = 1,
161 GST_H264_I_SLICE = 2,
162 GST_H264_SP_SLICE = 3,
163 GST_H264_SI_SLICE = 4,
164 GST_H264_S_P_SLICE = 5,
165 GST_H264_S_B_SLICE = 6,
166 GST_H264_S_I_SLICE = 7,
167 GST_H264_S_SP_SLICE = 8,
168 GST_H264_S_SI_SLICE = 9
171 typedef struct _GstH264NalParser GstH264NalParser;
173 typedef struct _GstH264NalUnit GstH264NalUnit;
175 typedef struct _GstH264SPS GstH264SPS;
176 typedef struct _GstH264PPS GstH264PPS;
177 typedef struct _GstH264HRDParams GstH264HRDParams;
178 typedef struct _GstH264VUIParams GstH264VUIParams;
180 typedef struct _GstH264RefPicListModification GstH264RefPicListModification;
181 typedef struct _GstH264DecRefPicMarking GstH264DecRefPicMarking;
182 typedef struct _GstH264RefPicMarking GstH264RefPicMarking;
183 typedef struct _GstH264PredWeightTable GstH264PredWeightTable;
184 typedef struct _GstH264SliceHdr GstH264SliceHdr;
186 typedef struct _GstH264ClockTimestamp GstH264ClockTimestamp;
187 typedef struct _GstH264PicTiming GstH264PicTiming;
188 typedef struct _GstH264BufferingPeriod GstH264BufferingPeriod;
189 typedef struct _GstH264SEIMessage GstH264SEIMessage;
193 * @ref_idc: not equal to 0 specifies that the content of the NAL unit contains a sequence
194 * parameter set, a sequence * parameter set extension, a subset sequence parameter set, a
195 * picture parameter set, a slice of a reference picture, a slice data partition of a
196 * reference picture, or a prefix NAL unit preceding a slice of a reference picture.
197 * @type: A #GstH264NalUnitType
198 * @idr_pic_flag: calculated idr_pic_flag
199 * @size: The size of the nal unit starting from @offset
200 * @offset: The offset of the actual start of the nal unit
201 * @sc_offset:The offset of the start code of the nal unit
202 * @valid: If the nal unit is valid, which mean it has
203 * already been parsed
204 * @data: The data from which the Nalu has been parsed
206 * Structure defining the Nal unit headers
208 struct _GstH264NalUnit
213 /* calculated values */
225 * @cpb_cnt_minus1: plus 1 specifies the number of alternative
226 * CPB specifications in the bitstream
227 * @bit_rate_scale: specifies the maximum input bit rate of the
229 * @cpb_size_scale: specifies the CPB size of the SchedSelIdx-th CPB
230 * @guint32 bit_rate_value_minus1: specifies the maximum input bit rate for the
232 * @cpb_size_value_minus1: is used together with cpb_size_scale to specify the
233 * SchedSelIdx-th CPB size
234 * @cbr_flag: Specifies if running in itermediate bitrate mode or constant
235 * @initial_cpb_removal_delay_length_minus1: specifies the length in bits of
236 * the cpb_removal_delay syntax element
237 * @cpb_removal_delay_length_minus1: specifies the length in bits of the
238 * dpb_output_delay syntax element
239 * @dpb_output_delay_length_minus1: >0 specifies the length in bits of the time_offset syntax element.
240 * =0 specifies that the time_offset syntax element is not present
241 * @time_offset_length: Length of the time offset
243 * Defines the HRD parameters
245 struct _GstH264HRDParams
247 guint8 cpb_cnt_minus1;
248 guint8 bit_rate_scale;
249 guint8 cpb_size_scale;
251 guint32 bit_rate_value_minus1[32];
252 guint32 cpb_size_value_minus1[32];
255 guint8 initial_cpb_removal_delay_length_minus1;
256 guint8 cpb_removal_delay_length_minus1;
257 guint8 dpb_output_delay_length_minus1;
258 guint8 time_offset_length;
263 * @aspect_ratio_info_present_flag: %TRUE specifies that aspect_ratio_idc is present.
264 * %FALSE specifies that aspect_ratio_idc is not present
265 * @aspect_ratio_idc specifies the value of the sample aspect ratio of the luma samples
266 * @sar_width indicates the horizontal size of the sample aspect ratio
267 * @sar_height indicates the vertical size of the sample aspect ratio
268 * @overscan_info_present_flag: %TRUE overscan_appropriate_flag is present %FALSE otherwize
269 * @overscan_appropriate_flag: %TRUE indicates that the cropped decoded pictures
270 * output are suitable for display using overscan. %FALSE the cropped decoded pictures
271 * output contain visually important information
272 * @video_signal_type_present_flag: %TRUE specifies that video_format, video_full_range_flag and
273 * colour_description_present_flag are present.
274 * @video_format: indicates the representation of the picture
275 * @video_full_range_flag: indicates the black level and range of the luma and chroma signals
276 * @colour_description_present_flag: %TRUE specifies that colour_primaries,
277 * transfer_characteristics and matrix_coefficients are present
278 * @colour_primaries: indicates the chromaticity coordinates of the source primaries
279 * @transfer_characteristics: indicates the opto-electronic transfer characteristic
280 * @matrix_coefficients: describes the matrix coefficients used in deriving luma and chroma signals
281 * @chroma_loc_info_present_flag: %TRUE specifies that chroma_sample_loc_type_top_field and
282 * chroma_sample_loc_type_bottom_field are present, %FALSE otherwize
283 * @chroma_sample_loc_type_top_field: specify the location of chroma for top field
284 * @chroma_sample_loc_type_bottom_field specify the location of chroma for bottom field
285 * @timing_info_present_flag: %TRUE specifies that num_units_in_tick,
286 * time_scale and fixed_frame_rate_flag are present in the bitstream
287 * @num_units_in_tick: is the number of time units of a clock operating at the frequency time_scale Hz
288 * time_scale: is the number of time units that pass in one second
289 * @fixed_frame_rate_flag: %TRUE indicates that the temporal distance between the HRD output times
290 * of any two consecutive pictures in output order is constrained as specified in the spec, %FALSE
292 * @nal_hrd_parameters_present_flag: %TRUE if nal hrd parameters present in the bitstream
293 * @vcl_hrd_parameters_present_flag: %TRUE if nal vlc hrd parameters present in the bitstream
294 * @low_delay_hrd_flag: specifies the HRD operational mode
295 * @pic_struct_present_flag: %TRUE specifies that picture timing SEI messages are present or not
296 * @bitstream_restriction_flag: %TRUE specifies that the following coded video sequence bitstream restriction
297 * parameters are present
298 * @motion_vectors_over_pic_boundaries_flag: %FALSE indicates that no sample outside the
299 * picture boundaries and no sample at a fractional sample position, %TRUE indicates that one or more
300 * samples outside picture boundaries may be used in inter prediction
301 * @max_bytes_per_pic_denom: indicates a number of bytes not exceeded by the sum of the sizes of
302 * the VCL NAL units associated with any coded picture in the coded video sequence.
303 * @max_bits_per_mb_denom: indicates the maximum number of coded bits of macroblock_layer
304 * @log2_max_mv_length_horizontal: indicate the maximum absolute value of a decoded horizontal
305 * motion vector component
306 * @log2_max_mv_length_vertical: indicate the maximum absolute value of a decoded vertical
307 * motion vector component
308 * @num_reorder_frames: indicates the maximum number of frames, complementary field pairs,
309 * or non-paired fields that precede any frame,
310 * @max_dec_frame_buffering: specifies the required size of the HRD decoded picture buffer in
311 * units of frame buffers.
313 * The structure representing the VUI parameters.
315 struct _GstH264VUIParams
317 guint8 aspect_ratio_info_present_flag;
318 guint8 aspect_ratio_idc;
319 /* if aspect_ratio_idc == 255 */
323 guint8 overscan_info_present_flag;
324 /* if overscan_info_present_flag */
325 guint8 overscan_appropriate_flag;
327 guint8 video_signal_type_present_flag;
329 guint8 video_full_range_flag;
330 guint8 colour_description_present_flag;
331 guint8 colour_primaries;
332 guint8 transfer_characteristics;
333 guint8 matrix_coefficients;
335 guint8 chroma_loc_info_present_flag;
336 guint8 chroma_sample_loc_type_top_field;
337 guint8 chroma_sample_loc_type_bottom_field;
339 guint8 timing_info_present_flag;
340 /* if timing_info_present_flag */
341 guint32 num_units_in_tick;
343 guint8 fixed_frame_rate_flag;
345 guint8 nal_hrd_parameters_present_flag;
346 /* if nal_hrd_parameters_present_flag */
347 GstH264HRDParams nal_hrd_parameters;
349 guint8 vcl_hrd_parameters_present_flag;
350 /* if nal_hrd_parameters_present_flag */
351 GstH264HRDParams vcl_hrd_parameters;
353 guint8 low_delay_hrd_flag;
354 guint8 pic_struct_present_flag;
356 guint8 bitstream_restriction_flag;
357 /* if bitstream_restriction_flag */
358 guint8 motion_vectors_over_pic_boundaries_flag;
359 guint32 max_bytes_per_pic_denom;
360 guint32 max_bits_per_mb_denom;
361 guint32 log2_max_mv_length_horizontal;
362 guint32 log2_max_mv_length_vertical;
363 guint32 num_reorder_frames;
364 guint32 max_dec_frame_buffering;
366 /* calculated values */
373 * @id: The ID of the sequence parameter set
374 * @profile_idc: indicate the profile to which the coded video sequence conforms
376 * H264 Sequence Parameter Set (SPS)
383 guint8 constraint_set0_flag;
384 guint8 constraint_set1_flag;
385 guint8 constraint_set2_flag;
386 guint8 constraint_set3_flag;
389 guint8 chroma_format_idc;
390 guint8 separate_colour_plane_flag;
391 guint8 bit_depth_luma_minus8;
392 guint8 bit_depth_chroma_minus8;
393 guint8 qpprime_y_zero_transform_bypass_flag;
395 guint8 scaling_matrix_present_flag;
396 guint8 scaling_lists_4x4[6][16];
397 guint8 scaling_lists_8x8[6][64];
399 guint8 log2_max_frame_num_minus4;
400 guint8 pic_order_cnt_type;
402 /* if pic_order_cnt_type == 0 */
403 guint8 log2_max_pic_order_cnt_lsb_minus4;
405 /* else if pic_order_cnt_type == 1 */
406 guint8 delta_pic_order_always_zero_flag;
407 gint32 offset_for_non_ref_pic;
408 gint32 offset_for_top_to_bottom_field;
409 guint8 num_ref_frames_in_pic_order_cnt_cycle;
410 gint32 offset_for_ref_frame[255];
412 guint32 num_ref_frames;
413 guint8 gaps_in_frame_num_value_allowed_flag;
414 guint32 pic_width_in_mbs_minus1;
415 guint32 pic_height_in_map_units_minus1;
416 guint8 frame_mbs_only_flag;
418 guint8 mb_adaptive_frame_field_flag;
420 guint8 direct_8x8_inference_flag;
422 guint8 frame_cropping_flag;
424 /* if frame_cropping_flag */
425 guint32 frame_crop_left_offset;
426 guint32 frame_crop_right_offset;
427 guint32 frame_crop_top_offset;
428 guint32 frame_crop_bottom_offset;
430 guint8 vui_parameters_present_flag;
431 /* if vui_parameters_present_flag */
432 GstH264VUIParams vui_parameters;
434 /* calculated values */
435 guint8 chroma_array_type;
436 guint32 max_frame_num;
438 gint fps_num, fps_den;
445 * H264 Picture Parameter Set
451 GstH264SPS *sequence;
453 guint8 entropy_coding_mode_flag;
454 guint8 pic_order_present_flag;
456 guint32 num_slice_groups_minus1;
458 /* if num_slice_groups_minus1 > 0 */
459 guint8 slice_group_map_type;
460 /* and if slice_group_map_type == 0 */
461 guint32 run_length_minus1[8];
462 /* or if slice_group_map_type == 2 */
464 guint32 bottom_right[8];
465 /* or if slice_group_map_type == (3, 4, 5) */
466 guint8 slice_group_change_direction_flag;
467 guint32 slice_group_change_rate_minus1;
468 /* or if slice_group_map_type == 6 */
469 guint32 pic_size_in_map_units_minus1;
470 guint8 *slice_group_id;
472 guint8 num_ref_idx_l0_active_minus1;
473 guint8 num_ref_idx_l1_active_minus1;
474 guint8 weighted_pred_flag;
475 guint8 weighted_bipred_idc;
476 gint8 pic_init_qp_minus26;
477 gint8 pic_init_qs_minus26;
478 gint8 chroma_qp_index_offset;
479 guint8 deblocking_filter_control_present_flag;
480 guint8 constrained_intra_pred_flag;
481 guint8 redundant_pic_cnt_present_flag;
483 guint8 transform_8x8_mode_flag;
485 guint8 scaling_lists_4x4[6][16];
486 guint8 scaling_lists_8x8[6][64];
488 guint8 second_chroma_qp_index_offset;
493 struct _GstH264RefPicListModification
495 guint8 modification_of_pic_nums_idc;
498 /* if modification_of_pic_nums_idc == 0 || 1 */
499 guint32 abs_diff_pic_num_minus1;
500 /* if modification_of_pic_nums_idc == 2 */
501 guint32 long_term_pic_num;
505 struct _GstH264PredWeightTable
507 guint8 luma_log2_weight_denom;
508 guint8 chroma_log2_weight_denom;
510 gint16 luma_weight_l0[32];
511 gint8 luma_offset_l0[32];
513 /* if seq->ChromaArrayType != 0 */
514 gint16 chroma_weight_l0[32][2];
515 gint8 chroma_offset_l0[32][2];
517 /* if slice->slice_type % 5 == 1 */
518 gint16 luma_weight_l1[32];
519 gint8 luma_offset_l1[32];
521 /* and if seq->ChromaArrayType != 0 */
522 gint16 chroma_weight_l1[32][2];
523 gint8 chroma_offset_l1[32][2];
526 struct _GstH264RefPicMarking
528 guint8 memory_management_control_operation;
530 guint32 difference_of_pic_nums_minus1;
531 guint32 long_term_pic_num;
532 guint32 long_term_frame_idx;
533 guint32 max_long_term_frame_idx_plus1;
536 struct _GstH264DecRefPicMarking
538 /* if slice->nal_unit.IdrPicFlag */
539 guint8 no_output_of_prior_pics_flag;
540 guint8 long_term_reference_flag;
542 guint8 adaptive_ref_pic_marking_mode_flag;
543 GstH264RefPicMarking ref_pic_marking[10];
544 guint8 n_ref_pic_marking;
548 struct _GstH264SliceHdr
550 guint32 first_mb_in_slice;
554 /* if seq->separate_colour_plane_flag */
555 guint8 colour_plane_id;
559 guint8 field_pic_flag;
560 guint8 bottom_field_flag;
562 /* if nal_unit.type == 5 */
565 /* if seq->pic_order_cnt_type == 0 */
566 guint16 pic_order_cnt_lsb;
567 /* if seq->pic_order_present_flag && !field_pic_flag */
568 gint32 delta_pic_order_cnt_bottom;
570 gint32 delta_pic_order_cnt[2];
571 guint8 redundant_pic_cnt;
573 /* if slice_type == B_SLICE */
574 guint8 direct_spatial_mv_pred_flag;
576 guint8 num_ref_idx_l0_active_minus1;
577 guint8 num_ref_idx_l1_active_minus1;
579 guint8 ref_pic_list_modification_flag_l0;
580 guint8 n_ref_pic_list_modification_l0;
581 GstH264RefPicListModification ref_pic_list_modification_l0[32];
582 guint8 ref_pic_list_modification_flag_l1;
583 guint8 n_ref_pic_list_modification_l1;
584 GstH264RefPicListModification ref_pic_list_modification_l1[32];
586 GstH264PredWeightTable pred_weight_table;
587 /* if nal_unit.ref_idc != 0 */
588 GstH264DecRefPicMarking dec_ref_pic_marking;
590 guint8 cabac_init_idc;
591 gint8 slice_qp_delta;
592 gint8 slice_qs_delta;
594 guint8 disable_deblocking_filter_idc;
595 gint8 slice_alpha_c0_offset_div2;
596 gint8 slice_beta_offset_div2;
598 guint16 slice_group_change_cycle;
600 /* calculated values */
604 /* Size of the slice_header() in bits */
607 /* Number of emulation prevention bytes (EPB) in this slice_header() */
608 guint n_emulation_prevention_bytes;
612 struct _GstH264ClockTimestamp
615 guint8 nuit_field_based_flag;
616 guint8 counting_type;
617 guint8 discontinuity_flag;
618 guint8 cnt_dropped_flag;
622 guint8 seconds_value;
625 guint8 minutes_value;
633 struct _GstH264PicTiming
635 guint32 cpb_removal_delay;
636 guint32 dpb_output_delay;
638 guint8 pic_struct_present_flag;
639 /* if pic_struct_present_flag */
642 guint8 clock_timestamp_flag[3];
643 GstH264ClockTimestamp clock_timestamp[3];
646 struct _GstH264BufferingPeriod
650 /* seq->vui_parameters->nal_hrd_parameters_present_flag */
651 guint8 nal_initial_cpb_removal_delay[32];
652 guint8 nal_initial_cpb_removal_delay_offset[32];
654 /* seq->vui_parameters->vcl_hrd_parameters_present_flag */
655 guint8 vcl_initial_cpb_removal_delay[32];
656 guint8 vcl_initial_cpb_removal_delay_offset[32];
659 struct _GstH264SEIMessage
661 GstH264SEIPayloadType payloadType;
664 GstH264BufferingPeriod buffering_period;
665 GstH264PicTiming pic_timing;
666 /* ... could implement more */
673 * H264 NAL Parser (opaque structure).
675 struct _GstH264NalParser
678 GstH264SPS sps[GST_H264_MAX_SPS_COUNT];
679 GstH264PPS pps[GST_H264_MAX_PPS_COUNT];
680 GstH264SPS *last_sps;
681 GstH264PPS *last_pps;
684 GstH264NalParser *gst_h264_nal_parser_new (void);
686 GstH264ParserResult gst_h264_parser_identify_nalu (GstH264NalParser *nalparser,
687 const guint8 *data, guint offset,
688 gsize size, GstH264NalUnit *nalu);
690 GstH264ParserResult gst_h264_parser_identify_nalu_unchecked (GstH264NalParser *nalparser,
691 const guint8 *data, guint offset,
692 gsize size, GstH264NalUnit *nalu);
694 GstH264ParserResult gst_h264_parser_identify_nalu_avc (GstH264NalParser *nalparser, const guint8 *data,
695 guint offset, gsize size, guint8 nal_length_size,
696 GstH264NalUnit *nalu);
698 GstH264ParserResult gst_h264_parser_parse_nal (GstH264NalParser *nalparser,
699 GstH264NalUnit *nalu);
701 GstH264ParserResult gst_h264_parser_parse_slice_hdr (GstH264NalParser *nalparser, GstH264NalUnit *nalu,
702 GstH264SliceHdr *slice, gboolean parse_pred_weight_table,
703 gboolean parse_dec_ref_pic_marking);
705 GstH264ParserResult gst_h264_parser_parse_sps (GstH264NalParser *nalparser, GstH264NalUnit *nalu,
706 GstH264SPS *sps, gboolean parse_vui_params);
708 GstH264ParserResult gst_h264_parser_parse_pps (GstH264NalParser *nalparser,
709 GstH264NalUnit *nalu, GstH264PPS *pps);
711 GstH264ParserResult gst_h264_parser_parse_sei (GstH264NalParser *nalparser,
712 GstH264NalUnit *nalu, GstH264SEIMessage *sei);
714 void gst_h264_nal_parser_free (GstH264NalParser *nalparser);
716 GstH264ParserResult gst_h264_parse_sps (GstH264NalUnit *nalu,
717 GstH264SPS *sps, gboolean parse_vui_params);
719 GstH264ParserResult gst_h264_parse_pps (GstH264NalParser *nalparser,
720 GstH264NalUnit *nalu, GstH264PPS *pps);