~ubuntu-branches/ubuntu/saucy/gstreamer0.10/saucy

« back to all changes in this revision

Viewing changes to .pc/79_multiarch-backwards-compat.patch/gst/gstregistry.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2011-12-11 18:52:12 UTC
  • mfrom: (32.1.14 experimental)
  • Revision ID: package-import@ubuntu.com-20111211185212-3k215ps4qtyz2qa5
Tags: 0.10.35.2-1
* New upstream pre-release:
  + debian/control.in:
    - Build-depend on GLib >= 2.24.
  + debian/patches/99_ltmain_as-needed.patch:
    - Refreshed to apply cleanly again.
  + debian/libgstreamer.symbols:
    - Update symbols file with new API.
* debian/rules:
  + Remove all dependency_libs from the .la files (Closes: #633319).
* debian/control.in:
  + Put GI package into section introspection.
* debian/compat,
  debian/control.in,
  debian/gir1.2-gstreamer.install,
  debian/libgstreamer-dev.install,
  debian/libgstreamer.install,
  debian/patches/79_multiarch-backwards-compat.patch,
  debian/patches/80_ia32-hack.patch,
  debian/rules:
  + Transition package to multi-arch (Closes: #647481).
    Patch taken from the Ubuntu package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 * means of doing so is to load every plugin and look at the resulting
47
47
 * information that is gathered in the default registry. Clearly, this is a time
48
48
 * consuming process, so we cache information in the registry file. The format
49
 
 * and location of the cache file is internal to gstreamer. 
 
49
 * and location of the cache file is internal to gstreamer.
50
50
 *
51
51
 * On startup, plugins are searched for in the plugin search path. The following
52
52
 * locations are checked in this order:
103
103
 * different sets of plugins. For various reasons, at init time, the cache is
104
104
 * stored in the default registry, and plugins not relevant to the current
105
105
 * process are marked with the %GST_PLUGIN_FLAG_CACHED bit. These plugins are
106
 
 * removed at the end of intitialization.
 
106
 * removed at the end of initialization.
107
107
 */
108
108
 
109
109
#ifdef HAVE_CONFIG_H
175
175
 
176
176
/* Set to TRUE when the registry cache should be disabled */
177
177
gboolean _gst_disable_registry_cache = FALSE;
 
178
 
 
179
static gboolean __registry_reuse_plugin_scanner = TRUE;
178
180
#endif
179
181
 
180
182
/* Element signals and args */
280
282
    if (feature) {
281
283
      GST_LOG_OBJECT (registry, "removing feature %p (%s)",
282
284
          feature, gst_plugin_feature_get_name (feature));
283
 
      gst_object_unref (feature);
 
285
      gst_object_unparent (GST_OBJECT_CAST (feature));
284
286
    }
285
287
    f = g_list_next (f);
286
288
  }
485
487
 
486
488
      registry->features = g_list_delete_link (registry->features, f);
487
489
      g_hash_table_remove (registry->feature_hash, feature->name);
488
 
      gst_object_unref (feature);
 
490
      gst_object_unparent (GST_OBJECT_CAST (feature));
489
491
    }
490
492
    f = next;
491
493
  }
561
563
  if (G_UNLIKELY (existing_feature)) {
562
564
    /* We unref now. No need to remove the feature name from the hash table, it
563
565
     * got replaced by the new feature */
564
 
    gst_object_unref (existing_feature);
 
566
    gst_object_unparent (GST_OBJECT_CAST (existing_feature));
565
567
  }
566
568
 
567
 
  gst_object_ref_sink (feature);
 
569
  gst_object_set_parent (GST_OBJECT_CAST (feature), GST_OBJECT_CAST (registry));
568
570
 
569
571
  registry->priv->cookie++;
570
572
  GST_OBJECT_UNLOCK (registry);
598
600
  g_hash_table_remove (registry->feature_hash, feature->name);
599
601
  registry->priv->cookie++;
600
602
  GST_OBJECT_UNLOCK (registry);
601
 
  gst_object_unref (feature);
 
603
 
 
604
  gst_object_unparent ((GstObject *) feature);
602
605
}
603
606
 
604
607
/**
623
626
gst_registry_plugin_filter (GstRegistry * registry,
624
627
    GstPluginFilter filter, gboolean first, gpointer user_data)
625
628
{
626
 
  GList *list;
627
 
  GList *g;
 
629
  GList *list = NULL;
628
630
 
629
631
  g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
630
632
 
631
633
  GST_OBJECT_LOCK (registry);
632
 
  list = gst_filter_run (registry->plugins, (GstFilterFunc) filter, first,
633
 
      user_data);
634
 
  for (g = list; g; g = g->next) {
635
 
    gst_object_ref (GST_PLUGIN_CAST (g->data));
 
634
  {
 
635
    const GList *walk;
 
636
 
 
637
    for (walk = registry->plugins; walk != NULL; walk = walk->next) {
 
638
      GstPlugin *plugin = walk->data;
 
639
 
 
640
      if (filter == NULL || filter (plugin, user_data)) {
 
641
        list = g_list_prepend (list, gst_object_ref (plugin));
 
642
 
 
643
        if (first)
 
644
          break;
 
645
      }
 
646
    }
636
647
  }
637
648
  GST_OBJECT_UNLOCK (registry);
638
649
 
639
650
  return list;
640
651
}
641
652
 
 
653
#ifdef GST_DISABLE_DEPRECATED
 
654
typedef struct
 
655
{
 
656
  const gchar *name;
 
657
  GType type;
 
658
} GstTypeNameData;
 
659
static gboolean
 
660
gst_plugin_feature_type_name_filter (GstPluginFeature * feature,
 
661
    GstTypeNameData * data)
 
662
{
 
663
  g_assert (GST_IS_PLUGIN_FEATURE (feature));
 
664
 
 
665
  return ((data->type == 0 || data->type == G_OBJECT_TYPE (feature)) &&
 
666
      (data->name == NULL
 
667
          || !strcmp (data->name, GST_PLUGIN_FEATURE_NAME (feature))));
 
668
}
 
669
#endif
 
670
 
642
671
/* returns TRUE if the list was changed
643
672
 *
644
673
 * Must be called with the object lock taken */
