My Project
Elementary stream format

Classes

struct  MMAL_VIDEO_FORMAT_T
 
struct  MMAL_AUDIO_FORMAT_T
 
struct  MMAL_SUBPICTURE_FORMAT_T
 
union  MMAL_ES_SPECIFIC_FORMAT_T
 
struct  MMAL_ES_FORMAT_T
 

Typedefs

typedef struct MMAL_AUDIO_FORMAT_T MMAL_AUDIO_FORMAT_T
 
typedef struct MMAL_ES_FORMAT_T MMAL_ES_FORMAT_T
 

Enumerations

enum  MMAL_ES_TYPE_T {
  MMAL_ES_TYPE_UNKNOWN, MMAL_ES_TYPE_CONTROL, MMAL_ES_TYPE_AUDIO, MMAL_ES_TYPE_VIDEO,
  MMAL_ES_TYPE_SUBPICTURE
}
 

Functions

MMAL_ES_FORMAT_Tmmal_format_alloc (void)
 
void mmal_format_free (MMAL_ES_FORMAT_T *format)
 
MMAL_STATUS_T mmal_format_extradata_alloc (MMAL_ES_FORMAT_T *format, unsigned int size)
 
void mmal_format_copy (MMAL_ES_FORMAT_T *format_dest, MMAL_ES_FORMAT_T *format_src)
 
MMAL_STATUS_T mmal_format_full_copy (MMAL_ES_FORMAT_T *format_dest, MMAL_ES_FORMAT_T *format_src)
 
uint32_t mmal_format_compare (MMAL_ES_FORMAT_T *format_1, MMAL_ES_FORMAT_T *format_2)
 

Elementary stream flags

The following flags describe properties of an elementary stream

#define MMAL_ES_FORMAT_FLAG_FRAMED   0x1
 

Undefined encoding value.

This value indicates an unknown encoding

#define MMAL_ENCODING_UNKNOWN   0
 

Default encoding variant value.

This value indicates the default encoding variant is used

#define MMAL_ENCODING_VARIANT_DEFAULT   0
 

Comparison flags

The following flags describe the differences between 2 format structures

#define MMAL_ES_FORMAT_COMPARE_FLAG_TYPE   0x01
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_ENCODING   0x02
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_BITRATE   0x04
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_FLAGS   0x08
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_EXTRADATA   0x10
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_RESOLUTION   0x0100
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_CROPPING   0x0200
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_FRAME_RATE   0x0400
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_ASPECT_RATIO   0x0800
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_COLOR_SPACE   0x1000
 
#define MMAL_ES_FORMAT_COMPARE_FLAG_ES_OTHER   0x10000000
 

Detailed Description

Definition of an elementary stream format and its associated API

Macro Definition Documentation

◆ MMAL_ENCODING_UNKNOWN

#define MMAL_ENCODING_UNKNOWN   0

Definition at line 114 of file mmal_format.h.

◆ MMAL_ENCODING_VARIANT_DEFAULT

#define MMAL_ENCODING_VARIANT_DEFAULT   0

Definition at line 121 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_BITRATE

#define MMAL_ES_FORMAT_COMPARE_FLAG_BITRATE   0x04

The bitrate is different

Definition at line 194 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_ENCODING

#define MMAL_ES_FORMAT_COMPARE_FLAG_ENCODING   0x02

The encoding is different

Definition at line 193 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_ES_OTHER

#define MMAL_ES_FORMAT_COMPARE_FLAG_ES_OTHER   0x10000000

Other ES specific parameters are different

Definition at line 204 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_EXTRADATA

#define MMAL_ES_FORMAT_COMPARE_FLAG_EXTRADATA   0x10

The extradata is different

Definition at line 196 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_FLAGS

#define MMAL_ES_FORMAT_COMPARE_FLAG_FLAGS   0x08

The flags are different

Definition at line 195 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_TYPE

#define MMAL_ES_FORMAT_COMPARE_FLAG_TYPE   0x01

The type is different

Definition at line 192 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_ASPECT_RATIO

#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_ASPECT_RATIO   0x0800

