mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
gst/mxf/: Convert the structural metadata to GstMiniObjects to make a lot of code easier and to make everything bette...
Original commit message from CVS: * gst/mxf/Makefile.am: * gst/mxf/mxf.c: (plugin_init): * gst/mxf/mxfaes-bwf.c: (mxf_metadata_wave_audio_essence_descriptor_handle_tag), (mxf_metadata_wave_audio_essence_descriptor_init), (mxf_metadata_wave_audio_essence_descriptor_class_init), (mxf_metadata_aes3_audio_essence_descriptor_finalize), (mxf_metadata_aes3_audio_essence_descriptor_handle_tag), (mxf_metadata_aes3_audio_essence_descriptor_init), (mxf_metadata_aes3_audio_essence_descriptor_class_init), (mxf_is_aes_bwf_essence_track), (mxf_bwf_create_caps), (mxf_aes3_create_caps), (mxf_aes_bwf_create_caps), (mxf_aes_bwf_init): * gst/mxf/mxfaes-bwf.h: * gst/mxf/mxfalaw.c: (mxf_is_alaw_essence_track), (mxf_alaw_create_caps), (mxf_alaw_init): * gst/mxf/mxfalaw.h: * gst/mxf/mxfd10.c: (mxf_is_d10_essence_track), (mxf_d10_create_caps), (mxf_d10_init): * gst/mxf/mxfd10.h: * gst/mxf/mxfdemux.c: (gst_mxf_demux_reset_metadata), (gst_mxf_demux_handle_header_metadata_resolve_references), (gst_mxf_demux_find_package), (gst_mxf_demux_choose_package), (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_handle_metadata), (gst_mxf_demux_handle_generic_container_essence_element), (gst_mxf_demux_handle_klv_packet), (gst_mxf_demux_src_query): * gst/mxf/mxfdemux.h: * gst/mxf/mxfdv-dif.c: (mxf_is_dv_dif_essence_track), (mxf_dv_dif_create_caps), (mxf_dv_dif_init): * gst/mxf/mxfdv-dif.h: * gst/mxf/mxfjpeg2000.c: (mxf_is_jpeg2000_essence_track), (mxf_jpeg2000_create_caps), (mxf_jpeg2000_init): * gst/mxf/mxfjpeg2000.h: * gst/mxf/mxfmetadata.c: (mxf_metadata_base_finalize), (mxf_metadata_base_handle_tag), (mxf_metadata_base_resolve), (mxf_metadata_base_init), (mxf_metadata_base_class_init), (mxf_metadata_parse), (mxf_metadata_resolve), (mxf_metadata_handle_tag), (mxf_metadata_class_init), (mxf_metadata_init), (mxf_metadata_init_types), (mxf_metadata_register), (mxf_metadata_new), (mxf_metadata_preface_finalize), (mxf_metadata_preface_handle_tag), (mxf_metadata_preface_resolve), (mxf_metadata_preface_init), (mxf_metadata_preface_class_init), (mxf_metadata_identification_finalize), (mxf_metadata_identification_handle_tag), (mxf_metadata_identification_init), (mxf_metadata_identification_class_init), (mxf_metadata_content_storage_finalize), (mxf_metadata_content_storage_handle_tag), (mxf_metadata_content_storage_resolve), (mxf_metadata_content_storage_init), (mxf_metadata_content_storage_class_init), (mxf_metadata_essence_container_data_handle_tag), (mxf_metadata_essence_container_data_resolve), (mxf_metadata_essence_container_data_init), (mxf_metadata_essence_container_data_class_init), (mxf_metadata_generic_package_finalize), (mxf_metadata_generic_package_handle_tag), (mxf_metadata_generic_package_resolve), (mxf_metadata_generic_package_init), (mxf_metadata_generic_package_class_init), (mxf_metadata_material_package_resolve), (mxf_metadata_material_package_init), (mxf_metadata_material_package_class_init), (mxf_metadata_source_package_finalize), (mxf_metadata_source_package_handle_tag), (mxf_metadata_source_package_resolve), (mxf_metadata_source_package_init), (mxf_metadata_source_package_class_init), (mxf_metadata_track_finalize), (mxf_metadata_track_handle_tag), (mxf_metadata_track_resolve), (mxf_metadata_track_init), (mxf_metadata_track_class_init), (mxf_metadata_track_identifier_parse), (mxf_metadata_timeline_track_handle_tag), (mxf_metadata_timeline_track_init), (mxf_metadata_timeline_track_class_init), (mxf_metadata_event_track_handle_tag), (mxf_metadata_event_track_init), (mxf_metadata_event_track_class_init), (mxf_metadata_static_track_init), (mxf_metadata_static_track_class_init), (mxf_metadata_sequence_finalize), (mxf_metadata_sequence_handle_tag), (mxf_metadata_sequence_resolve), (mxf_metadata_sequence_init), (mxf_metadata_sequence_class_init), (mxf_metadata_structural_component_handle_tag), (mxf_metadata_structural_component_init), (mxf_metadata_structural_component_class_init), (mxf_metadata_timecode_component_handle_tag), (mxf_metadata_timecode_component_init), (mxf_metadata_timecode_component_class_init), (mxf_metadata_source_clip_handle_tag), (mxf_metadata_source_clip_resolve), (mxf_metadata_source_clip_init), (mxf_metadata_source_clip_class_init), (mxf_metadata_dm_source_clip_finalize), (mxf_metadata_dm_source_clip_handle_tag), (mxf_metadata_dm_source_clip_init), (mxf_metadata_dm_source_clip_class_init), (mxf_metadata_dm_segment_finalize), (mxf_metadata_dm_segment_handle_tag), (mxf_metadata_dm_segment_resolve), (mxf_metadata_dm_segment_init), (mxf_metadata_dm_segment_class_init), (mxf_metadata_generic_descriptor_finalize), (mxf_metadata_generic_descriptor_handle_tag), (mxf_metadata_generic_descriptor_resolve), (mxf_metadata_generic_descriptor_init), (mxf_metadata_generic_descriptor_class_init), (mxf_metadata_file_descriptor_handle_tag), (mxf_metadata_file_descriptor_init), (mxf_metadata_file_descriptor_class_init), (mxf_metadata_generic_picture_essence_descriptor_handle_tag), (mxf_metadata_generic_picture_essence_descriptor_init), (mxf_metadata_generic_picture_essence_descriptor_class_init), (mxf_metadata_generic_picture_essence_descriptor_set_caps), (mxf_metadata_generic_sound_essence_descriptor_handle_tag), (mxf_metadata_generic_sound_essence_descriptor_init), (mxf_metadata_generic_sound_essence_descriptor_class_init), (mxf_metadata_cdci_picture_essence_descriptor_handle_tag), (mxf_metadata_cdci_picture_essence_descriptor_init), (mxf_metadata_cdci_picture_essence_descriptor_class_init), (mxf_metadata_rgba_picture_essence_descriptor_finalize), (mxf_metadata_rgba_picture_essence_descriptor_handle_tag), (mxf_metadata_rgba_picture_essence_descriptor_init), (mxf_metadata_rgba_picture_essence_descriptor_class_init), (mxf_metadata_generic_data_essence_descriptor_handle_tag), (mxf_metadata_generic_data_essence_descriptor_init), (mxf_metadata_generic_data_essence_descriptor_class_init), (mxf_metadata_multiple_descriptor_finalize), (mxf_metadata_multiple_descriptor_handle_tag), (mxf_metadata_multiple_descriptor_resolve), (mxf_metadata_multiple_descriptor_init), (mxf_metadata_multiple_descriptor_class_init), (mxf_metadata_locator_init), (mxf_metadata_locator_class_init), (mxf_metadata_text_locator_finalize), (mxf_metadata_text_locator_handle_tag), (mxf_metadata_text_locator_init), (mxf_metadata_text_locator_class_init), (mxf_metadata_network_locator_finalize), (mxf_metadata_network_locator_handle_tag), (mxf_metadata_network_locator_init), (mxf_metadata_network_locator_class_init): * gst/mxf/mxfmetadata.h: * gst/mxf/mxfmpeg.c: (mxf_metadata_mpeg_video_descriptor_handle_tag), (mxf_metadata_mpeg_video_descriptor_init), (mxf_metadata_mpeg_video_descriptor_class_init), (mxf_is_mpeg_essence_track), (mxf_mpeg_es_create_caps), (mxf_mpeg_create_caps), (mxf_mpeg_init): * gst/mxf/mxfmpeg.h: * gst/mxf/mxfparse.c: (mxf_index_table_segment_parse), (mxf_local_tag_add_to_hash_table): * gst/mxf/mxfparse.h: * gst/mxf/mxftypes.h: * gst/mxf/mxfup.c: (mxf_is_up_essence_track), (mxf_up_create_caps), (mxf_up_init): * gst/mxf/mxfup.h: Convert the structural metadata to GstMiniObjects to make a lot of code easier and to make everything better extensible. Add a "registry" for metadata handlers to improve extensibility even more and to remove metadata type specifics from mxfdemux. Clean up a lot of parts and add some more NULL checks.
This commit is contained in:
parent
9cfbca8754
commit
bc93b81dd5
24 changed files with 4831 additions and 4445 deletions
167
ChangeLog
167
ChangeLog
|
@ -1,3 +1,170 @@
|
|||
2008-12-15 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||
|
||||
* gst/mxf/Makefile.am:
|
||||
* gst/mxf/mxf.c: (plugin_init):
|
||||
* gst/mxf/mxfaes-bwf.c:
|
||||
(mxf_metadata_wave_audio_essence_descriptor_handle_tag),
|
||||
(mxf_metadata_wave_audio_essence_descriptor_init),
|
||||
(mxf_metadata_wave_audio_essence_descriptor_class_init),
|
||||
(mxf_metadata_aes3_audio_essence_descriptor_finalize),
|
||||
(mxf_metadata_aes3_audio_essence_descriptor_handle_tag),
|
||||
(mxf_metadata_aes3_audio_essence_descriptor_init),
|
||||
(mxf_metadata_aes3_audio_essence_descriptor_class_init),
|
||||
(mxf_is_aes_bwf_essence_track), (mxf_bwf_create_caps),
|
||||
(mxf_aes3_create_caps), (mxf_aes_bwf_create_caps),
|
||||
(mxf_aes_bwf_init):
|
||||
* gst/mxf/mxfaes-bwf.h:
|
||||
* gst/mxf/mxfalaw.c: (mxf_is_alaw_essence_track),
|
||||
(mxf_alaw_create_caps), (mxf_alaw_init):
|
||||
* gst/mxf/mxfalaw.h:
|
||||
* gst/mxf/mxfd10.c: (mxf_is_d10_essence_track),
|
||||
(mxf_d10_create_caps), (mxf_d10_init):
|
||||
* gst/mxf/mxfd10.h:
|
||||
* gst/mxf/mxfdemux.c: (gst_mxf_demux_reset_metadata),
|
||||
(gst_mxf_demux_handle_header_metadata_resolve_references),
|
||||
(gst_mxf_demux_find_package), (gst_mxf_demux_choose_package),
|
||||
(gst_mxf_demux_handle_header_metadata_update_streams),
|
||||
(gst_mxf_demux_handle_metadata),
|
||||
(gst_mxf_demux_handle_generic_container_essence_element),
|
||||
(gst_mxf_demux_handle_klv_packet), (gst_mxf_demux_src_query):
|
||||
* gst/mxf/mxfdemux.h:
|
||||
* gst/mxf/mxfdv-dif.c: (mxf_is_dv_dif_essence_track),
|
||||
(mxf_dv_dif_create_caps), (mxf_dv_dif_init):
|
||||
* gst/mxf/mxfdv-dif.h:
|
||||
* gst/mxf/mxfjpeg2000.c: (mxf_is_jpeg2000_essence_track),
|
||||
(mxf_jpeg2000_create_caps), (mxf_jpeg2000_init):
|
||||
* gst/mxf/mxfjpeg2000.h:
|
||||
* gst/mxf/mxfmetadata.c: (mxf_metadata_base_finalize),
|
||||
(mxf_metadata_base_handle_tag), (mxf_metadata_base_resolve),
|
||||
(mxf_metadata_base_init), (mxf_metadata_base_class_init),
|
||||
(mxf_metadata_parse), (mxf_metadata_resolve),
|
||||
(mxf_metadata_handle_tag), (mxf_metadata_class_init),
|
||||
(mxf_metadata_init), (mxf_metadata_init_types),
|
||||
(mxf_metadata_register), (mxf_metadata_new),
|
||||
(mxf_metadata_preface_finalize), (mxf_metadata_preface_handle_tag),
|
||||
(mxf_metadata_preface_resolve), (mxf_metadata_preface_init),
|
||||
(mxf_metadata_preface_class_init),
|
||||
(mxf_metadata_identification_finalize),
|
||||
(mxf_metadata_identification_handle_tag),
|
||||
(mxf_metadata_identification_init),
|
||||
(mxf_metadata_identification_class_init),
|
||||
(mxf_metadata_content_storage_finalize),
|
||||
(mxf_metadata_content_storage_handle_tag),
|
||||
(mxf_metadata_content_storage_resolve),
|
||||
(mxf_metadata_content_storage_init),
|
||||
(mxf_metadata_content_storage_class_init),
|
||||
(mxf_metadata_essence_container_data_handle_tag),
|
||||
(mxf_metadata_essence_container_data_resolve),
|
||||
(mxf_metadata_essence_container_data_init),
|
||||
(mxf_metadata_essence_container_data_class_init),
|
||||
(mxf_metadata_generic_package_finalize),
|
||||
(mxf_metadata_generic_package_handle_tag),
|
||||
(mxf_metadata_generic_package_resolve),
|
||||
(mxf_metadata_generic_package_init),
|
||||
(mxf_metadata_generic_package_class_init),
|
||||
(mxf_metadata_material_package_resolve),
|
||||
(mxf_metadata_material_package_init),
|
||||
(mxf_metadata_material_package_class_init),
|
||||
(mxf_metadata_source_package_finalize),
|
||||
(mxf_metadata_source_package_handle_tag),
|
||||
(mxf_metadata_source_package_resolve),
|
||||
(mxf_metadata_source_package_init),
|
||||
(mxf_metadata_source_package_class_init),
|
||||
(mxf_metadata_track_finalize), (mxf_metadata_track_handle_tag),
|
||||
(mxf_metadata_track_resolve), (mxf_metadata_track_init),
|
||||
(mxf_metadata_track_class_init),
|
||||
(mxf_metadata_track_identifier_parse),
|
||||
(mxf_metadata_timeline_track_handle_tag),
|
||||
(mxf_metadata_timeline_track_init),
|
||||
(mxf_metadata_timeline_track_class_init),
|
||||
(mxf_metadata_event_track_handle_tag),
|
||||
(mxf_metadata_event_track_init),
|
||||
(mxf_metadata_event_track_class_init),
|
||||
(mxf_metadata_static_track_init),
|
||||
(mxf_metadata_static_track_class_init),
|
||||
(mxf_metadata_sequence_finalize),
|
||||
(mxf_metadata_sequence_handle_tag),
|
||||
(mxf_metadata_sequence_resolve), (mxf_metadata_sequence_init),
|
||||
(mxf_metadata_sequence_class_init),
|
||||
(mxf_metadata_structural_component_handle_tag),
|
||||
(mxf_metadata_structural_component_init),
|
||||
(mxf_metadata_structural_component_class_init),
|
||||
(mxf_metadata_timecode_component_handle_tag),
|
||||
(mxf_metadata_timecode_component_init),
|
||||
(mxf_metadata_timecode_component_class_init),
|
||||
(mxf_metadata_source_clip_handle_tag),
|
||||
(mxf_metadata_source_clip_resolve),
|
||||
(mxf_metadata_source_clip_init),
|
||||
(mxf_metadata_source_clip_class_init),
|
||||
(mxf_metadata_dm_source_clip_finalize),
|
||||
(mxf_metadata_dm_source_clip_handle_tag),
|
||||
(mxf_metadata_dm_source_clip_init),
|
||||
(mxf_metadata_dm_source_clip_class_init),
|
||||
(mxf_metadata_dm_segment_finalize),
|
||||
(mxf_metadata_dm_segment_handle_tag),
|
||||
(mxf_metadata_dm_segment_resolve), (mxf_metadata_dm_segment_init),
|
||||
(mxf_metadata_dm_segment_class_init),
|
||||
(mxf_metadata_generic_descriptor_finalize),
|
||||
(mxf_metadata_generic_descriptor_handle_tag),
|
||||
(mxf_metadata_generic_descriptor_resolve),
|
||||
(mxf_metadata_generic_descriptor_init),
|
||||
(mxf_metadata_generic_descriptor_class_init),
|
||||
(mxf_metadata_file_descriptor_handle_tag),
|
||||
(mxf_metadata_file_descriptor_init),
|
||||
(mxf_metadata_file_descriptor_class_init),
|
||||
(mxf_metadata_generic_picture_essence_descriptor_handle_tag),
|
||||
(mxf_metadata_generic_picture_essence_descriptor_init),
|
||||
(mxf_metadata_generic_picture_essence_descriptor_class_init),
|
||||
(mxf_metadata_generic_picture_essence_descriptor_set_caps),
|
||||
(mxf_metadata_generic_sound_essence_descriptor_handle_tag),
|
||||
(mxf_metadata_generic_sound_essence_descriptor_init),
|
||||
(mxf_metadata_generic_sound_essence_descriptor_class_init),
|
||||
(mxf_metadata_cdci_picture_essence_descriptor_handle_tag),
|
||||
(mxf_metadata_cdci_picture_essence_descriptor_init),
|
||||
(mxf_metadata_cdci_picture_essence_descriptor_class_init),
|
||||
(mxf_metadata_rgba_picture_essence_descriptor_finalize),
|
||||
(mxf_metadata_rgba_picture_essence_descriptor_handle_tag),
|
||||
(mxf_metadata_rgba_picture_essence_descriptor_init),
|
||||
(mxf_metadata_rgba_picture_essence_descriptor_class_init),
|
||||
(mxf_metadata_generic_data_essence_descriptor_handle_tag),
|
||||
(mxf_metadata_generic_data_essence_descriptor_init),
|
||||
(mxf_metadata_generic_data_essence_descriptor_class_init),
|
||||
(mxf_metadata_multiple_descriptor_finalize),
|
||||
(mxf_metadata_multiple_descriptor_handle_tag),
|
||||
(mxf_metadata_multiple_descriptor_resolve),
|
||||
(mxf_metadata_multiple_descriptor_init),
|
||||
(mxf_metadata_multiple_descriptor_class_init),
|
||||
(mxf_metadata_locator_init), (mxf_metadata_locator_class_init),
|
||||
(mxf_metadata_text_locator_finalize),
|
||||
(mxf_metadata_text_locator_handle_tag),
|
||||
(mxf_metadata_text_locator_init),
|
||||
(mxf_metadata_text_locator_class_init),
|
||||
(mxf_metadata_network_locator_finalize),
|
||||
(mxf_metadata_network_locator_handle_tag),
|
||||
(mxf_metadata_network_locator_init),
|
||||
(mxf_metadata_network_locator_class_init):
|
||||
* gst/mxf/mxfmetadata.h:
|
||||
* gst/mxf/mxfmpeg.c:
|
||||
(mxf_metadata_mpeg_video_descriptor_handle_tag),
|
||||
(mxf_metadata_mpeg_video_descriptor_init),
|
||||
(mxf_metadata_mpeg_video_descriptor_class_init),
|
||||
(mxf_is_mpeg_essence_track), (mxf_mpeg_es_create_caps),
|
||||
(mxf_mpeg_create_caps), (mxf_mpeg_init):
|
||||
* gst/mxf/mxfmpeg.h:
|
||||
* gst/mxf/mxfparse.c: (mxf_index_table_segment_parse),
|
||||
(mxf_local_tag_add_to_hash_table):
|
||||
* gst/mxf/mxfparse.h:
|
||||
* gst/mxf/mxftypes.h:
|
||||
* gst/mxf/mxfup.c: (mxf_is_up_essence_track), (mxf_up_create_caps),
|
||||
(mxf_up_init):
|
||||
* gst/mxf/mxfup.h:
|
||||
Convert the structural metadata to GstMiniObjects to make a lot of
|
||||
code easier and to make everything better extensible.
|
||||
Add a "registry" for metadata handlers to improve extensibility even
|
||||
more and to remove metadata type specifics from mxfdemux.
|
||||
|
||||
Clean up a lot of parts and add some more NULL checks.
|
||||
|
||||
2008-12-15 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* ext/faac/gstfaac.c:
|
||||
|
|
|
@ -10,7 +10,8 @@ libgstmxf_la_SOURCES = \
|
|||
mxfalaw.c \
|
||||
mxfjpeg2000.c \
|
||||
mxfd10.c \
|
||||
mxfup.c
|
||||
mxfup.c \
|
||||
mxfmetadata.c
|
||||
|
||||
libgstmxf_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
|
||||
libgstmxf_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) \
|
||||
|
@ -27,5 +28,6 @@ noinst_HEADERS = \
|
|||
mxfjpeg2000.h \
|
||||
mxfd10.h \
|
||||
mxfup.h \
|
||||
mxftypes.h
|
||||
mxftypes.h \
|
||||
mxfmetadata.h
|
||||
|
||||
|
|
|
@ -23,6 +23,14 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
#include "mxfdemux.h"
|
||||
#include "mxfmetadata.h"
|
||||
#include "mxfaes-bwf.h"
|
||||
#include "mxfmpeg.h"
|
||||
#include "mxfdv-dif.h"
|
||||
#include "mxfalaw.h"
|
||||
#include "mxfjpeg2000.h"
|
||||
#include "mxfd10.h"
|
||||
#include "mxfup.h"
|
||||
|
||||
GST_DEBUG_CATEGORY (mxf_debug);
|
||||
#define GST_CAT_DEFAULT mxf_debug
|
||||
|
@ -30,6 +38,15 @@ GST_DEBUG_CATEGORY (mxf_debug);
|
|||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
mxf_metadata_init_types ();
|
||||
mxf_aes_bwf_init ();
|
||||
mxf_mpeg_init ();
|
||||
mxf_dv_dif_init ();
|
||||
mxf_alaw_init ();
|
||||
mxf_jpeg2000_init ();
|
||||
mxf_d10_init ();
|
||||
mxf_up_init ();
|
||||
|
||||
if (!gst_element_register (plugin, "mxfdemux", GST_RANK_PRIMARY,
|
||||
GST_TYPE_MXF_DEMUX))
|
||||
return FALSE;
|
||||
|
|
|
@ -41,180 +41,199 @@ GST_DEBUG_CATEGORY_EXTERN (mxf_debug);
|
|||
#define GST_CAT_DEFAULT mxf_debug
|
||||
|
||||
/* SMPTE 382M Annex 1 */
|
||||
gboolean
|
||||
mxf_metadata_wave_audio_essence_descriptor_handle_tag
|
||||
(MXFMetadataGenericDescriptor * d, const MXFPrimerPack * primer,
|
||||
guint16 tag, const guint8 * tag_data, guint16 tag_size)
|
||||
G_DEFINE_TYPE (MXFMetadataWaveAudioEssenceDescriptor,
|
||||
mxf_metadata_wave_audio_essence_descriptor,
|
||||
MXF_TYPE_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR);
|
||||
|
||||
static gboolean
|
||||
mxf_metadata_wave_audio_essence_descriptor_handle_tag (MXFMetadataBase *
|
||||
metadata, MXFPrimerPack * primer, guint16 tag, const guint8 * tag_data,
|
||||
guint tag_size)
|
||||
{
|
||||
MXFMetadataWaveAudioEssenceDescriptor *descriptor =
|
||||
(MXFMetadataWaveAudioEssenceDescriptor *) d;
|
||||
gboolean ret = FALSE;
|
||||
MXFMetadataWaveAudioEssenceDescriptor *self =
|
||||
MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR (metadata);
|
||||
gboolean ret = TRUE;
|
||||
gchar str[48];
|
||||
|
||||
switch (tag) {
|
||||
case 0x3d0a:
|
||||
if (tag_size != 2)
|
||||
goto error;
|
||||
descriptor->block_align = GST_READ_UINT16_BE (tag_data);
|
||||
GST_DEBUG (" block align = %u", descriptor->block_align);
|
||||
ret = TRUE;
|
||||
self->block_align = GST_READ_UINT16_BE (tag_data);
|
||||
GST_DEBUG (" block align = %u", self->block_align);
|
||||
break;
|
||||
case 0x3d0b:
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->sequence_offset = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" sequence offset = %u", descriptor->sequence_offset);
|
||||
ret = TRUE;
|
||||
self->sequence_offset = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" sequence offset = %u", self->sequence_offset);
|
||||
break;
|
||||
case 0x3d09:
|
||||
if (tag_size != 4)
|
||||
goto error;
|
||||
descriptor->avg_bps = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" average bps = %u", descriptor->avg_bps);
|
||||
ret = TRUE;
|
||||
self->avg_bps = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" average bps = %u", self->avg_bps);
|
||||
break;
|
||||
case 0x3d32:
|
||||
if (tag_size != 16)
|
||||
goto error;
|
||||
memcpy (&descriptor->channel_assignment, tag_data, 16);
|
||||
memcpy (&self->channel_assignment, tag_data, 16);
|
||||
GST_DEBUG (" channel assignment = %s",
|
||||
mxf_ul_to_string (&descriptor->channel_assignment, str));
|
||||
ret = TRUE;
|
||||
mxf_ul_to_string (&self->channel_assignment, str));
|
||||
break;
|
||||
case 0x3d29:
|
||||
if (tag_size != 4)
|
||||
goto error;
|
||||
descriptor->peak_envelope_version = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak envelope version = %u",
|
||||
descriptor->peak_envelope_version);
|
||||
ret = TRUE;
|
||||
self->peak_envelope_version = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak envelope version = %u", self->peak_envelope_version);
|
||||
break;
|
||||
case 0x3d2a:
|
||||
if (tag_size != 4)
|
||||
goto error;
|
||||
descriptor->peak_envelope_format = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak envelope format = %u",
|
||||
descriptor->peak_envelope_format);
|
||||
ret = TRUE;
|
||||
self->peak_envelope_format = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak envelope format = %u", self->peak_envelope_format);
|
||||
break;
|
||||
case 0x3d2b:
|
||||
if (tag_size != 4)
|
||||
goto error;
|
||||
descriptor->points_per_peak_value = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" points per peak value = %u",
|
||||
descriptor->points_per_peak_value);
|
||||
ret = TRUE;
|
||||
self->points_per_peak_value = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" points per peak value = %u", self->points_per_peak_value);
|
||||
break;
|
||||
case 0x3d2c:
|
||||
if (tag_size != 4)
|
||||
goto error;
|
||||
descriptor->peak_envelope_block_size = GST_READ_UINT32_BE (tag_data);
|
||||
self->peak_envelope_block_size = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak envelope block size = %u",
|
||||
descriptor->peak_envelope_block_size);
|
||||
ret = TRUE;
|
||||
self->peak_envelope_block_size);
|
||||
break;
|
||||
case 0x3d2d:
|
||||
if (tag_size != 4)
|
||||
goto error;
|
||||
descriptor->peak_channels = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak channels = %u", descriptor->peak_channels);
|
||||
ret = TRUE;
|
||||
self->peak_channels = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak channels = %u", self->peak_channels);
|
||||
break;
|
||||
case 0x3d2e:
|
||||
if (tag_size != 4)
|
||||
goto error;
|
||||
descriptor->peak_frames = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak frames = %u", descriptor->peak_frames);
|
||||
ret = TRUE;
|
||||
self->peak_frames = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" peak frames = %u", self->peak_frames);
|
||||
break;
|
||||
case 0x3d2f:
|
||||
if (tag_size != 8)
|
||||
goto error;
|
||||
descriptor->peak_of_peaks_position = GST_READ_UINT64_BE (tag_data);
|
||||
self->peak_of_peaks_position = GST_READ_UINT64_BE (tag_data);
|
||||
GST_DEBUG (" peak of peaks position = %" G_GINT64_FORMAT,
|
||||
descriptor->peak_of_peaks_position);
|
||||
ret = TRUE;
|
||||
self->peak_of_peaks_position);
|
||||
break;
|
||||
case 0x3d30:
|
||||
if (!mxf_timestamp_parse (&descriptor->peak_envelope_timestamp,
|
||||
if (!mxf_timestamp_parse (&self->peak_envelope_timestamp,
|
||||
tag_data, tag_size))
|
||||
goto error;
|
||||
GST_DEBUG (" peak envelope timestamp = %d/%u/%u %u:%u:%u.%u",
|
||||
descriptor->peak_envelope_timestamp.year,
|
||||
descriptor->peak_envelope_timestamp.month,
|
||||
descriptor->peak_envelope_timestamp.day,
|
||||
descriptor->peak_envelope_timestamp.hour,
|
||||
descriptor->peak_envelope_timestamp.minute,
|
||||
descriptor->peak_envelope_timestamp.second,
|
||||
(descriptor->peak_envelope_timestamp.quarter_msecond * 1000) / 256);
|
||||
ret = TRUE;
|
||||
self->peak_envelope_timestamp.year,
|
||||
self->peak_envelope_timestamp.month,
|
||||
self->peak_envelope_timestamp.day,
|
||||
self->peak_envelope_timestamp.hour,
|
||||
self->peak_envelope_timestamp.minute,
|
||||
self->peak_envelope_timestamp.second,
|
||||
(self->peak_envelope_timestamp.quarter_msecond * 1000) / 256);
|
||||
break;
|
||||
case 0x3d31:
|
||||
descriptor->peak_envelope_data = g_memdup (tag_data, tag_size);
|
||||
descriptor->peak_envelope_data_length = tag_size;
|
||||
self->peak_envelope_data = g_memdup (tag_data, tag_size);
|
||||
self->peak_envelope_data_length = tag_size;
|
||||
GST_DEBUG (" peak evelope data size = %u",
|
||||
descriptor->peak_envelope_data_length);
|
||||
ret = TRUE;
|
||||
self->peak_envelope_data_length);
|
||||
break;
|
||||
default:
|
||||
ret =
|
||||
mxf_metadata_generic_sound_essence_descriptor_handle_tag (d, primer,
|
||||
tag, tag_data, tag_size);
|
||||
MXF_METADATA_BASE_CLASS
|
||||
(mxf_metadata_wave_audio_essence_descriptor_parent_class)->
|
||||
handle_tag (metadata, primer, tag, tag_data, tag_size);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
error:
|
||||
GST_ERROR ("Invalid wave audio essence descriptor tag 0x%04x of size %u", tag,
|
||||
|
||||
GST_ERROR
|
||||
("Invalid wave audio essence descriptor local tag 0x%04x of size %u", tag,
|
||||
tag_size);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void mxf_metadata_wave_audio_essence_descriptor_reset
|
||||
(MXFMetadataWaveAudioEssenceDescriptor * descriptor)
|
||||
static void
|
||||
mxf_metadata_wave_audio_essence_descriptor_init
|
||||
(MXFMetadataWaveAudioEssenceDescriptor * self)
|
||||
{
|
||||
g_return_if_fail (descriptor != NULL);
|
||||
|
||||
mxf_metadata_generic_sound_essence_descriptor_reset (
|
||||
(MXFMetadataGenericSoundEssenceDescriptor *) descriptor);
|
||||
}
|
||||
|
||||
MXF_METADATA_DESCRIPTOR_CLEAR (descriptor,
|
||||
MXFMetadataWaveAudioEssenceDescriptor,
|
||||
MXFMetadataGenericSoundEssenceDescriptor);
|
||||
static void
|
||||
mxf_metadata_wave_audio_essence_descriptor_class_init
|
||||
(MXFMetadataWaveAudioEssenceDescriptorClass * klass)
|
||||
{
|
||||
MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass;
|
||||
|
||||
metadata_base_class->handle_tag =
|
||||
mxf_metadata_wave_audio_essence_descriptor_handle_tag;
|
||||
}
|
||||
|
||||
/* SMPTE 382M Annex 2 */
|
||||
gboolean
|
||||
mxf_metadata_aes3_audio_essence_descriptor_handle_tag
|
||||
(MXFMetadataGenericDescriptor * d, const MXFPrimerPack * primer,
|
||||
guint16 tag, const guint8 * tag_data, guint16 tag_size)
|
||||
G_DEFINE_TYPE (MXFMetadataAES3AudioEssenceDescriptor,
|
||||
mxf_metadata_aes3_audio_essence_descriptor,
|
||||
MXF_TYPE_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR);
|
||||
|
||||
static void
|
||||
mxf_metadata_aes3_audio_essence_descriptor_finalize (GstMiniObject * object)
|
||||
{
|
||||
MXFMetadataAES3AudioEssenceDescriptor *descriptor =
|
||||
(MXFMetadataAES3AudioEssenceDescriptor *) d;
|
||||
gboolean ret = FALSE;
|
||||
MXFMetadataAES3AudioEssenceDescriptor *self =
|
||||
MXF_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR (object);
|
||||
|
||||
g_free (self->channel_status_mode);
|
||||
self->channel_status_mode = NULL;
|
||||
g_free (self->fixed_channel_status_data);
|
||||
self->fixed_channel_status_data = NULL;
|
||||
g_free (self->user_data_mode);
|
||||
self->user_data_mode = NULL;
|
||||
g_free (self->fixed_user_data);
|
||||
self->fixed_user_data = NULL;
|
||||
|
||||
GST_MINI_OBJECT_CLASS
|
||||
(mxf_metadata_aes3_audio_essence_descriptor_parent_class)->
|
||||
finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
mxf_metadata_aes3_audio_essence_descriptor_handle_tag (MXFMetadataBase *
|
||||
metadata, MXFPrimerPack * primer, guint16 tag, const guint8 * tag_data,
|
||||
guint tag_size)
|
||||
{
|
||||
MXFMetadataAES3AudioEssenceDescriptor *self =
|
||||
MXF_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR (metadata);
|
||||
gboolean ret = TRUE;
|
||||
|
||||
switch (tag) {
|
||||
case 0x3d0d:
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->emphasis = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" emphasis = %u", descriptor->emphasis);
|
||||
self->emphasis = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" emphasis = %u", self->emphasis);
|
||||
ret = TRUE;
|
||||
break;
|
||||
case 0x3d0f:
|
||||
if (tag_size != 2)
|
||||
goto error;
|
||||
descriptor->block_start_offset = GST_READ_UINT16_BE (tag_data);
|
||||
GST_DEBUG (" block start offset = %u", descriptor->block_start_offset);
|
||||
self->block_start_offset = GST_READ_UINT16_BE (tag_data);
|
||||
GST_DEBUG (" block start offset = %u", self->block_start_offset);
|
||||
ret = TRUE;
|
||||
break;
|
||||
case 0x3d08:
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->auxiliary_bits_mode = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" auxiliary bits mode = %u", descriptor->auxiliary_bits_mode);
|
||||
self->auxiliary_bits_mode = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" auxiliary bits mode = %u", self->auxiliary_bits_mode);
|
||||
ret = TRUE;
|
||||
break;
|
||||
case 0x3d10:{
|
||||
|
@ -225,7 +244,7 @@ gboolean
|
|||
goto error;
|
||||
len = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" number of channel status mode = %u", len);
|
||||
descriptor->n_channel_status_mode = len;
|
||||
self->n_channel_status_mode = len;
|
||||
if (len == 0)
|
||||
return TRUE;
|
||||
|
||||
|
@ -238,12 +257,12 @@ gboolean
|
|||
if (tag_size != len)
|
||||
goto error;
|
||||
|
||||
descriptor->channel_status_mode = g_new0 (guint8, len);
|
||||
self->channel_status_mode = g_new0 (guint8, len);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
descriptor->channel_status_mode[i] = GST_READ_UINT8 (tag_data);
|
||||
self->channel_status_mode[i] = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" channel status mode %u = %u", i,
|
||||
descriptor->channel_status_mode[i]);
|
||||
self->channel_status_mode[i]);
|
||||
tag_data++;
|
||||
tag_size--;
|
||||
}
|
||||
|
@ -259,7 +278,7 @@ gboolean
|
|||
goto error;
|
||||
len = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" number of fixed channel status data = %u", len);
|
||||
descriptor->n_fixed_channel_status_data = len;
|
||||
self->n_fixed_channel_status_data = len;
|
||||
if (len == 0)
|
||||
return TRUE;
|
||||
|
||||
|
@ -272,41 +291,41 @@ gboolean
|
|||
if (tag_size != len * 24)
|
||||
goto error;
|
||||
|
||||
descriptor->fixed_channel_status_data =
|
||||
self->fixed_channel_status_data =
|
||||
g_malloc0 (len * sizeof (guint8 *) + len * 24);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
descriptor->fixed_channel_status_data[i] =
|
||||
((guint8 *) descriptor->fixed_channel_status_data) +
|
||||
self->fixed_channel_status_data[i] =
|
||||
((guint8 *) self->fixed_channel_status_data) +
|
||||
len * sizeof (guint8 *) + i * 24;
|
||||
|
||||
memcpy (descriptor->fixed_channel_status_data[i], tag_data, 24);
|
||||
memcpy (self->fixed_channel_status_data[i], tag_data, 24);
|
||||
GST_DEBUG
|
||||
(" fixed channel status data %u = 0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x",
|
||||
i, descriptor->fixed_channel_status_data[i][0],
|
||||
descriptor->fixed_channel_status_data[i][1],
|
||||
descriptor->fixed_channel_status_data[i][2],
|
||||
descriptor->fixed_channel_status_data[i][3],
|
||||
descriptor->fixed_channel_status_data[i][4],
|
||||
descriptor->fixed_channel_status_data[i][5],
|
||||
descriptor->fixed_channel_status_data[i][6],
|
||||
descriptor->fixed_channel_status_data[i][7],
|
||||
descriptor->fixed_channel_status_data[i][8],
|
||||
descriptor->fixed_channel_status_data[i][9],
|
||||
descriptor->fixed_channel_status_data[i][10],
|
||||
descriptor->fixed_channel_status_data[i][11],
|
||||
descriptor->fixed_channel_status_data[i][12],
|
||||
descriptor->fixed_channel_status_data[i][13],
|
||||
descriptor->fixed_channel_status_data[i][14],
|
||||
descriptor->fixed_channel_status_data[i][15],
|
||||
descriptor->fixed_channel_status_data[i][16],
|
||||
descriptor->fixed_channel_status_data[i][17],
|
||||
descriptor->fixed_channel_status_data[i][18],
|
||||
descriptor->fixed_channel_status_data[i][19],
|
||||
descriptor->fixed_channel_status_data[i][20],
|
||||
descriptor->fixed_channel_status_data[i][21],
|
||||
descriptor->fixed_channel_status_data[i][22],
|
||||
descriptor->fixed_channel_status_data[i][23]
|
||||
i, self->fixed_channel_status_data[i][0],
|
||||
self->fixed_channel_status_data[i][1],
|
||||
self->fixed_channel_status_data[i][2],
|
||||
self->fixed_channel_status_data[i][3],
|
||||
self->fixed_channel_status_data[i][4],
|
||||
self->fixed_channel_status_data[i][5],
|
||||
self->fixed_channel_status_data[i][6],
|
||||
self->fixed_channel_status_data[i][7],
|
||||
self->fixed_channel_status_data[i][8],
|
||||
self->fixed_channel_status_data[i][9],
|
||||
self->fixed_channel_status_data[i][10],
|
||||
self->fixed_channel_status_data[i][11],
|
||||
self->fixed_channel_status_data[i][12],
|
||||
self->fixed_channel_status_data[i][13],
|
||||
self->fixed_channel_status_data[i][14],
|
||||
self->fixed_channel_status_data[i][15],
|
||||
self->fixed_channel_status_data[i][16],
|
||||
self->fixed_channel_status_data[i][17],
|
||||
self->fixed_channel_status_data[i][18],
|
||||
self->fixed_channel_status_data[i][19],
|
||||
self->fixed_channel_status_data[i][20],
|
||||
self->fixed_channel_status_data[i][21],
|
||||
self->fixed_channel_status_data[i][22],
|
||||
self->fixed_channel_status_data[i][23]
|
||||
);
|
||||
tag_data += 24;
|
||||
tag_size -= 24;
|
||||
|
@ -323,7 +342,7 @@ gboolean
|
|||
goto error;
|
||||
len = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" number of user data mode = %u", len);
|
||||
descriptor->n_user_data_mode = len;
|
||||
self->n_user_data_mode = len;
|
||||
if (len == 0)
|
||||
return TRUE;
|
||||
|
||||
|
@ -336,12 +355,11 @@ gboolean
|
|||
if (tag_size != len)
|
||||
goto error;
|
||||
|
||||
descriptor->user_data_mode = g_new0 (guint8, len);
|
||||
self->user_data_mode = g_new0 (guint8, len);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
descriptor->user_data_mode[i] = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" user data mode %u = %u", i,
|
||||
descriptor->user_data_mode[i]);
|
||||
self->user_data_mode[i] = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" user data mode %u = %u", i, self->user_data_mode[i]);
|
||||
tag_data++;
|
||||
tag_size--;
|
||||
}
|
||||
|
@ -357,7 +375,7 @@ gboolean
|
|||
goto error;
|
||||
len = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" number of fixed user data = %u", len);
|
||||
descriptor->n_fixed_user_data = len;
|
||||
self->n_fixed_user_data = len;
|
||||
if (len == 0)
|
||||
return TRUE;
|
||||
|
||||
|
@ -370,41 +388,39 @@ gboolean
|
|||
if (tag_size != len * 24)
|
||||
goto error;
|
||||
|
||||
descriptor->fixed_user_data =
|
||||
g_malloc0 (len * sizeof (guint8 *) + len * 24);
|
||||
self->fixed_user_data = g_malloc0 (len * sizeof (guint8 *) + len * 24);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
descriptor->fixed_user_data[i] =
|
||||
((guint8 *) descriptor->fixed_user_data) + len * sizeof (guint8 *) +
|
||||
self->fixed_user_data[i] =
|
||||
((guint8 *) self->fixed_user_data) + len * sizeof (guint8 *) +
|
||||
i * 24;
|
||||
|
||||
memcpy (descriptor->fixed_user_data[i], tag_data, 24);
|
||||
memcpy (self->fixed_user_data[i], tag_data, 24);
|
||||
GST_DEBUG
|
||||
(" fixed user data %u = 0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x.0x%02x",
|
||||
i, descriptor->fixed_user_data[i][0],
|
||||
descriptor->fixed_user_data[i][1],
|
||||
descriptor->fixed_user_data[i][2],
|
||||
descriptor->fixed_user_data[i][3],
|
||||
descriptor->fixed_user_data[i][4],
|
||||
descriptor->fixed_user_data[i][5],
|
||||
descriptor->fixed_user_data[i][6],
|
||||
descriptor->fixed_user_data[i][7],
|
||||
descriptor->fixed_user_data[i][8],
|
||||
descriptor->fixed_user_data[i][9],
|
||||
descriptor->fixed_user_data[i][10],
|
||||
descriptor->fixed_user_data[i][11],
|
||||
descriptor->fixed_user_data[i][12],
|
||||
descriptor->fixed_user_data[i][13],
|
||||
descriptor->fixed_user_data[i][14],
|
||||
descriptor->fixed_user_data[i][15],
|
||||
descriptor->fixed_user_data[i][16],
|
||||
descriptor->fixed_user_data[i][17],
|
||||
descriptor->fixed_user_data[i][18],
|
||||
descriptor->fixed_user_data[i][19],
|
||||
descriptor->fixed_user_data[i][20],
|
||||
descriptor->fixed_user_data[i][21],
|
||||
descriptor->fixed_user_data[i][22],
|
||||
descriptor->fixed_user_data[i][23]
|
||||
i, self->fixed_user_data[i][0],
|
||||
self->fixed_user_data[i][1],
|
||||
self->fixed_user_data[i][2],
|
||||
self->fixed_user_data[i][3],
|
||||
self->fixed_user_data[i][4],
|
||||
self->fixed_user_data[i][5],
|
||||
self->fixed_user_data[i][6],
|
||||
self->fixed_user_data[i][7],
|
||||
self->fixed_user_data[i][8],
|
||||
self->fixed_user_data[i][9],
|
||||
self->fixed_user_data[i][10],
|
||||
self->fixed_user_data[i][11],
|
||||
self->fixed_user_data[i][12],
|
||||
self->fixed_user_data[i][13],
|
||||
self->fixed_user_data[i][14],
|
||||
self->fixed_user_data[i][15],
|
||||
self->fixed_user_data[i][16],
|
||||
self->fixed_user_data[i][17],
|
||||
self->fixed_user_data[i][18],
|
||||
self->fixed_user_data[i][19],
|
||||
self->fixed_user_data[i][20],
|
||||
self->fixed_user_data[i][21],
|
||||
self->fixed_user_data[i][22], self->fixed_user_data[i][23]
|
||||
);
|
||||
tag_data += 24;
|
||||
tag_size -= 24;
|
||||
|
@ -417,39 +433,42 @@ gboolean
|
|||
* SMPTE 382M Annex 2 */
|
||||
default:
|
||||
ret =
|
||||
mxf_metadata_wave_audio_essence_descriptor_handle_tag (d, primer,
|
||||
tag, tag_data, tag_size);
|
||||
MXF_METADATA_BASE_CLASS
|
||||
(mxf_metadata_aes3_audio_essence_descriptor_parent_class)->
|
||||
handle_tag (metadata, primer, tag, tag_data, tag_size);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
error:
|
||||
GST_ERROR ("Invalid AES3 audio essence descriptor tag 0x%04x of size %u", tag,
|
||||
|
||||
GST_ERROR
|
||||
("Invalid AES3 audio essence descriptor local tag 0x%04x of size %u", tag,
|
||||
tag_size);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void mxf_metadata_aes3_audio_essence_descriptor_reset
|
||||
(MXFMetadataAES3AudioEssenceDescriptor * descriptor)
|
||||
static void
|
||||
mxf_metadata_aes3_audio_essence_descriptor_init
|
||||
(MXFMetadataAES3AudioEssenceDescriptor * self)
|
||||
{
|
||||
g_return_if_fail (descriptor != NULL);
|
||||
|
||||
mxf_metadata_wave_audio_essence_descriptor_reset (
|
||||
(MXFMetadataWaveAudioEssenceDescriptor *) descriptor);
|
||||
|
||||
g_free (descriptor->channel_status_mode);
|
||||
g_free (descriptor->fixed_channel_status_data);
|
||||
g_free (descriptor->user_data_mode);
|
||||
g_free (descriptor->fixed_user_data);
|
||||
|
||||
MXF_METADATA_DESCRIPTOR_CLEAR (descriptor,
|
||||
MXFMetadataAES3AudioEssenceDescriptor,
|
||||
MXFMetadataWaveAudioEssenceDescriptor);
|
||||
}
|
||||
|
||||
static void
|
||||
mxf_metadata_aes3_audio_essence_descriptor_class_init
|
||||
(MXFMetadataAES3AudioEssenceDescriptorClass * klass)
|
||||
{
|
||||
MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass;
|
||||
GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass;
|
||||
|
||||
miniobject_class->finalize =
|
||||
mxf_metadata_aes3_audio_essence_descriptor_finalize;
|
||||
metadata_base_class->handle_tag =
|
||||
mxf_metadata_aes3_audio_essence_descriptor_handle_tag;
|
||||
}
|
||||
|
||||
gboolean
|
||||
mxf_is_aes_bwf_essence_track (const MXFMetadataTrack * track)
|
||||
|
@ -465,7 +484,12 @@ mxf_is_aes_bwf_essence_track (const MXFMetadataTrack * track)
|
|||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
MXFMetadataFileDescriptor *d = track->descriptor[i];
|
||||
MXFUL *key = &d->essence_container;
|
||||
MXFUL *key;
|
||||
|
||||
if (!d)
|
||||
continue;
|
||||
|
||||
key = &d->essence_container;
|
||||
/* SMPTE 382M 9 */
|
||||
if (mxf_is_generic_container_essence_container_label (key) &&
|
||||
key->u[12] == 0x02 &&
|
||||
|
@ -548,8 +572,7 @@ mxf_bwf_create_caps (MXFMetadataGenericPackage * package,
|
|||
gchar str[48];
|
||||
gchar *codec_name = NULL;
|
||||
|
||||
if (((MXFMetadataGenericDescriptor *) descriptor)->type ==
|
||||
MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR)
|
||||
if (MXF_IS_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR (descriptor))
|
||||
wa_descriptor = (MXFMetadataWaveAudioEssenceDescriptor *) descriptor;
|
||||
|
||||
/* TODO: Handle width=!depth, needs shifting of samples */
|
||||
|
@ -666,10 +689,7 @@ mxf_aes3_create_caps (MXFMetadataGenericPackage * package,
|
|||
gchar *codec_name = NULL;
|
||||
guint block_align;
|
||||
|
||||
if (((MXFMetadataGenericDescriptor *) descriptor)->type ==
|
||||
MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) descriptor)->type ==
|
||||
MXF_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR)
|
||||
if (MXF_IS_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR (descriptor))
|
||||
wa_descriptor = (MXFMetadataWaveAudioEssenceDescriptor *) descriptor;
|
||||
|
||||
/* FIXME: set a channel layout */
|
||||
|
@ -731,22 +751,18 @@ mxf_aes_bwf_create_caps (MXFMetadataGenericPackage * package,
|
|||
}
|
||||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
if ((track->descriptor[i]->parent.type ==
|
||||
MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR
|
||||
|| track->descriptor[i]->parent.type ==
|
||||
MXF_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR)
|
||||
if (!track->descriptor[i])
|
||||
continue;
|
||||
|
||||
if (MXF_IS_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (track->descriptor[i])
|
||||
&& (track->descriptor[i]->essence_container.u[14] == 0x01
|
||||
|| track->descriptor[i]->essence_container.u[14] == 0x02
|
||||
|| track->descriptor[i]->essence_container.u[14] == 0x08)) {
|
||||
s = (MXFMetadataGenericSoundEssenceDescriptor *) track->descriptor[i];
|
||||
bwf = TRUE;
|
||||
break;
|
||||
} else if ((track->descriptor[i]->parent.type ==
|
||||
MXF_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR
|
||||
|| track->descriptor[i]->parent.type ==
|
||||
MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR
|
||||
|| track->descriptor[i]->parent.type ==
|
||||
MXF_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR)
|
||||
} else if (MXF_IS_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (track->
|
||||
descriptor[i])
|
||||
&& (track->descriptor[i]->essence_container.u[14] == 0x03
|
||||
|| track->descriptor[i]->essence_container.u[14] == 0x04
|
||||
|| track->descriptor[i]->essence_container.u[14] == 0x09)) {
|
||||
|
@ -769,3 +785,12 @@ mxf_aes_bwf_create_caps (MXFMetadataGenericPackage * package,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
mxf_aes_bwf_init (void)
|
||||
{
|
||||
mxf_metadata_register (0x0148,
|
||||
MXF_TYPE_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR);
|
||||
mxf_metadata_register (0x0147,
|
||||
MXF_TYPE_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR);
|
||||
}
|
||||
|
|
|
@ -27,14 +27,20 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
#include "mxfparse.h"
|
||||
#include "mxfmetadata.h"
|
||||
|
||||
/* SMPTE 382M Annex 1 */
|
||||
#define MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR 0x0148
|
||||
/* SMPTE 382M Annex 2 */
|
||||
#define MXF_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR 0x0147
|
||||
#define MXF_TYPE_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR \
|
||||
(mxf_metadata_wave_audio_essence_descriptor_get_type())
|
||||
#define MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR, MXFMetadataWaveAudioEssenceDescriptor))
|
||||
#define MXF_IS_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataWaveAudioEssenceDescriptor MXFMetadataWaveAudioEssenceDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataWaveAudioEssenceDescriptorClass;
|
||||
GType mxf_metadata_wave_audio_essence_descriptor_get_type (void);
|
||||
|
||||
/* SMPTE 382M Annex 1 */
|
||||
typedef struct {
|
||||
struct _MXFMetadataWaveAudioEssenceDescriptor {
|
||||
MXFMetadataGenericSoundEssenceDescriptor parent;
|
||||
|
||||
guint16 block_align;
|
||||
|
@ -55,10 +61,20 @@ typedef struct {
|
|||
|
||||
guint8 *peak_envelope_data;
|
||||
guint16 peak_envelope_data_length;
|
||||
} MXFMetadataWaveAudioEssenceDescriptor;
|
||||
};
|
||||
|
||||
/* SMPTE 382M Annex 2 */
|
||||
typedef struct {
|
||||
#define MXF_TYPE_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR \
|
||||
(mxf_metadata_aes3_audio_essence_descriptor_get_type())
|
||||
#define MXF_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR, MXFMetadataAES3AudioEssenceDescriptor))
|
||||
#define MXF_IS_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataAES3AudioEssenceDescriptor MXFMetadataAES3AudioEssenceDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataAES3AudioEssenceDescriptorClass;
|
||||
GType mxf_metadata_aes3_audio_essence_descriptor_get_type (void);
|
||||
|
||||
struct _MXFMetadataAES3AudioEssenceDescriptor {
|
||||
MXFMetadataWaveAudioEssenceDescriptor parent;
|
||||
|
||||
guint8 emphasis;
|
||||
|
@ -79,19 +95,13 @@ typedef struct {
|
|||
|
||||
guint32 linked_timecode_track_id;
|
||||
guint8 stream_number;
|
||||
} MXFMetadataAES3AudioEssenceDescriptor;
|
||||
|
||||
gboolean mxf_metadata_wave_audio_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_wave_audio_essence_descriptor_reset (MXFMetadataWaveAudioEssenceDescriptor *descriptor);
|
||||
|
||||
gboolean mxf_metadata_aes3_audio_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_aes3_audio_essence_descriptor_reset (MXFMetadataAES3AudioEssenceDescriptor *descriptor);
|
||||
};
|
||||
|
||||
gboolean mxf_is_aes_bwf_essence_track (const MXFMetadataTrack *track);
|
||||
|
||||
GstCaps *
|
||||
mxf_aes_bwf_create_caps (MXFMetadataGenericPackage *package, MXFMetadataTrack *track, GstTagList **tags, MXFEssenceElementHandler *handler, gpointer *mapping_data);
|
||||
|
||||
void mxf_aes_bwf_init (void);
|
||||
|
||||
#endif /* __MXF_AES_BWF_H__ */
|
||||
|
|
|
@ -45,7 +45,12 @@ mxf_is_alaw_essence_track (const MXFMetadataTrack * track)
|
|||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
MXFMetadataFileDescriptor *d = track->descriptor[i];
|
||||
MXFUL *key = &d->essence_container;
|
||||
MXFUL *key;
|
||||
|
||||
if (!d)
|
||||
continue;
|
||||
|
||||
key = &d->essence_container;
|
||||
/* SMPTE 388M 6.1 */
|
||||
if (mxf_is_generic_container_essence_container_label (key) &&
|
||||
key->u[12] == 0x02 && key->u[13] == 0x0a &&
|
||||
|
@ -93,8 +98,10 @@ mxf_alaw_create_caps (MXFMetadataGenericPackage * package,
|
|||
}
|
||||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR) {
|
||||
if (!track->descriptor[i])
|
||||
continue;
|
||||
|
||||
if (MXF_IS_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (track->descriptor[i])) {
|
||||
s = (MXFMetadataGenericSoundEssenceDescriptor *) track->descriptor[i];
|
||||
break;
|
||||
}
|
||||
|
@ -127,3 +134,8 @@ mxf_alaw_create_caps (MXFMetadataGenericPackage * package,
|
|||
|
||||
return caps;
|
||||
}
|
||||
|
||||
void
|
||||
mxf_alaw_init (void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,4 +33,6 @@ gboolean mxf_is_alaw_essence_track (const MXFMetadataTrack *track);
|
|||
GstCaps *
|
||||
mxf_alaw_create_caps (MXFMetadataGenericPackage *package, MXFMetadataTrack *track, GstTagList **tags, MXFEssenceElementHandler *handler, gpointer *mapping_data);
|
||||
|
||||
void mxf_alaw_init (void);
|
||||
|
||||
#endif /* __MXF_ALAW_H__ */
|
||||
|
|
|
@ -52,7 +52,12 @@ mxf_is_d10_essence_track (const MXFMetadataTrack * track)
|
|||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
MXFMetadataFileDescriptor *d = track->descriptor[i];
|
||||
MXFUL *key = &d->essence_container;
|
||||
MXFUL *key;
|
||||
|
||||
if (!d)
|
||||
continue;
|
||||
|
||||
key = &d->essence_container;
|
||||
/* SMPTE 386M 5.1 */
|
||||
if (mxf_is_generic_container_essence_container_label (key) &&
|
||||
key->u[12] == 0x02 && key->u[13] == 0x01 &&
|
||||
|
@ -167,20 +172,15 @@ mxf_d10_create_caps (MXFMetadataGenericPackage * package,
|
|||
}
|
||||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_MPEG_VIDEO_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR) {
|
||||
if (!track->descriptor[i])
|
||||
continue;
|
||||
|
||||
if (MXF_IS_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (track->
|
||||
descriptor[i])) {
|
||||
p = (MXFMetadataGenericPictureEssenceDescriptor *) track->descriptor[i];
|
||||
break;
|
||||
} else if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR) {
|
||||
} else if (MXF_IS_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (track->
|
||||
descriptor[i])) {
|
||||
s = (MXFMetadataGenericSoundEssenceDescriptor *) track->descriptor[i];
|
||||
break;
|
||||
}
|
||||
|
@ -242,3 +242,8 @@ mxf_d10_create_caps (MXFMetadataGenericPackage * package,
|
|||
|
||||
return caps;
|
||||
}
|
||||
|
||||
void
|
||||
mxf_d10_init (void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,4 +33,6 @@ gboolean mxf_is_d10_essence_track (const MXFMetadataTrack *track);
|
|||
GstCaps *
|
||||
mxf_d10_create_caps (MXFMetadataGenericPackage *package, MXFMetadataTrack *track, GstTagList **tags, MXFEssenceElementHandler *handler, gpointer *mapping_data);
|
||||
|
||||
void mxf_d10_init (void);
|
||||
|
||||
#endif /* __MXF_D10_H__ */
|
||||
|
|
1638
gst/mxf/mxfdemux.c
1638
gst/mxf/mxfdemux.c
File diff suppressed because it is too large
Load diff
|
@ -23,7 +23,9 @@
|
|||
#include <gst/gst.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
|
||||
#include "mxftypes.h"
|
||||
#include "mxfparse.h"
|
||||
#include "mxfmetadata.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define GST_TYPE_MXF_DEMUX \
|
||||
|
@ -75,31 +77,9 @@ struct _GstMXFDemux
|
|||
gboolean pull_footer_metadata;
|
||||
|
||||
gboolean metadata_resolved;
|
||||
MXFMetadataPreface preface;
|
||||
GArray *identification;
|
||||
MXFMetadataContentStorage content_storage;
|
||||
GArray *essence_container_data;
|
||||
GArray *material_package;
|
||||
GArray *source_package;
|
||||
GPtrArray *package;
|
||||
GArray *track;
|
||||
GArray *sequence;
|
||||
GArray *structural_component;
|
||||
GArray *locator;
|
||||
MXFMetadataPreface *preface;
|
||||
GPtrArray *metadata;
|
||||
|
||||
GPtrArray *descriptor;
|
||||
GArray *generic_descriptor;
|
||||
GArray *file_descriptor;
|
||||
GArray *generic_sound_essence_descriptor;
|
||||
GArray *generic_picture_essence_descriptor;
|
||||
GArray *generic_data_essence_descriptor;
|
||||
GArray *cdci_picture_essence_descriptor;
|
||||
GArray *rgba_picture_essence_descriptor;
|
||||
GArray *mpeg_video_descriptor;
|
||||
GArray *wave_audio_essence_descriptor;
|
||||
GArray *aes3_audio_essence_descriptor;
|
||||
GArray *multiple_descriptor;
|
||||
|
||||
MXFUMID current_package_uid;
|
||||
MXFMetadataGenericPackage *current_package;
|
||||
gchar *current_package_string;
|
||||
|
|
|
@ -51,7 +51,12 @@ mxf_is_dv_dif_essence_track (const MXFMetadataTrack * track)
|
|||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
MXFMetadataFileDescriptor *d = track->descriptor[i];
|
||||
MXFUL *key = &d->essence_container;
|
||||
MXFUL *key;
|
||||
|
||||
if (!d)
|
||||
continue;
|
||||
|
||||
key = &d->essence_container;
|
||||
/* SMPTE 383M 8 */
|
||||
if (mxf_is_generic_container_essence_container_label (key) &&
|
||||
key->u[12] == 0x02 && key->u[13] == 0x02)
|
||||
|
@ -97,10 +102,11 @@ mxf_dv_dif_create_caps (MXFMetadataGenericPackage * package,
|
|||
}
|
||||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->
|
||||
is_file_descriptor
|
||||
&& ((MXFMetadataGenericDescriptor *) track->descriptor[i])->type !=
|
||||
MXF_METADATA_MULTIPLE_DESCRIPTOR) {
|
||||
if (!track->descriptor[i])
|
||||
continue;
|
||||
|
||||
if (MXF_IS_METADATA_FILE_DESCRIPTOR (track->descriptor[i]) &&
|
||||
!MXF_IS_METADATA_MULTIPLE_DESCRIPTOR (track->descriptor[i])) {
|
||||
f = track->descriptor[i];
|
||||
}
|
||||
}
|
||||
|
@ -131,3 +137,9 @@ mxf_dv_dif_create_caps (MXFMetadataGenericPackage * package,
|
|||
|
||||
return caps;
|
||||
}
|
||||
|
||||
void
|
||||
mxf_dv_dif_init (void)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -33,4 +33,6 @@ gboolean mxf_is_dv_dif_essence_track (const MXFMetadataTrack *track);
|
|||
GstCaps *
|
||||
mxf_dv_dif_create_caps (MXFMetadataGenericPackage *package, MXFMetadataTrack *track, GstTagList **tags, MXFEssenceElementHandler *handler, gpointer *mapping_data);
|
||||
|
||||
void mxf_dv_dif_init (void);
|
||||
|
||||
#endif /* __MXF_DV_DIF_H__ */
|
||||
|
|
|
@ -50,7 +50,12 @@ mxf_is_jpeg2000_essence_track (const MXFMetadataTrack * track)
|
|||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
MXFMetadataFileDescriptor *d = track->descriptor[i];
|
||||
MXFUL *key = &d->essence_container;
|
||||
MXFUL *key;
|
||||
|
||||
if (!d)
|
||||
continue;
|
||||
|
||||
key = &d->essence_container;
|
||||
/* SMPTE 422M 5.4 */
|
||||
if (mxf_is_generic_container_essence_container_label (key) &&
|
||||
key->u[12] == 0x02 && key->u[13] == 0x0c &&
|
||||
|
@ -99,19 +104,16 @@ mxf_jpeg2000_create_caps (MXFMetadataGenericPackage * package,
|
|||
}
|
||||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR) {
|
||||
if (!track->descriptor[i])
|
||||
continue;
|
||||
|
||||
if (MXF_IS_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (track->
|
||||
descriptor[i])) {
|
||||
p = (MXFMetadataGenericPictureEssenceDescriptor *) track->descriptor[i];
|
||||
f = track->descriptor[i];
|
||||
break;
|
||||
} else if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->
|
||||
is_file_descriptor
|
||||
&& ((MXFMetadataGenericDescriptor *) track->descriptor[i])->type !=
|
||||
MXF_METADATA_MULTIPLE_DESCRIPTOR) {
|
||||
} else if (MXF_IS_METADATA_FILE_DESCRIPTOR (track->descriptor[i]) &&
|
||||
!MXF_IS_METADATA_MULTIPLE_DESCRIPTOR (track->descriptor[i])) {
|
||||
f = track->descriptor[i];
|
||||
}
|
||||
}
|
||||
|
@ -122,13 +124,9 @@ mxf_jpeg2000_create_caps (MXFMetadataGenericPackage * package,
|
|||
}
|
||||
|
||||
fourcc = GST_MAKE_FOURCC ('s', 'R', 'G', 'B');
|
||||
if (p
|
||||
&& ((MXFMetadataGenericDescriptor *) p)->type ==
|
||||
MXF_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR) {
|
||||
if (p && MXF_IS_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR (p)) {
|
||||
fourcc = GST_MAKE_FOURCC ('s', 'Y', 'U', 'V');
|
||||
} else if (p
|
||||
&& ((MXFMetadataGenericDescriptor *) p)->type ==
|
||||
MXF_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR) {
|
||||
} else if (p && MXF_IS_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR (p)) {
|
||||
MXFMetadataRGBAPictureEssenceDescriptor *r =
|
||||
(MXFMetadataRGBAPictureEssenceDescriptor *) p;
|
||||
gboolean rgb = TRUE;
|
||||
|
@ -199,3 +197,8 @@ mxf_jpeg2000_create_caps (MXFMetadataGenericPackage * package,
|
|||
|
||||
return caps;
|
||||
}
|
||||
|
||||
void
|
||||
mxf_jpeg2000_init (void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,4 +33,6 @@ gboolean mxf_is_jpeg2000_essence_track (const MXFMetadataTrack *track);
|
|||
GstCaps *
|
||||
mxf_jpeg2000_create_caps (MXFMetadataGenericPackage *package, MXFMetadataTrack *track, GstTagList **tags, MXFEssenceElementHandler *handler, gpointer *mapping_data);
|
||||
|
||||
void mxf_jpeg2000_init (void);
|
||||
|
||||
#endif /* __MXF_JPEG2000_H__ */
|
||||
|
|
3306
gst/mxf/mxfmetadata.c
Normal file
3306
gst/mxf/mxfmetadata.c
Normal file
File diff suppressed because it is too large
Load diff
703
gst/mxf/mxfmetadata.h
Normal file
703
gst/mxf/mxfmetadata.h
Normal file
|
@ -0,0 +1,703 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) 2008 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* Handling of MXF structural metadata */
|
||||
|
||||
#ifndef __MXF_METADATA_H__
|
||||
#define __MXF_METADATA_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "mxftypes.h"
|
||||
|
||||
#define MXF_TYPE_METADATA_BASE \
|
||||
(mxf_metadata_base_get_type())
|
||||
#define MXF_METADATA_BASE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_BASE, MXFMetadataBase))
|
||||
#define MXF_IS_METADATA_BASE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_BASE))
|
||||
#define MXF_METADATA_BASE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), MXF_TYPE_METADATA_BASE, MXFMetadataBaseClass))
|
||||
#define MXF_METADATA_BASE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),MXF_TYPE_METADATA_BASE,MXFMetadataBaseClass))
|
||||
typedef struct _MXFMetadataBase MXFMetadataBase;
|
||||
typedef struct _MXFMetadataBaseClass MXFMetadataBaseClass;
|
||||
GType mxf_metadata_base_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA \
|
||||
(mxf_metadata_get_type())
|
||||
#define MXF_METADATA(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA, MXFMetadata))
|
||||
#define MXF_IS_METADATA(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA))
|
||||
#define MXF_METADATA_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), MXF_TYPE_METADATA, MXFMetadataClass))
|
||||
#define MXF_METADATA_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),MXF_TYPE_METADATA,MXFMetadataClass))
|
||||
typedef struct _MXFMetadata MXFMetadata;
|
||||
typedef MXFMetadataBaseClass MXFMetadataClass;
|
||||
GType mxf_metadata_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_PREFACE \
|
||||
(mxf_metadata_preface_get_type())
|
||||
#define MXF_METADATA_PREFACE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_PREFACE,MXFMetadataPreface))
|
||||
#define MXF_IS_METADATA_PREFACE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_PREFACE))
|
||||
typedef struct _MXFMetadataPreface MXFMetadataPreface;
|
||||
typedef MXFMetadataBaseClass MXFMetadataPrefaceClass;
|
||||
GType mxf_metadata_preface_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_IDENTIFICATION \
|
||||
(mxf_metadata_identification_get_type())
|
||||
#define MXF_METADATA_IDENTIFICATION(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_IDENTIFICATION,MXFMetadataIdentification))
|
||||
#define MXF_IS_METADATA_IDENTIFICATION(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_IDENTIFICATION))
|
||||
typedef struct _MXFMetadataIdentification MXFMetadataIdentification;
|
||||
typedef MXFMetadataBaseClass MXFMetadataIdentificationClass;
|
||||
GType mxf_metadata_identification_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_CONTENT_STORAGE \
|
||||
(mxf_metadata_content_storage_get_type())
|
||||
#define MXF_METADATA_CONTENT_STORAGE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_CONTENT_STORAGE, MXFMetadataContentStorage))
|
||||
#define MXF_IS_METADATA_CONTENT_STORAGE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_CONTENT_STORAGE))
|
||||
typedef struct _MXFMetadataContentStorage MXFMetadataContentStorage;
|
||||
typedef MXFMetadataBaseClass MXFMetadataContentStorageClass;
|
||||
GType mxf_metadata_content_storage_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_ESSENCE_CONTAINER_DATA \
|
||||
(mxf_metadata_essence_container_data_get_type())
|
||||
#define MXF_METADATA_ESSENCE_CONTAINER_DATA(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_ESSENCE_CONTAINER_DATA, MXFMetadataEssenceContainerData))
|
||||
#define MXF_IS_METADATA_ESSENCE_CONTAINER_DATA(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_ESSENCE_CONTAINER_DATA))
|
||||
typedef struct _MXFMetadataEssenceContainerData MXFMetadataEssenceContainerData;
|
||||
typedef MXFMetadataBaseClass MXFMetadataEssenceContainerDataClass;
|
||||
GType mxf_metadata_essence_container_data_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_GENERIC_PACKAGE \
|
||||
(mxf_metadata_generic_package_get_type())
|
||||
#define MXF_METADATA_GENERIC_PACKAGE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_GENERIC_PACKAGE, MXFMetadataGenericPackage))
|
||||
#define MXF_IS_METADATA_GENERIC_PACKAGE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_GENERIC_PACKAGE))
|
||||
typedef struct _MXFMetadataGenericPackage MXFMetadataGenericPackage;
|
||||
typedef MXFMetadataBaseClass MXFMetadataGenericPackageClass;
|
||||
GType mxf_metadata_generic_package_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_MATERIAL_PACKAGE \
|
||||
(mxf_metadata_material_package_get_type())
|
||||
#define MXF_METADATA_MATERIAL_PACKAGE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_MATERIAL_PACKAGE, MXFMetadataMaterialPackage))
|
||||
#define MXF_IS_METADATA_MATERIAL_PACKAGE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_MATERIAL_PACKAGE))
|
||||
typedef MXFMetadataGenericPackage MXFMetadataMaterialPackage;
|
||||
typedef MXFMetadataBaseClass MXFMetadataMaterialPackageClass;
|
||||
GType mxf_metadata_material_package_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_SOURCE_PACKAGE \
|
||||
(mxf_metadata_source_package_get_type())
|
||||
#define MXF_METADATA_SOURCE_PACKAGE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_SOURCE_PACKAGE, MXFMetadataSourcePackage))
|
||||
#define MXF_IS_METADATA_SOURCE_PACKAGE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_SOURCE_PACKAGE))
|
||||
typedef struct _MXFMetadataSourcePackage MXFMetadataSourcePackage;
|
||||
typedef MXFMetadataBaseClass MXFMetadataSourcePackageClass;
|
||||
GType mxf_metadata_source_package_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_TRACK \
|
||||
(mxf_metadata_track_get_type())
|
||||
#define MXF_METADATA_TRACK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_TRACK, MXFMetadataTrack))
|
||||
#define MXF_IS_METADATA_TRACK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_TRACK))
|
||||
typedef struct _MXFMetadataTrack MXFMetadataTrack;
|
||||
typedef MXFMetadataBaseClass MXFMetadataTrackClass;
|
||||
GType mxf_metadata_track_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_TIMELINE_TRACK \
|
||||
(mxf_metadata_timeline_track_get_type())
|
||||
#define MXF_METADATA_TIMELINE_TRACK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_TIMELINE_TRACK, MXFMetadataTimelineTrack))
|
||||
#define MXF_IS_METADATA_TIMELINE_TRACK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_TIMELINE_TRACK))
|
||||
typedef struct _MXFMetadataTimelineTrack MXFMetadataTimelineTrack;
|
||||
typedef MXFMetadataBaseClass MXFMetadataTimelineTrackClass;
|
||||
GType mxf_metadata_timeline_track_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_EVENT_TRACK \
|
||||
(mxf_metadata_event_track_get_type())
|
||||
#define MXF_METADATA_EVENT_TRACK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_EVENT_TRACK, MXFMetadataEventTrack))
|
||||
#define MXF_IS_METADATA_EVENT_TRACK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_EVENT_TRACK))
|
||||
typedef struct _MXFMetadataEventTrack MXFMetadataEventTrack;
|
||||
typedef MXFMetadataBaseClass MXFMetadataEventTrackClass;
|
||||
GType mxf_metadata_event_track_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_STATIC_TRACK \
|
||||
(mxf_metadata_static_track_get_type())
|
||||
#define MXF_METADATA_STATIC_TRACK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_STATIC_TRACK, MXFMetadataStaticTrack))
|
||||
#define MXF_IS_METADATA_STATIC_TRACK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_STATIC_TRACK))
|
||||
typedef MXFMetadataTrack MXFMetadataStaticTrack;
|
||||
typedef MXFMetadataBaseClass MXFMetadataStaticTrackClass;
|
||||
GType mxf_metadata_static_track_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_SEQUENCE \
|
||||
(mxf_metadata_sequence_get_type())
|
||||
#define MXF_METADATA_SEQUENCE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_SEQUENCE, MXFMetadataSequence))
|
||||
#define MXF_IS_METADATA_SEQUENCE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_SEQUENCE))
|
||||
typedef struct _MXFMetadataSequence MXFMetadataSequence;
|
||||
typedef MXFMetadataBaseClass MXFMetadataSequenceClass;
|
||||
GType mxf_metadata_sequence_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_STRUCTURAL_COMPONENT \
|
||||
(mxf_metadata_structural_component_get_type())
|
||||
#define MXF_METADATA_STRUCTURAL_COMPONENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_STRUCTURAL_COMPONENT, MXFMetadataStructuralComponent))
|
||||
#define MXF_IS_METADATA_STRUCTURAL_COMPONENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_STRUCTURAL_COMPONENT))
|
||||
typedef struct _MXFMetadataStructuralComponent MXFMetadataStructuralComponent;
|
||||
typedef MXFMetadataBaseClass MXFMetadataStructuralComponentClass;
|
||||
GType mxf_metadata_structural_component_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_SOURCE_CLIP \
|
||||
(mxf_metadata_source_clip_get_type())
|
||||
#define MXF_METADATA_SOURCE_CLIP(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_SOURCE_CLIP, MXFMetadataSourceClip))
|
||||
#define MXF_IS_METADATA_SOURCE_CLIP(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_SOURCE_CLIP))
|
||||
typedef struct _MXFMetadataSourceClip MXFMetadataSourceClip;
|
||||
typedef MXFMetadataBaseClass MXFMetadataSourceClipClass;
|
||||
GType mxf_metadata_source_clip_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_TIMECODE_COMPONENT \
|
||||
(mxf_metadata_timecode_component_get_type())
|
||||
#define MXF_METADATA_TIMECODE_COMPONENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_TIMECODE_COMPONENT, MXFMetadataTimecodeComponent))
|
||||
#define MXF_IS_METADATA_TIMECODE_COMPONENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_TIMECODE_COMPONENT))
|
||||
typedef struct _MXFMetadataTimecodeComponent MXFMetadataTimecodeComponent;
|
||||
typedef MXFMetadataBaseClass MXFMetadataTimecodeComponentClass;
|
||||
GType mxf_metadata_timecode_component_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_DM_SOURCE_CLIP \
|
||||
(mxf_metadata_dm_source_clip_get_type())
|
||||
#define MXF_METADATA_DM_SOURCE_CLIP(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_DM_SOURCE_CLIP, MXFMetadataDMSourceClip))
|
||||
#define MXF_IS_METADATA_DM_SOURCE_CLIP(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_DM_SOURCE_CLIP))
|
||||
typedef struct _MXFMetadataDMSourceClip MXFMetadataDMSourceClip;
|
||||
typedef MXFMetadataBaseClass MXFMetadataDMSourceClipClass;
|
||||
GType mxf_metadata_dm_source_clip_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_DM_SEGMENT \
|
||||
(mxf_metadata_dm_segment_get_type())
|
||||
#define MXF_METADATA_DM_SEGMENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_DM_SEGMENT, MXFMetadataDMSegment))
|
||||
#define MXF_IS_METADATA_DM_SEGMENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_DM_SEGMENT))
|
||||
typedef struct _MXFMetadataDMSegment MXFMetadataDMSegment;
|
||||
typedef MXFMetadataBaseClass MXFMetadataDMSegmentClass;
|
||||
GType mxf_metadata_dm_segment_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_GENERIC_DESCRIPTOR \
|
||||
(mxf_metadata_generic_descriptor_get_type())
|
||||
#define MXF_METADATA_GENERIC_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_GENERIC_DESCRIPTOR, MXFMetadataGenericDescriptor))
|
||||
#define MXF_IS_METADATA_GENERIC_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_GENERIC_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataGenericDescriptor MXFMetadataGenericDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataGenericDescriptorClass;
|
||||
GType mxf_metadata_generic_descriptor_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_FILE_DESCRIPTOR \
|
||||
(mxf_metadata_file_descriptor_get_type())
|
||||
#define MXF_METADATA_FILE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_FILE_DESCRIPTOR, MXFMetadataFileDescriptor))
|
||||
#define MXF_IS_METADATA_FILE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_FILE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataFileDescriptor MXFMetadataFileDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataFileDescriptorClass;
|
||||
GType mxf_metadata_file_descriptor_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR \
|
||||
(mxf_metadata_generic_picture_essence_descriptor_get_type())
|
||||
#define MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR, MXFMetadataGenericPictureEssenceDescriptor))
|
||||
#define MXF_IS_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataGenericPictureEssenceDescriptor MXFMetadataGenericPictureEssenceDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataGenericPictureEssenceDescriptorClass;
|
||||
GType mxf_metadata_generic_picture_essence_descriptor_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR \
|
||||
(mxf_metadata_cdci_picture_essence_descriptor_get_type())
|
||||
#define MXF_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR, MXFMetadataCDCIPictureEssenceDescriptor))
|
||||
#define MXF_IS_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataCDCIPictureEssenceDescriptor MXFMetadataCDCIPictureEssenceDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataCDCIPictureEssenceDescriptorClass;
|
||||
GType mxf_metadata_cdci_picture_essence_descriptor_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR \
|
||||
(mxf_metadata_rgba_picture_essence_descriptor_get_type())
|
||||
#define MXF_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR, MXFMetadataRGBAPictureEssenceDescriptor))
|
||||
#define MXF_IS_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataRGBAPictureEssenceDescriptor MXFMetadataRGBAPictureEssenceDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataRGBAPictureEssenceDescriptorClass;
|
||||
GType mxf_metadata_rgba_picture_essence_descriptor_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR \
|
||||
(mxf_metadata_generic_sound_essence_descriptor_get_type())
|
||||
#define MXF_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR, MXFMetadataGenericSoundEssenceDescriptor))
|
||||
#define MXF_IS_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataGenericSoundEssenceDescriptor MXFMetadataGenericSoundEssenceDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataGenericSoundEssenceDescriptorClass;
|
||||
GType mxf_metadata_generic_sound_essence_descriptor_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR \
|
||||
(mxf_metadata_generic_data_essence_descriptor_get_type())
|
||||
#define MXF_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR, MXFMetadataGenericDataEssenceDescriptor))
|
||||
#define MXF_IS_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataGenericDataEssenceDescriptor MXFMetadataGenericDataEssenceDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataGenericDataEssenceDescriptorClass;
|
||||
GType mxf_metadata_generic_data_essence_descriptor_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_MULTIPLE_DESCRIPTOR \
|
||||
(mxf_metadata_multiple_descriptor_get_type())
|
||||
#define MXF_METADATA_MULTIPLE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_MULTIPLE_DESCRIPTOR, MXFMetadataMultipleDescriptor))
|
||||
#define MXF_IS_METADATA_MULTIPLE_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_MULTIPLE_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataMultipleDescriptor MXFMetadataMultipleDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataMultipleDescriptorClass;
|
||||
GType mxf_metadata_multiple_descriptor_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_LOCATOR \
|
||||
(mxf_metadata_locator_get_type())
|
||||
#define MXF_METADATA_LOCATOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_LOCATOR, MXFMetadataLocator))
|
||||
#define MXF_IS_METADATA_LOCATOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_LOCATOR))
|
||||
typedef struct _MXFMetadataLocator MXFMetadataLocator;
|
||||
typedef MXFMetadataBaseClass MXFMetadataLocatorClass;
|
||||
GType mxf_metadata_locator_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_NETWORK_LOCATOR \
|
||||
(mxf_metadata_network_locator_get_type())
|
||||
#define MXF_METADATA_NETWORK_LOCATOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_NETWORK_LOCATOR, MXFMetadataNetworkLocator))
|
||||
#define MXF_IS_METADATA_NETWORK_LOCATOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_NETWORK_LOCATOR))
|
||||
typedef struct _MXFMetadataNetworkLocator MXFMetadataNetworkLocator;
|
||||
typedef MXFMetadataBaseClass MXFMetadataNetworkLocatorClass;
|
||||
GType mxf_metadata_network_locator_get_type (void);
|
||||
|
||||
#define MXF_TYPE_METADATA_TEXT_LOCATOR \
|
||||
(mxf_metadata_text_locator_get_type())
|
||||
#define MXF_METADATA_TEXT_LOCATOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_TEXT_LOCATOR, MXFMetadataTextLocator))
|
||||
#define MXF_IS_METADATA_TEXT_LOCATOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_TEXT_LOCATOR))
|
||||
typedef struct _MXFMetadataTextLocator MXFMetadataTextLocator;
|
||||
typedef MXFMetadataBaseClass MXFMetadataTextLocatorClass;
|
||||
GType mxf_metadata_text_locator_get_type (void);
|
||||
|
||||
struct _MXFMetadataBase {
|
||||
GstMiniObject parent;
|
||||
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
gboolean resolved;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
struct _MXFMetadataBaseClass {
|
||||
GstMiniObjectClass parent;
|
||||
|
||||
gboolean (*handle_tag) (MXFMetadataBase *self, MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint tag_size);
|
||||
gboolean (*resolve) (MXFMetadataBase *self, MXFMetadataBase **metadata);
|
||||
};
|
||||
|
||||
struct _MXFMetadata {
|
||||
MXFMetadataBase parent;
|
||||
|
||||
guint16 type;
|
||||
};
|
||||
|
||||
struct _MXFMetadataPreface {
|
||||
MXFMetadata parent;
|
||||
|
||||
MXFTimestamp last_modified_date;
|
||||
guint16 version;
|
||||
|
||||
guint32 object_model_version;
|
||||
|
||||
MXFUL primary_package_uid;
|
||||
MXFMetadataGenericPackage *primary_package;
|
||||
|
||||
guint32 n_identifications;
|
||||
MXFUL *identifications_uids;
|
||||
MXFMetadataIdentification **identifications;
|
||||
|
||||
MXFUL content_storage_uid;
|
||||
MXFMetadataContentStorage *content_storage;
|
||||
|
||||
MXFUL operational_pattern;
|
||||
|
||||
guint32 n_essence_containers;
|
||||
MXFUL *essence_containers;
|
||||
|
||||
guint32 n_dm_schemes;
|
||||
MXFUL *dm_schemes;
|
||||
};
|
||||
|
||||
struct _MXFMetadataIdentification {
|
||||
MXFMetadata parent;
|
||||
|
||||
gchar *company_name;
|
||||
|
||||
gchar *product_name;
|
||||
MXFProductVersion product_version;
|
||||
|
||||
gchar *version_string;
|
||||
|
||||
MXFUL product_uid;
|
||||
|
||||
MXFTimestamp modification_date;
|
||||
|
||||
MXFProductVersion toolkit_version;
|
||||
|
||||
gchar *platform;
|
||||
};
|
||||
|
||||
struct _MXFMetadataContentStorage {
|
||||
MXFMetadata parent;
|
||||
|
||||
guint32 n_packages;
|
||||
MXFUL *packages_uids;
|
||||
MXFMetadataGenericPackage **packages;
|
||||
|
||||
guint32 n_essence_container_data;
|
||||
MXFUL *essence_container_data_uids;
|
||||
MXFMetadataEssenceContainerData **essence_container_data;
|
||||
};
|
||||
|
||||
struct _MXFMetadataEssenceContainerData {
|
||||
MXFMetadata parent;
|
||||
|
||||
MXFUMID linked_package_uid;
|
||||
MXFMetadataSourcePackage *linked_package;
|
||||
|
||||
guint32 index_sid;
|
||||
guint32 body_sid;
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericPackage {
|
||||
MXFMetadata parent;
|
||||
|
||||
MXFUMID package_uid;
|
||||
|
||||
gchar *name;
|
||||
MXFTimestamp package_creation_date;
|
||||
MXFTimestamp package_modified_date;
|
||||
|
||||
guint32 n_tracks;
|
||||
MXFUL *tracks_uids;
|
||||
MXFMetadataTrack **tracks;
|
||||
|
||||
guint n_timecode_tracks;
|
||||
guint n_metadata_tracks;
|
||||
guint n_essence_tracks;
|
||||
guint n_other_tracks;
|
||||
};
|
||||
|
||||
struct _MXFMetadataSourcePackage
|
||||
{
|
||||
MXFMetadataGenericPackage parent;
|
||||
|
||||
MXFUL descriptors_uid;
|
||||
guint32 n_descriptors;
|
||||
MXFMetadataGenericDescriptor **descriptors;
|
||||
|
||||
gboolean top_level;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
MXF_METADATA_TRACK_UNKNOWN = 0x00,
|
||||
MXF_METADATA_TRACK_TIMECODE_12M_INACTIVE = 0x10,
|
||||
MXF_METADATA_TRACK_TIMECODE_12M_ACTIVE = 0x11,
|
||||
MXF_METADATA_TRACK_TIMECODE_309M = 0x12,
|
||||
MXF_METADATA_TRACK_METADATA = 0x20,
|
||||
MXF_METADATA_TRACK_PICTURE_ESSENCE = 0x30,
|
||||
MXF_METADATA_TRACK_SOUND_ESSENCE = 0x31,
|
||||
MXF_METADATA_TRACK_DATA_ESSENCE = 0x32,
|
||||
MXF_METADATA_TRACK_AUXILIARY_DATA = 0x40,
|
||||
MXF_METADATA_TRACK_PARSED_TEXT = 0x41
|
||||
} MXFMetadataTrackType;
|
||||
|
||||
struct _MXFMetadataTrack {
|
||||
MXFMetadata parent;
|
||||
|
||||
guint32 track_id;
|
||||
guint32 track_number;
|
||||
|
||||
gchar *track_name;
|
||||
|
||||
MXFUL sequence_uid;
|
||||
MXFMetadataSequence *sequence;
|
||||
|
||||
MXFMetadataTrackType type;
|
||||
|
||||
MXFMetadataFileDescriptor **descriptor;
|
||||
guint n_descriptor;
|
||||
};
|
||||
|
||||
struct _MXFMetadataTimelineTrack {
|
||||
MXFMetadataTrack parent;
|
||||
|
||||
MXFFraction edit_rate;
|
||||
gint64 origin;
|
||||
};
|
||||
|
||||
struct _MXFMetadataEventTrack {
|
||||
MXFMetadataTrack parent;
|
||||
|
||||
MXFFraction event_edit_rate;
|
||||
gint64 event_origin;
|
||||
};
|
||||
|
||||
struct _MXFMetadataSequence {
|
||||
MXFMetadata parent;
|
||||
|
||||
MXFUL data_definition;
|
||||
|
||||
gint64 duration;
|
||||
|
||||
guint32 n_structural_components;
|
||||
MXFUL *structural_components_uids;
|
||||
MXFMetadataStructuralComponent **structural_components;
|
||||
};
|
||||
|
||||
struct _MXFMetadataStructuralComponent {
|
||||
MXFMetadata parent;
|
||||
|
||||
MXFUL data_definition;
|
||||
gint64 duration;
|
||||
};
|
||||
|
||||
struct _MXFMetadataTimecodeComponent {
|
||||
MXFMetadataStructuralComponent parent;
|
||||
|
||||
gint64 start_timecode;
|
||||
guint16 rounded_timecode_base;
|
||||
gboolean drop_frame;
|
||||
};
|
||||
|
||||
struct _MXFMetadataSourceClip {
|
||||
MXFMetadataStructuralComponent parent;
|
||||
|
||||
gint64 start_position;
|
||||
MXFUMID source_package_id;
|
||||
MXFMetadataSourcePackage *source_package;
|
||||
|
||||
guint32 source_track_id;
|
||||
};
|
||||
|
||||
struct _MXFMetadataDMSourceClip {
|
||||
MXFMetadataSourceClip parent;
|
||||
|
||||
guint32 n_track_ids;
|
||||
guint32 *track_ids;
|
||||
};
|
||||
|
||||
struct _MXFMetadataDMSegment {
|
||||
MXFMetadataStructuralComponent parent;
|
||||
|
||||
gint64 event_start_position;
|
||||
gchar *event_comment;
|
||||
|
||||
guint32 n_track_ids;
|
||||
guint32 *track_ids;
|
||||
|
||||
MXFUL dm_framework_uid;
|
||||
MXFMetadataBase *dm_framework;
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericDescriptor {
|
||||
MXFMetadata parent;
|
||||
|
||||
guint32 n_locators;
|
||||
MXFUL *locators_uids;
|
||||
MXFMetadataLocator **locators;
|
||||
};
|
||||
|
||||
struct _MXFMetadataFileDescriptor {
|
||||
MXFMetadataGenericDescriptor parent;
|
||||
|
||||
guint32 linked_track_id;
|
||||
|
||||
MXFFraction sample_rate;
|
||||
gint64 container_duration;
|
||||
|
||||
MXFUL essence_container;
|
||||
MXFUL codec;
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericPictureEssenceDescriptor {
|
||||
MXFMetadataFileDescriptor parent;
|
||||
|
||||
guint8 signal_standard;
|
||||
guint8 frame_layout;
|
||||
|
||||
guint32 stored_width;
|
||||
guint32 stored_height;
|
||||
gint32 stored_f2_offset;
|
||||
guint32 sampled_width;
|
||||
guint32 sampled_height;
|
||||
gint32 sampled_x_offset;
|
||||
gint32 sampled_y_offset;
|
||||
guint32 display_height;
|
||||
guint32 display_width;
|
||||
gint32 display_x_offset;
|
||||
gint32 display_y_offset;
|
||||
gint32 display_f2_offset;
|
||||
MXFFraction aspect_ratio;
|
||||
|
||||
guint8 active_format_descriptor;
|
||||
gint32 video_line_map[2];
|
||||
guint8 alpha_transparency;
|
||||
MXFUL capture_gamma;
|
||||
|
||||
guint32 image_alignment_offset;
|
||||
guint32 image_start_offset;
|
||||
guint32 image_end_offset;
|
||||
|
||||
guint8 field_dominance;
|
||||
|
||||
MXFUL picture_essence_coding;
|
||||
};
|
||||
|
||||
struct _MXFMetadataCDCIPictureEssenceDescriptor {
|
||||
MXFMetadataGenericPictureEssenceDescriptor parent;
|
||||
|
||||
guint32 component_depth;
|
||||
guint32 horizontal_subsampling;
|
||||
guint32 vertical_subsampling;
|
||||
guint8 color_siting;
|
||||
gboolean reversed_byte_order;
|
||||
gint16 padding_bits;
|
||||
guint32 alpha_sample_depth;
|
||||
guint32 black_ref_level;
|
||||
guint32 white_ref_level;
|
||||
guint32 color_range;
|
||||
};
|
||||
|
||||
struct _MXFMetadataRGBAPictureEssenceDescriptor {
|
||||
MXFMetadataGenericPictureEssenceDescriptor parent;
|
||||
|
||||
guint32 component_max_ref;
|
||||
guint32 component_min_ref;
|
||||
guint32 alpha_max_ref;
|
||||
guint32 alpha_min_ref;
|
||||
guint8 scanning_direction;
|
||||
|
||||
guint32 n_pixel_layout;
|
||||
guint8 *pixel_layout;
|
||||
|
||||
/* TODO: palette & palette layout */
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericSoundEssenceDescriptor {
|
||||
MXFMetadataFileDescriptor parent;
|
||||
|
||||
MXFFraction audio_sampling_rate;
|
||||
|
||||
gboolean locked;
|
||||
|
||||
gint8 audio_ref_level;
|
||||
|
||||
guint8 electro_spatial_formulation;
|
||||
|
||||
guint32 channel_count;
|
||||
guint32 quantization_bits;
|
||||
|
||||
gint8 dial_norm;
|
||||
|
||||
MXFUL sound_essence_compression;
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericDataEssenceDescriptor {
|
||||
MXFMetadataFileDescriptor parent;
|
||||
|
||||
MXFUL data_essence_compression;
|
||||
};
|
||||
|
||||
struct _MXFMetadataMultipleDescriptor {
|
||||
MXFMetadataFileDescriptor parent;
|
||||
|
||||
MXFUL *sub_descriptors_uids;
|
||||
guint32 n_sub_descriptors;
|
||||
MXFMetadataGenericDescriptor **sub_descriptors;
|
||||
};
|
||||
|
||||
struct _MXFMetadataLocator {
|
||||
MXFMetadata parent;
|
||||
};
|
||||
|
||||
struct _MXFMetadataNetworkLocator {
|
||||
MXFMetadataLocator parent;
|
||||
|
||||
gchar *url_string;
|
||||
};
|
||||
|
||||
struct _MXFMetadataTextLocator {
|
||||
MXFMetadataLocator parent;
|
||||
|
||||
gchar *locator_name;
|
||||
};
|
||||
|
||||
gboolean mxf_metadata_parse (MXFMetadataBase *self, MXFPrimerPack *primer, const guint8 *data, guint size);
|
||||
gboolean mxf_metadata_resolve (MXFMetadataBase *self, MXFMetadataBase **metadata);
|
||||
|
||||
MXFMetadata *mxf_metadata_new (guint16 type, MXFPrimerPack *primer, const guint8 *data, guint size);
|
||||
void mxf_metadata_register (guint16 type_id, GType type);
|
||||
void mxf_metadata_init_types (void);
|
||||
|
||||
MXFMetadataTrackType mxf_metadata_track_identifier_parse (const MXFUL * track_identifier);
|
||||
|
||||
void mxf_metadata_generic_picture_essence_descriptor_set_caps (MXFMetadataGenericPictureEssenceDescriptor * self, GstCaps * caps);
|
||||
|
||||
#endif /* __MXF_METADATA_H__ */
|
|
@ -91,14 +91,18 @@ static const guint8 _profile_and_level_ul[] = {
|
|||
0x0a, 0x00, 0x00
|
||||
};
|
||||
|
||||
gboolean
|
||||
mxf_metadata_mpeg_video_descriptor_handle_tag (MXFMetadataGenericDescriptor * d,
|
||||
const MXFPrimerPack * primer, guint16 tag, const guint8 * tag_data,
|
||||
guint16 tag_size)
|
||||
G_DEFINE_TYPE (MXFMetadataMPEGVideoDescriptor,
|
||||
mxf_metadata_mpeg_video_descriptor,
|
||||
MXF_TYPE_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR);
|
||||
|
||||
static gboolean
|
||||
mxf_metadata_mpeg_video_descriptor_handle_tag (MXFMetadataBase * metadata,
|
||||
MXFPrimerPack * primer, guint16 tag, const guint8 * tag_data,
|
||||
guint tag_size)
|
||||
{
|
||||
MXFMetadataMPEGVideoDescriptor *descriptor =
|
||||
(MXFMetadataMPEGVideoDescriptor *) d;
|
||||
gboolean ret = FALSE;
|
||||
MXFMetadataMPEGVideoDescriptor *self =
|
||||
MXF_METADATA_MPEG_VIDEO_DESCRIPTOR (metadata);
|
||||
gboolean ret = TRUE;
|
||||
MXFUL *tag_ul = NULL;
|
||||
|
||||
if (!(tag_ul =
|
||||
|
@ -109,91 +113,86 @@ mxf_metadata_mpeg_video_descriptor_handle_tag (MXFMetadataGenericDescriptor * d,
|
|||
if (memcmp (tag_ul, &_single_sequence_ul, 16) == 0) {
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->single_sequence = GST_READ_UINT8 (tag_data);
|
||||
self->single_sequence = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" single sequence = %s",
|
||||
(descriptor->single_sequence) ? "yes" : "no");
|
||||
ret = TRUE;
|
||||
(self->single_sequence) ? "yes" : "no");
|
||||
} else if (memcmp (tag_ul, &_constant_b_frames_ul, 16) == 0) {
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->const_b_frames = GST_READ_UINT8 (tag_data);
|
||||
self->const_b_frames = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" constant b frames = %s",
|
||||
(descriptor->single_sequence) ? "yes" : "no");
|
||||
ret = TRUE;
|
||||
(self->single_sequence) ? "yes" : "no");
|
||||
} else if (memcmp (tag_ul, &_coded_content_type_ul, 16) == 0) {
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->coded_content_type = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" coded content type = %u", descriptor->coded_content_type);
|
||||
ret = TRUE;
|
||||
self->coded_content_type = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" coded content type = %u", self->coded_content_type);
|
||||
} else if (memcmp (tag_ul, &_low_delay_ul, 16) == 0) {
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->low_delay = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" low delay = %s", (descriptor->low_delay) ? "yes" : "no");
|
||||
ret = TRUE;
|
||||
self->low_delay = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" low delay = %s", (self->low_delay) ? "yes" : "no");
|
||||
} else if (memcmp (tag_ul, &_closed_gop_ul, 16) == 0) {
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->closed_gop = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" closed gop = %s", (descriptor->closed_gop) ? "yes" : "no");
|
||||
ret = TRUE;
|
||||
self->closed_gop = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" closed gop = %s", (self->closed_gop) ? "yes" : "no");
|
||||
} else if (memcmp (tag_ul, &_identical_gop_ul, 16) == 0) {
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->identical_gop = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" identical gop = %s",
|
||||
(descriptor->identical_gop) ? "yes" : "no");
|
||||
ret = TRUE;
|
||||
self->identical_gop = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" identical gop = %s", (self->identical_gop) ? "yes" : "no");
|
||||
} else if (memcmp (tag_ul, &_max_gop_ul, 16) == 0) {
|
||||
if (tag_size != 2)
|
||||
goto error;
|
||||
descriptor->max_gop = GST_READ_UINT16_BE (tag_data);
|
||||
GST_DEBUG (" max gop = %u", descriptor->max_gop);
|
||||
ret = TRUE;
|
||||
self->max_gop = GST_READ_UINT16_BE (tag_data);
|
||||
GST_DEBUG (" max gop = %u", self->max_gop);
|
||||
} else if (memcmp (tag_ul, &_b_picture_count_ul, 16) == 0) {
|
||||
if (tag_size != 2)
|
||||
goto error;
|
||||
descriptor->b_picture_count = GST_READ_UINT16_BE (tag_data);
|
||||
GST_DEBUG (" b picture count = %u", descriptor->b_picture_count);
|
||||
ret = TRUE;
|
||||
self->b_picture_count = GST_READ_UINT16_BE (tag_data);
|
||||
GST_DEBUG (" b picture count = %u", self->b_picture_count);
|
||||
} else if (memcmp (tag_ul, &_bitrate_ul, 16) == 0) {
|
||||
if (tag_size != 4)
|
||||
goto error;
|
||||
descriptor->bitrate = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" bitrate = %u", descriptor->bitrate);
|
||||
ret = TRUE;
|
||||
self->bitrate = GST_READ_UINT32_BE (tag_data);
|
||||
GST_DEBUG (" bitrate = %u", self->bitrate);
|
||||
} else if (memcmp (tag_ul, &_profile_and_level_ul, 16) == 0) {
|
||||
if (tag_size != 1)
|
||||
goto error;
|
||||
descriptor->profile_and_level = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" profile & level = %u", descriptor->profile_and_level);
|
||||
ret = TRUE;
|
||||
self->profile_and_level = GST_READ_UINT8 (tag_data);
|
||||
GST_DEBUG (" profile & level = %u", self->profile_and_level);
|
||||
} else {
|
||||
ret =
|
||||
mxf_metadata_cdci_picture_essence_descriptor_handle_tag (d, primer, tag,
|
||||
tag_data, tag_size);
|
||||
MXF_METADATA_BASE_CLASS
|
||||
(mxf_metadata_mpeg_video_descriptor_parent_class)->handle_tag (metadata,
|
||||
primer, tag, tag_data, tag_size);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
error:
|
||||
GST_ERROR ("Invalid mpeg video descriptor tag 0x%04x of size %u", tag,
|
||||
|
||||
GST_ERROR ("Invalid MPEG video descriptor local tag 0x%04x of size %u", tag,
|
||||
tag_size);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void mxf_metadata_mpeg_video_descriptor_reset
|
||||
(MXFMetadataMPEGVideoDescriptor * descriptor)
|
||||
static void
|
||||
mxf_metadata_mpeg_video_descriptor_init (MXFMetadataMPEGVideoDescriptor * self)
|
||||
{
|
||||
g_return_if_fail (descriptor != NULL);
|
||||
|
||||
mxf_metadata_cdci_picture_essence_descriptor_reset (
|
||||
(MXFMetadataCDCIPictureEssenceDescriptor *) descriptor);
|
||||
}
|
||||
|
||||
MXF_METADATA_DESCRIPTOR_CLEAR (descriptor, MXFMetadataMPEGVideoDescriptor,
|
||||
MXFMetadataCDCIPictureEssenceDescriptor);
|
||||
static void
|
||||
mxf_metadata_mpeg_video_descriptor_class_init
|
||||
(MXFMetadataMPEGVideoDescriptorClass * klass)
|
||||
{
|
||||
MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass;
|
||||
|
||||
metadata_base_class->handle_tag =
|
||||
mxf_metadata_mpeg_video_descriptor_handle_tag;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -208,7 +207,12 @@ mxf_is_mpeg_essence_track (const MXFMetadataTrack * track)
|
|||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
MXFMetadataFileDescriptor *d = track->descriptor[i];
|
||||
MXFUL *key = &d->essence_container;
|
||||
MXFUL *key;
|
||||
|
||||
if (!d)
|
||||
continue;
|
||||
|
||||
key = &d->essence_container;
|
||||
/* SMPTE 381M 7 */
|
||||
if (mxf_is_generic_container_essence_container_label (key) &&
|
||||
key->u[12] == 0x02 &&
|
||||
|
@ -338,8 +342,8 @@ mxf_mpeg_es_create_caps (MXFMetadataGenericPackage * package,
|
|||
codec_name = "MPEG-1 Video";
|
||||
} else if (p->picture_essence_coding.u[13] == 0x20) {
|
||||
MXFLocalTag *local_tag =
|
||||
(((MXFMetadataGenericDescriptor *) p)->other_tags) ?
|
||||
g_hash_table_lookup (((MXFMetadataGenericDescriptor *)
|
||||
(((MXFMetadataBase *) p)->other_tags) ?
|
||||
g_hash_table_lookup (((MXFMetadataBase *)
|
||||
p)->other_tags, &sony_mpeg4_extradata) : NULL;
|
||||
|
||||
caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 4,
|
||||
|
@ -446,17 +450,16 @@ mxf_mpeg_create_caps (MXFMetadataGenericPackage * package,
|
|||
}
|
||||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_MPEG_VIDEO_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR ||
|
||||
((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR) {
|
||||
if (!track->descriptor[i])
|
||||
continue;
|
||||
|
||||
if (MXF_IS_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (track->
|
||||
descriptor[i])) {
|
||||
f = track->descriptor[i];
|
||||
p = (MXFMetadataGenericPictureEssenceDescriptor *) track->descriptor[i];
|
||||
break;
|
||||
} else if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR) {
|
||||
} else if (MXF_IS_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (track->
|
||||
descriptor[i])) {
|
||||
f = track->descriptor[i];
|
||||
s = (MXFMetadataGenericSoundEssenceDescriptor *) track->descriptor[i];
|
||||
break;
|
||||
|
@ -503,3 +506,9 @@ mxf_mpeg_create_caps (MXFMetadataGenericPackage * package,
|
|||
|
||||
return caps;
|
||||
}
|
||||
|
||||
void
|
||||
mxf_mpeg_init (void)
|
||||
{
|
||||
mxf_metadata_register (0x0151, MXF_TYPE_METADATA_MPEG_VIDEO_DESCRIPTOR);
|
||||
}
|
||||
|
|
|
@ -27,12 +27,20 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
#include "mxfparse.h"
|
||||
|
||||
/* SMPTE 381M 8.1.1 */
|
||||
#define MXF_METADATA_MPEG_VIDEO_DESCRIPTOR 0x0151
|
||||
#include "mxfmetadata.h"
|
||||
|
||||
/* SMPTE 381M 8.1 */
|
||||
typedef struct {
|
||||
#define MXF_TYPE_METADATA_MPEG_VIDEO_DESCRIPTOR \
|
||||
(mxf_metadata_mpeg_video_descriptor_get_type())
|
||||
#define MXF_METADATA_MPEG_VIDEO_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),MXF_TYPE_METADATA_MPEG_VIDEO_DESCRIPTOR, MXFMetadataMPEGVideoDescriptor))
|
||||
#define MXF_IS_METADATA_MPEG_VIDEO_DESCRIPTOR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_MPEG_VIDEO_DESCRIPTOR))
|
||||
typedef struct _MXFMetadataMPEGVideoDescriptor MXFMetadataMPEGVideoDescriptor;
|
||||
typedef MXFMetadataBaseClass MXFMetadataMPEGVideoDescriptorClass;
|
||||
GType mxf_metadata_mpeg_video_descriptor_get_type (void);
|
||||
|
||||
struct _MXFMetadataMPEGVideoDescriptor {
|
||||
MXFMetadataCDCIPictureEssenceDescriptor parent;
|
||||
|
||||
gboolean single_sequence;
|
||||
|
@ -47,14 +55,13 @@ typedef struct {
|
|||
guint16 b_picture_count;
|
||||
guint32 bitrate;
|
||||
guint8 profile_and_level;
|
||||
} MXFMetadataMPEGVideoDescriptor;
|
||||
|
||||
gboolean mxf_metadata_mpeg_video_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor, const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_mpeg_video_descriptor_reset (MXFMetadataMPEGVideoDescriptor *descriptor);
|
||||
};
|
||||
|
||||
gboolean mxf_is_mpeg_essence_track (const MXFMetadataTrack *track);
|
||||
|
||||
GstCaps *
|
||||
mxf_mpeg_create_caps (MXFMetadataGenericPackage *package, MXFMetadataTrack *track, GstTagList **tags, MXFEssenceElementHandler *handler, gpointer *mapping_data);
|
||||
|
||||
void mxf_mpeg_init (void);
|
||||
|
||||
#endif /* __MXF_MPEG_H__ */
|
||||
|
|
2204
gst/mxf/mxfparse.c
2204
gst/mxf/mxfparse.c
File diff suppressed because it is too large
Load diff
|
@ -17,19 +17,18 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* Handling of the basic MXF types */
|
||||
|
||||
#ifndef __MXF_PARSE_H__
|
||||
#define __MXF_PARSE_H__
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "mxftypes.h"
|
||||
#include "mxfmetadata.h"
|
||||
|
||||
typedef GstFlowReturn (*MXFEssenceElementHandler) (const MXFUL *key, GstBuffer *buffer, GstCaps *caps, MXFMetadataGenericPackage *package, MXFMetadataTrack *track, MXFMetadataStructuralComponent *component, gpointer mapping_data, GstBuffer **outbuf);
|
||||
|
||||
typedef gboolean (*MXFMetadataDescriptorHandleTag) (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
typedef void (*MXFMetadataDescriptorReset) (MXFMetadataGenericDescriptor *descriptor);
|
||||
|
||||
gchar * mxf_ul_to_string (const MXFUL *ul, gchar str[48]);
|
||||
gboolean mxf_ul_is_equal (const MXFUL *a, const MXFUL *b);
|
||||
gboolean mxf_ul_is_zero (const MXFUL *ul);
|
||||
|
@ -87,80 +86,9 @@ gboolean mxf_local_tag_parse (const guint8 * data, guint size, guint16 * tag,
|
|||
guint16 * tag_size, const guint8 ** tag_data);
|
||||
void gst_mxf_local_tag_free (MXFLocalTag *tag);
|
||||
|
||||
gboolean gst_metadata_add_custom_tag (const MXFPrimerPack *primer,
|
||||
gboolean mxf_local_tag_add_to_hash_table (const MXFPrimerPack *primer,
|
||||
guint16 tag, const guint8 *tag_data, guint16 tag_size,
|
||||
GHashTable **hash_table);
|
||||
|
||||
gboolean mxf_metadata_preface_parse (const MXFUL *key, MXFMetadataPreface *preface, const MXFPrimerPack *primer, const guint8 *data, guint size);
|
||||
void mxf_metadata_preface_reset (MXFMetadataPreface *preface);
|
||||
|
||||
gboolean mxf_metadata_identification_parse (const MXFUL *key, MXFMetadataIdentification *identification, const MXFPrimerPack *primer, const guint8 *data, guint size);
|
||||
void mxf_metadata_identification_reset (MXFMetadataIdentification *identification);
|
||||
|
||||
gboolean mxf_metadata_content_storage_parse (const MXFUL *key, MXFMetadataContentStorage *content_storage, const MXFPrimerPack *primer, const guint8 *data, guint size);
|
||||
void mxf_metadata_content_storage_reset (MXFMetadataContentStorage *content_storage);
|
||||
|
||||
gboolean mxf_metadata_essence_container_data_parse (const MXFUL *key, MXFMetadataEssenceContainerData *essence_container_data, const MXFPrimerPack *primer, const guint8 *data, guint size);
|
||||
void mxf_metadata_essence_container_data_reset (MXFMetadataEssenceContainerData *essence_container_data);
|
||||
|
||||
gboolean mxf_metadata_generic_package_parse (const MXFUL *key, MXFMetadataGenericPackage *generic_package, const MXFPrimerPack *primer, const guint8 *data, guint size);
|
||||
void mxf_metadata_generic_package_reset (MXFMetadataGenericPackage *generic_package);
|
||||
|
||||
gboolean mxf_metadata_track_parse (const MXFUL *key, MXFMetadataTrack *track, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size);
|
||||
void mxf_metadata_track_reset (MXFMetadataTrack *track);
|
||||
|
||||
MXFMetadataTrackType mxf_metadata_track_identifier_parse (const MXFUL *track_identifier);
|
||||
|
||||
gboolean mxf_metadata_sequence_parse (const MXFUL *key, MXFMetadataSequence *sequence, const MXFPrimerPack *primer, const guint8 *data, guint size);
|
||||
void mxf_metadata_sequence_reset (MXFMetadataSequence *sequence);
|
||||
|
||||
gboolean mxf_metadata_structural_component_parse (const MXFUL *key, MXFMetadataStructuralComponent *component, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size);
|
||||
void mxf_metadata_structural_component_reset (MXFMetadataStructuralComponent *component);
|
||||
|
||||
gboolean
|
||||
mxf_metadata_descriptor_parse (const MXFUL * key, MXFMetadataGenericDescriptor * descriptor, const MXFPrimerPack * primer, guint16 type, const guint8 * data, guint size, MXFMetadataDescriptorHandleTag handle_tag, MXFMetadataDescriptorReset reset);
|
||||
|
||||
#define MXF_METADATA_DESCRIPTOR_CLEAR(descriptor, type, parent_type) \
|
||||
G_STMT_START { \
|
||||
guint8 *___data = (guint8 *) descriptor + sizeof (parent_type); \
|
||||
memset (___data, 0, sizeof (type) - sizeof (parent_type)); \
|
||||
} G_STMT_END
|
||||
|
||||
gboolean mxf_metadata_generic_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_generic_descriptor_reset (MXFMetadataGenericDescriptor *descriptor);
|
||||
|
||||
gboolean mxf_metadata_file_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_file_descriptor_reset (MXFMetadataFileDescriptor *descriptor);
|
||||
|
||||
gboolean mxf_metadata_generic_sound_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_generic_sound_essence_descriptor_reset (MXFMetadataGenericSoundEssenceDescriptor *descriptor);
|
||||
|
||||
gboolean mxf_metadata_generic_picture_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_generic_picture_essence_descriptor_reset (MXFMetadataGenericPictureEssenceDescriptor *descriptor);
|
||||
void mxf_metadata_generic_picture_essence_descriptor_set_caps (MXFMetadataGenericPictureEssenceDescriptor *descriptor, GstCaps *caps);
|
||||
|
||||
gboolean mxf_metadata_cdci_picture_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_cdci_picture_essence_descriptor_reset (MXFMetadataCDCIPictureEssenceDescriptor *descriptor);
|
||||
|
||||
gboolean mxf_metadata_rgba_picture_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_rgba_picture_essence_descriptor_reset (MXFMetadataRGBAPictureEssenceDescriptor *descriptor);
|
||||
|
||||
gboolean mxf_metadata_generic_data_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_generic_data_essence_descriptor_reset (MXFMetadataGenericDataEssenceDescriptor *descriptor);
|
||||
|
||||
gboolean mxf_metadata_multiple_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
|
||||
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
|
||||
void mxf_metadata_multiple_descriptor_reset (MXFMetadataMultipleDescriptor *descriptor);
|
||||
|
||||
gboolean mxf_metadata_locator_parse (const MXFUL *key, MXFMetadataLocator *locator, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size);
|
||||
void mxf_metadata_locator_reset (MXFMetadataLocator *locator);
|
||||
|
||||
#endif /* __MXF_PARSE_H__ */
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* Definitions of the basic MXF types, excluding structural metadata */
|
||||
|
||||
#ifndef __MXF_TYPES_H__
|
||||
#define __MXF_TYPES_H__
|
||||
|
||||
|
@ -153,408 +155,4 @@ typedef struct {
|
|||
GHashTable *other_tags;
|
||||
} MXFIndexTableSegment;
|
||||
|
||||
/* SMPTE 377M 8.6 table 14 */
|
||||
#define MXF_METADATA_PREFACE (0x012f)
|
||||
#define MXF_METADATA_IDENTIFICATION (0x0130)
|
||||
#define MXF_METADATA_CONTENT_STORAGE (0x0118)
|
||||
#define MXF_METADATA_ESSENCE_CONTAINER_DATA (0x0123)
|
||||
#define MXF_METADATA_MATERIAL_PACKAGE (0x0136)
|
||||
#define MXF_METADATA_SOURCE_PACKAGE (0x0137)
|
||||
#define MXF_METADATA_TRACK (0x013b)
|
||||
#define MXF_METADATA_EVENT_TRACK (0x0139)
|
||||
#define MXF_METADATA_STATIC_TRACK (0x013a)
|
||||
#define MXF_METADATA_SEQUENCE (0x010f)
|
||||
#define MXF_METADATA_SOURCE_CLIP (0x0111)
|
||||
#define MXF_METADATA_TIMECODE_COMPONENT (0x0114)
|
||||
#define MXF_METADATA_DM_SEGMENT (0x0141)
|
||||
#define MXF_METADATA_DM_SOURCE_CLIP (0x0145)
|
||||
#define MXF_METADATA_FILE_DESCRIPTOR (0x0125)
|
||||
#define MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (0x0127)
|
||||
#define MXF_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR (0x0128)
|
||||
#define MXF_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR (0x0129)
|
||||
#define MXF_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (0x0142)
|
||||
#define MXF_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR (0x0143)
|
||||
#define MXF_METADATA_MULTIPLE_DESCRIPTOR (0x0144)
|
||||
#define MXF_METADATA_NETWORK_LOCATOR (0x0132)
|
||||
#define MXF_METADATA_TEXT_LOCATOR (0x0133)
|
||||
|
||||
/* SMPTE 377M Annex A, B, C, D */
|
||||
typedef struct _MXFMetadataPreface MXFMetadataPreface;
|
||||
typedef struct _MXFMetadataIdentification MXFMetadataIdentification;
|
||||
typedef struct _MXFMetadataContentStorage MXFMetadataContentStorage;
|
||||
typedef struct _MXFMetadataEssenceContainerData MXFMetadataEssenceContainerData;
|
||||
typedef struct _MXFMetadataGenericPackage MXFMetadataGenericPackage;
|
||||
typedef MXFMetadataGenericPackage MXFMetadataMaterialPackage;
|
||||
typedef MXFMetadataGenericPackage MXFMetadataSourcePackage;
|
||||
typedef struct _MXFMetadataTrack MXFMetadataTrack;
|
||||
typedef struct _MXFMetadataSequence MXFMetadataSequence;
|
||||
typedef struct _MXFMetadataStructuralComponent MXFMetadataStructuralComponent;
|
||||
typedef struct _MXFMetadataGenericDescriptor MXFMetadataGenericDescriptor;
|
||||
typedef struct _MXFMetadataFileDescriptor MXFMetadataFileDescriptor;
|
||||
typedef struct _MXFMetadataGenericPictureEssenceDescriptor MXFMetadataGenericPictureEssenceDescriptor;
|
||||
typedef struct _MXFMetadataCDCIPictureEssenceDescriptor MXFMetadataCDCIPictureEssenceDescriptor;
|
||||
typedef struct _MXFMetadataRGBAPictureEssenceDescriptor MXFMetadataRGBAPictureEssenceDescriptor;
|
||||
typedef struct _MXFMetadataGenericSoundEssenceDescriptor MXFMetadataGenericSoundEssenceDescriptor;
|
||||
typedef struct _MXFMetadataGenericDataEssenceDescriptor MXFMetadataGenericDataEssenceDescriptor;
|
||||
typedef struct _MXFMetadataMultipleDescriptor MXFMetadataMultipleDescriptor;
|
||||
typedef struct _MXFMetadataLocator MXFMetadataLocator;
|
||||
|
||||
struct _MXFMetadataPreface {
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
MXFTimestamp last_modified_date;
|
||||
guint16 version;
|
||||
|
||||
guint32 object_model_version;
|
||||
|
||||
MXFUL primary_package_uid;
|
||||
MXFMetadataGenericPackage *primary_package;
|
||||
|
||||
guint32 n_identifications;
|
||||
MXFUL *identifications_uids;
|
||||
MXFMetadataIdentification **identifications;
|
||||
|
||||
MXFUL content_storage_uid;
|
||||
MXFMetadataContentStorage *content_storage;
|
||||
|
||||
MXFUL operational_pattern;
|
||||
|
||||
guint32 n_essence_containers;
|
||||
MXFUL *essence_containers;
|
||||
|
||||
guint32 n_dm_schemes;
|
||||
MXFUL *dm_schemes;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
struct _MXFMetadataIdentification {
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
gchar *company_name;
|
||||
|
||||
gchar *product_name;
|
||||
MXFProductVersion product_version;
|
||||
|
||||
gchar *version_string;
|
||||
|
||||
MXFUL product_uid;
|
||||
|
||||
MXFTimestamp modification_date;
|
||||
|
||||
MXFProductVersion toolkit_version;
|
||||
|
||||
gchar *platform;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
struct _MXFMetadataContentStorage {
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
guint32 n_packages;
|
||||
MXFUL *packages_uids;
|
||||
MXFMetadataGenericPackage **packages;
|
||||
|
||||
guint32 n_essence_container_data;
|
||||
MXFUL *essence_container_data_uids;
|
||||
MXFMetadataEssenceContainerData **essence_container_data;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
struct _MXFMetadataEssenceContainerData {
|
||||
MXFUL instance_uid;
|
||||
|
||||
MXFUMID linked_package_uid;
|
||||
MXFMetadataGenericPackage *linked_package;
|
||||
|
||||
MXFUL generation_uid;
|
||||
|
||||
guint32 index_sid;
|
||||
guint32 body_sid;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
MXF_METADATA_GENERIC_PACKAGE_SOURCE = 0,
|
||||
MXF_METADATA_GENERIC_PACKAGE_MATERIAL = 1,
|
||||
MXF_METADATA_GENERIC_PACKAGE_TOP_LEVEL_SOURCE = 2
|
||||
} MXFMetadataGenericPackageType;
|
||||
|
||||
struct _MXFMetadataGenericPackage {
|
||||
MXFUL instance_uid;
|
||||
MXFUMID package_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
MXFMetadataGenericPackageType type;
|
||||
|
||||
gchar *name;
|
||||
MXFTimestamp package_creation_date;
|
||||
MXFTimestamp package_modified_date;
|
||||
|
||||
guint32 n_tracks;
|
||||
MXFUL *tracks_uids;
|
||||
MXFMetadataTrack **tracks;
|
||||
|
||||
guint n_timecode_tracks;
|
||||
guint n_metadata_tracks;
|
||||
guint n_essence_tracks;
|
||||
guint n_other_tracks;
|
||||
|
||||
/* Only in Source packages */
|
||||
MXFUL descriptors_uid;
|
||||
guint32 n_descriptors;
|
||||
MXFMetadataGenericDescriptor **descriptors;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
MXF_METADATA_TRACK_UNKNOWN = 0x00,
|
||||
MXF_METADATA_TRACK_TIMECODE_12M_INACTIVE = 0x10,
|
||||
MXF_METADATA_TRACK_TIMECODE_12M_ACTIVE = 0x11,
|
||||
MXF_METADATA_TRACK_TIMECODE_309M = 0x12,
|
||||
MXF_METADATA_TRACK_METADATA = 0x20,
|
||||
MXF_METADATA_TRACK_PICTURE_ESSENCE = 0x30,
|
||||
MXF_METADATA_TRACK_SOUND_ESSENCE = 0x31,
|
||||
MXF_METADATA_TRACK_DATA_ESSENCE = 0x32,
|
||||
MXF_METADATA_TRACK_AUXILIARY_DATA = 0x40,
|
||||
MXF_METADATA_TRACK_PARSED_TEXT = 0x41
|
||||
} MXFMetadataTrackType;
|
||||
|
||||
typedef enum {
|
||||
MXF_METADATA_TRACK_VARIANT_TIMELINE,
|
||||
MXF_METADATA_TRACK_VARIANT_EVENT,
|
||||
MXF_METADATA_TRACK_VARIANT_STATIC
|
||||
} MXFMetadataTrackVariant;
|
||||
|
||||
struct _MXFMetadataTrack {
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
guint32 track_id;
|
||||
guint32 track_number;
|
||||
|
||||
MXFMetadataTrackType type;
|
||||
MXFMetadataTrackVariant variant;
|
||||
|
||||
gchar *track_name;
|
||||
|
||||
MXFFraction edit_rate;
|
||||
|
||||
gint64 origin;
|
||||
|
||||
MXFUL sequence_uid;
|
||||
MXFMetadataSequence *sequence;
|
||||
|
||||
MXFMetadataFileDescriptor **descriptor;
|
||||
guint n_descriptor;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
struct _MXFMetadataSequence {
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
MXFUL data_definition;
|
||||
|
||||
gint64 duration;
|
||||
|
||||
guint32 n_structural_components;
|
||||
MXFUL *structural_components_uids;
|
||||
MXFMetadataStructuralComponent **structural_components;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
struct _MXFMetadataStructuralComponent {
|
||||
guint16 type;
|
||||
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
MXFUL data_definition;
|
||||
|
||||
gint64 duration;
|
||||
|
||||
union {
|
||||
struct {
|
||||
gint64 start_timecode;
|
||||
guint16 rounded_timecode_base;
|
||||
gboolean drop_frame;
|
||||
} timecode_component;
|
||||
|
||||
struct {
|
||||
gint64 start_position;
|
||||
MXFUMID source_package_id;
|
||||
MXFMetadataGenericPackage *source_package;
|
||||
|
||||
guint32 source_track_id;
|
||||
} source_clip;
|
||||
|
||||
struct {
|
||||
gint64 event_start_position;
|
||||
gchar *event_comment;
|
||||
|
||||
guint32 n_track_ids;
|
||||
guint32 *track_ids;
|
||||
|
||||
MXFUL dm_framework;
|
||||
} dm_segment;
|
||||
|
||||
struct {
|
||||
gint64 start_position;
|
||||
MXFUMID source_package_id;
|
||||
MXFMetadataGenericPackage *source_package;
|
||||
|
||||
guint32 source_track_id;
|
||||
|
||||
guint32 n_track_ids;
|
||||
guint32 *track_ids;
|
||||
} dm_source_clip;
|
||||
};
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericDescriptor {
|
||||
guint16 type;
|
||||
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
guint32 n_locators;
|
||||
MXFUL *locators_uids;
|
||||
MXFMetadataLocator **locators;
|
||||
|
||||
gboolean is_file_descriptor;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
struct _MXFMetadataFileDescriptor {
|
||||
MXFMetadataGenericDescriptor parent;
|
||||
|
||||
guint32 linked_track_id;
|
||||
|
||||
MXFFraction sample_rate;
|
||||
gint64 container_duration;
|
||||
MXFUL essence_container;
|
||||
MXFUL codec;
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericPictureEssenceDescriptor {
|
||||
MXFMetadataFileDescriptor parent;
|
||||
|
||||
guint8 signal_standard;
|
||||
guint8 frame_layout;
|
||||
|
||||
guint32 stored_width;
|
||||
guint32 stored_height;
|
||||
gint32 stored_f2_offset;
|
||||
guint32 sampled_width;
|
||||
guint32 sampled_height;
|
||||
gint32 sampled_x_offset;
|
||||
gint32 sampled_y_offset;
|
||||
guint32 display_height;
|
||||
guint32 display_width;
|
||||
gint32 display_x_offset;
|
||||
gint32 display_y_offset;
|
||||
gint32 display_f2_offset;
|
||||
MXFFraction aspect_ratio;
|
||||
|
||||
guint8 active_format_descriptor;
|
||||
gint32 video_line_map[2];
|
||||
guint8 alpha_transparency;
|
||||
MXFUL capture_gamma;
|
||||
|
||||
guint32 image_alignment_offset;
|
||||
guint32 image_start_offset;
|
||||
guint32 image_end_offset;
|
||||
|
||||
guint8 field_dominance;
|
||||
|
||||
MXFUL picture_essence_coding;
|
||||
};
|
||||
|
||||
struct _MXFMetadataCDCIPictureEssenceDescriptor {
|
||||
MXFMetadataGenericPictureEssenceDescriptor parent;
|
||||
|
||||
guint32 component_depth;
|
||||
guint32 horizontal_subsampling;
|
||||
guint32 vertical_subsampling;
|
||||
guint8 color_siting;
|
||||
gboolean reversed_byte_order;
|
||||
gint16 padding_bits;
|
||||
guint32 alpha_sample_depth;
|
||||
guint32 black_ref_level;
|
||||
guint32 white_ref_level;
|
||||
guint32 color_range;
|
||||
};
|
||||
|
||||
struct _MXFMetadataRGBAPictureEssenceDescriptor {
|
||||
MXFMetadataGenericPictureEssenceDescriptor parent;
|
||||
|
||||
guint32 component_max_ref;
|
||||
guint32 component_min_ref;
|
||||
guint32 alpha_max_ref;
|
||||
guint32 alpha_min_ref;
|
||||
guint8 scanning_direction;
|
||||
|
||||
guint32 n_pixel_layout;
|
||||
guint8 *pixel_layout;
|
||||
|
||||
/* TODO: palette & palette layout */
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericSoundEssenceDescriptor {
|
||||
MXFMetadataFileDescriptor parent;
|
||||
|
||||
MXFFraction audio_sampling_rate;
|
||||
|
||||
gboolean locked;
|
||||
|
||||
gint8 audio_ref_level;
|
||||
|
||||
guint8 electro_spatial_formulation;
|
||||
|
||||
guint32 channel_count;
|
||||
guint32 quantization_bits;
|
||||
|
||||
gint8 dial_norm;
|
||||
|
||||
MXFUL sound_essence_compression;
|
||||
};
|
||||
|
||||
struct _MXFMetadataGenericDataEssenceDescriptor {
|
||||
MXFMetadataFileDescriptor parent;
|
||||
|
||||
MXFUL data_essence_compression;
|
||||
};
|
||||
|
||||
struct _MXFMetadataMultipleDescriptor {
|
||||
MXFMetadataFileDescriptor parent;
|
||||
|
||||
MXFUL *sub_descriptors_uids;
|
||||
guint32 n_sub_descriptors;
|
||||
MXFMetadataGenericDescriptor **sub_descriptors;
|
||||
};
|
||||
|
||||
struct _MXFMetadataLocator {
|
||||
guint16 type;
|
||||
|
||||
MXFUL instance_uid;
|
||||
MXFUL generation_uid;
|
||||
|
||||
gchar *location;
|
||||
|
||||
GHashTable *other_tags;
|
||||
};
|
||||
|
||||
#endif /* __MXF_TYPES_H__ */
|
||||
|
|
|
@ -61,7 +61,12 @@ mxf_is_up_essence_track (const MXFMetadataTrack * track)
|
|||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
MXFMetadataFileDescriptor *d = track->descriptor[i];
|
||||
MXFUL *key = &d->essence_container;
|
||||
MXFUL *key;
|
||||
|
||||
if (!d)
|
||||
continue;
|
||||
|
||||
key = &d->essence_container;
|
||||
/* SMPTE 384M 8 */
|
||||
if (mxf_is_generic_container_essence_container_label (key) &&
|
||||
key->u[12] == 0x02 && key->u[13] == 0x05 && key->u[15] <= 0x03)
|
||||
|
@ -216,13 +221,15 @@ mxf_up_create_caps (MXFMetadataGenericPackage * package,
|
|||
}
|
||||
|
||||
for (i = 0; i < track->n_descriptor; i++) {
|
||||
if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR) {
|
||||
if (!track->descriptor[i])
|
||||
continue;
|
||||
|
||||
if (MXF_IS_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR (track->descriptor[i])) {
|
||||
p = (MXFMetadataGenericPictureEssenceDescriptor *) track->descriptor[i];
|
||||
r = (MXFMetadataRGBAPictureEssenceDescriptor *) track->descriptor[i];
|
||||
break;
|
||||
} else if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->type ==
|
||||
MXF_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR) {
|
||||
} else if (MXF_IS_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR (track->
|
||||
descriptor[i])) {
|
||||
p = (MXFMetadataGenericPictureEssenceDescriptor *) track->descriptor[i];
|
||||
c = (MXFMetadataCDCIPictureEssenceDescriptor *) track->descriptor[i];
|
||||
}
|
||||
|
@ -250,3 +257,8 @@ mxf_up_create_caps (MXFMetadataGenericPackage * package,
|
|||
|
||||
return caps;
|
||||
}
|
||||
|
||||
void
|
||||
mxf_up_init (void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,4 +33,6 @@ gboolean mxf_is_up_essence_track (const MXFMetadataTrack *track);
|
|||
GstCaps *
|
||||
mxf_up_create_caps (MXFMetadataGenericPackage *package, MXFMetadataTrack *track, GstTagList **tags, MXFEssenceElementHandler *handler, gpointer *mapping_data);
|
||||
|
||||
void mxf_up_init (void);
|
||||
|
||||
#endif /* __MXF_UP_H__ */
|
||||
|
|
Loading…
Reference in a new issue