651
680
 
652
681
  if (G_UNLIKELY (!*previous || priv->cookie != *cookie)) {
653
682
    GstTypeNameData data;
 
683
    const GList *walk;
654
684
 
655
 
    if (*previous)
 
685
    if (*previous) {
656
686
      gst_plugin_feature_list_free (*previous);
 
687
      *previous = NULL;
 
688
    }
657
689
 
658
690
    data.type = type;
659
691
    data.name = NULL;
660
 
    *previous =
661
 
        gst_filter_run (registry->features,
662
 
        (GstFilterFunc) gst_plugin_feature_type_name_filter, FALSE, &data);
663
 
    g_list_foreach (*previous, (GFunc) gst_object_ref, NULL);
 
692
 
 
693
    for (walk = registry->features; walk != NULL; walk = walk->next) {
 
694
      GstPluginFeature *feature = walk->data;
 
695
 
 
696
      if (gst_plugin_feature_type_name_filter (feature, &data)) {
 
697
        *previous = g_list_prepend (*previous, gst_object_ref (feature));
 
698
      }
 
699
    }
 
700
 
664
701
    *cookie = priv->cookie;
665
702
    res = TRUE;
666
703
  }
742
779
gst_registry_feature_filter (GstRegistry * registry,
743
780
    GstPluginFeatureFilter filter, gboolean first, gpointer user_data)
744
781
{
745
 
  GList *list;
746
 
  GList *g;
 
782
  GList *list = NULL;
747
783
 
748
784
  g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
749
785
 
750
786
  GST_OBJECT_LOCK (registry);
751
 
  list = gst_filter_run (registry->features, (GstFilterFunc) filter, first,
752
 
      user_data);
753
 
  for (g = list; g; g = g->next) {
754
 
    gst_object_ref (GST_PLUGIN_FEATURE_CAST (g->data));
 
787
  {
 
788
    const GList *walk;
 
789
 
 
790
    for (walk = registry->features; walk != NULL; walk = walk->next) {
 
791
      GstPluginFeature *feature = walk->data;
 
792
 
 
793
      if (filter == NULL || filter (feature, user_data)) {
 
794
        list = g_list_prepend (list, gst_object_ref (feature));
 
795
 
 
796
        if (first)
 
797
          break;
 
798
      }
 
799
    }
755
800
  }
756
801
  GST_OBJECT_UNLOCK (registry);
757
802
 
1083
1128
    changed = TRUE;
1084
1129
  }
1085
1130
 
 
1131
  if (!__registry_reuse_plugin_scanner) {
 
1132
    clear_scan_context (context);
 
1133
    context->helper_state = REGISTRY_SCAN_HELPER_NOT_STARTED;
 
1134
  }
 
1135
 
1086
1136
  return changed;
1087
1137
}
1088
1138
 
1215
1265
      } else {
1216
1266
        GST_INFO_OBJECT (context->registry, "cached info for %s is stale",
1217
1267
            filename);
1218
 
        GST_DEBUG_OBJECT (context->registry, "mtime %ld != %ld or size %"
1219
 
            G_GINT64_FORMAT " != %" G_GINT64_FORMAT " or external dependency "
1220
 
            "env_vars changed: %d or external dependencies changed: %d"
1221
 
            " or old path %s != new path %s",
1222
 
            plugin->file_mtime, file_status.st_mtime,
 
1268
        GST_DEBUG_OBJECT (context->registry, "mtime %" G_GINT64_FORMAT " != %"
 
1269
            G_GINT64_FORMAT " or size %" G_GINT64_FORMAT " != %"
 
1270
            G_GINT64_FORMAT " or external dependency env_vars changed: %d or"
 
1271
            " external dependencies changed: %d or old path %s != new path %s",
 
1272
            (gint64) plugin->file_mtime, (gint64) file_status.st_mtime,
1223
1273
            (gint64) plugin->file_size, (gint64) file_status.st_size,
1224
1274
            env_vars_changed, deps_changed, plugin->filename, filename);
1225
1275
        gst_registry_remove_plugin (context->registry, plugin);
1615
1665
  }
1616
1666
 
1617
1667
  if (do_update) {
 
1668
    const gchar *reuse_env;
 
1669
 
 
1670
    if ((reuse_env = g_getenv ("GST_REGISTRY_REUSE_PLUGIN_SCANNER"))) {
 
1671
      /* do reuse for any value different from "no" */
 
1672
      __registry_reuse_plugin_scanner = (strcmp (reuse_env, "no") != 0);
 
1673
    }
1618
1674
    /* now check registry */
1619
1675
    GST_DEBUG ("Updating registry cache");
1620
1676
    scan_and_update_registry (default_registry, registry_file, TRUE, error);