The video aspect ratio is different

Definition at line 201 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_COLOR_SPACE

#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_COLOR_SPACE   0x1000

The video color space is different

Definition at line 202 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_CROPPING

#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_CROPPING   0x0200

The video cropping is different

Definition at line 199 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_FRAME_RATE

#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_FRAME_RATE   0x0400

The video frame rate is different

Definition at line 200 of file mmal_format.h.

◆ MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_RESOLUTION

#define MMAL_ES_FORMAT_COMPARE_FLAG_VIDEO_RESOLUTION   0x0100

The video resolution is different

Definition at line 198 of file mmal_format.h.

◆ MMAL_ES_FORMAT_FLAG_FRAMED

#define MMAL_ES_FORMAT_FLAG_FRAMED   0x1

The elementary stream will already be framed

Definition at line 107 of file mmal_format.h.

Typedef Documentation

◆ MMAL_AUDIO_FORMAT_T

Definition of an audio format. This describes the properties specific to an audio stream

◆ MMAL_ES_FORMAT_T

Definition of an elementary stream format

Enumeration Type Documentation

◆ MMAL_ES_TYPE_T

Enumeration of the different types of elementary streams. This divides elementary streams into 4 big categories, plus an invalid type.

Enumerator
MMAL_ES_TYPE_UNKNOWN 

Unknown elementary stream type

MMAL_ES_TYPE_CONTROL 

Elementary stream of control commands

MMAL_ES_TYPE_AUDIO 

Audio elementary stream

MMAL_ES_TYPE_VIDEO 

Video elementary stream

MMAL_ES_TYPE_SUBPICTURE 

Sub-picture elementary stream (e.g. subtitles, overlays)

Definition at line 44 of file mmal_format.h.

Function Documentation

◆ mmal_format_alloc()

MMAL_ES_FORMAT_T* mmal_format_alloc ( void  )

Allocate and initialise a MMAL_ES_FORMAT_T structure.

Returns
a MMAL_ES_FORMAT_T structure

◆ mmal_format_compare()

uint32_t mmal_format_compare ( MMAL_ES_FORMAT_T format_1,
MMAL_ES_FORMAT_T format_2 
)

Compare 2 format structures and returns a set of flags describing the differences. The result will be zero if the structures are the same, or a combination of one or more of the Comparison flags if different.

Parameters
format_1first MMAL_ES_FORMAT_T to compare
format_2second MMAL_ES_FORMAT_T to compare
Returns
set of flags describing the differences

◆ mmal_format_copy()

void mmal_format_copy ( MMAL_ES_FORMAT_T format_dest,
MMAL_ES_FORMAT_T format_src 
)

Shallow copy a format structure. It is worth noting that the extradata buffer will not be copied in the new format.

Parameters
format_destdestination MMAL_ES_FORMAT_T for the copy
format_srcsource MMAL_ES_FORMAT_T for the copy

◆ mmal_format_extradata_alloc()

MMAL_STATUS_T mmal_format_extradata_alloc ( MMAL_ES_FORMAT_T format,
unsigned int  size 
)

Allocate the extradata buffer in MMAL_ES_FORMAT_T. This buffer will be freed automatically when the format is destroyed or another allocation is done.

Parameters
formatformat structure for which the extradata buffer will be allocated
sizesize of the extradata buffer to allocate
Returns
MMAL_SUCCESS on success

◆ mmal_format_free()

void mmal_format_free ( MMAL_ES_FORMAT_T format)

Free a MMAL_ES_FORMAT_T structure allocated by mmal_format_alloc.

Parameters
formatthe MMAL_ES_FORMAT_T structure to free

◆ mmal_format_full_copy()

MMAL_STATUS_T mmal_format_full_copy ( MMAL_ES_FORMAT_T format_dest,
MMAL_ES_FORMAT_T format_src 
)

Fully copy a format structure, including the extradata buffer.

Parameters
format_destdestination MMAL_ES_FORMAT_T for the copy
format_srcsource MMAL_ES_FORMAT_T for the copy
Returns
MMAL_SUCCESS on success