~ubuntu-branches/ubuntu/quantal/gst-plugins-bad-multiverse0.10/quantal

« back to all changes in this revision

Viewing changes to gst/mxf/mxfmetadata.c

  • Committer: Bazaar Package Importer
  • Author(s): Onkar Shinde
  • Date: 2009-12-07 08:54:28 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20091207085428-ml6aaukf0p2ph34d
Tags: 0.10.17-0ubuntu1
* New upstream release.
* Add myself to maintainer.
* Fix misc lintian warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
  return TRUE;
63
63
}
64
64
 
65
 
#if !GLIB_CHECK_VERSION (2, 16, 0)
66
 
static void
67
 
build_values_in_hash_table (gpointer key, gpointer value, gpointer user_data)
68
 
{
69
 
  GList **valuelist = (GList **) (user_data);
70
 
  *valuelist = g_list_prepend (*valuelist, value);
71
 
}
72
 
#endif
73
 
 
74
65
static GstStructure *
75
66
mxf_metadata_base_to_structure_default (MXFMetadataBase * self)
76
67
{
100
91
    GValue v = { 0, };
101
92
    GstStructure *s;
102
93
    GstBuffer *buf;
103
 
#if GLIB_CHECK_VERSION (2, 16, 0)
104
94
    GHashTableIter iter;
105
95
 
106
96
    g_hash_table_iter_init (&iter, self->other_tags);
107
 
#else
108
 
    GList *l, *values = NULL;
109
 
 
110
 
    g_hash_table_foreach (self->other_tags, build_values_in_hash_table,
111
 
        &values);
112
 
#endif
113
 
 
114
97
    g_value_init (&va, GST_TYPE_ARRAY);
115
98
 
116
 
#if GLIB_CHECK_VERSION (2, 16, 0)
117
99
    while (g_hash_table_iter_next (&iter, NULL, (gpointer) & tag)) {
118
 
#else
119
 
    for (l = values; l; l = l->next) {
120
 
      tag = l->data;
121
 
#endif
122
 
 
123
100
      g_value_init (&v, GST_TYPE_STRUCTURE);
124
101
      s = gst_structure_id_empty_new (MXF_QUARK (TAG));
125
102
 
140
117
 
141
118
    gst_structure_id_set_value (ret, MXF_QUARK (OTHER_TAGS), &va);
142
119
    g_value_unset (&va);
143
 
 
144
 
#if !GLIB_CHECK_VERSION (2, 16, 0)
145
 
    g_list_free (values);
146
 
#endif
147
120
  }
148
121
 
149
122
  return ret;
261
234
  /* Add unknown tags */
262
235
  if (self->other_tags) {
263
236
    MXFLocalTag *tmp;
264
 
#if GLIB_CHECK_VERSION (2, 16, 0)
265
237
    GHashTableIter iter;
266
238
 
267
239
    g_hash_table_iter_init (&iter, self->other_tags);
268
 
#else
269
 
    GList *l, *values;
270
 
 
271
 
    values = g_hash_table_get_values (self->other_tags);
272
 
#endif
273
 
 
274
 
#if GLIB_CHECK_VERSION (2, 16, 0)
 
240
 
275
241
    while (g_hash_table_iter_next (&iter, NULL, (gpointer) & t)) {
276
 
#else
277
 
    for (l = values; l; l = l->next) {
278
 
      t = l->data;
279
 
#endif
280
242
      tmp = g_slice_dup (MXFLocalTag, t);
281
243
      if (t->g_slice) {
282
244
        tmp->data = g_slice_alloc (t->size);
287
249
      }
288
250
      tags = g_list_prepend (tags, tmp);
289
251
    }
290
 
 
291
 
#if !GLIB_CHECK_VERSION (2, 16, 0)
292
 
    g_list_free (values);
293
 
#endif
294
252
  }
295
253
 
296
254
  l = g_list_last (tags);
1646
1604
  MXFMetadataEssenceContainerData *self =
1647
1605
      MXF_METADATA_ESSENCE_CONTAINER_DATA (m);
1648
1606
  MXFMetadataBase *current = NULL;
1649
 
#if GLIB_CHECK_VERSION (2, 16, 0)
1650
1607
  GHashTableIter iter;
1651
1608
 
1652
1609
  g_hash_table_iter_init (&iter, metadata);
1653
 
#else
1654
 
  GList *l, *values = NULL;
1655
 
 
1656
 
  g_hash_table_foreach (metadata, build_values_in_hash_table, &values);
1657
 
#endif
1658
 
 
1659
 
#if GLIB_CHECK_VERSION (2, 16, 0)
 
1610
 
1660
1611
  while (g_hash_table_iter_next (&iter, NULL, (gpointer) & current)) {
1661
 
#else
1662
 
  for (l = values; l; l = l->next) {
1663
 
    current = l->data;
1664
 
#endif
1665
1612
    if (MXF_IS_METADATA_SOURCE_PACKAGE (current)) {
1666
1613
      MXFMetadataSourcePackage *package = MXF_METADATA_SOURCE_PACKAGE (current);
1667
1614
 
1675
1622
    }
1676
1623
  }
1677
1624
 
1678
 
#if !GLIB_CHECK_VERSION (2, 16, 0)
1679
 
  g_list_free (values);
1680
 
#endif
1681
 
 
1682
1625
  if (!self->linked_package) {
1683
1626
    GST_ERROR ("Couldn't resolve a package");
1684
1627
    return FALSE;
3390
3333
{
3391
3334
  MXFMetadataSourceClip *self = MXF_METADATA_SOURCE_CLIP (m);
3392
3335
  MXFMetadataBase *current = NULL;
3393
 
#if GLIB_CHECK_VERSION (2, 16, 0)
3394
3336
  GHashTableIter iter;
3395
3337
 
3396
3338
  g_hash_table_iter_init (&iter, metadata);
3397
 
#else
3398
 
  GList *l, *values = NULL;
3399
 
 
3400
 
  g_hash_table_foreach (metadata, build_values_in_hash_table, &values);
3401
 
#endif
3402
 
 
3403
 
#if GLIB_CHECK_VERSION (2, 16, 0)
 
3339
 
3404
3340
  while (g_hash_table_iter_next (&iter, NULL, (gpointer) & current)) {
3405
 
#else
3406
 
  for (l = values; l; l = l->next) {
3407
 
    current = l->data;
3408
 
#endif
3409
3341
    if (MXF_IS_METADATA_SOURCE_PACKAGE (current)) {
3410
3342
      MXFMetadataGenericPackage *p = MXF_METADATA_GENERIC_PACKAGE (current);
3411
3343
 
3416
3348
    }
3417
3349
  }
3418
3350
 
3419
 
#if !GLIB_CHECK_VERSION (2, 16, 0)
3420
 
  g_list_free (values);
3421
 
#endif
3422
 
 
3423
3351
  return
3424
3352
      MXF_METADATA_BASE_CLASS (mxf_metadata_source_clip_parent_class)->resolve
3425
3353
      (m, metadata);