Go to the documentation of this file.
57 #include <libxml/parser.h>
61 xmlNodePtr cur_element;
63 cur_element = xmlFirstElementChild(parent);
65 if (xmlStrcmp(cur_element->name, name_utf8) == 0)
68 cur_element = xmlNextElementSibling(cur_element);
75 xmlChar *element_text =
NULL;
79 element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1);
80 scanf_ret = sscanf(element_text,
98 if (scanf_ret != 16) {
102 xmlFree(element_text);
109 xmlChar *element_text =
NULL;
112 element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1);
113 if (sscanf(element_text,
"%i %i", &rational->
num, &rational->
den) != 2) {
117 xmlFree(element_text);
124 xmlChar *element_text =
NULL;
127 element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1);
128 if (sscanf(element_text,
"%" PRIu32, number) != 1) {
132 xmlFree(element_text);
145 track->resource_count = 0;
146 track->resources =
NULL;
152 track->resource_count = 0;
153 track->resources_alloc_sz = 0;
154 track->resources =
NULL;
168 rsrc->marker_count = 0;
169 rsrc->markers =
NULL;
182 memset(rsrc->track_file_uuid, 0,
sizeof(rsrc->track_file_uuid));
187 xmlNodePtr element =
NULL;
194 element->xmlChildrenNode,
202 xmlNodePtr element =
NULL;
214 xmlNodePtr element =
NULL;
226 xmlNodePtr element =
NULL;
242 if (!(marker->
label_utf8 = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1))) {
246 if (!(marker->
scope_utf8 = xmlGetNoNsProp(element,
"scope"))) {
248 = xmlCharStrdup(
"http://www.smpte-ra.org/schemas/2067-3/2013#standard-markers");
260 xmlNodePtr element =
NULL;
311 xmlNodePtr element =
NULL;
335 xmlNodePtr element =
NULL;
342 element = xmlFirstElementChild(marker_resource_elem);
344 if (xmlStrcmp(element->name,
"Marker") == 0) {
347 if (marker_resource->marker_count == UINT32_MAX)
350 marker_resource->marker_count + 1,
354 marker_resource->markers =
tmp;
356 imf_marker_init(&marker_resource->markers[marker_resource->marker_count]);
358 &marker_resource->markers[marker_resource->marker_count]);
359 marker_resource->marker_count++;
364 element = xmlNextElementSibling(element);
374 xmlNodePtr resource_list_elem =
NULL;
375 xmlNodePtr resource_elem =
NULL;
376 xmlNodePtr track_id_elem =
NULL;
377 unsigned long resource_elem_count;
409 if (!resource_list_elem)
412 resource_elem_count = xmlChildElementCount(resource_list_elem);
413 if (resource_elem_count > UINT32_MAX
425 resource_elem = xmlFirstElementChild(resource_list_elem);
426 while (resource_elem) {
435 resource_elem = xmlNextElementSibling(resource_elem);
443 if (xmlStrcmp(element->name,
"Left") == 0 || xmlStrcmp(element->name,
"Right") == 0)
446 element = xmlFirstElementChild(element);
451 element = xmlNextElementSibling(element);
461 xmlNodePtr resource_list_elem =
NULL;
462 xmlNodePtr resource_elem =
NULL;
463 xmlNodePtr track_id_elem =
NULL;
464 unsigned long resource_elem_count;
509 if (!resource_list_elem)
512 resource_elem_count = xmlChildElementCount(resource_list_elem);
513 if (resource_elem_count > UINT32_MAX
526 resource_elem = xmlFirstElementChild(resource_list_elem);
527 while (resource_elem) {
538 resource_elem = xmlNextElementSibling(resource_elem);
548 xmlNodePtr resource_list_elem =
NULL;
549 xmlNodePtr resource_elem =
NULL;
550 xmlNodePtr track_id_elem =
NULL;
552 unsigned long resource_elem_count;
589 if (!resource_list_elem)
592 resource_elem_count = xmlChildElementCount(resource_list_elem);
593 if (resource_elem_count > UINT32_MAX
608 resource_elem = xmlFirstElementChild(resource_list_elem);
609 while (resource_elem) {
621 resource_elem = xmlNextElementSibling(resource_elem);
630 xmlNodePtr segment_list_elem =
NULL;
631 xmlNodePtr segment_elem =
NULL;
632 xmlNodePtr sequence_list_elem =
NULL;
633 xmlNodePtr sequence_elem =
NULL;
641 segment_elem = xmlFirstElementChild(segment_list_elem);
642 while (segment_elem) {
646 if (!segment_list_elem)
649 sequence_elem = xmlFirstElementChild(sequence_list_elem);
650 while (sequence_elem) {
651 if (xmlStrcmp(sequence_elem->name,
"MarkerSequence") == 0)
654 else if (xmlStrcmp(sequence_elem->name,
"MainImageSequence") == 0)
657 else if (xmlStrcmp(sequence_elem->name,
"MainAudioSequence") == 0)
663 "The following Sequence is not supported and is ignored: %s\n",
664 sequence_elem->name);
670 sequence_elem = xmlNextElementSibling(sequence_elem);
673 segment_elem = xmlNextElementSibling(segment_elem);
682 xmlNodePtr cpl_element =
NULL;
690 cpl_element = xmlDocGetRootElement(doc);
691 if (!cpl_element || xmlStrcmp(cpl_element->name,
"CompositionPlaylist")) {
813 doc = xmlReadMemory(buf.str, buf.len,
NULL,
NULL, 0);
817 "XML parsing failed when reading the IMF CPL\n");
827 "IMF CPL ContentTitle: %s\n",
828 (*cpl)->content_title_utf8);
static void imf_base_virtual_track_init(FFIMFBaseVirtualTrack *track)
FFIMFTrackFileResource * resources
Resource elements of the Virtual Track.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
static int push_main_audio_sequence(xmlNodePtr audio_sequence_elem, FFIMFCPL *cpl)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
void ff_imf_cpl_free(FFIMFCPL *cpl)
Deletes an FFIMFCPL data structure previously instantiated with ff_imf_cpl_alloc().
FFIMFUUID id_uuid
CompositionPlaylist/Id element.
static void imf_marker_free(FFIMFMarker *marker)
FFIMFMarkerResource * resources
Resource elements of the Virtual Track.
FFIMFCPL * ff_imf_cpl_alloc(void)
Allocates and initializes an FFIMFCPL data structure.
static av_cold void cleanup(FlashSV2Context *s)
int ff_imf_parse_cpl_from_xml_dom(xmlDocPtr doc, FFIMFCPL **cpl)
Parse an IMF CompositionPlaylist element into the FFIMFCPL data structure.
uint32_t resource_count
Number of Resource elements present in the Virtual Track.
int ff_imf_xml_read_uuid(xmlNodePtr element, uint8_t uuid[16])
Reads a UUID from an XML element.
static void imf_trackfile_virtual_track_init(FFIMFTrackFileVirtualTrack *track)
IMF Composition Playlist Virtual Track that consists of Marker Resources.
xmlChar * content_title_utf8
CompositionPlaylist/ContentTitle element.
FFIMFTrackFileVirtualTrack * main_audio_tracks
Main Audio Virtual Tracks.
static void imf_cpl_init(FFIMFCPL *cpl)
uint32_t duration
BaseResourceType/Duration.
FFIMFMarkerVirtualTrack * main_markers_track
Main Marker Virtual Track.
FFIMFUUID id_uuid
TrackId associated with the Virtual Track.
static void imf_marker_virtual_track_free(FFIMFMarkerVirtualTrack *vt)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
IMF Composition Playlist Virtual Track that consists of Track File Resources.
static int push_main_image_2d_sequence(xmlNodePtr image_sequence_elem, FFIMFCPL *cpl)
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
static void imf_base_resource_init(FFIMFBaseResource *rsrc)
int avio_read_to_bprint(AVIOContext *h, struct AVBPrint *pb, size_t max_size)
Read contents of h into print buffer, up to max_size bytes, or up to EOF.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
static void imf_marker_virtual_track_init(FFIMFMarkerVirtualTrack *track)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static void imf_trackfile_resource_init(FFIMFTrackFileResource *rsrc)
static int fill_base_resource(xmlNodePtr resource_elem, FFIMFBaseResource *resource, FFIMFCPL *cpl)
int ff_imf_xml_read_uint32(xmlNodePtr element, uint32_t *number)
Reads an unsigned 32-bit integer from an XML element.
AVRational edit_rate
CompositionPlaylist/EditRate element.
static int fill_trackfile_resource(xmlNodePtr tf_resource_elem, FFIMFTrackFileResource *tf_resource, FFIMFCPL *cpl)
unsigned int resources_alloc_sz
Size of the resources buffer.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
IMF Composition Playlist Virtual Track.
IMF Composition Playlist Base Resource.
Rational number (pair of numerator and denominator).
FFIMFBaseVirtualTrack base
FFIMFBaseVirtualTrack base
static int has_stereo_resources(xmlNodePtr element)
AVRational edit_rate
BaseResourceType/EditRate.
static int fill_content_title(xmlNodePtr cpl_element, FFIMFCPL *cpl)
static int fill_marker(xmlNodePtr marker_elem, FFIMFMarker *marker)
static AVRational av_make_q(int num, int den)
Create an AVRational.
static void imf_marker_resource_free(FFIMFMarkerResource *rsrc)
static int fill_id(xmlNodePtr cpl_element, FFIMFCPL *cpl)
static int push_marker_sequence(xmlNodePtr marker_sequence_elem, FFIMFCPL *cpl)
uint32_t repeat_count
BaseResourceType/RepeatCount.
#define AV_LOG_INFO
Standard information.
#define i(width, name, range_min, range_max)
uint32_t entry_point
BaseResourceType/EntryPoint.
static int fill_virtual_tracks(xmlNodePtr cpl_element, FFIMFCPL *cpl)
IMF Composition Playlist Marker Resource.
FFIMFMarker * markers
Marker elements.
int ff_imf_xml_read_rational(xmlNodePtr element, AVRational *rational)
Reads an AVRational from an XML element.
IMF Composition Playlist Track File Resource.
uint32_t offset
Marker/Offset.
static void imf_marker_resource_init(FFIMFMarkerResource *rsrc)
static void imf_marker_init(FFIMFMarker *marker)
uint32_t main_audio_track_count
Number of Main Audio Virtual Tracks.
uint32_t resource_count
Number of Resource elements present in the Virtual Track.
static void imf_trackfile_virtual_track_free(FFIMFTrackFileVirtualTrack *vt)
FFIMFTrackFileVirtualTrack * main_image_2d_track
Main Image Virtual Track.
uint32_t marker_count
Number of Marker elements.
IMF Composition Playlist.
Public header file for the processing of Interoperable Master Format (IMF) packages.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
xmlChar * label_utf8
Marker/Label.
int ff_imf_parse_cpl(AVIOContext *in, FFIMFCPL **cpl)
Parse an IMF Composition Playlist document into the FFIMFCPL data structure.
xmlChar * scope_utf8
Marker/Label/@scope.
static int fill_marker_resource(xmlNodePtr marker_resource_elem, FFIMFMarkerResource *marker_resource, FFIMFCPL *cpl)
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.
#define FF_IMF_UUID_FORMAT
static int fill_edit_rate(xmlNodePtr cpl_element, FFIMFCPL *cpl)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.