|  |  |  | GStreamer Bad Plugins 0.10 Library Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
#include <gst/codecparsers/gstmpegvideoparser.h> enum GstMpegVideoPacketTypeCode; enum GstMpegVideoPacketExtensionCode; enum GstMpegVideoLevel; enum GstMpegVideoProfile; enum GstMpegVideoPictureType; enum GstMpegVideoPictureStructure; struct GstMpegVideoSequenceHdr; struct GstMpegVideoSequenceExt; struct GstMpegVideoPictureHdr; struct GstMpegVideoGop; struct GstMpegVideoPictureExt; struct GstMpegVideoQuantMatrixExt; struct GstMpegVideoTypeOffsetSize; GList * gst_mpeg_video_parse (const guint8 *data,gsize size,guint offset); gboolean gst_mpeg_video_parse_sequence_header (GstMpegVideoSequenceHdr *params,const guint8 *data,gsize size,guint offset); gboolean gst_mpeg_video_parse_picture_header (GstMpegVideoPictureHdr *hdr,const guint8 *data,gsize size,guint offset); gboolean gst_mpeg_video_parse_picture_extension (GstMpegVideoPictureExt *ext,const guint8 *data,gsize size,guint offset); gboolean gst_mpeg_video_parse_gop (GstMpegVideoGop *gop,const guint8 *data,gsize size,guint offset); gboolean gst_mpeg_video_parse_sequence_extension (GstMpegVideoSequenceExt *seqext,const guint8 *data,gsize size,guint offset); gboolean gst_mpeg_video_parse_quant_matrix_extension (GstMpegVideoQuantMatrixExt *quant,const guint8 *data,gsize size,guint offset);
typedef enum {
  GST_MPEG_VIDEO_PACKET_PICTURE      = 0x00,
  GST_MPEG_VIDEO_PACKET_SLICE_MIN    = 0x01,
  GST_MPEG_VIDEO_PACKET_SLICE_MAX    = 0xaf,
  GST_MPEG_VIDEO_PACKET_USER_DATA    = 0xb2,
  GST_MPEG_VIDEO_PACKET_SEQUENCE     = 0xb3,
  GST_MPEG_VIDEO_PACKET_EXTENSION    = 0xb5,
  GST_MPEG_VIDEO_PACKET_SEQUENCE_END = 0xb7,
  GST_MPEG_VIDEO_PACKET_GOP          = 0xb8,
  GST_MPEG_VIDEO_PACKET_NONE         = 0xff
} GstMpegVideoPacketTypeCode;
Indicates the type of MPEG packet
| Picture packet starting code | |
| Slice min packet starting code | |
| Slice max packet starting code | |
| User data packet starting code | |
| Sequence packet starting code | |
| Extension packet starting code | |
| Sequence end packet code | |
| Group of Picture packet starting code | |
| None packet code | 
typedef enum {
  GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE         = 0x01,
  GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_DISPLAY = 0x02,
  GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX     = 0x03,
  GST_MPEG_VIDEO_PACKET_EXT_PICTURE          = 0x08
} GstMpegVideoPacketExtensionCode;
Indicates what type of packets are in this block, some are mutually exclusive though - ie, sequence packs are accumulated separately. GOP & Picture may occur together or separately.
typedef enum {
 GST_MPEG_VIDEO_LEVEL_HIGH      = 0x04,
 GST_MPEG_VIDEO_LEVEL_HIGH_1440 = 0x06,
 GST_MPEG_VIDEO_LEVEL_MAIN      = 0x08,
 GST_MPEG_VIDEO_LEVEL_LOW       = 0x0a
} GstMpegVideoLevel;
Mpeg-2 Levels.
typedef enum {
  GST_MPEG_VIDEO_PROFILE_422                 = 0x00,
  GST_MPEG_VIDEO_PROFILE_HIGH                = 0x01,
  GST_MPEG_VIDEO_PROFILE_SPATIALLY_SCALABLE  = 0x02,
  GST_MPEG_VIDEO_PROFILE_SNR_SCALABLE        = 0x03,
  GST_MPEG_VIDEO_PROFILE_MAIN                = 0x04,
  GST_MPEG_VIDEO_PROFILE_SIMPLE              = 0x05
} GstMpegVideoProfile;
Mpeg-2 Profiles.
| 4:2:2 profile (422) | |
| High profile (HP) | |
| Spatially Scalable profile (Spatial) | |
| SNR Scalable profile (SNR) | |
| Main profile (MP) | |
| Simple profile (SP) | 
typedef enum {
  GST_MPEG_VIDEO_PICTURE_TYPE_I = 0x01,
  GST_MPEG_VIDEO_PICTURE_TYPE_P = 0x02,
  GST_MPEG_VIDEO_PICTURE_TYPE_B = 0x03,
  GST_MPEG_VIDEO_PICTURE_TYPE_D = 0x04
} GstMpegVideoPictureType;
Picture type.
typedef enum {
    GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD    = 0x01,
    GST_MPEG_VIDEO_PICTURE_STRUCTURE_BOTTOM_FIELD = 0x02,
    GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME        = 0x03
} GstMpegVideoPictureStructure;
Picture structure type.
struct GstMpegVideoSequenceHdr {
  guint16 width, height;
  guint8  aspect_ratio_info;
  guint8  frame_rate_code;
  guint32 bitrate_value;
  guint16 vbv_buffer_size_value;
  guint8  constrained_parameters_flag;
  guint8  intra_quantizer_matrix[64];
  guint8  non_intra_quantizer_matrix[64];
  /* Calculated values */
  guint   par_w, par_h;
  guint   fps_n, fps_d;
  guint   bitrate;
};
The Mpeg2 Video Sequence Header structure.
| Width of each frame | |
| Height of each frame | |
| Value of the bitrate as is in the stream (400bps unit) | |
| TRUEif this stream uses contrained parameters. | |
| intra-quantization table | |
| non-intra quantization table | |
| guint  | Calculated Pixel Aspect Ratio width | 
| guint  | Calculated Pixel Aspect Ratio height | 
| guint  | Calculated Framrate nominator | 
| guint  | Calculated Framerate denominator | 
| guint  | the real bitrate of the Mpeg video stream in bits per second, 0 if VBR stream | 
struct GstMpegVideoSequenceExt {
  /* mpeg2 decoder profile */
  guint8 profile;
  /* mpeg2 decoder level */
  guint8 level;
  guint8 progressive;
  guint8 chroma_format;
  guint8 horiz_size_ext, vert_size_ext;
  guint16 bitrate_ext;
  guint8 vbv_buffer_size_extension;
  guint8 low_delay;
  guint8 fps_n_ext, fps_d_ext;
};
The Mpeg2 Video Sequence Extension structure.
| mpeg2 decoder profil | |
| mpeg2 decoder level | |
| TRUEif the frames are progressiveFALSEotherwize | |
| indicates the chrominance format | |
| Horizontal size | |
| Vertical size | |
| The bitrate | |
| Vbv vuffer size | |
| TRUEif the sequence doesn't contain any B-pictures,FALSEotherwize | |
| Framerate nominator code | |
| Framerate denominator code | 
struct GstMpegVideoPictureHdr {
  guint16 tsn;
  guint8 pic_type;
  guint8 full_pel_forward_vector, full_pel_backward_vector;
  guint8 f_code[2][2];
};
The Mpeg2 Video Picture Header structure.
struct GstMpegVideoGop {
  guint8 drop_frame_flag;
  guint8 hour, minute, second, frame;
  guint8 closed_gop;
  guint8 broken_link;
};
The Mpeg Video Group of Picture structure.
struct GstMpegVideoPictureExt {
  guint8 f_code[2][2];
  guint8 intra_dc_precision;
  guint8 picture_structure;
  guint8 top_field_first;
  guint8 frame_pred_frame_dct;
  guint8 concealment_motion_vectors;
  guint8 q_scale_type;
  guint8 intra_vlc_format;
  guint8 alternate_scan;
  guint8 repeat_first_field;
  guint8 chroma_420_type;
  guint8 progressive_frame;
  guint8 composite_display;
  guint8 v_axis;
  guint8 field_sequence;
  guint8 sub_carrier;
  guint8 burst_amplitude;
  guint8 sub_carrier_phase;
};
The Mpeg2 Video Picture Extension structure.
struct GstMpegVideoQuantMatrixExt {
 guint8 load_intra_quantiser_matrix;
 guint8 intra_quantiser_matrix[64];
 guint8 load_non_intra_quantiser_matrix;
 guint8 non_intra_quantiser_matrix[64];
 guint8 load_chroma_intra_quantiser_matrix;
 guint8 chroma_intra_quantiser_matrix[64];
 guint8 load_chroma_non_intra_quantiser_matrix;
 guint8 chroma_non_intra_quantiser_matrix[64];
};
The Quant Matrix Extension structure
struct GstMpegVideoTypeOffsetSize {
  guint8 type;
  guint  offset;
  gint   size;
};
A structure that contains the type of a packet, its offset and its size
GList * gst_mpeg_video_parse (const guint8 *data,gsize size,guint offset);
Parses the MPEG 1/2 video bitstream contained in data , and returns the
detect packets as a list of GstMpegVideoTypeOffsetSize.
| 
 | The data to parse | 
