From b5b2e44563a4073e44eedee07cc181e6285925ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 28 Feb 2009 20:39:42 +0100 Subject: mxf: Store the metadata type ID inside the class structure --- gst/mxf/mxfaes-bwf.c | 14 ++-- gst/mxf/mxfdms1.c | 156 +++++++++++++++++++++++++++++----------- gst/mxf/mxfmetadata.c | 192 ++++++++++++++++++++++++++++++++++---------------- gst/mxf/mxfmetadata.h | 76 ++++++++++---------- gst/mxf/mxfmpeg.c | 7 +- 5 files changed, 297 insertions(+), 148 deletions(-) (limited to 'gst') diff --git a/gst/mxf/mxfaes-bwf.c b/gst/mxf/mxfaes-bwf.c index 7a3ad4ec..d40ff6a6 100644 --- a/gst/mxf/mxfaes-bwf.c +++ b/gst/mxf/mxfaes-bwf.c @@ -50,7 +50,7 @@ GST_DEBUG_CATEGORY_EXTERN (mxf_debug); (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR)) typedef struct _MXFMetadataWaveAudioEssenceDescriptor MXFMetadataWaveAudioEssenceDescriptor; -typedef MXFMetadataBaseClass MXFMetadataWaveAudioEssenceDescriptorClass; +typedef MXFMetadataClass MXFMetadataWaveAudioEssenceDescriptorClass; GType mxf_metadata_wave_audio_essence_descriptor_get_type (void); struct _MXFMetadataWaveAudioEssenceDescriptor @@ -86,7 +86,7 @@ struct _MXFMetadataWaveAudioEssenceDescriptor (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR)) typedef struct _MXFMetadataAES3AudioEssenceDescriptor MXFMetadataAES3AudioEssenceDescriptor; -typedef MXFMetadataBaseClass MXFMetadataAES3AudioEssenceDescriptorClass; +typedef MXFMetadataClass MXFMetadataAES3AudioEssenceDescriptorClass; GType mxf_metadata_aes3_audio_essence_descriptor_get_type (void); struct _MXFMetadataAES3AudioEssenceDescriptor @@ -317,12 +317,14 @@ static void (MXFMetadataWaveAudioEssenceDescriptorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_wave_audio_essence_descriptor_handle_tag; metadata_base_class->name_quark = MXF_QUARK (WAVE_AUDIO_ESSENCE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_wave_audio_essence_descriptor_to_structure; + metadata_class->type = 0x0148; } /* SMPTE 382M Annex 2 */ @@ -717,6 +719,7 @@ static void { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_aes3_audio_essence_descriptor_finalize; @@ -725,6 +728,7 @@ static void metadata_base_class->name_quark = MXF_QUARK (AES3_AUDIO_ESSENCE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_aes3_audio_essence_descriptor_to_structure; + metadata_class->type = 0x0147; } static gboolean @@ -1050,10 +1054,8 @@ static const MXFEssenceElementHandler mxf_aes_bwf_essence_handler = { 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); + mxf_metadata_register (MXF_TYPE_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR); + mxf_metadata_register (MXF_TYPE_METADATA_AES3_AUDIO_ESSENCE_DESCRIPTOR); mxf_essence_element_handler_register (&mxf_aes_bwf_essence_handler); } diff --git a/gst/mxf/mxfdms1.c b/gst/mxf/mxfdms1.c index 86adf473..083e6a08 100644 --- a/gst/mxf/mxfdms1.c +++ b/gst/mxf/mxfdms1.c @@ -99,8 +99,10 @@ static void mxf_dms1_class_init (MXFDMS1Class * klass) { MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; metadatabase_class->handle_tag = mxf_dms1_handle_tag; + dm_class->scheme = 0x01; } G_DEFINE_ABSTRACT_TYPE (MXFDMS1TextLanguage, mxf_dms1_text_language, @@ -1055,10 +1057,13 @@ mxf_dms1_production_framework_class_init (MXFDMS1ProductionFrameworkClass * { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_production_framework_finalize; metadatabase_class->handle_tag = mxf_dms1_production_framework_handle_tag; metadatabase_class->resolve = mxf_dms1_production_framework_resolve; + + dm_class->type = 0x010100; } G_DEFINE_TYPE (MXFDMS1ClipFramework, mxf_dms1_clip_framework, @@ -1326,10 +1331,12 @@ mxf_dms1_clip_framework_class_init (MXFDMS1ClipFrameworkClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_clip_framework_finalize; metadatabase_class->handle_tag = mxf_dms1_clip_framework_handle_tag; metadatabase_class->resolve = mxf_dms1_clip_framework_resolve; + dm_class->type = 0x010200; } G_DEFINE_TYPE (MXFDMS1SceneFramework, mxf_dms1_scene_framework, @@ -1487,10 +1494,12 @@ mxf_dms1_scene_framework_class_init (MXFDMS1SceneFrameworkClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_scene_framework_finalize; metadatabase_class->handle_tag = mxf_dms1_scene_framework_handle_tag; metadatabase_class->resolve = mxf_dms1_scene_framework_resolve; + dm_class->type = 0x010300; } G_DEFINE_TYPE (MXFDMS1Titles, mxf_dms1_titles, MXF_TYPE_DMS1_TEXT_LANGUAGE); @@ -1585,9 +1594,11 @@ mxf_dms1_titles_class_init (MXFDMS1TitlesClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_titles_finalize; metadatabase_class->handle_tag = mxf_dms1_titles_handle_tag; + dm_class->type = 0x100100; } G_DEFINE_TYPE (MXFDMS1Identification, mxf_dms1_identification, @@ -1691,9 +1702,11 @@ mxf_dms1_identification_class_init (MXFDMS1IdentificationClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_identification_finalize; metadatabase_class->handle_tag = mxf_dms1_identification_handle_tag; + dm_class->type = 0x110100; } G_DEFINE_TYPE (MXFDMS1GroupRelationship, mxf_dms1_group_relationship, @@ -1823,9 +1836,11 @@ mxf_dms1_group_relationship_class_init (MXFDMS1GroupRelationshipClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_group_relationship_finalize; metadatabase_class->handle_tag = mxf_dms1_group_relationship_handle_tag; + dm_class->type = 0x120100; } G_DEFINE_TYPE (MXFDMS1Branding, mxf_dms1_branding, MXF_TYPE_DMS1_TEXT_LANGUAGE); @@ -1893,9 +1908,11 @@ mxf_dms1_branding_class_init (MXFDMS1BrandingClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_branding_finalize; metadatabase_class->handle_tag = mxf_dms1_branding_handle_tag; + dm_class->type = 0x130100; } G_DEFINE_TYPE (MXFDMS1Event, mxf_dms1_event, MXF_TYPE_DMS1_THESAURUS); @@ -2068,10 +2085,12 @@ mxf_dms1_event_class_init (MXFDMS1EventClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_event_finalize; metadatabase_class->handle_tag = mxf_dms1_event_handle_tag; metadatabase_class->resolve = mxf_dms1_event_resolve; + dm_class->type = 0x140100; } G_DEFINE_TYPE (MXFDMS1Publication, mxf_dms1_publication, MXF_TYPE_DMS1); @@ -2162,9 +2181,11 @@ mxf_dms1_publication_class_init (MXFDMS1PublicationClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_publication_finalize; metadatabase_class->handle_tag = mxf_dms1_publication_handle_tag; + dm_class->type = 0x140200; } G_DEFINE_TYPE (MXFDMS1Award, mxf_dms1_award, MXF_TYPE_DMS1_THESAURUS); @@ -2320,10 +2341,12 @@ mxf_dms1_award_class_init (MXFDMS1AwardClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_award_finalize; metadatabase_class->handle_tag = mxf_dms1_award_handle_tag; metadatabase_class->resolve = mxf_dms1_award_resolve; + dm_class->type = 0x150100; } G_DEFINE_TYPE (MXFDMS1CaptionsDescription, mxf_dms1_captions_description, @@ -2401,9 +2424,11 @@ mxf_dms1_captions_description_class_init (MXFDMS1CaptionsDescriptionClass * { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_captions_description_finalize; metadatabase_class->handle_tag = mxf_dms1_captions_description_handle_tag; + dm_class->type = 0x160100; } G_DEFINE_TYPE (MXFDMS1Annotation, mxf_dms1_annotation, MXF_TYPE_DMS1_THESAURUS); @@ -2629,10 +2654,12 @@ mxf_dms1_annotation_class_init (MXFDMS1AnnotationClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_annotation_finalize; metadatabase_class->handle_tag = mxf_dms1_annotation_handle_tag; metadatabase_class->resolve = mxf_dms1_annotation_resolve; + dm_class->type = 0x170100; } G_DEFINE_TYPE (MXFDMS1SettingPeriod, mxf_dms1_setting_period, @@ -2723,9 +2750,11 @@ mxf_dms1_setting_period_class_init (MXFDMS1SettingPeriodClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_setting_period_finalize; metadatabase_class->handle_tag = mxf_dms1_setting_period_handle_tag; + dm_class->type = 0x170200; } G_DEFINE_TYPE (MXFDMS1Scripting, mxf_dms1_scripting, MXF_TYPE_DMS1_THESAURUS); @@ -2824,9 +2853,11 @@ mxf_dms1_scripting_class_init (MXFDMS1ScriptingClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_scripting_finalize; metadatabase_class->handle_tag = mxf_dms1_scripting_handle_tag; + dm_class->type = 0x170300; } G_DEFINE_TYPE (MXFDMS1Classification, mxf_dms1_classification, @@ -2945,10 +2976,12 @@ mxf_dms1_classification_class_init (MXFDMS1ClassificationClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_classification_finalize; metadatabase_class->handle_tag = mxf_dms1_classification_handle_tag; metadatabase_class->resolve = mxf_dms1_classification_resolve; + dm_class->type = 0x170400; } G_DEFINE_TYPE (MXFDMS1Shot, mxf_dms1_shot, MXF_TYPE_DMS1_TEXT_LANGUAGE); @@ -3151,10 +3184,12 @@ mxf_dms1_shot_class_init (MXFDMS1ShotClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_shot_finalize; metadatabase_class->handle_tag = mxf_dms1_shot_handle_tag; metadatabase_class->resolve = mxf_dms1_shot_resolve; + dm_class->type = 0x170500; } G_DEFINE_TYPE (MXFDMS1KeyPoint, mxf_dms1_key_point, MXF_TYPE_DMS1_THESAURUS); @@ -3238,9 +3273,11 @@ mxf_dms1_key_point_class_init (MXFDMS1KeyPointClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_key_point_finalize; metadatabase_class->handle_tag = mxf_dms1_key_point_handle_tag; + dm_class->type = 0x170600; } G_DEFINE_TYPE (MXFDMS1Participant, mxf_dms1_participant, @@ -3436,10 +3473,12 @@ mxf_dms1_participant_class_init (MXFDMS1ParticipantClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_participant_finalize; metadatabase_class->handle_tag = mxf_dms1_participant_handle_tag; metadatabase_class->resolve = mxf_dms1_participant_resolve; + dm_class->type = 0x180100; } G_DEFINE_ABSTRACT_TYPE (MXFDMS1Contact, mxf_dms1_contact, @@ -3821,10 +3860,12 @@ mxf_dms1_person_class_init (MXFDMS1PersonClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_person_finalize; metadatabase_class->handle_tag = mxf_dms1_person_handle_tag; metadatabase_class->resolve = mxf_dms1_person_resolve; + dm_class->type = 0x1a0200; } G_DEFINE_TYPE (MXFDMS1Organisation, mxf_dms1_organisation, @@ -3915,9 +3956,11 @@ mxf_dms1_organisation_class_init (MXFDMS1OrganisationClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_organisation_finalize; metadatabase_class->handle_tag = mxf_dms1_organisation_handle_tag; + dm_class->type = 0x1a0300; } G_DEFINE_TYPE (MXFDMS1Location, mxf_dms1_location, MXF_TYPE_DMS1_CONTACT); @@ -3984,9 +4027,11 @@ mxf_dms1_location_class_init (MXFDMS1LocationClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_location_finalize; metadatabase_class->handle_tag = mxf_dms1_location_handle_tag; + dm_class->type = 0x1a0400; } G_DEFINE_TYPE (MXFDMS1Address, mxf_dms1_address, MXF_TYPE_DMS1); @@ -4260,10 +4305,12 @@ mxf_dms1_address_class_init (MXFDMS1AddressClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_address_finalize; metadatabase_class->handle_tag = mxf_dms1_address_handle_tag; metadatabase_class->resolve = mxf_dms1_address_resolve; + dm_class->type = 0x1b0100; } G_DEFINE_TYPE (MXFDMS1Communications, mxf_dms1_communications, MXF_TYPE_DMS1); @@ -4379,9 +4426,11 @@ mxf_dms1_communications_class_init (MXFDMS1CommunicationsClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_communications_finalize; metadatabase_class->handle_tag = mxf_dms1_communications_handle_tag; + dm_class->type = 0x1b0200; } G_DEFINE_TYPE (MXFDMS1Contract, mxf_dms1_contract, MXF_TYPE_DMS1_THESAURUS); @@ -4532,10 +4581,12 @@ mxf_dms1_contract_class_init (MXFDMS1ContractClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_contract_finalize; metadatabase_class->handle_tag = mxf_dms1_contract_handle_tag; metadatabase_class->resolve = mxf_dms1_contract_resolve; + dm_class->type = 0x1c0100; } G_DEFINE_TYPE (MXFDMS1Rights, mxf_dms1_rights, MXF_TYPE_DMS1_THESAURUS); @@ -4706,9 +4757,11 @@ mxf_dms1_rights_class_init (MXFDMS1RightsClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_rights_finalize; metadatabase_class->handle_tag = mxf_dms1_rights_handle_tag; + dm_class->type = 0x1c0200; } G_DEFINE_TYPE (MXFDMS1PictureFormat, mxf_dms1_picture_format, MXF_TYPE_DMS1); @@ -4795,9 +4848,11 @@ mxf_dms1_picture_format_class_init (MXFDMS1PictureFormatClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_picture_format_finalize; metadatabase_class->handle_tag = mxf_dms1_picture_format_handle_tag; + dm_class->type = 0x1d0100; } G_DEFINE_TYPE (MXFDMS1DeviceParameters, mxf_dms1_device_parameters, @@ -4997,10 +5052,12 @@ mxf_dms1_device_parameters_class_init (MXFDMS1DeviceParametersClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_device_parameters_finalize; metadatabase_class->handle_tag = mxf_dms1_device_parameters_handle_tag; metadatabase_class->resolve = mxf_dms1_device_parameters_resolve; + dm_class->type = 0x1e0100; } G_DEFINE_TYPE (MXFDMS1NameValue, mxf_dms1_name_value, MXF_TYPE_DMS1); @@ -5087,9 +5144,11 @@ mxf_dms1_name_value_class_init (MXFDMS1NameValueClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_name_value_finalize; metadatabase_class->handle_tag = mxf_dms1_name_value_handle_tag; + dm_class->type = 0x1f0100; } G_DEFINE_TYPE (MXFDMS1Processing, mxf_dms1_processing, MXF_TYPE_DMS1); @@ -5214,9 +5273,11 @@ mxf_dms1_processing_class_init (MXFDMS1ProcessingClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_processing_finalize; metadatabase_class->handle_tag = mxf_dms1_processing_handle_tag; + dm_class->type = 0x200100; } G_DEFINE_TYPE (MXFDMS1Project, mxf_dms1_project, MXF_TYPE_DMS1); @@ -5289,9 +5350,11 @@ mxf_dms1_project_class_init (MXFDMS1ProjectClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_project_finalize; metadatabase_class->handle_tag = mxf_dms1_project_handle_tag; + dm_class->type = 0x200200; } G_DEFINE_TYPE (MXFDMS1ContactsList, mxf_dms1_contacts_list, MXF_TYPE_DMS1); @@ -5471,10 +5534,12 @@ mxf_dms1_contacts_list_class_init (MXFDMS1ContactsListClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_contacts_list_finalize; metadatabase_class->handle_tag = mxf_dms1_contacts_list_handle_tag; metadatabase_class->resolve = mxf_dms1_contacts_list_resolve; + dm_class->type = 0x190100; } G_DEFINE_TYPE (MXFDMS1CueWords, mxf_dms1_cue_words, @@ -5541,56 +5606,65 @@ mxf_dms1_cue_words_class_init (MXFDMS1CueWordsClass * klass) { GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; MXFMetadataBaseClass *metadatabase_class = (MXFMetadataBaseClass *) klass; + MXFDescriptiveMetadataClass *dm_class = (MXFDescriptiveMetadataClass *) klass; miniobject_class->finalize = mxf_dms1_cue_words_finalize; metadatabase_class->handle_tag = mxf_dms1_cue_words_handle_tag; + dm_class->type = 0x170800; } -#define ADD_SET(ID, TYPE) \ - set = g_slice_new (MXFDescriptiveMetadataSet); \ - set->id = ID; \ - set->type = TYPE; \ - dms1_sets = g_slist_prepend (dms1_sets, set); - void mxf_dms1_initialize (void) { GSList *dms1_sets = NULL; - MXFDescriptiveMetadataSet *set; - - /* SMPTE S380M Table 3 */ - ADD_SET (0x010100, MXF_TYPE_DMS1_PRODUCTION_FRAMEWORK); - ADD_SET (0x010200, MXF_TYPE_DMS1_CLIP_FRAMEWORK); - ADD_SET (0x010300, MXF_TYPE_DMS1_SCENE_FRAMEWORK); - ADD_SET (0x100100, MXF_TYPE_DMS1_TITLES); - ADD_SET (0x110100, MXF_TYPE_DMS1_IDENTIFICATION); - ADD_SET (0x120100, MXF_TYPE_DMS1_GROUP_RELATIONSHIP); - ADD_SET (0x130100, MXF_TYPE_DMS1_BRANDING); - ADD_SET (0x140100, MXF_TYPE_DMS1_EVENT); - ADD_SET (0x140200, MXF_TYPE_DMS1_PUBLICATION); - ADD_SET (0x150100, MXF_TYPE_DMS1_AWARD); - ADD_SET (0x160100, MXF_TYPE_DMS1_CAPTIONS_DESCRIPTION); - ADD_SET (0x170100, MXF_TYPE_DMS1_ANNOTATION); - ADD_SET (0x170200, MXF_TYPE_DMS1_SETTING_PERIOD); - ADD_SET (0x170300, MXF_TYPE_DMS1_SCRIPTING); - ADD_SET (0x170400, MXF_TYPE_DMS1_CLASSIFICATION); - ADD_SET (0x170500, MXF_TYPE_DMS1_SHOT); - ADD_SET (0x170600, MXF_TYPE_DMS1_KEY_POINT); - ADD_SET (0x180100, MXF_TYPE_DMS1_PARTICIPANT); - ADD_SET (0x1a0200, MXF_TYPE_DMS1_PERSON); - ADD_SET (0x1a0300, MXF_TYPE_DMS1_ORGANISATION); - ADD_SET (0x1a0400, MXF_TYPE_DMS1_LOCATION); - ADD_SET (0x1b0100, MXF_TYPE_DMS1_ADDRESS); - ADD_SET (0x1b0200, MXF_TYPE_DMS1_COMMUNICATIONS); - ADD_SET (0x1c0100, MXF_TYPE_DMS1_CONTRACT); - ADD_SET (0x1c0200, MXF_TYPE_DMS1_RIGHTS); - ADD_SET (0x1d0100, MXF_TYPE_DMS1_PICTURE_FORMAT); - ADD_SET (0x1e0100, MXF_TYPE_DMS1_DEVICE_PARAMETERS); - ADD_SET (0x1f0100, MXF_TYPE_DMS1_NAME_VALUE); - ADD_SET (0x200100, MXF_TYPE_DMS1_PROCESSING); - ADD_SET (0x200200, MXF_TYPE_DMS1_PROJECT); - ADD_SET (0x190100, MXF_TYPE_DMS1_CONTACTS_LIST); - ADD_SET (0x170800, MXF_TYPE_DMS1_CUE_WORDS); + + dms1_sets = + g_slist_prepend (dms1_sets, + (gpointer) MXF_TYPE_DMS1_PRODUCTION_FRAMEWORK); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_CLIP_FRAMEWORK); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_SCENE_FRAMEWORK); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_TITLES); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_IDENTIFICATION); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_GROUP_RELATIONSHIP); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_BRANDING); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_EVENT); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_PUBLICATION); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_AWARD); + dms1_sets = + g_slist_prepend (dms1_sets, + (gpointer) MXF_TYPE_DMS1_CAPTIONS_DESCRIPTION); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_ANNOTATION); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_SETTING_PERIOD); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_SCRIPTING); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_CLASSIFICATION); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_SHOT); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_KEY_POINT); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_PARTICIPANT); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_PERSON); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_ORGANISATION); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_LOCATION); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_ADDRESS); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_COMMUNICATIONS); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_CONTRACT); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_RIGHTS); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_PICTURE_FORMAT); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_DEVICE_PARAMETERS); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_NAME_VALUE); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_PROCESSING); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_PROJECT); + dms1_sets = + g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_CONTACTS_LIST); + dms1_sets = g_slist_prepend (dms1_sets, (gpointer) MXF_TYPE_DMS1_CUE_WORDS); mxf_descriptive_metadata_register (0x01, dms1_sets); } diff --git a/gst/mxf/mxfmetadata.c b/gst/mxf/mxfmetadata.c index c1849c0d..9e3af62f 100644 --- a/gst/mxf/mxfmetadata.c +++ b/gst/mxf/mxfmetadata.c @@ -295,67 +295,86 @@ typedef struct void mxf_metadata_init_types (void) { - _MXFMetadataType *l; - g_return_if_fail (_mxf_metadata_registry == NULL); -#define _add_type(TI, T) \ - l = g_slice_new (_MXFMetadataType); \ - l->type_id = TI; \ - l->type = T; \ - _mxf_metadata_registry = g_slist_prepend (_mxf_metadata_registry, l); - - /* SMPTE S377M 8.6 Table 14 */ - _add_type (0x012f, MXF_TYPE_METADATA_PREFACE); - _add_type (0x0130, MXF_TYPE_METADATA_IDENTIFICATION); - _add_type (0x0118, MXF_TYPE_METADATA_CONTENT_STORAGE); - _add_type (0x0123, MXF_TYPE_METADATA_ESSENCE_CONTAINER_DATA); - _add_type (0x0136, MXF_TYPE_METADATA_MATERIAL_PACKAGE); - _add_type (0x0137, MXF_TYPE_METADATA_SOURCE_PACKAGE); - _add_type (0x013b, MXF_TYPE_METADATA_TIMELINE_TRACK); - _add_type (0x0139, MXF_TYPE_METADATA_EVENT_TRACK); - _add_type (0x013a, MXF_TYPE_METADATA_STATIC_TRACK); - _add_type (0x010f, MXF_TYPE_METADATA_SEQUENCE); - _add_type (0x0111, MXF_TYPE_METADATA_SOURCE_CLIP); - _add_type (0x0114, MXF_TYPE_METADATA_TIMECODE_COMPONENT); - _add_type (0x0141, MXF_TYPE_METADATA_DM_SEGMENT); - _add_type (0x0145, MXF_TYPE_METADATA_DM_SOURCE_CLIP); - _add_type (0x0125, MXF_TYPE_METADATA_FILE_DESCRIPTOR); - _add_type (0x0127, MXF_TYPE_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR); - _add_type (0x0128, MXF_TYPE_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR); - _add_type (0x0129, MXF_TYPE_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR); - _add_type (0x0142, MXF_TYPE_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR); - _add_type (0x0143, MXF_TYPE_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR); - _add_type (0x0144, MXF_TYPE_METADATA_MULTIPLE_DESCRIPTOR); - _add_type (0x0132, MXF_TYPE_METADATA_NETWORK_LOCATOR); - _add_type (0x0133, MXF_TYPE_METADATA_TEXT_LOCATOR); - -#undef _add_type + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_PREFACE); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_IDENTIFICATION); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_CONTENT_STORAGE); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_ESSENCE_CONTAINER_DATA); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_MATERIAL_PACKAGE); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_SOURCE_PACKAGE); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_TIMELINE_TRACK); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_EVENT_TRACK); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_STATIC_TRACK); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_SEQUENCE); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_SOURCE_CLIP); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_TIMECODE_COMPONENT); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_DM_SEGMENT); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_DM_SOURCE_CLIP); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_FILE_DESCRIPTOR); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_MULTIPLE_DESCRIPTOR); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_NETWORK_LOCATOR); + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, + (gpointer) MXF_TYPE_METADATA_TEXT_LOCATOR); } void -mxf_metadata_register (guint16 type_id, GType type) +mxf_metadata_register (GType type) { g_return_if_fail (g_type_is_a (type, MXF_TYPE_METADATA)); - g_return_if_fail (type_id != 0); - g_return_if_fail (_mxf_metadata_registry != NULL); - - { - GSList *l = _mxf_metadata_registry; - for (; l; l = l->next) { - if (((_MXFMetadataType *) l->data)->type_id == type_id) { - return; - } - } - } - - { - _MXFMetadataType *l = g_slice_new (_MXFMetadataType); - l->type_id = type_id; - l->type = type; - _mxf_metadata_registry = g_slist_prepend (_mxf_metadata_registry, l); - } + _mxf_metadata_registry = + g_slist_prepend (_mxf_metadata_registry, (gpointer) type); } MXFMetadata * @@ -371,12 +390,15 @@ mxf_metadata_new (guint16 type, MXFPrimerPack * primer, guint64 offset, g_return_val_if_fail (_mxf_metadata_registry != NULL, NULL); for (l = _mxf_metadata_registry; l; l = l->next) { - _MXFMetadataType *data = l->data; + GType tmp = (GType) l->data; + MXFMetadataClass *klass = MXF_METADATA_CLASS (g_type_class_ref (tmp)); - if (data->type_id == type) { - t = data->type; + if (klass->type == type) { + g_type_class_unref (klass); + t = tmp; break; } + g_type_class_unref (klass); } if (t == G_TYPE_INVALID) { @@ -397,7 +419,6 @@ mxf_metadata_new (guint16 type, MXFPrimerPack * primer, guint64 offset, return NULL; } - ret->type = type; ret->parent.offset = offset; return ret; } @@ -735,12 +756,14 @@ mxf_metadata_preface_class_init (MXFMetadataPrefaceClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_preface_finalize; metadata_base_class->handle_tag = mxf_metadata_preface_handle_tag; metadata_base_class->resolve = mxf_metadata_preface_resolve; metadata_base_class->to_structure = mxf_metadata_preface_to_structure; metadata_base_class->name_quark = MXF_QUARK (PREFACE); + metadata_class->type = 0x012f; } G_DEFINE_TYPE (MXFMetadataIdentification, mxf_metadata_identification, @@ -933,11 +956,13 @@ mxf_metadata_identification_class_init (MXFMetadataIdentificationClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_identification_finalize; metadata_base_class->handle_tag = mxf_metadata_identification_handle_tag; metadata_base_class->name_quark = MXF_QUARK (IDENTIFICATION); metadata_base_class->to_structure = mxf_metadata_identification_to_structure; + metadata_class->type = 0x0130; } G_DEFINE_TYPE (MXFMetadataContentStorage, mxf_metadata_content_storage, @@ -1170,12 +1195,14 @@ mxf_metadata_content_storage_class_init (MXFMetadataContentStorageClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_content_storage_finalize; metadata_base_class->handle_tag = mxf_metadata_content_storage_handle_tag; metadata_base_class->resolve = mxf_metadata_content_storage_resolve; metadata_base_class->name_quark = MXF_QUARK (CONTENT_STORAGE); metadata_base_class->to_structure = mxf_metadata_content_storage_to_structure; + metadata_class->type = 0x0118; } G_DEFINE_TYPE (MXFMetadataEssenceContainerData, @@ -1316,6 +1343,7 @@ static void (MXFMetadataEssenceContainerDataClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_essence_container_data_handle_tag; @@ -1323,6 +1351,7 @@ static void metadata_base_class->name_quark = MXF_QUARK (ESSENCE_CONTAINER_DATA); metadata_base_class->to_structure = mxf_metadata_essence_container_data_to_structure; + metadata_class->type = 0x0123; } G_DEFINE_ABSTRACT_TYPE (MXFMetadataGenericPackage, mxf_metadata_generic_package, @@ -1645,9 +1674,11 @@ mxf_metadata_material_package_class_init (MXFMetadataMaterialPackageClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->resolve = mxf_metadata_material_package_resolve; metadata_base_class->name_quark = MXF_QUARK (MATERIAL_PACKAGE); + metadata_class->type = 0x0136; } G_DEFINE_TYPE (MXFMetadataSourcePackage, mxf_metadata_source_package, @@ -1813,11 +1844,13 @@ static void mxf_metadata_source_package_class_init (MXFMetadataSourcePackageClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_source_package_handle_tag; metadata_base_class->resolve = mxf_metadata_source_package_resolve; metadata_base_class->name_quark = MXF_QUARK (SOURCE_PACKAGE); metadata_base_class->to_structure = mxf_metadata_source_package_to_structure; + metadata_class->type = 0x0137; } G_DEFINE_ABSTRACT_TYPE (MXFMetadataTrack, mxf_metadata_track, @@ -2087,10 +2120,12 @@ static void mxf_metadata_timeline_track_class_init (MXFMetadataTimelineTrackClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_timeline_track_handle_tag; metadata_base_class->name_quark = MXF_QUARK (TIMELINE_TRACK); metadata_base_class->to_structure = mxf_metadata_timeline_track_to_structure; + metadata_class->type = 0x013b; } G_DEFINE_TYPE (MXFMetadataEventTrack, mxf_metadata_event_track, @@ -2159,10 +2194,12 @@ static void mxf_metadata_event_track_class_init (MXFMetadataEventTrackClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_event_track_handle_tag; metadata_base_class->name_quark = MXF_QUARK (EVENT_TRACK); metadata_base_class->to_structure = mxf_metadata_event_track_to_structure; + metadata_class->type = 0x0139; } G_DEFINE_TYPE (MXFMetadataStaticTrack, mxf_metadata_static_track, @@ -2177,8 +2214,10 @@ static void mxf_metadata_static_track_class_init (MXFMetadataStaticTrackClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->name_quark = MXF_QUARK (STATIC_TRACK); + metadata_class->type = 0x013a; } G_DEFINE_TYPE (MXFMetadataSequence, mxf_metadata_sequence, MXF_TYPE_METADATA); @@ -2349,12 +2388,14 @@ mxf_metadata_sequence_class_init (MXFMetadataSequenceClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_sequence_finalize; metadata_base_class->handle_tag = mxf_metadata_sequence_handle_tag; metadata_base_class->resolve = mxf_metadata_sequence_resolve; metadata_base_class->name_quark = MXF_QUARK (SEQUENCE); metadata_base_class->to_structure = mxf_metadata_sequence_to_structure; + metadata_class->type = 0x010f; } G_DEFINE_TYPE (MXFMetadataStructuralComponent, @@ -2514,11 +2555,13 @@ mxf_metadata_timecode_component_class_init (MXFMetadataTimecodeComponentClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_timecode_component_handle_tag; metadata_base_class->name_quark = MXF_QUARK (TIMECODE_COMPONENT); metadata_base_class->to_structure = mxf_metadata_timecode_component_to_structure; + metadata_class->type = 0x0114; } G_DEFINE_TYPE (MXFMetadataSourceClip, mxf_metadata_source_clip, @@ -2643,11 +2686,13 @@ static void mxf_metadata_source_clip_class_init (MXFMetadataSourceClipClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_source_clip_handle_tag; metadata_base_class->resolve = mxf_metadata_source_clip_resolve; metadata_base_class->name_quark = MXF_QUARK (SOURCE_CLIP); metadata_base_class->to_structure = mxf_metadata_source_clip_to_structure; + metadata_class->type = 0x0111; } G_DEFINE_TYPE (MXFMetadataDMSourceClip, mxf_metadata_dm_source_clip, @@ -2769,11 +2814,13 @@ mxf_metadata_dm_source_clip_class_init (MXFMetadataDMSourceClipClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_dm_source_clip_finalize; metadata_base_class->handle_tag = mxf_metadata_dm_source_clip_handle_tag; metadata_base_class->name_quark = MXF_QUARK (DM_SOURCE_CLIP); metadata_base_class->to_structure = mxf_metadata_dm_source_clip_to_structure; + metadata_class->type = 0x0145; } G_DEFINE_TYPE (MXFMetadataDMSegment, mxf_metadata_dm_segment, @@ -2959,12 +3006,14 @@ mxf_metadata_dm_segment_class_init (MXFMetadataDMSegmentClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_dm_segment_finalize; metadata_base_class->handle_tag = mxf_metadata_dm_segment_handle_tag; metadata_base_class->resolve = mxf_metadata_dm_segment_resolve; metadata_base_class->name_quark = MXF_QUARK (DM_SEGMENT); metadata_base_class->to_structure = mxf_metadata_dm_segment_to_structure; + metadata_class->type = 0x0141; } G_DEFINE_ABSTRACT_TYPE (MXFMetadataGenericDescriptor, @@ -3238,10 +3287,12 @@ static void mxf_metadata_file_descriptor_class_init (MXFMetadataFileDescriptorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_file_descriptor_handle_tag; metadata_base_class->name_quark = MXF_QUARK (FILE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_file_descriptor_to_structure; + metadata_class->type = 0x0125; } G_DEFINE_TYPE (MXFMetadataGenericPictureEssenceDescriptor, @@ -3559,6 +3610,7 @@ static void (MXFMetadataGenericPictureEssenceDescriptorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_generic_picture_essence_descriptor_handle_tag; @@ -3566,6 +3618,7 @@ static void MXF_QUARK (GENERIC_PICTURE_ESSENCE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_generic_picture_essence_descriptor_to_structure; + metadata_class->type = 0x0127; } void mxf_metadata_generic_picture_essence_descriptor_set_caps @@ -3760,6 +3813,7 @@ static void (MXFMetadataGenericSoundEssenceDescriptorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_generic_sound_essence_descriptor_handle_tag; @@ -3767,6 +3821,7 @@ static void MXF_QUARK (GENERIC_SOUND_ESSENCE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_generic_sound_essence_descriptor_to_structure; + metadata_class->type = 0x0142; } void mxf_metadata_generic_sound_essence_descriptor_set_caps @@ -3950,12 +4005,14 @@ static void (MXFMetadataCDCIPictureEssenceDescriptorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_cdci_picture_essence_descriptor_handle_tag; metadata_base_class->name_quark = MXF_QUARK (CDCI_PICTURE_ESSENCE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_cdci_picture_essence_descriptor_to_structure; + metadata_class->type = 0x0128; } G_DEFINE_TYPE (MXFMetadataRGBAPictureEssenceDescriptor, @@ -4125,6 +4182,7 @@ static void { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_rgba_picture_essence_descriptor_finalize; @@ -4133,6 +4191,7 @@ static void metadata_base_class->name_quark = MXF_QUARK (RGBA_PICTURE_ESSENCE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_rgba_picture_essence_descriptor_to_structure; + metadata_class->type = 0x0129; } G_DEFINE_TYPE (MXFMetadataGenericDataEssenceDescriptor, @@ -4210,12 +4269,14 @@ static void (MXFMetadataGenericDataEssenceDescriptorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_generic_data_essence_descriptor_handle_tag; metadata_base_class->name_quark = MXF_QUARK (GENERIC_DATA_ESSENCE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_generic_data_essence_descriptor_to_structure; + metadata_class->type = 0x0143; } G_DEFINE_TYPE (MXFMetadataMultipleDescriptor, mxf_metadata_multiple_descriptor, @@ -4372,6 +4433,7 @@ mxf_metadata_multiple_descriptor_class_init (MXFMetadataMultipleDescriptorClass { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_multiple_descriptor_finalize; metadata_base_class->handle_tag = mxf_metadata_multiple_descriptor_handle_tag; @@ -4379,6 +4441,7 @@ mxf_metadata_multiple_descriptor_class_init (MXFMetadataMultipleDescriptorClass metadata_base_class->name_quark = MXF_QUARK (MULTIPLE_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_multiple_descriptor_to_structure; + metadata_class->type = 0x0144; } G_DEFINE_ABSTRACT_TYPE (MXFMetadataLocator, mxf_metadata_locator, @@ -4458,11 +4521,13 @@ mxf_metadata_text_locator_class_init (MXFMetadataTextLocatorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_text_locator_finalize; metadata_base_class->handle_tag = mxf_metadata_text_locator_handle_tag; metadata_base_class->name_quark = MXF_QUARK (TEXT_LOCATOR); metadata_base_class->to_structure = mxf_metadata_text_locator_to_structure; + metadata_class->type = 0x0133; } G_DEFINE_TYPE (MXFMetadataNetworkLocator, mxf_metadata_network_locator, @@ -4528,11 +4593,13 @@ mxf_metadata_network_locator_class_init (MXFMetadataNetworkLocatorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; GstMiniObjectClass *miniobject_class = (GstMiniObjectClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; miniobject_class->finalize = mxf_metadata_network_locator_finalize; metadata_base_class->handle_tag = mxf_metadata_network_locator_handle_tag; metadata_base_class->name_quark = MXF_QUARK (NETWORK_LOCATOR); metadata_base_class->to_structure = mxf_metadata_network_locator_to_structure; + metadata_class->type = 0x0133; } G_DEFINE_ABSTRACT_TYPE (MXFDescriptiveMetadata, mxf_descriptive_metadata, @@ -4594,12 +4661,16 @@ mxf_descriptive_metadata_new (guint8 scheme, guint32 type, } for (l = s->sets; l; l = l->next) { - MXFDescriptiveMetadataSet *set = l->data; + GType tmp = (GType) l->data; + MXFDescriptiveMetadataClass *klass = + MXF_DESCRIPTIVE_METADATA_CLASS (g_type_class_ref (tmp)); - if (set->id == type) { - t = set->type; + if (klass->type == type) { + g_type_class_unref (klass); + t = tmp; break; } + g_type_class_unref (klass); } if (t == G_TYPE_INVALID) { @@ -4619,7 +4690,6 @@ mxf_descriptive_metadata_new (guint8 scheme, guint32 type, return NULL; } - ret->type = type; ret->parent.offset = offset; return ret; diff --git a/gst/mxf/mxfmetadata.h b/gst/mxf/mxfmetadata.h index 72e4e9e5..d3a9a3e4 100644 --- a/gst/mxf/mxfmetadata.h +++ b/gst/mxf/mxfmetadata.h @@ -50,7 +50,7 @@ GType mxf_metadata_base_get_type (void); #define MXF_METADATA_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass),MXF_TYPE_METADATA,MXFMetadataClass)) typedef struct _MXFMetadata MXFMetadata; -typedef MXFMetadataBaseClass MXFMetadataClass; +typedef struct _MXFMetadataClass MXFMetadataClass; GType mxf_metadata_get_type (void); #define MXF_TYPE_METADATA_PREFACE \ @@ -60,7 +60,7 @@ GType mxf_metadata_get_type (void); #define MXF_IS_METADATA_PREFACE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_PREFACE)) typedef struct _MXFMetadataPreface MXFMetadataPreface; -typedef MXFMetadataBaseClass MXFMetadataPrefaceClass; +typedef MXFMetadataClass MXFMetadataPrefaceClass; GType mxf_metadata_preface_get_type (void); #define MXF_TYPE_METADATA_IDENTIFICATION \ @@ -70,7 +70,7 @@ GType mxf_metadata_preface_get_type (void); #define MXF_IS_METADATA_IDENTIFICATION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_IDENTIFICATION)) typedef struct _MXFMetadataIdentification MXFMetadataIdentification; -typedef MXFMetadataBaseClass MXFMetadataIdentificationClass; +typedef MXFMetadataClass MXFMetadataIdentificationClass; GType mxf_metadata_identification_get_type (void); #define MXF_TYPE_METADATA_CONTENT_STORAGE \ @@ -80,7 +80,7 @@ GType mxf_metadata_identification_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataContentStorageClass; GType mxf_metadata_content_storage_get_type (void); #define MXF_TYPE_METADATA_ESSENCE_CONTAINER_DATA \ @@ -90,7 +90,7 @@ GType mxf_metadata_content_storage_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataEssenceContainerDataClass; GType mxf_metadata_essence_container_data_get_type (void); #define MXF_TYPE_METADATA_GENERIC_PACKAGE \ @@ -100,7 +100,7 @@ GType mxf_metadata_essence_container_data_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataGenericPackageClass; GType mxf_metadata_generic_package_get_type (void); #define MXF_TYPE_METADATA_MATERIAL_PACKAGE \ @@ -110,7 +110,7 @@ GType mxf_metadata_generic_package_get_type (void); #define MXF_IS_METADATA_MATERIAL_PACKAGE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_MATERIAL_PACKAGE)) typedef MXFMetadataGenericPackage MXFMetadataMaterialPackage; -typedef MXFMetadataBaseClass MXFMetadataMaterialPackageClass; +typedef MXFMetadataClass MXFMetadataMaterialPackageClass; GType mxf_metadata_material_package_get_type (void); #define MXF_TYPE_METADATA_SOURCE_PACKAGE \ @@ -120,7 +120,7 @@ GType mxf_metadata_material_package_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataSourcePackageClass; GType mxf_metadata_source_package_get_type (void); #define MXF_TYPE_METADATA_TRACK \ @@ -130,7 +130,7 @@ GType mxf_metadata_source_package_get_type (void); #define MXF_IS_METADATA_TRACK(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_TRACK)) typedef struct _MXFMetadataTrack MXFMetadataTrack; -typedef MXFMetadataBaseClass MXFMetadataTrackClass; +typedef MXFMetadataClass MXFMetadataTrackClass; GType mxf_metadata_track_get_type (void); #define MXF_TYPE_METADATA_TIMELINE_TRACK \ @@ -140,7 +140,7 @@ GType mxf_metadata_track_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataTimelineTrackClass; GType mxf_metadata_timeline_track_get_type (void); #define MXF_TYPE_METADATA_EVENT_TRACK \ @@ -150,7 +150,7 @@ GType mxf_metadata_timeline_track_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataEventTrackClass; GType mxf_metadata_event_track_get_type (void); #define MXF_TYPE_METADATA_STATIC_TRACK \ @@ -160,7 +160,7 @@ GType mxf_metadata_event_track_get_type (void); #define MXF_IS_METADATA_STATIC_TRACK(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_STATIC_TRACK)) typedef MXFMetadataTrack MXFMetadataStaticTrack; -typedef MXFMetadataBaseClass MXFMetadataStaticTrackClass; +typedef MXFMetadataClass MXFMetadataStaticTrackClass; GType mxf_metadata_static_track_get_type (void); #define MXF_TYPE_METADATA_SEQUENCE \ @@ -170,7 +170,7 @@ GType mxf_metadata_static_track_get_type (void); #define MXF_IS_METADATA_SEQUENCE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_SEQUENCE)) typedef struct _MXFMetadataSequence MXFMetadataSequence; -typedef MXFMetadataBaseClass MXFMetadataSequenceClass; +typedef MXFMetadataClass MXFMetadataSequenceClass; GType mxf_metadata_sequence_get_type (void); #define MXF_TYPE_METADATA_STRUCTURAL_COMPONENT \ @@ -180,7 +180,7 @@ GType mxf_metadata_sequence_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataStructuralComponentClass; GType mxf_metadata_structural_component_get_type (void); #define MXF_TYPE_METADATA_SOURCE_CLIP \ @@ -190,7 +190,7 @@ GType mxf_metadata_structural_component_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataSourceClipClass; GType mxf_metadata_source_clip_get_type (void); #define MXF_TYPE_METADATA_TIMECODE_COMPONENT \ @@ -200,7 +200,7 @@ GType mxf_metadata_source_clip_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataTimecodeComponentClass; GType mxf_metadata_timecode_component_get_type (void); #define MXF_TYPE_METADATA_DM_SOURCE_CLIP \ @@ -210,7 +210,7 @@ GType mxf_metadata_timecode_component_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataDMSourceClipClass; GType mxf_metadata_dm_source_clip_get_type (void); #define MXF_TYPE_METADATA_DM_SEGMENT \ @@ -220,7 +220,7 @@ GType mxf_metadata_dm_source_clip_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataDMSegmentClass; GType mxf_metadata_dm_segment_get_type (void); #define MXF_TYPE_METADATA_GENERIC_DESCRIPTOR \ @@ -230,7 +230,7 @@ GType mxf_metadata_dm_segment_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataGenericDescriptorClass; GType mxf_metadata_generic_descriptor_get_type (void); #define MXF_TYPE_METADATA_FILE_DESCRIPTOR \ @@ -240,7 +240,7 @@ GType mxf_metadata_generic_descriptor_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataFileDescriptorClass; GType mxf_metadata_file_descriptor_get_type (void); #define MXF_TYPE_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR \ @@ -250,7 +250,7 @@ GType mxf_metadata_file_descriptor_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataGenericPictureEssenceDescriptorClass; GType mxf_metadata_generic_picture_essence_descriptor_get_type (void); #define MXF_TYPE_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR \ @@ -260,7 +260,7 @@ GType mxf_metadata_generic_picture_essence_descriptor_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataCDCIPictureEssenceDescriptorClass; GType mxf_metadata_cdci_picture_essence_descriptor_get_type (void); #define MXF_TYPE_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR \ @@ -270,7 +270,7 @@ GType mxf_metadata_cdci_picture_essence_descriptor_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataRGBAPictureEssenceDescriptorClass; GType mxf_metadata_rgba_picture_essence_descriptor_get_type (void); #define MXF_TYPE_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR \ @@ -280,7 +280,7 @@ GType mxf_metadata_rgba_picture_essence_descriptor_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataGenericSoundEssenceDescriptorClass; GType mxf_metadata_generic_sound_essence_descriptor_get_type (void); #define MXF_TYPE_METADATA_GENERIC_DATA_ESSENCE_DESCRIPTOR \ @@ -290,7 +290,7 @@ GType mxf_metadata_generic_sound_essence_descriptor_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataGenericDataEssenceDescriptorClass; GType mxf_metadata_generic_data_essence_descriptor_get_type (void); #define MXF_TYPE_METADATA_MULTIPLE_DESCRIPTOR \ @@ -300,7 +300,7 @@ GType mxf_metadata_generic_data_essence_descriptor_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataMultipleDescriptorClass; GType mxf_metadata_multiple_descriptor_get_type (void); #define MXF_TYPE_METADATA_LOCATOR \ @@ -310,7 +310,7 @@ GType mxf_metadata_multiple_descriptor_get_type (void); #define MXF_IS_METADATA_LOCATOR(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),MXF_TYPE_METADATA_LOCATOR)) typedef struct _MXFMetadataLocator MXFMetadataLocator; -typedef MXFMetadataBaseClass MXFMetadataLocatorClass; +typedef MXFMetadataClass MXFMetadataLocatorClass; GType mxf_metadata_locator_get_type (void); #define MXF_TYPE_METADATA_NETWORK_LOCATOR \ @@ -320,7 +320,7 @@ GType mxf_metadata_locator_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataNetworkLocatorClass; GType mxf_metadata_network_locator_get_type (void); #define MXF_TYPE_METADATA_TEXT_LOCATOR \ @@ -330,7 +330,7 @@ GType mxf_metadata_network_locator_get_type (void); #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; +typedef MXFMetadataClass MXFMetadataTextLocatorClass; GType mxf_metadata_text_locator_get_type (void); #define MXF_TYPE_DESCRIPTIVE_METADATA \ @@ -392,7 +392,11 @@ struct _MXFMetadataBaseClass { struct _MXFMetadata { MXFMetadataBase parent; - +}; + +struct _MXFMetadataClass { + MXFMetadataBaseClass parent; + guint16 type; }; @@ -729,19 +733,15 @@ struct _MXFMetadataTextLocator { gchar *locator_name; }; -typedef struct { - guint32 id; - GType type; -} MXFDescriptiveMetadataSet; - struct _MXFDescriptiveMetadata { MXFMetadataBase parent; - - guint32 type; }; struct _MXFDescriptiveMetadataClass { MXFMetadataBase parent; + + guint8 scheme; + guint32 type; }; struct _MXFDescriptiveMetadataFrameworkInterface { @@ -753,7 +753,7 @@ gboolean mxf_metadata_base_resolve (MXFMetadataBase *self, GHashTable *metadata) GstStructure * mxf_metadata_base_to_structure (MXFMetadataBase *self); MXFMetadata *mxf_metadata_new (guint16 type, MXFPrimerPack *primer, guint64 offset, const guint8 *data, guint size); -void mxf_metadata_register (guint16 type_id, GType type); +void mxf_metadata_register (GType type); void mxf_metadata_init_types (void); MXFMetadataTrackType mxf_metadata_track_identifier_parse (const MXFUL * track_identifier); diff --git a/gst/mxf/mxfmpeg.c b/gst/mxf/mxfmpeg.c index c0ed1d29..996199af 100644 --- a/gst/mxf/mxfmpeg.c +++ b/gst/mxf/mxfmpeg.c @@ -102,7 +102,7 @@ static const guint8 _profile_and_level_ul[] = { #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; +typedef MXFMetadataClass MXFMetadataMPEGVideoDescriptorClass; GType mxf_metadata_mpeg_video_descriptor_get_type (void); struct _MXFMetadataMPEGVideoDescriptor @@ -254,12 +254,15 @@ static void (MXFMetadataMPEGVideoDescriptorClass * klass) { MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass; + MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass; metadata_base_class->handle_tag = mxf_metadata_mpeg_video_descriptor_handle_tag; metadata_base_class->name_quark = MXF_QUARK (MPEG_VIDEO_DESCRIPTOR); metadata_base_class->to_structure = mxf_metadata_mpeg_video_descriptor_to_structure; + + metadata_class->type = 0x0151; } typedef enum @@ -736,6 +739,6 @@ static const MXFEssenceElementHandler mxf_mpeg_essence_element_handler = { void mxf_mpeg_init (void) { - mxf_metadata_register (0x0151, MXF_TYPE_METADATA_MPEG_VIDEO_DESCRIPTOR); + mxf_metadata_register (MXF_TYPE_METADATA_MPEG_VIDEO_DESCRIPTOR); mxf_essence_element_handler_register (&mxf_mpeg_essence_element_handler); } -- cgit v1.2.1