diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-03-11 19:32:16 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-03-21 10:19:47 +0100 |
commit | e50039897b9550ff01901069cb17e923760c8600 (patch) | |
tree | 1c6d0ad6f2777d36403adc70695ec6ba25a180fe /gst/mxf/mxfparse.c | |
parent | 86719f194f17773979913e21cb0629c3eba06c05 (diff) | |
download | gst-plugins-bad-e50039897b9550ff01901069cb17e923760c8600.tar.gz gst-plugins-bad-e50039897b9550ff01901069cb17e923760c8600.tar.bz2 gst-plugins-bad-e50039897b9550ff01901069cb17e923760c8600.zip |
mxf: Add MXF muxer
This muxer currently only supports OP1a and is
probably not yet 100% complying to the standards.
Diffstat (limited to 'gst/mxf/mxfparse.c')
-rw-r--r-- | gst/mxf/mxfparse.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/gst/mxf/mxfparse.c b/gst/mxf/mxfparse.c index d4d52312..71d639e4 100644 --- a/gst/mxf/mxfparse.c +++ b/gst/mxf/mxfparse.c @@ -469,6 +469,14 @@ mxf_product_version_parse (MXFProductVersion * product_version, } gboolean +mxf_product_version_is_valid (const MXFProductVersion * version) +{ + static const guint8 null[sizeof (MXFProductVersion)] = { 0, }; + + return (memcmp (version, &null, sizeof (MXFProductVersion)) == 0); +} + +gboolean mxf_ul_array_parse (MXFUL ** array, guint32 * count, const guint8 * data, guint size) { @@ -1023,7 +1031,12 @@ mxf_primer_pack_reset (MXFPrimerPack * pack) if (pack->mappings) g_hash_table_destroy (pack->mappings); + if (pack->reverse_mappings) + g_hash_table_destroy (pack->reverse_mappings); + memset (pack, 0, sizeof (MXFPrimerPack)); + + pack->next_free_tag = 0x8000; } /* structural metadata parsing */ @@ -1051,7 +1064,10 @@ mxf_local_tag_parse (const guint8 * data, guint size, guint16 * tag, void mxf_local_tag_free (MXFLocalTag * tag) { - g_free (tag->data); + if (tag->g_slice) + g_slice_free1 (tag->size, tag->data); + else + g_free (tag->data); g_slice_free (MXFLocalTag, tag); } @@ -1100,6 +1116,32 @@ mxf_local_tag_add_to_hash_table (const MXFPrimerPack * primer, return TRUE; } +gboolean +mxf_local_tag_insert (MXFLocalTag * tag, GHashTable ** hash_table) +{ +#ifndef GST_DISABLE_GST_DEBUG + gchar str[48]; +#endif + + g_return_val_if_fail (tag != NULL, FALSE); + g_return_val_if_fail (hash_table != NULL, FALSE); + + if (*hash_table == NULL) + *hash_table = + g_hash_table_new_full ((GHashFunc) mxf_ul_hash, + (GEqualFunc) mxf_ul_is_equal, (GDestroyNotify) NULL, + (GDestroyNotify) mxf_local_tag_free); + + g_return_val_if_fail (*hash_table != NULL, FALSE); + + GST_DEBUG ("Adding local tag 0x%04x with UL %s and size %u", tag, + mxf_ul_to_string (&tag->key, str), tag->size); + + g_hash_table_insert (*hash_table, &tag->key, tag); + + return TRUE; +} + static GSList *_mxf_essence_element_handler_registry = NULL; void |