if (!mxf_timestamp_parse (&self->peak_envelope_timestamp,
tag_data, tag_size))
goto error;
- GST_DEBUG (" peak envelope timestamp = %d/%u/%u %u:%u:%u.%u",
- self->peak_envelope_timestamp.year,
- self->peak_envelope_timestamp.month,
- self->peak_envelope_timestamp.day,
- self->peak_envelope_timestamp.hour,
- self->peak_envelope_timestamp.minute,
- self->peak_envelope_timestamp.second,
- (self->peak_envelope_timestamp.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" peak envelope timestamp = %s",
+ mxf_timestamp_to_string (&self->peak_envelope_timestamp, str));
break;
case 0x3d31:
self->peak_envelope_data = g_memdup (tag_data, tag_size);
if (!mxf_timestamp_parse (&self->clip_creation_date_and_time, tag_data,
tag_size))
goto error;
- GST_DEBUG (" clip creation date and time = %d/%u/%u %u:%u:%u.%u",
- self->clip_creation_date_and_time.year,
- self->clip_creation_date_and_time.month,
- self->clip_creation_date_and_time.day,
- self->clip_creation_date_and_time.hour,
- self->clip_creation_date_and_time.minute,
- self->clip_creation_date_and_time.second,
- (self->clip_creation_date_and_time.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" clip creation date and time = %s",
+ mxf_timestamp_to_string (&self->clip_creation_date_and_time, str));
} else if (memcmp (tag_ul, &take_number_ul, 16) == 0) {
if (tag_size != 2)
goto error;
{
MXFDMS1SettingPeriod *self = MXF_DMS1_SETTING_PERIOD (metadata);
gboolean ret = TRUE;
+#ifndef GST_DISABLE_GST_DEBUG
+ gchar str[32];
+#endif
MXFUL *tag_ul = NULL;
static const guint8 setting_date_and_time_ul[] = {
0x06, 0x0e, 0x2b, 0x34, 0x01, 0x01, 0x01, 0x04, 0x07,
if (!mxf_timestamp_parse (&self->setting_date_and_time, tag_data, tag_size))
goto error;
- GST_DEBUG (" last modified date = %d/%u/%u %u:%u:%u.%u",
- self->setting_date_and_time.year, self->setting_date_and_time.month,
- self->setting_date_and_time.day, self->setting_date_and_time.hour,
- self->setting_date_and_time.minute,
- self->setting_date_and_time.second,
- (self->setting_date_and_time.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" last modified date = %s",
+ mxf_timestamp_to_string (&self->setting_date_and_time, str));
} else if (memcmp (tag_ul, &time_period_keyword_ul, 16) == 0) {
self->time_period_keyword = mxf_utf16_to_utf8 (tag_data, tag_size);
GST_DEBUG (" time period keyword = %s",
MXFDMS1Rights *self = MXF_DMS1_RIGHTS (metadata);
gboolean ret = TRUE;
MXFUL *tag_ul = NULL;
+#ifndef GST_DISABLE_GST_DEBUG
+ gchar str[32];
+#endif
static const guint8 copyright_owner_ul[] = {
0x06, 0x0e, 0x2b, 0x34, 0x01, 0x01, 0x01, 0x03, 0x02,
0x05, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00
tag_size))
goto error;
- GST_DEBUG (" rights start date and time = %d/%u/%u %u:%u:%u.%u",
- self->rights_start_date_and_time.year,
- self->rights_start_date_and_time.month,
- self->rights_start_date_and_time.day,
- self->rights_start_date_and_time.hour,
- self->rights_start_date_and_time.minute,
- self->rights_start_date_and_time.second,
- (self->rights_start_date_and_time.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" rights start date and time = %s",
+ mxf_timestamp_to_string (&self->rights_start_date_and_time, str));
} else if (memcmp (tag_ul, &rights_stop_date_and_time_ul, 16) == 0) {
if (!mxf_timestamp_parse (&self->rights_start_date_and_time, tag_data,
tag_size))
goto error;
- GST_DEBUG (" rights stop date and time = %d/%u/%u %u:%u:%u.%u",
- self->rights_stop_date_and_time.year,
- self->rights_stop_date_and_time.month,
- self->rights_stop_date_and_time.day,
- self->rights_stop_date_and_time.hour,
- self->rights_stop_date_and_time.minute,
- self->rights_stop_date_and_time.second,
- (self->rights_stop_date_and_time.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" rights stop date and time = %s",
+ mxf_timestamp_to_string (&self->rights_stop_date_and_time, str));
} else if (memcmp (tag_ul, &maximum_number_of_usages_ul, 16) == 0) {
if (tag_size != 2)
goto error;
case 0x3b02:
if (!mxf_timestamp_parse (&self->last_modified_date, tag_data, tag_size))
goto error;
- GST_DEBUG (" last modified date = %d/%u/%u %u:%u:%u.%u",
- self->last_modified_date.year, self->last_modified_date.month,
- self->last_modified_date.day, self->last_modified_date.hour,
- self->last_modified_date.minute,
- self->last_modified_date.second,
- (self->last_modified_date.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" last modified date = %s",
+ mxf_timestamp_to_string (&self->last_modified_date, str));
break;
case 0x3b05:
if (tag_size != 2)
case 0x3c06:
if (!mxf_timestamp_parse (&self->modification_date, tag_data, tag_size))
goto error;
- GST_DEBUG (" modification date = %d/%u/%u %u:%u:%u.%u",
- self->modification_date.year,
- self->modification_date.month,
- self->modification_date.day,
- self->modification_date.hour,
- self->modification_date.minute,
- self->modification_date.second,
- (self->modification_date.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" modification date = %s",
+ mxf_timestamp_to_string (&self->modification_date, str));
break;
case 0x3c07:
if (!mxf_product_version_parse (&self->toolkit_version,
if (!mxf_timestamp_parse (&self->package_creation_date,
tag_data, tag_size))
goto error;
- GST_DEBUG (" creation date = %d/%u/%u %u:%u:%u.%u",
- self->package_creation_date.year,
- self->package_creation_date.month,
- self->package_creation_date.day,
- self->package_creation_date.hour,
- self->package_creation_date.minute,
- self->package_creation_date.second,
- (self->package_creation_date.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" creation date = %s",
+ mxf_timestamp_to_string (&self->package_creation_date, str));
break;
case 0x4404:
if (!mxf_timestamp_parse (&self->package_modified_date,
tag_data, tag_size))
goto error;
- GST_DEBUG (" modification date = %d/%u/%u %u:%u:%u.%u",
- self->package_modified_date.year,
- self->package_modified_date.month,
- self->package_modified_date.day,
- self->package_modified_date.hour,
- self->package_modified_date.minute,
- self->package_modified_date.second,
- (self->package_modified_date.quarter_msecond * 1000) / 256);
+ GST_DEBUG (" modification date = %s",
+ mxf_timestamp_to_string (&self->package_modified_date, str));
break;
case 0x4403:
if (!mxf_ul_array_parse (&self->tracks_uids, &self->n_tracks, tag_data,
timestamp->hour = GST_READ_UINT8 (data + 4);
timestamp->minute = GST_READ_UINT8 (data + 5);
timestamp->second = GST_READ_UINT8 (data + 6);
- timestamp->quarter_msecond = GST_READ_UINT8 (data + 7);
+ timestamp->msecond = (GST_READ_UINT8 (data + 7) * 1000) / 256;
return TRUE;
}
return diff;
else if ((diff = a->second - b->second) != 0)
return diff;
- else if ((diff = a->quarter_msecond - b->quarter_msecond) != 0)
+ else if ((diff = a->msecond - b->msecond) != 0)
return diff;
else
return 0;
}
+gchar *
+mxf_timestamp_to_string (const MXFTimestamp * t, gchar str[32])
+{
+ g_snprintf (str, 32,
+ "%04d-%02u-%02u %02u:%02u:%02u.%03u", t->year, t->month,
+ t->day, t->hour, t->minute, t->second, t->msecond);
+ return str;
+}
+
gboolean
mxf_fraction_parse (MXFFraction * fraction, const guint8 * data, guint size)
{
gboolean mxf_timestamp_parse (MXFTimestamp * timestamp, const guint8 * data, guint size);
gboolean mxf_timestamp_is_unknown (const MXFTimestamp *a);
gint mxf_timestamp_compare (const MXFTimestamp *a, const MXFTimestamp *b);
+gchar *mxf_timestamp_to_string (const MXFTimestamp *t, gchar str[32]);
gboolean mxf_ul_array_parse (MXFUL **array, guint32 *count, const guint8 *data, guint size);
guint8 hour;
guint8 minute;
guint8 second;
- guint8 quarter_msecond;
+ guint16 msecond;
} MXFTimestamp;
/* SMPTE 377M 3.3 */