FFmpeg
Data Structures | Functions
imf.h File Reference

Public header file for the processing of Interoperable Master Format (IMF) packages. More...

#include "avformat.h"
#include "libavformat/avio.h"
#include "libavutil/rational.h"
#include "libavutil/uuid.h"
#include "libavutil/timecode.h"
#include <libxml/tree.h>

Go to the source code of this file.

Data Structures

struct  FFIMFBaseResource
 IMF Composition Playlist Base Resource. More...
 
struct  FFIMFTrackFileResource
 IMF Composition Playlist Track File Resource. More...
 
struct  FFIMFMarker
 IMF Marker. More...
 
struct  FFIMFMarkerResource
 IMF Composition Playlist Marker Resource. More...
 
struct  FFIMFBaseVirtualTrack
 IMF Composition Playlist Virtual Track. More...
 
struct  FFIMFTrackFileVirtualTrack
 IMF Composition Playlist Virtual Track that consists of Track File Resources. More...
 
struct  FFIMFMarkerVirtualTrack
 IMF Composition Playlist Virtual Track that consists of Marker Resources. More...
 
struct  FFIMFCPL
 IMF Composition Playlist. More...
 

Functions

int ff_imf_parse_cpl_from_xml_dom (void *log_ctx, xmlDocPtr doc, FFIMFCPL **cpl)
 Parse an IMF CompositionPlaylist element into the FFIMFCPL data structure. More...
 
int ff_imf_parse_cpl (void *log_ctx, AVIOContext *in, FFIMFCPL **cpl)
 Parse an IMF Composition Playlist document into the FFIMFCPL data structure. More...
 
FFIMFCPLff_imf_cpl_alloc (void)
 Allocates and initializes an FFIMFCPL data structure. More...
 
void ff_imf_cpl_free (FFIMFCPL *cpl)
 Deletes an FFIMFCPL data structure previously instantiated with ff_imf_cpl_alloc(). More...
 
int ff_imf_xml_read_uint32 (xmlNodePtr element, uint32_t *number)
 Reads an unsigned 32-bit integer from an XML element. More...
 
int ff_imf_xml_read_rational (xmlNodePtr element, AVRational *rational)
 Reads an AVRational from an XML element. More...
 
int ff_imf_xml_read_uuid (xmlNodePtr element, AVUUID uuid)
 Reads a UUID from an XML element. More...
 
xmlNodePtr ff_imf_xml_get_child_element_by_name (xmlNodePtr parent, const char *name_utf8)
 Returns the first child element with the specified local name. More...
 

Detailed Description

Public header file for the processing of Interoperable Master Format (IMF) packages.

Author
Pierre-Anthony Lemieux
Valentin Noel

Definition in file imf.h.

Function Documentation

◆ ff_imf_parse_cpl_from_xml_dom()

int ff_imf_parse_cpl_from_xml_dom ( void *  log_ctx,
xmlDocPtr  doc,
FFIMFCPL **  cpl 
)

Parse an IMF CompositionPlaylist element into the FFIMFCPL data structure.

Parameters
[in]log_ctxLogging context (points to an instance of AVClass). May be NULL.
[in]docAn XML document from which the CPL is read.
[out]cplPointer to a memory area (allocated by the client), where the function writes a pointer to the newly constructed FFIMFCPL structure (or NULL if the CPL could not be parsed). The client is responsible for freeing the FFIMFCPL structure using ff_imf_cpl_free().
Returns
A non-zero value in case of an error.

Definition at line 745 of file imf_cpl.c.

Referenced by ff_imf_parse_cpl(), test_cpl_from_doc(), and test_cpl_parsing().

◆ ff_imf_parse_cpl()

int ff_imf_parse_cpl ( void *  log_ctx,
AVIOContext in,
FFIMFCPL **  cpl 
)

Parse an IMF Composition Playlist document into the FFIMFCPL data structure.

Parameters
[in]log_ctxLogging context (points to an instance of AVClass). May be NULL.
[in]inThe context from which the CPL is read.
[out]cplPointer to a memory area (allocated by the client), where the function writes a pointer to the newly constructed FFIMFCPL structure (or NULL if the CPL could not be parsed). The client is responsible for freeing the FFIMFCPL structure using ff_imf_cpl_free().
Returns
A non-zero value in case of an error.

Definition at line 875 of file imf_cpl.c.

Referenced by imf_read_header().

◆ ff_imf_cpl_alloc()

FFIMFCPL* ff_imf_cpl_alloc ( void  )

Allocates and initializes an FFIMFCPL data structure.

Returns
A pointer to the newly constructed FFIMFCPL structure (or NULL if the structure could not be constructed). The client is responsible for freeing the FFIMFCPL structure using ff_imf_cpl_free().

Definition at line 835 of file imf_cpl.c.

Referenced by ff_imf_parse_cpl_from_xml_dom().

◆ ff_imf_cpl_free()

void ff_imf_cpl_free ( FFIMFCPL cpl)

Deletes an FFIMFCPL data structure previously instantiated with ff_imf_cpl_alloc().

Parameters
[in]cplThe FFIMFCPL structure to delete.

Definition at line 846 of file imf_cpl.c.

Referenced by ff_imf_parse_cpl_from_xml_dom(), imf_close(), test_cpl_from_doc(), and test_cpl_parsing().

◆ ff_imf_xml_read_uint32()

int ff_imf_xml_read_uint32 ( xmlNodePtr  element,
uint32_t *  number 
)

Reads an unsigned 32-bit integer from an XML element.

Returns
0 on success, < 0 AVERROR code on error.

Definition at line 100 of file imf_cpl.c.

Referenced by fill_base_resource(), and fill_marker().

◆ ff_imf_xml_read_rational()

int ff_imf_xml_read_rational ( xmlNodePtr  element,
AVRational rational 
)

Reads an AVRational from an XML element.

Returns
0 on success, < 0 AVERROR code on error.

Definition at line 88 of file imf_cpl.c.

Referenced by fill_base_resource(), and fill_edit_rate().

◆ ff_imf_xml_read_uuid()

int ff_imf_xml_read_uuid ( xmlNodePtr  element,
AVUUID  uuid 
)

Reads a UUID from an XML element.

Returns
0 on success, < 0 AVERROR code on error.

Definition at line 73 of file imf_cpl.c.

Referenced by fill_id(), fill_trackfile_resource(), parse_imf_asset_map_from_xml_dom(), push_main_audio_sequence(), push_main_image_2d_sequence(), and push_marker_sequence().

◆ ff_imf_xml_get_child_element_by_name()

xmlNodePtr ff_imf_xml_get_child_element_by_name ( xmlNodePtr  parent,
const char *  name_utf8 
)

Returns the first child element with the specified local name.

Returns
A pointer to the child element, or NULL if no such child element exists.

Definition at line 59 of file imf_cpl.c.

Referenced by fill_base_resource(), fill_content_title(), fill_edit_rate(), fill_id(), fill_marker(), fill_timecode(), fill_trackfile_resource(), fill_virtual_tracks(), parse_imf_asset_map_from_xml_dom(), push_main_audio_sequence(), push_main_image_2d_sequence(), and push_marker_sequence().