GstMpeg4Parser
For more details about the structures, you can refer to the specifications: ISO-IEC-14496-2_2004_MPEG4_VISUAL.pdf
Functions
gst_h263_parse
GstMpeg4ParseResult gst_h263_parse (GstMpeg4Packet * packet, guint8* data, guint offset, gsize size)
Parses data and fills packet with the information of the next packet found.
Note that the type of the packet is meaningless in this case.
Parameters:
packet
–
The GstMpeg4Packet to fill
data
–
The data to parse
offset
–
offset from which to start the parsing
size
–
The size of the data to parse
gst_mpeg4_parse
GstMpeg4ParseResult gst_mpeg4_parse (GstMpeg4Packet * packet, gboolean skip_user_data, GstMpeg4VideoObjectPlane * vop, guint8* data, guint offset, gsize size)
Parses data and fills packet with the information of the next packet found.
Parameters:
packet
–
The GstMpeg4Packet to fill
skip_user_data
–
TRUE to skip user data packet FALSE otherwise
vop
–
The last parsed GstMpeg4VideoObjectPlane or NULL if you do not need to detect the resync codes.
data
–
The data to parse
offset
–
offset from which to start the parsing
size
–
The size of the data to parse
gst_mpeg4_parse_group_of_vop
GstMpeg4ParseResult gst_mpeg4_parse_group_of_vop (GstMpeg4GroupOfVOP * gov, guint8* data, gsize size)
Parses data containing the group of video object plane packet, and fills the gov structure.
Parameters:
gov
–
The GstMpeg4GroupOfVOP structure to fill
data
–
The data to parse
size
–
The size of the data to parse
gst_mpeg4_parse_video_object_layer
GstMpeg4ParseResult gst_mpeg4_parse_video_object_layer (GstMpeg4VideoObjectLayer * vol, GstMpeg4VisualObject * vo, guint8* data, gsize size)
Parses data containing the video object layer packet, and fills the vol structure.
Parameters:
vol
–
The GstMpeg4VideoObjectLayer structure to fill
vo
–
The GstMpeg4VisualObject currently being parsed or NULL
data
–
The data to parse
size
–
The size of the data to parse
gst_mpeg4_parse_video_object_plane
GstMpeg4ParseResult gst_mpeg4_parse_video_object_plane (GstMpeg4VideoObjectPlane * vop, GstMpeg4SpriteTrajectory * sprite_trajectory, GstMpeg4VideoObjectLayer * vol, guint8* data, gsize size)
Parses data containing the video object plane packet, and fills the vol structure.
Parameters:
vop
–
The GstMpeg4VideoObjectPlane currently being parsed
sprite_trajectory
–
A GstMpeg4SpriteTrajectory to fill or NULL
vol
–
The GstMpeg4VideoObjectLayer structure to fill
data
–
The data to parse
size
–
The size of the data to parse
gst_mpeg4_parse_video_packet_header
GstMpeg4ParseResult gst_mpeg4_parse_video_packet_header (GstMpeg4VideoPacketHdr * videopackethdr, GstMpeg4VideoObjectLayer * vol, GstMpeg4VideoObjectPlane * vop, GstMpeg4SpriteTrajectory * sprite_trajectory, guint8* data, gsize size)
Parsers data containing the video packet header and fills the videopackethdr structure
Parameters:
videopackethdr
–
The GstMpeg4VideoPacketHdr structure to fill
vol
–
The last parsed GstMpeg4VideoObjectLayer, will be updated with the information found during the parsing
vop
–
The last parsed GstMpeg4VideoObjectPlane, will be updated with the information found during the parsing
sprite_trajectory
–
A GstMpeg4SpriteTrajectory to fill or NULL with the information found during the parsing
data
–
The data to parse, should be set after the resync marker.
size
–
The size of the data to parse
gst_mpeg4_parse_video_plane_short_header
GstMpeg4ParseResult gst_mpeg4_parse_video_plane_short_header (GstMpeg4VideoPlaneShortHdr * shorthdr, guint8* data, gsize size)
Parameters:
shorthdr
–
data
–
size
–
gst_mpeg4_parse_visual_object
GstMpeg4ParseResult gst_mpeg4_parse_visual_object (GstMpeg4VisualObject * vo, GstMpeg4VideoSignalType * signal_type, guint8* data, gsize size)
Parses data containing the visual object packet, and fills the vo structure.
Parameters:
vo
–
The GstMpeg4VisualObject structure to fill
signal_type
–
The GstMpeg4VideoSignalType to fill or NULL
data
–
The data to parse, should contain the vo_start_code but not the start code prefix
size
–
The size of the data to parse
gst_mpeg4_parse_visual_object_sequence
GstMpeg4ParseResult gst_mpeg4_parse_visual_object_sequence (GstMpeg4VisualObjectSequence * vos, guint8* data, gsize size)
Parses data containing the visual object sequence packet, and fills the vos structure.
Parameters:
vos
–
The GstMpeg4VisualObjectSequence structure to fill
data
–
The data to parse, should contain the visual_object_sequence_start_code but not the start code prefix
size
–
The size of the data to parse
Structures
GstMpeg4GroupOfVOP
struct _GstMpeg4GroupOfVOP { guint8 hours; guint8 minutes; guint8 seconds; guint8 closed; guint8 broken_link; };
The group of video object plane structure as defined in: 6.2.4 Group of Video Object Plane
Fields
hours
(guint8)
–
minutes
(guint8)
–
seconds
(guint8)
–
closed
(guint8)
–
broken_link
(guint8)
–
GstMpeg4Packet
struct _GstMpeg4Packet { const guint8 *data; guint offset; gsize size; guint marker_size; GstMpeg4StartCode type; };
A structure that contains the type of a packet, its offset and its size
Fields
data
(guint8*)
–
the data containing packet starting at offset
offset
(guint)
–
offset of the start of the packet (without the 3 bytes startcode), but including the GstMpeg4StartCode byte.
size
(gsize)
–
The size in bytes of the packet or G_MAXUINT if the end wasn't found.
marker_size
(guint)
–
The size in bit of the resync marker.
type
(GstMpeg4StartCode)
–
the type of the packet that start at offset
GstMpeg4SpriteTrajectory
struct _GstMpeg4SpriteTrajectory { guint16 vop_ref_points[63]; /* Defined as "du" in 6.2.5.4 */ guint16 sprite_ref_points[63]; /* Defined as "dv" in 6.2.5.4 */ };
The sprite trajectory structure as defined in: 7.8.4 Sprite reference point decoding and 6.2.5.4 Sprite coding
Fields
vop_ref_points
(guint16[63] )
–
sprite_ref_points
(guint16[63] )
–
GstMpeg4VideoObjectLayer
struct _GstMpeg4VideoObjectLayer { guint8 random_accessible_vol; guint8 video_object_type_indication; guint8 is_object_layer_identifier; /* if is_object_layer_identifier */ guint8 verid; guint8 priority; GstMpeg4AspectRatioInfo aspect_ratio_info; guint8 par_width; guint8 par_height; guint8 control_parameters; /* if control_parameters */ GstMpeg4ChromaFormat chroma_format; guint8 low_delay; guint8 vbv_parameters; /* if vbv_parameters */ guint16 first_half_bitrate; guint16 latter_half_bitrate; guint16 first_half_vbv_buffer_size; guint16 latter_half_vbv_buffer_size; guint16 first_half_vbv_occupancy; guint16 latter_half_vbv_occupancy; /* Computed values */ guint32 bit_rate; guint32 vbv_buffer_size; GstMpeg4VideoObjectLayerShape shape; /* if shape == GST_MPEG4_GRAYSCALE && verid =! 1 */ guint8 shape_extension; guint16 vop_time_increment_resolution; guint8 vop_time_increment_bits; guint8 fixed_vop_rate; /* if fixed_vop_rate */ guint16 fixed_vop_time_increment; guint16 width; guint16 height; guint8 interlaced; guint8 obmc_disable; GstMpeg4SpriteEnable sprite_enable; /* if vol->sprite_enable == SPRITE_GMG or SPRITE_STATIC*/ /* if vol->sprite_enable != GST_MPEG4_SPRITE_GMG */ guint16 sprite_width; guint16 sprite_height; guint16 sprite_left_coordinate; guint16 sprite_top_coordinate; guint8 no_of_sprite_warping_points; guint8 sprite_warping_accuracy; guint8 sprite_brightness_change; /* if vol->sprite_enable != GST_MPEG4_SPRITE_GMG */ guint8 low_latency_sprite_enable; /* if shape != GST_MPEG4_RECTANGULAR */ guint8 sadct_disable; guint8 not_8_bit; /* if no_8_bit */ guint8 quant_precision; guint8 bits_per_pixel; /* if shape == GRAYSCALE */ guint8 no_gray_quant_update; guint8 composition_method; guint8 linear_composition; guint8 quant_type; /* if quant_type */ guint8 load_intra_quant_mat; guint8 intra_quant_mat[64]; guint8 load_non_intra_quant_mat; guint8 non_intra_quant_mat[64]; guint8 quarter_sample; guint8 complexity_estimation_disable; guint8 resync_marker_disable; guint8 data_partitioned; guint8 reversible_vlc; guint8 newpred_enable; guint8 reduced_resolution_vop_enable; guint8 scalability; guint8 enhancement_type; GstMpeg4VideoPlaneShortHdr short_hdr; };
The video object layer structure as defined in: 6.2.3 Video Object Layer
Fields
random_accessible_vol
(guint8)
–
video_object_type_indication
(guint8)
–
is_object_layer_identifier
(guint8)
–
verid
(guint8)
–
priority
(guint8)
–
aspect_ratio_info
(GstMpeg4AspectRatioInfo)
–
par_width
(guint8)
–
par_height
(guint8)
–
control_parameters
(guint8)
–
chroma_format
(GstMpeg4ChromaFormat)
–
low_delay
(guint8)
–
vbv_parameters
(guint8)
–
first_half_bitrate
(guint16)
–
latter_half_bitrate
(guint16)
–
first_half_vbv_buffer_size
(guint16)
–
latter_half_vbv_buffer_size
(guint16)
–
first_half_vbv_occupancy
(guint16)
–
latter_half_vbv_occupancy
(guint16)
–
bit_rate
(guint32)
–
vbv_buffer_size
(guint32)
–
shape
(GstMpeg4VideoObjectLayerShape)
–
shape_extension
(guint8)
–
vop_time_increment_resolution
(guint16)
–
vop_time_increment_bits
(guint8)
–
fixed_vop_rate
(guint8)
–
fixed_vop_time_increment
(guint16)
–
width
(guint16)
–
height
(guint16)
–
interlaced
(guint8)
–
obmc_disable
(guint8)
–
sprite_enable
(GstMpeg4SpriteEnable)
–
sprite_width
(guint16)
–
sprite_height
(guint16)
–
sprite_left_coordinate
(guint16)
–
sprite_top_coordinate
(guint16)
–
no_of_sprite_warping_points
(guint8)
–
sprite_warping_accuracy
(guint8)
–
sprite_brightness_change
(guint8)
–
low_latency_sprite_enable
(guint8)
–
sadct_disable
(guint8)
–
not_8_bit
(guint8)
–
quant_precision
(guint8)
–
bits_per_pixel
(guint8)
–
no_gray_quant_update
(guint8)
–
composition_method
(guint8)
–
linear_composition
(guint8)
–
quant_type
(guint8)
–
load_intra_quant_mat
(guint8)
–
intra_quant_mat
(guint8[64] )
–
load_non_intra_quant_mat
(guint8)
–
non_intra_quant_mat
(guint8[64] )
–
quarter_sample
(guint8)
–
complexity_estimation_disable
(guint8)
–
resync_marker_disable
(guint8)
–
data_partitioned
(guint8)
–
reversible_vlc
(guint8)
–
newpred_enable
(guint8)
–
reduced_resolution_vop_enable
(guint8)
–
scalability
(guint8)
–
enhancement_type
(guint8)
–
short_hdr
(GstMpeg4VideoPlaneShortHdr)
–
GstMpeg4VideoObjectPlane
struct _GstMpeg4VideoObjectPlane { GstMpeg4VideoObjectCodingType coding_type; guint8 modulo_time_base; guint16 time_increment; guint8 coded; /* if newpred_enable */ guint16 id; guint8 id_for_prediction_indication; guint16 id_for_prediction; guint16 width; guint16 height; guint16 horizontal_mc_spatial_ref; guint16 vertical_mc_spatial_ref; guint8 rounding_type; /*if vol->shape != GST_MPEG4_RECTANGULAR */ guint8 background_composition; guint8 change_conv_ratio_disable; guint8 constant_alpha; guint8 constant_alpha_value; guint8 reduced_resolution; guint8 intra_dc_vlc_thr; guint8 top_field_first; guint8 alternate_vertical_scan_flag; guint16 quant; guint8 fcode_forward; guint8 fcode_backward; guint8 shape_coding_type; guint8 load_backward_shape; guint8 ref_select_code; /* Computed macroblock information */ guint16 mb_height; guint16 mb_width; guint mb_num; /* The size of the header */ guint size; };
The Video object plane structure as defined in: 6.2.5 Video Object Plane and Video Plane with Short Header
Fields
coding_type
(GstMpeg4VideoObjectCodingType)
–
modulo_time_base
(guint8)
–
time_increment
(guint16)
–
coded
(guint8)
–
id
(guint16)
–
id_for_prediction_indication
(guint8)
–
id_for_prediction
(guint16)
–
width
(guint16)
–
height
(guint16)
–
horizontal_mc_spatial_ref
(guint16)
–
vertical_mc_spatial_ref
(guint16)
–
rounding_type
(guint8)
–
background_composition
(guint8)
–
change_conv_ratio_disable
(guint8)
–
constant_alpha
(guint8)
–
constant_alpha_value
(guint8)
–
reduced_resolution
(guint8)
–
intra_dc_vlc_thr
(guint8)
–
top_field_first
(guint8)
–
alternate_vertical_scan_flag
(guint8)
–
quant
(guint16)
–
fcode_forward
(guint8)
–
fcode_backward
(guint8)
–
shape_coding_type
(guint8)
–
load_backward_shape
(guint8)
–
ref_select_code
(guint8)
–
mb_height
(guint16)
–
mb_width
(guint16)
–
mb_num
(guint)
–
size
(guint)
–
GstMpeg4VideoPacketHdr
struct _GstMpeg4VideoPacketHdr { guint8 header_extension_code; guint16 macroblock_number; guint16 quant_scale; guint size; };
The video packet header structure as defined in: 6.2.5.2 Video Plane with Short Header
Fields
header_extension_code
(guint8)
–
macroblock_number
(guint16)
–
quant_scale
(guint16)
–
size
(guint)
–
Size of the header in bit.
GstMpeg4VideoPlaneShortHdr
struct _GstMpeg4VideoPlaneShortHdr { guint8 temporal_reference; guint8 split_screen_indicator; guint8 document_camera_indicator; guint8 full_picture_freeze_release; guint8 source_format; guint8 picture_coding_type; guint8 vop_quant; guint8 pei; guint8 psupp; /* Gob layer specific fields */ guint8 gob_header_empty; guint8 gob_number; guint8 gob_frame_id; guint8 quant_scale; /* Computed * If all the values are set to 0, then it is reserved * Table 6-25 -- Parameters Defined by source_format Field */ guint16 vop_width; guint16 vop_height; guint16 num_macroblocks_in_gob; guint8 num_gobs_in_vop; /* The size in bits */ guint size; };
The video plane short header structure as defined in: 6.2.5.2 Video Plane with Short Header
Fields
temporal_reference
(guint8)
–
split_screen_indicator
(guint8)
–
document_camera_indicator
(guint8)
–
full_picture_freeze_release
(guint8)
–
source_format
(guint8)
–
picture_coding_type
(guint8)
–
vop_quant
(guint8)
–
pei
(guint8)
–
psupp
(guint8)
–
gob_header_empty
(guint8)
–
gob_number
(guint8)
–
gob_frame_id
(guint8)
–
quant_scale
(guint8)
–
vop_width
(guint16)
–
vop_height
(guint16)
–
num_macroblocks_in_gob
(guint16)
–
num_gobs_in_vop
(guint8)
–
size
(guint)
–
GstMpeg4VideoSignalType
struct _GstMpeg4VideoSignalType { guint8 type; guint8 format; guint8 range; guint8 color_description; guint8 color_primaries; guint8 transfer_characteristics; guint8 matrix_coefficients; };
The video signal type structure as defined in: 6.2.2 Visual Object Sequence and Visual Object.
Fields
type
(guint8)
–
format
(guint8)
–
range
(guint8)
–
color_description
(guint8)
–
color_primaries
(guint8)
–
transfer_characteristics
(guint8)
–
matrix_coefficients
(guint8)
–
GstMpeg4VisualObject
struct _GstMpeg4VisualObject { guint8 is_identifier; /* If is_identifier */ guint8 verid; guint8 priority; GstMpeg4VisualObjectType type; };
The visual object structure as defined in: 6.2.2 Visual Object Sequence and Visual Object
Fields
is_identifier
(guint8)
–
verid
(guint8)
–
priority
(guint8)
–
type
(GstMpeg4VisualObjectType)
–
GstMpeg4VisualObjectSequence
struct _GstMpeg4VisualObjectSequence { guint8 profile_and_level_indication; /* Computed according to: * Table G.1 — FLC table for profile_and_level_indication */ GstMpeg4Level level; GstMpeg4Profile profile; };
The visual object sequence structure as defined in: 6.2.2 Visual Object Sequence and Visual Object
Fields
profile_and_level_indication
(guint8)
–
level
(GstMpeg4Level)
–
profile
(GstMpeg4Profile)
–
Aliases
GstMpeg4AspectRatioInfo
typedef enum GstMpeg4AspectRatioInfo GstMpeg4AspectRatioInfo
Defines the different pixel aspect ratios as defined in: Table 6-12 -- Meaning of pixel aspect ratio
GstMpeg4ChromaFormat
typedef enum GstMpeg4ChromaFormat GstMpeg4ChromaFormat
The chroma format in use as defined in: Table 6-13 -- Meaning of chroma_format
GstMpeg4Level
typedef enum GstMpeg4Level GstMpeg4Level
Different levels as defined in: 9- Profiles and levels
It is computed using: Table G.1 — FLC table for profile_and_level_indication
GstMpeg4ParseResult
typedef enum GstMpeg4ParseResult GstMpeg4ParseResult
Result type of any parsing function.
GstMpeg4Profile
typedef enum GstMpeg4Profile GstMpeg4Profile
Different defined profiles as defined in: 9- Profiles and levels
It is computed using: Table G.1 — FLC table for profile_and_level_indication
GstMpeg4SpriteEnable
typedef enum GstMpeg4SpriteEnable GstMpeg4SpriteEnable
Indicates the usage of static sprite coding or global motion compensation (GMC) as defined in: Table V2 - 2 -- Meaning of sprite_enable codewords
GstMpeg4StartCode
typedef enum GstMpeg4StartCode GstMpeg4StartCode
Defines the different startcodes present in the bitstream as defined in: Table 6-3 — Start code values
GstMpeg4VideoObjectCodingType
typedef enum GstMpeg4VideoObjectCodingType GstMpeg4VideoObjectCodingType
The vop coding types as defined in: Table 6-20 -- Meaning of vop_coding_type
GstMpeg4VideoObjectLayerShape
typedef enum GstMpeg4VideoObjectLayerShape GstMpeg4VideoObjectLayerShape
The different video object layer shapes as defined in: Table 6-16 — Video Object Layer shape type
GstMpeg4VisualObjectType
typedef enum GstMpeg4VisualObjectType GstMpeg4VisualObjectType
Defines the different visual object types as defined in: Table 6-5 -- Meaning of visual object type
The results of the search are