summaryrefslogtreecommitdiffstats
path: root/gst/mxf/mxfdemux.c
AgeCommit message (Collapse)AuthorFilesLines
2009-01-31Generate an index table for essence streamsSebastian Dröge1-106/+208
Generate an index table for essence streams during playback and make sure that only the correct essence elements are used for played tracks. Make it possible to have one essence stream used in multiple playback tracks. Fix some minor bugs.
2009-01-31Allow index table segments without primer packSebastian Dröge1-9/+8
When parsing an index table segment without a valid primer pack in this partition only parse the static local tags and ignore all dynamic ones. This allows us to use index table segments in some broken files.
2009-01-31Add essence track abstractionSebastian Dröge1-246/+388
Add an abstraction to represent essence tracks and use this everywhere. This will later be used to keep track of positions and to generate/handle seek tables. Some random cleanup and renaming.
2009-01-31Improve detection of the end of the header metadataSebastian Dröge1-12/+19
Header metadata is finished after partition.header_byte_count bytes after the first byte of the primer pack are handled. After this there can only be index table segments, filler packets, essence or the start of the next partition. This fixes playback of some files that have non-standard metadata packets in the header metadata.
2009-01-23Store all partitions & primer packs in memory for faster accessSebastian Dröge1-116/+203
Store all partitions & primer packs in memory for faster access. This is later needed for fast seeking. Pre-fill the list of partitions with the content of the random index pack. Don't parse metadata of an partition twice.
2009-01-22Store MXF metadata in a hash table, keyed by UIDSebastian Dröge1-86/+105
Store the MXF metadata in a hash table, keyed by the instance UID. This simplifies resolval of the metadata and makes looping over all metadata sets unnecessary in most cases. Additionally parse metadata always. If we already have a metadata set with the same UID replace it only if the new metadata set is from a later offset. This fixes metadata parsing of files where following partitions don't have a complete copy of the previous metadata.
2009-01-22Build the random index pack while parsingSebastian Dröge1-10/+39
If the file contains no random index pack or just an invalid one build the random index pack while parsing.
2009-01-22Update copyrights for 2009Sebastian Dröge1-1/+1
2009-01-22Implement parsing of DMS1 (SMPTE S380M)Sebastian Dröge1-14/+24
2009-01-05gst/mxf/: "Generation UID" and "This Generation UID" are different so handle ↵Sebastian Dröge1-10/+8
them different. Also both are not part o... Original commit message from CVS: * gst/mxf/Makefile.am: * gst/mxf/mxfdemux.c: * gst/mxf/mxfmetadata.c: (mxf_metadata_handle_tag), (mxf_metadata_preface_handle_tag), (mxf_metadata_identification_handle_tag), (mxf_metadata_content_storage_handle_tag), (mxf_metadata_essence_container_data_handle_tag), (mxf_metadata_generic_package_handle_tag), (mxf_metadata_track_handle_tag), (mxf_metadata_sequence_handle_tag), (mxf_metadata_structural_component_handle_tag), (mxf_metadata_generic_descriptor_handle_tag), (mxf_metadata_locator_handle_tag), (mxf_metadata_locator_class_init): * gst/mxf/mxfmetadata.h: "Generation UID" and "This Generation UID" are different so handle them different. Also both are not part of every metadata type.
2009-01-05gst/mxf/mxfdemux.c: Don't allow negative or zero edit rates to prevent ↵Sebastian Dröge1-8/+21
division by zero and we support negative edit ... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_pad_next_component): Don't allow negative or zero edit rates to prevent division by zero and we support negative edit rates anyway.
2009-01-05gst/mxf/: Fix compilation with debugging disabled.Sebastian Dröge1-8/+10
Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: (mxf_metadata_wave_audio_essence_descriptor_handle_tag), (mxf_bwf_create_caps): * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_klv_packet): * gst/mxf/mxfmetadata.c: (mxf_metadata_handle_tag), (mxf_metadata_preface_handle_tag), (mxf_metadata_identification_handle_tag), (mxf_metadata_content_storage_handle_tag), (mxf_metadata_essence_container_data_handle_tag), (mxf_metadata_generic_package_handle_tag), (mxf_metadata_source_package_handle_tag), (mxf_metadata_track_handle_tag), (mxf_metadata_sequence_handle_tag), (mxf_metadata_structural_component_handle_tag), (mxf_metadata_source_clip_handle_tag), (mxf_metadata_dm_segment_handle_tag), (mxf_metadata_generic_descriptor_handle_tag), (mxf_metadata_file_descriptor_handle_tag), (mxf_metadata_generic_picture_essence_descriptor_handle_tag), (mxf_metadata_generic_sound_essence_descriptor_handle_tag), (mxf_metadata_generic_data_essence_descriptor_handle_tag), (mxf_metadata_multiple_descriptor_handle_tag): * gst/mxf/mxfparse.c: (mxf_partition_pack_parse), (mxf_index_table_segment_parse), (mxf_primer_pack_parse), (mxf_local_tag_add_to_hash_table): Fix compilation with debugging disabled.
2008-12-31Implement support for OP2a/b/c and OP3a/b/c, i.e. tracks with more than a ↵Sebastian Dröge1-54/+257
single component. This currently only works... Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: (mxf_bwf_handle_essence_element), (mxf_aes3_handle_essence_element): * gst/mxf/mxfalaw.c: (mxf_alaw_handle_essence_element): * gst/mxf/mxfd10.c: (mxf_d10_picture_handle_essence_element), (mxf_d10_sound_handle_essence_element): * gst/mxf/mxfdemux.c: (gst_mxf_demux_pad_init), (gst_mxf_demux_choose_package), (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_pad_next_component), (gst_mxf_demux_handle_generic_container_essence_element), (gst_mxf_demux_parse_footer_metadata), (gst_mxf_demux_handle_klv_packet), (gst_mxf_demux_src_query): * gst/mxf/mxfdv-dif.c: (mxf_dv_dif_handle_essence_element): * gst/mxf/mxfjpeg2000.c: (mxf_jpeg2000_handle_essence_element): * gst/mxf/mxfmetadata.c: (mxf_metadata_sequence_init), (mxf_metadata_structural_component_init), (mxf_metadata_generic_picture_essence_descriptor_init): * gst/mxf/mxfmpeg.c: (mxf_mpeg_video_handle_essence_element), (mxf_mpeg_audio_handle_essence_element): * gst/mxf/mxfparse.h: * gst/mxf/mxfup.c: (mxf_up_handle_essence_element): * gst/mxf/mxfvc3.c: (mxf_vc3_handle_essence_element): * tests/check/elements/mxfdemux.c: (_sink_chain): Implement support for OP2a/b/c and OP3a/b/c, i.e. tracks with more than a single component. This currently only works for the case where the components are stored in playback order in the file. Set some more default/distinguished values for the structural metadata. Make some types more strict by choosing the correct subclasses. Set DISCONT flag on buffers after a component switch. Take the last partition from the random index pack for the footer partition of the header partition doesn't reference the footer partition. This gives us the final structural metadata for some more files in the beginning.
2008-12-19gst/mxf/: Add mxf_metadata_generic_sound_essence_descriptor_set_caps() to ↵Sebastian Dröge1-4/+5
set rate and channels and use this for all ... Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: (mxf_bwf_create_caps), (mxf_aes3_create_caps): * gst/mxf/mxfalaw.c: (mxf_alaw_create_caps): * gst/mxf/mxfd10.c: (mxf_d10_create_caps): * gst/mxf/mxfdemux.c: * gst/mxf/mxfmetadata.c: (mxf_metadata_source_package_resolve), (mxf_metadata_generic_picture_essence_descriptor_set_caps), (mxf_metadata_generic_sound_essence_descriptor_set_caps): * gst/mxf/mxfmetadata.h: * gst/mxf/mxfmpeg.c: (mxf_mpeg_es_create_caps): Add mxf_metadata_generic_sound_essence_descriptor_set_caps() to set rate and channels and use this for all sound essence. Give some debug output when setting picture essence caps with invalid descriptor values. Fix height calculation from the frame layout a bit more and add a TODO to check if it's really correct now or if it needs more fixing (especially, does the framerate need adjustments?).
2008-12-17gst/mxf/mxfdemux.c: In push mode skip the run in again if we get buffers ↵Sebastian Dröge1-4/+9
with an offset before the run in. This can h... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_chain): In push mode skip the run in again if we get buffers with an offset before the run in. This can happen on seeks for example.
2008-12-16gst/mxf/: Implement an essence element handling registry and use this ↵Sebastian Dröge1-98/+24
instead of an hardcoded, large if-then-else block. Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: (mxf_is_aes_bwf_essence_track), (mxf_bwf_handle_essence_element), (mxf_aes3_handle_essence_element), (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_handle_essence_element), (mxf_alaw_create_caps), (mxf_alaw_init): * gst/mxf/mxfalaw.h: * gst/mxf/mxfd10.c: (mxf_is_d10_essence_track), (mxf_d10_picture_handle_essence_element), (mxf_d10_sound_handle_essence_element), (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_update_streams), (gst_mxf_demux_handle_generic_container_essence_element): * gst/mxf/mxfdv-dif.c: (mxf_is_dv_dif_essence_track), (mxf_dv_dif_handle_essence_element), (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_handle_essence_element), (mxf_jpeg2000_create_caps), (mxf_jpeg2000_init): * gst/mxf/mxfjpeg2000.h: * gst/mxf/mxfmpeg.c: (mxf_is_mpeg_essence_track), (mxf_mpeg_video_handle_essence_element), (mxf_mpeg_audio_handle_essence_element), (mxf_mpeg_es_create_caps), (mxf_mpeg_create_caps), (mxf_mpeg_init): * gst/mxf/mxfmpeg.h: * gst/mxf/mxfparse.c: (mxf_essence_element_handler_register), (mxf_essence_element_handler_find): * gst/mxf/mxfparse.h: * gst/mxf/mxfup.c: (mxf_is_up_essence_track), (mxf_up_handle_essence_element), (mxf_up_rgba_create_caps), (mxf_up_create_caps), (mxf_up_init): * gst/mxf/mxfup.h: Implement an essence element handling registry and use this instead of an hardcoded, large if-then-else block.
2008-12-16Add initial documentation for the MXF plugin and mxfdemux.Sebastian Dröge1-4/+17
Original commit message from CVS: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * docs/plugins/gst-plugins-bad-plugins.args: * docs/plugins/gst-plugins-bad-plugins.hierarchy: * docs/plugins/gst-plugins-bad-plugins.interfaces: * docs/plugins/gst-plugins-bad-plugins.prerequisites: * docs/plugins/inspect/plugin-ladspa.xml: * docs/plugins/inspect/plugin-musepack.xml: * docs/plugins/inspect/plugin-mxf.xml: * gst/mxf/mxfdemux.c: * gst/mxf/mxfdemux.h: Add initial documentation for the MXF plugin and mxfdemux.
2008-12-16gst/mxf/: Rename MXFMetadataBase methods to reflect that they belong toSebastian Dröge1-5/+6
Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_resolve_references): * gst/mxf/mxfmetadata.c: (mxf_metadata_base_resolve_default), (mxf_metadata_base_class_init), (mxf_metadata_base_parse), (mxf_metadata_base_resolve), (mxf_metadata_new), (mxf_metadata_preface_resolve), (mxf_metadata_content_storage_resolve), (mxf_metadata_essence_container_data_resolve), (mxf_metadata_generic_package_resolve), (mxf_metadata_source_package_resolve), (mxf_metadata_track_resolve), (mxf_metadata_sequence_resolve), (mxf_metadata_dm_segment_resolve), (mxf_metadata_generic_descriptor_resolve), (mxf_metadata_multiple_descriptor_resolve): * gst/mxf/mxfmetadata.h: Rename MXFMetadataBase methods to reflect that they belong to MXFMetadataBase and not MXFMetadata.
2008-12-15gst/mxf/: Convert the structural metadata to GstMiniObjects to make a lot of ↵Sebastian Dröge1-1426/+206
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.
2008-12-13gst/mxf/mxfdemux.c: Add a generic handler for descriptive metadata so we can ↵Sebastian Dröge1-2/+48
get some debug output and let users file... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_descriptive_metadata), (gst_mxf_demux_handle_klv_packet): Add a generic handler for descriptive metadata so we can get some debug output and let users file bugs for unsupport descriptive metadata schemes.
2008-12-12gst/mxf/: Major update of the TODO lists. There's still much to do.Sebastian Dröge1-8/+32
Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: * gst/mxf/mxfalaw.c: (mxf_alaw_create_caps): * gst/mxf/mxfdemux.c: * gst/mxf/mxfdv-dif.c: (mxf_dv_dif_create_caps): * gst/mxf/mxfjpeg2000.c: * gst/mxf/mxfmpeg.c: * gst/mxf/mxfup.c: Major update of the TODO lists. There's still much to do.
2008-12-11gst/mxf/: Implement parsing of Event Tracks, Static Tracks, DM Segments and ↵Sebastian Dröge1-13/+24
DM Source Clips as a preparation for desc... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_metadata_track), (gst_mxf_demux_handle_header_metadata_resolve_references), (gst_mxf_demux_handle_metadata): * gst/mxf/mxfparse.c: (mxf_metadata_track_parse), (mxf_metadata_structural_component_parse), (mxf_metadata_structural_component_reset): * gst/mxf/mxfparse.h: * gst/mxf/mxftypes.h: Implement parsing of Event Tracks, Static Tracks, DM Segments and DM Source Clips as a preparation for descriptive metadata support. Next step is to implement SMPTE S380M, "Descriptive Metadata Scheme-1".
2008-12-08gst/mxf/: Remove the concept of "final" metadata, broken files have updated ↵Sebastian Dröge1-40/+33
metadata in following partitions even if ... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_reset_metadata), (gst_mxf_demux_handle_primer_pack), (gst_mxf_demux_handle_metadata_preface), (gst_mxf_demux_handle_header_metadata_resolve_references), (gst_mxf_demux_choose_package), (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_parse_footer_metadata), (gst_mxf_demux_handle_klv_packet): * gst/mxf/mxfdemux.h: * gst/mxf/mxftypes.h: Remove the concept of "final" metadata, broken files have updated metadata in following partitions even if the current partition is closed and complete. If there's a second primer pack inside a partition ignore the second one instead of throwing an error. Store the type of a track (audio, video, timestamp, ...) inside the track struct. Post no-more-pads only once for a stream and not a second time when switching the currently playing package. When updating all streams make sure that we could select and find a package instead of dereferencing NULL. Allow descriptive metadata inside metadata parts of a file when pulling the footer metadata too. Only switch the currently playing package if a new one was chosen and the metadata is in a resolved state. If the latter isn't true postpone the switch until the metadata is resolved. Pull the footer metadata directly after parsing the header partition pack if it's not closed or not complete instead of waiting until the next KLV packet.
2008-12-07gst/mxf/mxfdemux.c: Rename GstMXFPad to GstMXFDemuxPad to prevent name ↵Sebastian Dröge1-45/+38
clashes with the GstMXFMuxPad in the muxer (la... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_pad_finalize), (gst_mxf_demux_pad_class_init), (gst_mxf_demux_pad_init), (gst_mxf_demux_remove_pad), (gst_mxf_demux_reset_metadata), (gst_mxf_demux_combine_flows), (gst_mxf_demux_handle_header_metadata_resolve_references), (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_handle_generic_container_essence_element), (gst_mxf_demux_pull_random_index_pack), (gst_mxf_demux_loop), (gst_mxf_demux_src_query): Rename GstMXFPad to GstMXFDemuxPad to prevent name clashes with the GstMXFMuxPad in the muxer (later). Pull the random index pack only directly after skipping the run in and don't allocate an array for it if parsing it failed.
2008-12-07gst/mxf/: Add initial support for uncompressed video essence (SMPTE S384M).Sebastian Dröge1-2/+8
Original commit message from CVS: * gst/mxf/Makefile.am: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams): * gst/mxf/mxftypes.h: * gst/mxf/mxfup.c: (mxf_is_up_essence_track), (mxf_up_handle_essence_element), (mxf_up_rgba_create_caps), (mxf_up_create_caps): * gst/mxf/mxfup.h: Add initial support for uncompressed video essence (SMPTE S384M). * gst/mxf/mxfparse.c: (mxf_metadata_rgba_picture_essence_descriptor_handle_tag), (mxf_metadata_rgba_picture_essence_descriptor_reset): Fix parsing of the RGBA descriptor and add support for parsing the pixel layout.
2008-12-06gst/mxf/mxfdemux.c: The previous partition field of the partition is ↵Sebastian Dröge1-10/+14
relative to the current partition and not to the... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_parse_footer_metadata): The previous partition field of the partition is relative to the current partition and not to the offset of the header partition.
2008-12-05gst/mxf/: Implement parsing of the generic data essence descriptor.Sebastian Dröge1-39/+54
Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_reset_metadata), (gst_mxf_demux_handle_metadata_generic_data_essence_descriptor), (gst_mxf_demux_handle_header_metadata_resolve_references), (gst_mxf_demux_handle_metadata): * gst/mxf/mxfdemux.h: * gst/mxf/mxfparse.c: (mxf_metadata_generic_data_essence_descriptor_handle_tag), (mxf_metadata_generic_data_essence_descriptor_reset): * gst/mxf/mxfparse.h: * gst/mxf/mxftypes.h: Implement parsing of the generic data essence descriptor.
2008-12-05gst/mxf/mxfdemux.c: Generalize some lines of codes that are more or less the ↵Sebastian Dröge1-73/+34
same by a macro. Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_resolve_references): Generalize some lines of codes that are more or less the same by a macro.
2008-12-04gst/mxf/mxfdemux.c: Ignore zero sized essence elements. They're often ↵Sebastian Dröge1-2/+8
inserted to fulfill the streaming requirements. Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_generic_container_essence_element): Ignore zero sized essence elements. They're often inserted to fulfill the streaming requirements.
2008-12-04gst/mxf/: Add support for SMPTE D10 essence (SMPTE 386M).Sebastian Dröge1-3/+19
Original commit message from CVS: * gst/mxf/Makefile.am: * gst/mxf/mxfd10.c: (mxf_is_d10_essence_track), (mxf_d10_picture_handle_essence_element), (mxf_d10_sound_handle_essence_element), (mxf_d10_create_caps): * gst/mxf/mxfd10.h: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams): Add support for SMPTE D10 essence (SMPTE 386M). * gst/mxf/mxfparse.c: (mxf_metadata_generic_picture_essence_descriptor_set_caps): Don't set width/height and PAR on the caps as those values are wrong for most files (height is sometimes the height of a field and aspect ratio is some random value). * gst/mxf/mxfaes-bwf.c: (mxf_bwf_create_caps), (mxf_aes3_create_caps): Fix calculation of block align if it isn't set in the descriptor.
2008-12-03gst/mxf/: Add support for AES3 audio (SMPTE 382M).Sebastian Dröge1-0/+58
Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: (mxf_metadata_aes3_audio_essence_descriptor_handle_tag), (mxf_metadata_aes3_audio_essence_descriptor_reset), (mxf_aes3_handle_essence_element), (mxf_bwf_create_caps), (mxf_aes3_create_caps), (mxf_aes_bwf_create_caps): * gst/mxf/mxfaes-bwf.h: * gst/mxf/mxfdemux.c: (gst_mxf_demux_reset_metadata), (gst_mxf_demux_handle_metadata_aes3_audio_essence_descriptor), (gst_mxf_demux_handle_header_metadata_resolve_references), (gst_mxf_demux_handle_metadata): * gst/mxf/mxfdemux.h: Add support for AES3 audio (SMPTE 382M). * gst/mxf/mxfdv-dif.c: (mxf_dv_dif_create_caps): * gst/mxf/mxfjpeg2000.c: (mxf_jpeg2000_create_caps): Fix coding style.
2008-12-03gst/mxf/mxfdemux.c: Improve debugging a bit.Sebastian Dröge1-2/+12
Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_generic_container_essence_element): Improve debugging a bit.
2008-12-03gst/mxf/mxfdemux.c: Use a single "track_%u" src pad template and use the ↵Sebastian Dröge1-45/+9
track ID of the playback package for the pad... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_base_init): Use a single "track_%u" src pad template and use the track ID of the playback package for the pad name instead of the track ID of the source package, as the latter could be the same for more than one track if they're in different packages.
2008-12-01gst/mxf/: Add the codec name, and if possible the avg bitrate, to the pad's ↵Sebastian Dröge1-3/+10
taglist. Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: (mxf_bwf_create_caps): * gst/mxf/mxfalaw.c: (mxf_alaw_create_caps): * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_generic_container_essence_element): * gst/mxf/mxfdv-dif.c: (mxf_dv_dif_create_caps): * gst/mxf/mxfjpeg2000.c: (mxf_jpeg2000_create_caps): * gst/mxf/mxfmpeg.c: (mxf_mpeg_es_create_caps), (mxf_mpeg_create_caps): Add the codec name, and if possible the avg bitrate, to the pad's taglist.
2008-12-01gst/mxf/mxfdemux.c: If the preface references a primary package use this as ↵Sebastian Dröge1-3/+8
the default playback package unless one w... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_choose_package): If the preface references a primary package use this as the default playback package unless one was specified by the "package" property. If there's no preface primary package still try to use the first material package.
2008-11-30gst/mxf/mxfdemux.c: If there's no descriptor for the track in the track's ↵Sebastian Dröge1-7/+10
source package and there's a single descrip... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_resolve_references): If there's no descriptor for the track in the track's source package and there's a single descriptor without a linked track assume that it belongs to this track.
2008-11-30gst/mxf/: Some random cleanup.Sebastian Dröge1-7/+10
Original commit message from CVS: * gst/mxf/mxfalaw.c: (mxf_is_alaw_essence_track): * gst/mxf/mxfalaw.h: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams): * gst/mxf/mxfjpeg2000.c: (mxf_is_jpeg2000_essence_track): * gst/mxf/mxfjpeg2000.h: * gst/mxf/mxfmpeg.c: (mxf_is_mpeg_essence_track), (mxf_mpeg_es_create_caps), (mxf_mpeg_create_caps): * gst/mxf/mxfmpeg.h: Some random cleanup.
2008-11-30gst/mxf/: Add property to select the top-level source package or material ↵Sebastian Dröge1-55/+139
package that should be used for playback. Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_remove_pads), (gst_mxf_demux_reset), (gst_mxf_demux_find_package), (gst_mxf_demux_choose_package), (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_handle_klv_packet), (gst_mxf_demux_set_property), (gst_mxf_demux_get_property), (gst_mxf_demux_finalize), (gst_mxf_demux_class_init): * gst/mxf/mxfdemux.h: * gst/mxf/mxfparse.c: (mxf_umid_from_string): * gst/mxf/mxfparse.h: Add property to select the top-level source package or material package that should be used for playback.
2008-11-30gst/mxf/mxfdemux.c: Make sure that demux->offset has the correct value ↵Sebastian Dröge1-6/+7
before calling any gst_mxf_demux_handle_* func... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_pull_random_index_pack): Make sure that demux->offset has the correct value before calling any gst_mxf_demux_handle_* functions.
2008-11-29gst/mxf/: Add initial support for JPEG2000 encoded video essence.Sebastian Dröge1-3/+9
Original commit message from CVS: * gst/mxf/Makefile.am: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams): * gst/mxf/mxfjpeg2000.c: (mxf_is_jpeg2000_video_essence_track), (mxf_jpeg2000_handle_essence_element), (mxf_jpeg2000_create_caps): * gst/mxf/mxfjpeg2000.h: Add initial support for JPEG2000 encoded video essence. * gst/mxf/mxfparse.c: (mxf_metadata_generic_picture_essence_descriptor_set_caps): Set the framerate in the video caps.
2008-11-28gst/mxf/mxfdemux.c: Only try to pull the random index pack at the end of ↵Sebastian Dröge1-10/+10
file one time and not for every single packe... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_pull_random_index_pack): Only try to pull the random index pack at the end of file one time and not for every single packet if it fails.
2008-11-28gst/mxf/: Add support for A-Law encoded audio essence (SMPTE 388M and 382M).Sebastian Dröge1-2/+8
Original commit message from CVS: * gst/mxf/Makefile.am: * gst/mxf/mxfaes-bwf.c: (mxf_bwf_create_caps): * gst/mxf/mxfalaw.c: (mxf_is_alaw_audio_essence_track), (mxf_alaw_handle_essence_element), (mxf_alaw_create_caps): * gst/mxf/mxfalaw.h: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams): Add support for A-Law encoded audio essence (SMPTE 388M and 382M).
2008-11-28gst/mxf/: Implement parsing of index table segments, which will later be ↵Sebastian Dröge1-4/+35
used for seeking. Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_reset), (gst_mxf_demux_handle_index_table_segment): * gst/mxf/mxfdemux.h: * gst/mxf/mxfparse.c: (mxf_index_table_segment_parse), (mxf_index_table_segment_reset): * gst/mxf/mxfparse.h: * gst/mxf/mxftypes.h: Implement parsing of index table segments, which will later be used for seeking.
2008-11-27gst/mxf/: Implement parsing of the random index pack, which provides a seek ↵Sebastian Dröge1-3/+92
table (including body sid) to the start o... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_reset), (gst_mxf_demux_handle_random_index_pack), (gst_mxf_demux_pull_random_index_pack), (gst_mxf_demux_loop): * gst/mxf/mxfdemux.h: * gst/mxf/mxfparse.c: (mxf_random_index_pack_parse): * gst/mxf/mxfparse.h: * gst/mxf/mxftypes.h: Implement parsing of the random index pack, which provides a seek table (including body sid) to the start of partition packs. Later this will be used for reading all index table segments of the complete file efficiently.
2008-11-27gst/mxf/: Add fundamental support for DV-DIF essence streams.Sebastian Dröge1-4/+16
Original commit message from CVS: * gst/mxf/Makefile.am: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_handle_klv_packet): * gst/mxf/mxfdv-dif.c: (mxf_is_dv_dif_essence_track), (mxf_dv_dif_handle_essence_element), (mxf_dv_dif_create_caps): * gst/mxf/mxfdv-dif.h: * gst/mxf/mxfparse.c: (mxf_is_descriptive_metadata): * gst/mxf/mxfparse.h: Add fundamental support for DV-DIF essence streams. Handle descriptive metadata packets as metadata packets.
2008-11-27gst/mxf/mxfdemux.*: Only try to pull the footer metadata once and not on ↵Sebastian Dröge1-3/+8
every KLV packet if it failed before. Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_reset), (gst_mxf_demux_handle_klv_packet): * gst/mxf/mxfdemux.h: Only try to pull the footer metadata once and not on every KLV packet if it failed before.
2008-11-26gst/mxf/mxfdemux.c: Properly combine flow returns of the source pads.Sebastian Dröge1-4/+57
Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_pad_init), (gst_mxf_demux_reset_metadata), (gst_mxf_demux_combine_flows), (gst_mxf_demux_handle_generic_container_essence_element): Properly combine flow returns of the source pads. Improve debugging and reset pad fields together with the metadata to prevent invalid memory references. * gst/mxf/mxfparse.c: (mxf_metadata_preface_parse): Fix typo.
2008-11-25gst/mxf/: Add initial parsing of RGBA descriptors.Sebastian Dröge1-11/+67
Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_reset_metadata), (gst_mxf_demux_handle_metadata_generic_descriptor), (gst_mxf_demux_handle_metadata_file_descriptor), (gst_mxf_demux_handle_metadata_multiple_descriptor), (gst_mxf_demux_handle_metadata_generic_picture_essence_descriptor), (gst_mxf_demux_handle_metadata_cdci_picture_essence_descriptor), (gst_mxf_demux_handle_metadata_rgba_picture_essence_descriptor), (gst_mxf_demux_handle_metadata_mpeg_video_descriptor), (gst_mxf_demux_handle_metadata_generic_sound_essence_descriptor), (gst_mxf_demux_handle_metadata_wave_audio_essence_descriptor), (gst_mxf_demux_handle_header_metadata_resolve_references), (gst_mxf_demux_handle_metadata): * gst/mxf/mxfdemux.h: * gst/mxf/mxfparse.c: (mxf_metadata_rgba_picture_essence_descriptor_handle_tag), (mxf_metadata_rgba_picture_essence_descriptor_reset): * gst/mxf/mxfparse.h: * gst/mxf/mxftypes.h: Add initial parsing of RGBA descriptors. Don't initialize descriptor GArray with zeroes.
2008-11-25gst/mxf/: Rewrite parsing of descriptors to go top-down instead of bottom-up ↵Sebastian Dröge1-40/+78
which makes it possible to have the buff... Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: (mxf_metadata_wave_audio_essence_descriptor_handle_tag): * gst/mxf/mxfaes-bwf.h: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_metadata_generic_descriptor), (gst_mxf_demux_handle_metadata_file_descriptor), (gst_mxf_demux_handle_metadata_multiple_descriptor), (gst_mxf_demux_handle_metadata_generic_picture_essence_descriptor), (gst_mxf_demux_handle_metadata_cdci_picture_essence_descriptor), (gst_mxf_demux_handle_metadata_mpeg_video_descriptor), (gst_mxf_demux_handle_metadata_generic_sound_essence_descriptor), (gst_mxf_demux_handle_metadata_wave_audio_essence_descriptor), (gst_mxf_demux_handle_header_metadata_resolve_references), (gst_mxf_demux_handle_metadata): * gst/mxf/mxfmpeg.c: (mxf_metadata_mpeg_video_descriptor_handle_tag): * gst/mxf/mxfmpeg.h: * gst/mxf/mxfparse.c: (mxf_partition_pack_parse), (mxf_primer_pack_parse), (mxf_metadata_preface_parse), (mxf_metadata_identification_parse), (mxf_metadata_content_storage_parse), (mxf_metadata_essence_container_data_parse), (mxf_metadata_generic_package_parse), (mxf_metadata_track_parse), (mxf_metadata_sequence_parse), (mxf_metadata_structural_component_parse), (mxf_metadata_descriptor_parse), (mxf_metadata_generic_descriptor_handle_tag), (mxf_metadata_generic_descriptor_reset), (mxf_metadata_file_descriptor_handle_tag), (mxf_metadata_generic_sound_essence_descriptor_handle_tag), (mxf_metadata_generic_picture_essence_descriptor_handle_tag), (mxf_metadata_cdci_picture_essence_descriptor_handle_tag), (mxf_metadata_multiple_descriptor_handle_tag), (mxf_metadata_locator_parse): * gst/mxf/mxfparse.h: Rewrite parsing of descriptors to go top-down instead of bottom-up which makes it possible to have the buffer data non-writable. Improve debugging a bit.
2008-11-24gst/mxf/mxfdemux.c: Make sure to only output generic container essence ↵Sebastian Dröge1-6/+21
elements for a track if the body SID of the su... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_generic_container_essence_element): Make sure to only output generic container essence elements for a track if the body SID of the surrounding partition is the same as the body SID of the track's source package.