mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
mxf: Use mxf_u{l,uid}_is_equal() and friends instead of memcmp()
This commit is contained in:
parent
c1c8b40d42
commit
f22494b6fe
4 changed files with 16 additions and 14 deletions
|
@ -1183,8 +1183,8 @@ mxf_bwf_create_caps (MXFMetadataTimelineTrack * track,
|
|||
/* FIXME: set a channel layout */
|
||||
|
||||
if (mxf_ul_is_zero (&descriptor->sound_essence_compression) ||
|
||||
mxf_ul_is_equal (&descriptor->sound_essence_compression,
|
||||
&mxf_sound_essence_compression_uncompressed)) {
|
||||
mxf_ul_is_subclass (&mxf_sound_essence_compression_uncompressed,
|
||||
&descriptor->sound_essence_compression)) {
|
||||
guint block_align;
|
||||
|
||||
if (descriptor->channel_count == 0 ||
|
||||
|
@ -1212,8 +1212,8 @@ mxf_bwf_create_caps (MXFMetadataTimelineTrack * track,
|
|||
codec_name =
|
||||
g_strdup_printf ("Uncompressed %u-bit little endian integer PCM audio",
|
||||
(block_align / descriptor->channel_count) * 8);
|
||||
} else if (mxf_ul_is_equal (&descriptor->sound_essence_compression,
|
||||
&mxf_sound_essence_compression_aiff)) {
|
||||
} else if (mxf_ul_is_subclass (&mxf_sound_essence_compression_aiff,
|
||||
&descriptor->sound_essence_compression)) {
|
||||
guint block_align;
|
||||
|
||||
if (descriptor->channel_count == 0 ||
|
||||
|
@ -1242,8 +1242,8 @@ mxf_bwf_create_caps (MXFMetadataTimelineTrack * track,
|
|||
codec_name =
|
||||
g_strdup_printf ("Uncompressed %u-bit big endian integer PCM audio",
|
||||
(block_align / descriptor->channel_count) * 8);
|
||||
} else if (mxf_ul_is_equal (&descriptor->sound_essence_compression,
|
||||
&mxf_sound_essence_compression_alaw)) {
|
||||
} else if (mxf_ul_is_subclass (&mxf_sound_essence_compression_alaw,
|
||||
&descriptor->sound_essence_compression)) {
|
||||
|
||||
if (descriptor->audio_sampling_rate.n != 0 ||
|
||||
descriptor->audio_sampling_rate.d != 0 ||
|
||||
|
|
|
@ -659,7 +659,7 @@ gst_mxf_demux_choose_package (GstMXFDemux * demux)
|
|||
}
|
||||
|
||||
done:
|
||||
if (memcmp (&ret->package_uid, &demux->current_package_uid, 32) != 0) {
|
||||
if (mxf_umid_is_equal (&ret->package_uid, &demux->current_package_uid)) {
|
||||
gchar current_package_string[96];
|
||||
GstTagList *tags = gst_tag_list_new ();
|
||||
|
||||
|
|
|
@ -42,8 +42,9 @@
|
|||
GST_DEBUG_CATEGORY_EXTERN (mxf_debug);
|
||||
#define GST_CAT_DEFAULT mxf_debug
|
||||
|
||||
static const guint8 picture_essence_coding_dv[13] = {
|
||||
0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x04, 0x01, 0x02, 0x02, 0x02
|
||||
static const MXFUL picture_essence_coding_dv = { {
|
||||
0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x04, 0x01, 0x02, 0x02,
|
||||
0x02}
|
||||
};
|
||||
|
||||
static gboolean
|
||||
|
@ -76,7 +77,7 @@ mxf_is_dv_dif_essence_track (const MXFMetadataTimelineTrack * track)
|
|||
p = MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (d);
|
||||
|
||||
key = &p->picture_essence_coding;
|
||||
if (memcmp (key, &picture_essence_coding_dv, 13) == 0)
|
||||
if (mxf_ul_is_subclass (&picture_essence_coding_dv, key))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,9 +35,10 @@
|
|||
GST_DEBUG_CATEGORY_EXTERN (mxf_debug);
|
||||
#define GST_CAT_DEFAULT mxf_debug
|
||||
|
||||
static const guint8 picture_essence_coding_vc3_avid[] = {
|
||||
0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x0e, 0x04, 0x02, 0x01, 0x02,
|
||||
0x04, 0x01, 0x00
|
||||
static const MXFUL picture_essence_coding_vc3_avid = { {
|
||||
0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x0e, 0x04, 0x02, 0x01,
|
||||
0x02,
|
||||
0x04, 0x01, 0x00}
|
||||
};
|
||||
|
||||
static gboolean
|
||||
|
@ -71,7 +72,7 @@ mxf_is_vc3_essence_track (const MXFMetadataTimelineTrack * track)
|
|||
p = MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (d);
|
||||
|
||||
key = &p->picture_essence_coding;
|
||||
if (memcmp (key, picture_essence_coding_vc3_avid, 16) == 0)
|
||||
if (mxf_ul_is_subclass (&picture_essence_coding_vc3_avid, key))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue