2 * Copyright (C) 2006 Josep Torra <josep@fluendo.com>
3 * 2006 Mathieu Garcia <matthieu@fluendo.com>
4 * 2006,2007 Stefan Kost <ensonic@users.sf.net>
5 * 2008 Sebastian Dröge <slomo@circular-chaos.org>
6 * 2008 Jan Schmidt <jan.schmidt@sun.com>
8 * gstregistrychunks.c: GstRegistryChunk helper for serialising/deserialising
9 * plugin entries and features.
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the
23 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA.
31 #include <gst/gst_private.h>
32 #include <gst/gstconfig.h>
33 #include <gst/gstelement.h>
34 #include <gst/gsttypefind.h>
35 #include <gst/gsttypefindfactory.h>
36 #include <gst/gsturi.h>
37 #include <gst/gstinfo.h>
38 #include <gst/gstenumtypes.h>
39 #include <gst/gstpadtemplate.h>
41 #include <gst/gstregistrychunks.h>
43 #define GST_CAT_DEFAULT GST_CAT_REGISTRY
45 /* count string length, but return -1 if we hit the eof */
47 _strnlen (const gchar * str, gint maxlen)
51 while (G_LIKELY (len < maxlen)) {
52 if (G_UNLIKELY (str[len] == '\0'))
60 #define unpack_element(inptr, outptr, element, endptr, error_label) G_STMT_START{ \
61 if (inptr + sizeof(element) > endptr) { \
62 GST_ERROR ("Failed reading element " G_STRINGIFY (element) \
63 ". Have %d bytes need %" G_GSSIZE_FORMAT, \
64 (int) (endptr - inptr), sizeof(element)); \
67 outptr = (element *) inptr; \
68 inptr += sizeof (element); \
71 #define unpack_const_string(inptr, outptr, endptr, error_label) G_STMT_START{\
72 gint _len = _strnlen (inptr, (endptr-inptr)); \
75 outptr = g_intern_string ((const gchar *)inptr); \
79 #define unpack_string(inptr, outptr, endptr, error_label) G_STMT_START{\
80 gint _len = _strnlen (inptr, (endptr-inptr)); \
83 outptr = g_memdup ((gconstpointer)inptr, _len + 1); \
87 #define ALIGNMENT (sizeof (void *))
88 #define alignment(_address) (gsize)_address%ALIGNMENT
89 #define align(_ptr) _ptr += (( alignment(_ptr) == 0) ? 0 : ALIGNMENT-alignment(_ptr))
92 * gst_registry_chunks_save_const_string:
94 * Store a const string in a binary chunk.
96 * Returns: %TRUE for success
98 inline static gboolean
99 gst_registry_chunks_save_const_string (GList ** list, const gchar * str)
101 GstRegistryChunk *chunk;
103 if (G_UNLIKELY (str == NULL)) {
104 GST_ERROR ("unexpected NULL string in plugin or plugin feature data");
108 chunk = g_malloc (sizeof (GstRegistryChunk));
109 chunk->data = (gpointer) str;
110 chunk->size = strlen ((gchar *) chunk->data) + 1;
111 chunk->flags = GST_REGISTRY_CHUNK_FLAG_CONST;
112 chunk->align = FALSE;
113 *list = g_list_prepend (*list, chunk);
118 * gst_registry_chunks_save_string:
120 * Store a string in a binary chunk.
122 * Returns: %TRUE for success
124 inline static gboolean
125 gst_registry_chunks_save_string (GList ** list, gchar * str)
127 GstRegistryChunk *chunk;
129 chunk = g_malloc (sizeof (GstRegistryChunk));
131 chunk->size = strlen ((gchar *) chunk->data) + 1;
132 chunk->flags = GST_REGISTRY_CHUNK_FLAG_NONE;
133 chunk->align = FALSE;
134 *list = g_list_prepend (*list, chunk);
139 * gst_registry_chunks_save_data:
141 * Store some data in a binary chunk.
143 * Returns: the initialized chunk
145 inline static GstRegistryChunk *
146 gst_registry_chunks_make_data (gpointer data, gulong size)
148 GstRegistryChunk *chunk;
150 chunk = g_malloc (sizeof (GstRegistryChunk));
153 chunk->flags = GST_REGISTRY_CHUNK_FLAG_NONE;
160 * gst_registry_chunks_save_pad_template:
162 * Store pad_templates in binary chunks.
164 * Returns: %TRUE for success
167 gst_registry_chunks_save_pad_template (GList ** list,
168 GstStaticPadTemplate * template)
170 GstRegistryChunkPadTemplate *pt;
171 GstRegistryChunk *chk;
173 pt = g_malloc0 (sizeof (GstRegistryChunkPadTemplate));
175 gst_registry_chunks_make_data (pt, sizeof (GstRegistryChunkPadTemplate));
177 pt->presence = template->presence;
178 pt->direction = template->direction;
180 /* pack pad template strings */
181 gst_registry_chunks_save_const_string (list,
182 (gchar *) (template->static_caps.string));
183 gst_registry_chunks_save_const_string (list, template->name_template);
185 *list = g_list_prepend (*list, chk);
191 * gst_registry_chunks_save_feature:
193 * Store features in binary chunks.
195 * Returns: %TRUE for success
198 gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
200 const gchar *type_name = g_type_name (G_OBJECT_TYPE (feature));
201 GstRegistryChunkPluginFeature *pf = NULL;
202 GstRegistryChunk *chk = NULL;
206 GST_ERROR ("NULL feature type_name, aborting.");
210 if (GST_IS_ELEMENT_FACTORY (feature)) {
211 GstRegistryChunkElementFactory *ef;
212 GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
214 ef = g_malloc0 (sizeof (GstRegistryChunkElementFactory));
216 gst_registry_chunks_make_data (ef,
217 sizeof (GstRegistryChunkElementFactory));
218 ef->npadtemplates = ef->ninterfaces = ef->nuriprotocols = 0;
219 pf = (GstRegistryChunkPluginFeature *) ef;
221 /* save interfaces */
222 for (walk = factory->interfaces; walk;
223 walk = g_list_next (walk), ef->ninterfaces++) {
224 gst_registry_chunks_save_const_string (list, (gchar *) walk->data);
226 GST_DEBUG ("Saved %d Interfaces", ef->ninterfaces);
228 if (GST_URI_TYPE_IS_VALID (factory->uri_type)) {
229 if (factory->uri_protocols && *factory->uri_protocols) {
230 GstRegistryChunk *subchk;
234 gst_registry_chunks_make_data (&factory->uri_type,
235 sizeof (factory->uri_type));
236 subchk->flags = GST_REGISTRY_CHUNK_FLAG_CONST;
238 protocol = factory->uri_protocols;
240 gst_registry_chunks_save_const_string (list, *protocol++);
243 *list = g_list_prepend (*list, subchk);
244 GST_DEBUG ("Saved %d UriTypes", ef->nuriprotocols);
246 g_warning ("GStreamer feature '%s' is URI handler but does not provide"
247 " any protocols it can handle", feature->name);
251 /* save pad-templates */
252 for (walk = factory->staticpadtemplates; walk;
253 walk = g_list_next (walk), ef->npadtemplates++) {
254 GstStaticPadTemplate *template = walk->data;
256 if (!gst_registry_chunks_save_pad_template (list, template)) {
257 GST_ERROR ("Can't fill pad template, aborting.");
262 /* pack element factory strings */
263 gst_registry_chunks_save_const_string (list, factory->details.author);
264 gst_registry_chunks_save_const_string (list, factory->details.description);
265 gst_registry_chunks_save_const_string (list, factory->details.klass);
266 gst_registry_chunks_save_const_string (list, factory->details.longname);
267 } else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
268 GstRegistryChunkTypeFindFactory *tff;
269 GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (feature);
272 tff = g_malloc0 (sizeof (GstRegistryChunkTypeFindFactory));
274 gst_registry_chunks_make_data (tff,
275 sizeof (GstRegistryChunkTypeFindFactory));
276 tff->nextensions = 0;
277 pf = (GstRegistryChunkPluginFeature *) tff;
279 /* save extensions */
280 if (factory->extensions) {
281 while (factory->extensions[tff->nextensions]) {
282 gst_registry_chunks_save_const_string (list,
283 factory->extensions[tff->nextensions++]);
288 /* we copy the caps here so we can simplify them before saving. This
289 * is a lot faster when loading them later on */
290 GstCaps *copy = gst_caps_copy (factory->caps);
292 gst_caps_do_simplify (copy);
293 str = gst_caps_to_string (copy);
294 gst_caps_unref (copy);
295 gst_registry_chunks_save_string (list, str);
297 gst_registry_chunks_save_const_string (list, "");
299 } else if (GST_IS_INDEX_FACTORY (feature)) {
300 GstIndexFactory *factory = GST_INDEX_FACTORY (feature);
302 pf = g_malloc0 (sizeof (GstRegistryChunkPluginFeature));
304 gst_registry_chunks_make_data (pf,
305 sizeof (GstRegistryChunkPluginFeature));
306 pf->rank = feature->rank;
308 /* pack element factory strings */
309 gst_registry_chunks_save_const_string (list, factory->longdesc);
311 GST_WARNING ("unhandled feature type '%s'", type_name);
315 pf->rank = feature->rank;
316 *list = g_list_prepend (*list, chk);
318 /* pack plugin feature strings */
319 gst_registry_chunks_save_const_string (list, feature->name);
320 gst_registry_chunks_save_const_string (list, (gchar *) type_name);
333 gst_registry_chunks_save_plugin_dep (GList ** list, GstPluginDep * dep)
335 GstRegistryChunkDep *ed;
336 GstRegistryChunk *chk;
339 ed = g_malloc0 (sizeof (GstRegistryChunkDep));
340 chk = gst_registry_chunks_make_data (ed, sizeof (GstRegistryChunkDep));
342 ed->flags = dep->flags;
347 ed->env_hash = dep->env_hash;
348 ed->stat_hash = dep->stat_hash;
350 for (s = dep->env_vars; s != NULL && *s != NULL; ++s, ++ed->n_env_vars)
351 gst_registry_chunks_save_string (list, g_strdup (*s));
353 for (s = dep->paths; s != NULL && *s != NULL; ++s, ++ed->n_paths)
354 gst_registry_chunks_save_string (list, g_strdup (*s));
356 for (s = dep->names; s != NULL && *s != NULL; ++s, ++ed->n_names)
357 gst_registry_chunks_save_string (list, g_strdup (*s));
359 *list = g_list_prepend (*list, chk);
361 GST_LOG ("Saved external plugin dependency");
366 * _priv_gst_registry_chunks_save_plugin:
368 * Adapt a GstPlugin to our GstRegistryChunkPluginElement structure, and
369 * prepend it as a GstRegistryChunk in the provided list.
373 _priv_gst_registry_chunks_save_plugin (GList ** list, GstRegistry * registry,
376 GstRegistryChunkPluginElement *pe;
377 GstRegistryChunk *chk;
378 GList *plugin_features = NULL;
381 pe = g_malloc0 (sizeof (GstRegistryChunkPluginElement));
383 gst_registry_chunks_make_data (pe,
384 sizeof (GstRegistryChunkPluginElement));
386 pe->file_size = plugin->file_size;
387 pe->file_mtime = plugin->file_mtime;
391 /* pack external deps */
392 for (walk = plugin->priv->deps; walk != NULL; walk = walk->next) {
393 if (!gst_registry_chunks_save_plugin_dep (list, walk->data)) {
394 GST_ERROR ("Could not save external plugin dependency, aborting.");
400 /* pack plugin features */
402 gst_registry_get_feature_list_by_plugin (registry, plugin->desc.name);
403 for (walk = plugin_features; walk; walk = g_list_next (walk), pe->nfeatures++) {
404 GstPluginFeature *feature = GST_PLUGIN_FEATURE (walk->data);
406 if (!gst_registry_chunks_save_feature (list, feature)) {
407 GST_ERROR ("Can't fill plugin feature, aborting.");
412 gst_plugin_feature_list_free (plugin_features);
414 /* pack cache data */
415 if (plugin->priv->cache_data) {
416 gchar *cache_str = gst_structure_to_string (plugin->priv->cache_data);
417 gst_registry_chunks_save_string (list, cache_str);
419 gst_registry_chunks_save_const_string (list, "");
422 /* pack plugin element strings */
423 gst_registry_chunks_save_const_string (list, plugin->desc.origin);
424 gst_registry_chunks_save_const_string (list, plugin->desc.package);
425 gst_registry_chunks_save_const_string (list, plugin->desc.source);
426 gst_registry_chunks_save_const_string (list, plugin->desc.license);
427 gst_registry_chunks_save_const_string (list, plugin->desc.version);
428 gst_registry_chunks_save_const_string (list, plugin->filename);
429 gst_registry_chunks_save_const_string (list, plugin->desc.description);
430 gst_registry_chunks_save_const_string (list, plugin->desc.name);
432 *list = g_list_prepend (*list, chk);
434 GST_DEBUG ("Found %d features in plugin \"%s\"", pe->nfeatures,
440 gst_plugin_feature_list_free (plugin_features);
447 * gst_registry_chunks_load_pad_template:
449 * Make a new GstStaticPadTemplate from current GstRegistryChunkPadTemplate
452 * Returns: new GstStaticPadTemplate
455 gst_registry_chunks_load_pad_template (GstElementFactory * factory, gchar ** in,
458 GstRegistryChunkPadTemplate *pt;
459 GstStaticPadTemplate *template = NULL;
462 GST_DEBUG ("Reading/casting for GstRegistryChunkPadTemplate at address %p",
464 unpack_element (*in, pt, GstRegistryChunkPadTemplate, end, fail);
466 template = g_new0 (GstStaticPadTemplate, 1);
467 template->presence = pt->presence;
468 template->direction = pt->direction;
470 /* unpack pad template strings */
471 unpack_const_string (*in, template->name_template, end, fail);
472 unpack_string (*in, template->static_caps.string, end, fail);
474 __gst_element_factory_add_static_pad_template (factory, template);
475 GST_DEBUG ("Added pad_template %s", template->name_template);
479 GST_INFO ("Reading pad template failed");
485 * gst_registry_chunks_load_feature:
487 * Make a new GstPluginFeature from current binary plugin feature structure
489 * Returns: new GstPluginFeature
492 gst_registry_chunks_load_feature (GstRegistry * registry, gchar ** in,
493 gchar * end, const gchar * plugin_name)
495 GstRegistryChunkPluginFeature *pf = NULL;
496 GstPluginFeature *feature = NULL;
497 gchar *type_name = NULL, *str;
501 /* unpack plugin feature strings */
502 unpack_string (*in, type_name, end, fail);
504 if (G_UNLIKELY (!type_name)) {
505 GST_ERROR ("No feature type name");
509 GST_DEBUG ("Plugin '%s' feature typename : '%s'", plugin_name, type_name);
511 if (G_UNLIKELY (!(type = g_type_from_name (type_name)))) {
512 GST_ERROR ("Unknown type from typename '%s' for plugin '%s'", type_name,
517 if (G_UNLIKELY ((feature = g_object_new (type, NULL)) == NULL)) {
518 GST_ERROR ("Can't create feature from type");
523 if (G_UNLIKELY (!GST_IS_PLUGIN_FEATURE (feature))) {
524 GST_ERROR ("typename : '%s' is not a plugin feature", type_name);
528 /* unpack more plugin feature strings */
529 unpack_string (*in, feature->name, end, fail);
531 if (GST_IS_ELEMENT_FACTORY (feature)) {
532 GstRegistryChunkElementFactory *ef;
534 GstElementFactory *factory = GST_ELEMENT_FACTORY_CAST (feature);
537 GST_LOG ("Reading/casting for GstRegistryChunkElementFactory at address %p",
539 unpack_element (*in, ef, GstRegistryChunkElementFactory, end, fail);
540 pf = (GstRegistryChunkPluginFeature *) ef;
542 /* unpack element factory strings */
543 unpack_string (*in, factory->details.longname, end, fail);
544 unpack_string (*in, factory->details.klass, end, fail);
545 unpack_string (*in, factory->details.description, end, fail);
546 unpack_string (*in, factory->details.author, end, fail);
547 n = ef->npadtemplates;
548 GST_DEBUG ("Element factory : '%s' with npadtemplates=%d",
549 factory->details.longname, n);
551 /* load pad templates */
552 for (i = 0; i < n; i++) {
553 if (G_UNLIKELY (!gst_registry_chunks_load_pad_template (factory, in,
555 GST_ERROR ("Error while loading binary pad template");
561 if (G_UNLIKELY ((n = ef->nuriprotocols))) {
562 GST_DEBUG ("Reading %d UriTypes at address %p", n, *in);
565 factory->uri_type = *((guint *) * in);
566 *in += sizeof (factory->uri_type);
567 /*unpack_element(*in, &factory->uri_type, factory->uri_type, end, fail); */
569 factory->uri_protocols = g_new0 (gchar *, n + 1);
570 for (i = 0; i < n; i++) {
571 unpack_string (*in, str, end, fail);
572 factory->uri_protocols[i] = str;
575 /* load interfaces */
576 if (G_UNLIKELY ((n = ef->ninterfaces))) {
577 GST_DEBUG ("Reading %d Interfaces at address %p", n, *in);
578 for (i = 0; i < n; i++) {
579 unpack_string (*in, str, end, fail);
580 __gst_element_factory_add_interface (factory, str);
584 } else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
585 GstRegistryChunkTypeFindFactory *tff;
586 GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (feature);
590 ("Reading/casting for GstRegistryChunkPluginFeature at address %p",
592 unpack_element (*in, tff, GstRegistryChunkTypeFindFactory, end, fail);
593 pf = (GstRegistryChunkPluginFeature *) tff;
596 unpack_string (*in, str, end, fail);
597 factory->caps = (str && *str) ? gst_caps_from_string (str) : NULL;
599 /* load extensions */
600 if (tff->nextensions) {
601 GST_DEBUG ("Reading %d Typefind extensions at address %p",
602 tff->nextensions, *in);
603 factory->extensions = g_new0 (gchar *, tff->nextensions + 1);
604 for (i = 0; i < tff->nextensions; i++) {
605 unpack_string (*in, str, end, fail);
606 factory->extensions[i] = str;
609 } else if (GST_IS_INDEX_FACTORY (feature)) {
610 GstIndexFactory *factory = GST_INDEX_FACTORY (feature);
614 ("Reading/casting for GstRegistryChunkPluginFeature at address %p",
616 unpack_element (*in, pf, GstRegistryChunkPluginFeature, end, fail);
618 /* unpack index factory strings */
619 unpack_string (*in, factory->longdesc, end, fail);
621 GST_WARNING ("unhandled factory type : %s", G_OBJECT_TYPE_NAME (feature));
625 feature->rank = pf->rank;
627 /* should already be the interned string, but better make sure */
628 feature->plugin_name = g_intern_string (plugin_name);
630 gst_registry_add_feature (registry, feature);
631 GST_DEBUG ("Added feature %s", feature->name);
638 GST_INFO ("Reading plugin feature failed");
641 if (GST_IS_OBJECT (feature))
642 gst_object_unref (feature);
644 g_object_unref (feature);
650 gst_registry_chunks_load_plugin_dep_strv (gchar ** in, gchar * end, guint n)
657 arr = g_new0 (gchar *, n + 1);
659 unpack_string (*in, arr[n - 1], end, fail);
664 GST_INFO ("Reading plugin dependency strings failed");
669 gst_registry_chunks_load_plugin_dep (GstPlugin * plugin, gchar ** in,
673 GstRegistryChunkDep *d;
677 GST_LOG_OBJECT (plugin, "Unpacking GstRegistryChunkDep from %p", *in);
678 unpack_element (*in, d, GstRegistryChunkDep, end, fail);
680 dep = g_malloc0 (sizeof (GstPluginDep));
682 dep->env_hash = d->env_hash;
683 dep->stat_hash = d->stat_hash;
685 dep->flags = d->flags;
687 dep->names = gst_registry_chunks_load_plugin_dep_strv (in, end, d->n_names);
688 dep->paths = gst_registry_chunks_load_plugin_dep_strv (in, end, d->n_paths);
690 gst_registry_chunks_load_plugin_dep_strv (in, end, d->n_env_vars);
692 plugin->priv->deps = g_list_append (plugin->priv->deps, dep);
694 GST_DEBUG_OBJECT (plugin, "Loaded external plugin dependency from registry: "
695 "env_hash: %08x, stat_hash: %08x", dep->env_hash, dep->stat_hash);
696 for (s = dep->env_vars; s != NULL && *s != NULL; ++s)
697 GST_LOG_OBJECT (plugin, " evar: %s", *s);
698 for (s = dep->paths; s != NULL && *s != NULL; ++s)
699 GST_LOG_OBJECT (plugin, " path: %s", *s);
700 for (s = dep->names; s != NULL && *s != NULL; ++s)
701 GST_LOG_OBJECT (plugin, " name: %s", *s);
705 GST_INFO ("Reading plugin dependency failed");
711 * _priv_gst_registry_chunks_load_plugin:
713 * Make a new GstPlugin from current GstRegistryChunkPluginElement structure
714 * and add it to the GstRegistry. Return an offset to the next
715 * GstRegistryChunkPluginElement structure.
718 _priv_gst_registry_chunks_load_plugin (GstRegistry * registry, gchar ** in,
719 gchar * end, GstPlugin ** out_plugin)
721 GstRegistryChunkPluginElement *pe;
722 GstPlugin *plugin = NULL;
723 gchar *cache_str = NULL;
727 GST_LOG ("Reading/casting for GstRegistryChunkPluginElement at address %p",
729 unpack_element (*in, pe, GstRegistryChunkPluginElement, end, fail);
731 plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
733 /* TODO: also set GST_PLUGIN_FLAG_CONST */
734 plugin->flags |= GST_PLUGIN_FLAG_CACHED;
735 plugin->file_mtime = pe->file_mtime;
736 plugin->file_size = pe->file_size;
738 /* unpack plugin element strings */
739 unpack_const_string (*in, plugin->desc.name, end, fail);
740 unpack_string (*in, plugin->desc.description, end, fail);
741 unpack_string (*in, plugin->filename, end, fail);
742 unpack_const_string (*in, plugin->desc.version, end, fail);
743 unpack_const_string (*in, plugin->desc.license, end, fail);
744 unpack_const_string (*in, plugin->desc.source, end, fail);
745 unpack_const_string (*in, plugin->desc.package, end, fail);
746 unpack_const_string (*in, plugin->desc.origin, end, fail);
747 GST_LOG ("read strings for name='%s'", plugin->desc.name);
748 GST_LOG (" desc.description='%s'", plugin->desc.description);
749 GST_LOG (" filename='%s'", plugin->filename);
750 GST_LOG (" desc.version='%s'", plugin->desc.version);
751 GST_LOG (" desc.license='%s'", plugin->desc.license);
752 GST_LOG (" desc.source='%s'", plugin->desc.source);
753 GST_LOG (" desc.package='%s'", plugin->desc.package);
754 GST_LOG (" desc.origin='%s'", plugin->desc.origin);
756 /* unpack cache data */
757 unpack_string (*in, cache_str, end, fail);
759 plugin->priv->cache_data = gst_structure_from_string (cache_str, NULL);
763 /* If the license string is 'BLACKLIST', mark this as a blacklisted
765 if (strcmp (plugin->desc.license, "BLACKLIST") == 0)
766 plugin->flags |= GST_PLUGIN_FLAG_BLACKLISTED;
768 plugin->basename = g_path_get_basename (plugin->filename);
770 /* Takes ownership of plugin */
771 gst_registry_add_plugin (registry, plugin);
773 GST_DEBUG ("Added plugin '%s' plugin with %d features from binary registry",
774 plugin->desc.name, n);
776 /* Load plugin features */
777 for (i = 0; i < n; i++) {
778 if (G_UNLIKELY (!gst_registry_chunks_load_feature (registry, in, end,
779 plugin->desc.name))) {
780 GST_ERROR ("Error while loading binary feature for plugin '%s'",
781 GST_STR_NULL (plugin->desc.name));
782 gst_registry_remove_plugin (registry, plugin);
787 /* Load external plugin dependencies */
788 for (i = 0; i < pe->n_deps; ++i) {
789 if (G_UNLIKELY (!gst_registry_chunks_load_plugin_dep (plugin, in, end))) {
790 GST_ERROR_OBJECT (plugin, "Could not read external plugin dependency "
791 "for plugin '%s'", GST_STR_NULL (plugin->desc.name));
792 gst_registry_remove_plugin (registry, plugin);
798 *out_plugin = plugin;
804 GST_INFO ("Reading plugin failed");