diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-12-16 12:30:34 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-12-16 12:30:34 +0000 |
commit | 5587f912104a8b4b7d3fbc71c9b7e39981235b43 (patch) | |
tree | c9b1ceb88f30576f7f065d93b14013c5c425067c /gst/mxf/mxfdv-dif.c | |
parent | 2bdd84b48d1ee8a64130efca7a953711614431b4 (diff) | |
download | gstreamer-plugins-bad-5587f912104a8b4b7d3fbc71c9b7e39981235b43.tar.gz |
gst/mxf/: Implement an essence element handling registry and use this 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.
Diffstat (limited to 'gst/mxf/mxfdv-dif.c')
-rw-r--r-- | gst/mxf/mxfdv-dif.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/gst/mxf/mxfdv-dif.c b/gst/mxf/mxfdv-dif.c index 25bd2a95d..4cae16b4f 100644 --- a/gst/mxf/mxfdv-dif.c +++ b/gst/mxf/mxfdv-dif.c @@ -39,18 +39,18 @@ GST_DEBUG_CATEGORY_EXTERN (mxf_debug); #define GST_CAT_DEFAULT mxf_debug -gboolean -mxf_is_dv_dif_essence_track (const MXFMetadataTrack * track) +static gboolean +mxf_is_dv_dif_essence_track (const MXFMetadataTimelineTrack * track) { guint i; g_return_val_if_fail (track != NULL, FALSE); - if (track->descriptor == NULL) + if (track->parent.descriptor == NULL) return FALSE; - for (i = 0; i < track->n_descriptor; i++) { - MXFMetadataFileDescriptor *d = track->descriptor[i]; + for (i = 0; i < track->parent.n_descriptor; i++) { + MXFMetadataFileDescriptor *d = track->parent.descriptor[i]; MXFUL *key; if (!d) @@ -68,9 +68,10 @@ mxf_is_dv_dif_essence_track (const MXFMetadataTrack * track) static GstFlowReturn mxf_dv_dif_handle_essence_element (const MXFUL * key, GstBuffer * buffer, - GstCaps * caps, MXFMetadataGenericPackage * package, - MXFMetadataTrack * track, MXFMetadataStructuralComponent * component, - gpointer mapping_data, GstBuffer ** outbuf) + GstCaps * caps, + MXFMetadataTimelineTrack * track, + MXFMetadataStructuralComponent * component, gpointer mapping_data, + GstBuffer ** outbuf) { *outbuf = buffer; @@ -84,30 +85,28 @@ mxf_dv_dif_handle_essence_element (const MXFUL * key, GstBuffer * buffer, } -GstCaps * -mxf_dv_dif_create_caps (MXFMetadataGenericPackage * package, - MXFMetadataTrack * track, GstTagList ** tags, - MXFEssenceElementHandler * handler, gpointer * mapping_data) +static GstCaps * +mxf_dv_dif_create_caps (MXFMetadataTimelineTrack * track, GstTagList ** tags, + MXFEssenceElementHandleFunc * handler, gpointer * mapping_data) { MXFMetadataFileDescriptor *f = NULL; guint i; GstCaps *caps = NULL; - g_return_val_if_fail (package != NULL, NULL); g_return_val_if_fail (track != NULL, NULL); - if (track->descriptor == NULL) { + if (track->parent.descriptor == NULL) { GST_ERROR ("No descriptor found for this track"); return NULL; } - for (i = 0; i < track->n_descriptor; i++) { - if (!track->descriptor[i]) + for (i = 0; i < track->parent.n_descriptor; i++) { + if (!track->parent.descriptor[i]) continue; - if (MXF_IS_METADATA_FILE_DESCRIPTOR (track->descriptor[i]) && - !MXF_IS_METADATA_MULTIPLE_DESCRIPTOR (track->descriptor[i])) { - f = track->descriptor[i]; + if (MXF_IS_METADATA_FILE_DESCRIPTOR (track->parent.descriptor[i]) && + !MXF_IS_METADATA_MULTIPLE_DESCRIPTOR (track->parent.descriptor[i])) { + f = track->parent.descriptor[i]; } } @@ -138,8 +137,13 @@ mxf_dv_dif_create_caps (MXFMetadataGenericPackage * package, return caps; } +static const MXFEssenceElementHandler mxf_dv_dif_essence_element_handler = { + mxf_is_dv_dif_essence_track, + mxf_dv_dif_create_caps +}; + void mxf_dv_dif_init (void) { - + mxf_essence_element_handler_register (&mxf_dv_dif_essence_element_handler); } |