1 /* GStreamer 2 * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef __MXF_ESSENCE_H__ 21 #define __MXF_ESSENCE_H__ 22 23 #include <gst/gst.h> 24 #include <gst/base/gstadapter.h> 25 26 #include "mxftypes.h" 27 #include "mxfmetadata.h" 28 29 typedef enum { 30 MXF_ESSENCE_WRAPPING_FRAME_WRAPPING, 31 MXF_ESSENCE_WRAPPING_CLIP_WRAPPING, 32 MXF_ESSENCE_WRAPPING_CUSTOM_WRAPPING, 33 MXF_ESSENCE_WRAPPING_UNKNOWN_WRAPPING 34 } MXFEssenceWrapping; 35 36 typedef GstFlowReturn (*MXFEssenceElementHandleFunc) (const MXFUL *key, GstBuffer *buffer, GstCaps *caps, MXFMetadataTimelineTrack *track, gpointer mapping_data, GstBuffer **outbuf); 37 38 typedef struct { 39 gboolean (*handles_track) (const MXFMetadataTimelineTrack *track); 40 MXFEssenceWrapping (*get_track_wrapping) (const MXFMetadataTimelineTrack *track); 41 GstCaps * (*create_caps) (MXFMetadataTimelineTrack *track, GstTagList **tags, gboolean * intra_only, MXFEssenceElementHandleFunc *handler, gpointer *mapping_data); 42 } MXFEssenceElementHandler; 43 44 typedef GstFlowReturn (*MXFEssenceElementWriteFunc) (GstBuffer *buffer, gpointer mapping_data, GstAdapter *adapter, GstBuffer **outbuf, gboolean flush); 45 46 typedef struct { 47 MXFMetadataFileDescriptor * (*get_descriptor) (GstPadTemplate *tmpl, GstCaps *caps, MXFEssenceElementWriteFunc *handler, gpointer *mapping_data); 48 void (*update_descriptor) (MXFMetadataFileDescriptor *d, GstCaps *caps, gpointer mapping_data, GstBuffer *buf); 49 void (*get_edit_rate) (MXFMetadataFileDescriptor *a, GstCaps *caps, gpointer mapping_data, GstBuffer *buf, MXFMetadataSourcePackage *package, MXFMetadataTimelineTrack *track, MXFFraction *edit_rate); 50 guint32 (*get_track_number_template) (MXFMetadataFileDescriptor *a, GstCaps *caps, gpointer mapping_data); 51 const GstPadTemplate *pad_template; 52 MXFUL data_definition; 53 } MXFEssenceElementWriter; 54 55 void mxf_essence_element_handler_register (const MXFEssenceElementHandler *handler); 56 const MXFEssenceElementHandler * mxf_essence_element_handler_find (const MXFMetadataTimelineTrack *track); 57 58 void mxf_essence_element_writer_register (const MXFEssenceElementWriter *writer); 59 const GstPadTemplate ** mxf_essence_element_writer_get_pad_templates (void); 60 const MXFEssenceElementWriter *mxf_essence_element_writer_find (const GstPadTemplate *templ); 61 62 #endif /* __MXF_ESSENCE_H__ */ 63