34
35
#include <gst/gst.h>
36
#include <gst/video/video.h>
35
37
#include <string.h>
37
39
#include "mxfdv-dif.h"
40
#include "mxfessence.h"
39
42
GST_DEBUG_CATEGORY_EXTERN (mxf_debug);
40
43
#define GST_CAT_DEFAULT mxf_debug
42
static const guint8 picture_essence_coding_dv[13] = {
43
0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x04, 0x01, 0x02, 0x02, 0x02
45
static const MXFUL picture_essence_coding_dv = { {
46
0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x04, 0x01, 0x02, 0x02,
136
154
mxf_dv_dif_create_caps
158
mxf_dv_dif_write_func (GstBuffer * buffer, GstCaps * caps,
159
gpointer mapping_data, GstAdapter * adapter, GstBuffer ** outbuf,
166
static const guint8 dv_dif_essence_container_ul[] = {
167
0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01,
168
0x0d, 0x01, 0x03, 0x01, 0x02, 0x02, 0x7f, 0x01
171
static MXFMetadataFileDescriptor *
172
mxf_dv_dif_get_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
173
MXFEssenceElementWriteFunc * handler, gpointer * mapping_data)
175
MXFMetadataCDCIPictureEssenceDescriptor *ret;
177
ret = (MXFMetadataCDCIPictureEssenceDescriptor *)
178
gst_mini_object_new (MXF_TYPE_METADATA_CDCI_PICTURE_ESSENCE_DESCRIPTOR);
180
memcpy (&ret->parent.parent.essence_container, &dv_dif_essence_container_ul,
183
if (!mxf_metadata_generic_picture_essence_descriptor_from_caps (&ret->parent,
185
gst_mini_object_unref (GST_MINI_OBJECT_CAST (ret));
188
*handler = mxf_dv_dif_write_func;
190
return (MXFMetadataFileDescriptor *) ret;
194
mxf_dv_dif_update_descriptor (MXFMetadataFileDescriptor * d, GstCaps * caps,
195
gpointer mapping_data, GstBuffer * buf)
201
mxf_dv_dif_get_edit_rate (MXFMetadataFileDescriptor * a, GstCaps * caps,
202
gpointer mapping_data, GstBuffer * buf, MXFMetadataSourcePackage * package,
203
MXFMetadataTimelineTrack * track, MXFFraction * edit_rate)
205
edit_rate->n = a->sample_rate.n;
206
edit_rate->d = a->sample_rate.d;
210
mxf_dv_dif_get_track_number_template (MXFMetadataFileDescriptor * a,
211
GstCaps * caps, gpointer mapping_data)
213
return (0x18 << 24) | (0x01 << 8);
216
static MXFEssenceElementWriter mxf_dv_dif_essence_element_writer = {
217
mxf_dv_dif_get_descriptor,
218
mxf_dv_dif_update_descriptor,
219
mxf_dv_dif_get_edit_rate,
220
mxf_dv_dif_get_track_number_template,
140
226
mxf_dv_dif_init (void)
142
228
mxf_essence_element_handler_register (&mxf_dv_dif_essence_element_handler);
230
mxf_dv_dif_essence_element_writer.pad_template =
231
gst_pad_template_new ("dv_dif_video_sink_%u", GST_PAD_SINK,
233
gst_caps_from_string ("video/x-dv, width = "
234
GST_VIDEO_SIZE_RANGE ", height = " GST_VIDEO_SIZE_RANGE
235
", framerate = " GST_VIDEO_FPS_RANGE ", systemstream = true"));
236
memcpy (&mxf_dv_dif_essence_element_writer.data_definition,
237
mxf_metadata_track_identifier_get (MXF_METADATA_TRACK_PICTURE_ESSENCE),
239
mxf_essence_element_writer_register (&mxf_dv_dif_essence_element_writer);