| 
 | The size of data | 
| 
 | The offset from which to start parsing | 
| Returns : | a GList of GstMpegVideoTypeOffsetSize | 
gboolean gst_mpeg_video_parse_sequence_header (GstMpegVideoSequenceHdr *params,const guint8 *data,gsize size,guint offset);
Parses the seqhdr Mpeg Video Sequence Header structure members from data
| 
 | The GstMpegVideoSequenceHdr structure to fill. [out] | 
| 
 | The data from which to parse the sequence header | 
| 
 | The size of data | 
| 
 | The offset in byte from which to start parsing data | 
| Returns : | TRUEif the seqhdr could be parsed correctly,FALSEotherwize. | 
gboolean gst_mpeg_video_parse_picture_header (GstMpegVideoPictureHdr *hdr,const guint8 *data,gsize size,guint offset);
Parsers the hdr Mpeg Video Picture Header structure members from data
| 
 | The GstMpegVideoPictureHdr structure to fill. [out] | 
| 
 | The data from which to parse the picture header | 
| 
 | The size of data | 
| 
 | The offset in byte from which to start the parsing | 
| Returns : | TRUEif the picture sequence could be parsed correctly,FALSEotherwize. | 
gboolean gst_mpeg_video_parse_picture_extension (GstMpegVideoPictureExt *ext,const guint8 *data,gsize size,guint offset);
Parse the ext Mpeg Video Picture Extension structure members from data
| 
 | The GstMpegVideoPictureExt structure to fill. [out] | 
| 
 | The data from which to parse the picture extension | 
| 
 | The size of data | 
| 
 | The offset in byte from which to start the parsing | 
| Returns : | TRUEif the picture extension could be parsed correctly,FALSEotherwize. | 
gboolean gst_mpeg_video_parse_gop (GstMpegVideoGop *gop,const guint8 *data,gsize size,guint offset);
Parses the gop Mpeg Video Group of Picture structure members from data
| 
 | The GstMpegVideoGop structure to fill. [out] | 
| 
 | The data from which to parse the gop | 
| 
 | The size of data | 
| 
 | The offset in byte from which to start the parsing | 
| Returns : | TRUEif the gop could be parsed correctly,FALSEotherwize. | 
gboolean gst_mpeg_video_parse_sequence_extension (GstMpegVideoSequenceExt *seqext,const guint8 *data,gsize size,guint offset);
Parses the seqext Mpeg Video Sequence Extension structure members from data
| 
 | The GstMpegVideoSequenceExt structure to fill. [out] | 
| 
 | The data from which to parse the sequence extension | 
| 
 | The size of data | 
| 
 | The offset in byte from which to start parsing data | 
| Returns : | TRUEif the seqext could be parsed correctly,FALSEotherwize. | 
gboolean gst_mpeg_video_parse_quant_matrix_extension (GstMpegVideoQuantMatrixExt *quant,const guint8 *data,gsize size,guint offset);
Parses the quant Mpeg Video Quant Matrix Extension structure members from
data
| 
 | The GstMpegVideoQuantMatrixExt structure to fill. [out] | 
| 
 | The data from which to parse the Quantization Matrix extension | 
| 
 | The size of data | 
| 
 | The offset in byte from which to start the parsing | 
| Returns : | TRUEif the quant matrix extension could be parsed correctly,FALSEotherwize. |