Blame gst/gstregistrychunks.h

Packit a6ee4b
/* GStreamer
Packit a6ee4b
 * Copyright (C) 2006 Josep Torra <josep@fluendo.com>
Packit a6ee4b
 * Copyright (C) 2006 Mathieu Garcia  <matthieu@fluendo.com>
Packit a6ee4b
 * Copyright (C) 2006 Stefan Kost <ensonic@sonicpulse.de>
Packit a6ee4b
 *
Packit a6ee4b
 * gstregistrybinary.h: Header for registry handling
Packit a6ee4b
 *
Packit a6ee4b
 * This library is free software; you can redistribute it and/or
Packit a6ee4b
 * modify it under the terms of the GNU Library General Public
Packit a6ee4b
 * License as published by the Free Software Foundation; either
Packit a6ee4b
 * version 2 of the License, or (at your option) any later version.
Packit a6ee4b
 *
Packit a6ee4b
 * This library is distributed in the hope that it will be useful,
Packit a6ee4b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a6ee4b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a6ee4b
 * Library General Public License for more details.
Packit a6ee4b
 *
Packit a6ee4b
 * You should have received a copy of the GNU Library General Public
Packit a6ee4b
 * License along with this library; if not, write to the
Packit a6ee4b
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit a6ee4b
 * Boston, MA 02110-1301, USA.
Packit a6ee4b
 */
Packit a6ee4b
#ifndef __GST_REGISTRYCHUNKS_H__
Packit a6ee4b
#define __GST_REGISTRYCHUNKS_H__
Packit a6ee4b
Packit a6ee4b
#include <gst/gstpad.h>
Packit a6ee4b
#include <gst/gstregistry.h>
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * we reference strings directly from the plugins and in this case set CONST to
Packit a6ee4b
 * avoid freeing them. If g_free() should be used, the MALLOC flag is set,
Packit a6ee4b
 * otherwise g_slice_free1() will be used!
Packit a6ee4b
 */
Packit a6ee4b
enum {
Packit a6ee4b
  GST_REGISTRY_CHUNK_FLAG_NONE = 0,
Packit a6ee4b
  GST_REGISTRY_CHUNK_FLAG_CONST = 1,
Packit a6ee4b
  GST_REGISTRY_CHUNK_FLAG_MALLOC = 2,
Packit a6ee4b
};
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * GstRegistryChunk:
Packit a6ee4b
 *
Packit a6ee4b
 * Header for binary blobs
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstRegistryChunk
Packit a6ee4b
{
Packit a6ee4b
  gpointer data;
Packit a6ee4b
  guint size;
Packit a6ee4b
  guint flags;
Packit a6ee4b
  gboolean align;
Packit a6ee4b
} GstRegistryChunk;
Packit a6ee4b
Packit a6ee4b
typedef struct _GstRegistryChunkGlobalHeader
Packit a6ee4b
{
Packit a6ee4b
  guint32  filter_env_hash;
Packit a6ee4b
} GstRegistryChunkGlobalHeader;
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * GstRegistryChunkPluginElement:
Packit a6ee4b
 *
Packit a6ee4b
 * @n_deps: Says how many dependency structures follows.
Packit a6ee4b
 *
Packit a6ee4b
 * @nfeatures: says how many binary plugin feature structures we will have
Packit a6ee4b
 * right after the structure itself.
Packit a6ee4b
 *
Packit a6ee4b
 * A structure containing (staticely) every information needed for a plugin
Packit a6ee4b
 */
Packit a6ee4b
Packit a6ee4b
typedef struct _GstRegistryChunkPluginElement
Packit a6ee4b
{
Packit a6ee4b
  gulong file_size;
Packit a6ee4b
  gulong file_mtime;
Packit a6ee4b
Packit a6ee4b
  guint n_deps;
Packit a6ee4b
Packit a6ee4b
  guint nfeatures;
Packit a6ee4b
} GstRegistryChunkPluginElement;
Packit a6ee4b
Packit a6ee4b
/* GstRegistryChunkDep:
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstRegistryChunkDep
Packit a6ee4b
{
Packit a6ee4b
  guint flags;
Packit a6ee4b
  guint n_env_vars;
Packit a6ee4b
  guint n_paths;
Packit a6ee4b
  guint n_names;
Packit a6ee4b
Packit a6ee4b
  guint env_hash;
Packit a6ee4b
  guint stat_hash;
Packit a6ee4b
} GstRegistryChunkDep;
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * GstRegistryChunkPluginFeature:
Packit a6ee4b
 * @rank: rank of the feature
Packit a6ee4b
 *
Packit a6ee4b
 * A structure containing the plugin features
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstRegistryChunkPluginFeature
Packit a6ee4b
{
Packit a6ee4b
  gulong rank;
Packit a6ee4b
} GstRegistryChunkPluginFeature;
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * GstRegistryChunkElementFactory:
Packit a6ee4b
 * @npadtemplates: stores the number of GstRegistryChunkPadTemplate structures
Packit a6ee4b
 * following the structure
Packit a6ee4b
 * @ninterfaces: stores the number of interface names following the structure
Packit a6ee4b
 * @nuriprotocols: stores the number of protocol strings following the structure
Packit a6ee4b
 *
Packit a6ee4b
 * A structure containing the element factory fields
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstRegistryChunkElementFactory
Packit a6ee4b
{
Packit a6ee4b
  GstRegistryChunkPluginFeature plugin_feature;
Packit a6ee4b
Packit a6ee4b
  guint npadtemplates;
Packit a6ee4b
  guint ninterfaces;
Packit a6ee4b
  guint nuriprotocols;
Packit a6ee4b
} GstRegistryChunkElementFactory;
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * GstRegistryChunkTypeFindFactory:
Packit a6ee4b
 * @nextensions: stores the number of typefind extensions
Packit a6ee4b
 *
Packit a6ee4b
 * A structure containing the type find factory fields
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstRegistryChunkTypeFindFactory
Packit a6ee4b
{
Packit a6ee4b
  GstRegistryChunkPluginFeature plugin_feature;
Packit a6ee4b
Packit a6ee4b
  guint nextensions;
Packit a6ee4b
} GstRegistryChunkTypeFindFactory;
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * GstRegistryChunkDeviceProviderFactory:
Packit a6ee4b
 *
Packit a6ee4b
 * A structure containing the device provider factory fields
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstRegistryChunkDeviceProviderFactory
Packit a6ee4b
{
Packit a6ee4b
  GstRegistryChunkPluginFeature plugin_feature;
Packit a6ee4b
Packit a6ee4b
} GstRegistryChunkDeviceProviderFactory;
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * GstRegistryChunkDynamicTypeFactory:
Packit a6ee4b
 *
Packit a6ee4b
 * A structure containing the dynamic type factory flags field
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstRegistryChunkDynamicTypeFactory
Packit a6ee4b
{
Packit a6ee4b
  GstRegistryChunkPluginFeature plugin_feature;
Packit a6ee4b
Packit a6ee4b
  guint type_flags;
Packit a6ee4b
} GstRegistryChunkDynamicTypeFactory;
Packit a6ee4b
Packit a6ee4b
/*
Packit a6ee4b
 * GstRegistryChunkPadTemplate:
Packit a6ee4b
 *
Packit a6ee4b
 * A structure containing the static pad templates of a plugin feature
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstRegistryChunkPadTemplate
Packit a6ee4b
{
Packit a6ee4b
  guint direction;	               /* Either 0:"sink" or 1:"src" */
Packit a6ee4b
  GstPadPresence presence;
Packit a6ee4b
} GstRegistryChunkPadTemplate;
Packit a6ee4b
Packit a6ee4b
G_BEGIN_DECLS
Packit a6ee4b
Packit a6ee4b
gboolean
Packit a6ee4b
_priv_gst_registry_chunks_save_plugin (GList ** list, GstRegistry * registry,
Packit a6ee4b
    GstPlugin * plugin);
Packit a6ee4b
Packit a6ee4b
gboolean
Packit a6ee4b
_priv_gst_registry_chunks_load_plugin (GstRegistry * registry, gchar ** in,
Packit a6ee4b
    gchar *end, GstPlugin **out_plugin);
Packit a6ee4b
Packit a6ee4b
void
Packit a6ee4b
_priv_gst_registry_chunks_save_global_header (GList ** list,
Packit a6ee4b
    GstRegistry * registry, guint32 filter_env_hash);
Packit a6ee4b
Packit a6ee4b
gboolean
Packit a6ee4b
_priv_gst_registry_chunks_load_global_header (GstRegistry * registry,
Packit a6ee4b
    gchar ** in, gchar *end, guint32 * filter_env_hash);
Packit a6ee4b
Packit a6ee4b
void
Packit a6ee4b
_priv_gst_registry_chunk_free (GstRegistryChunk *chunk);
Packit a6ee4b
Packit a6ee4b
G_END_DECLS
Packit a6ee4b
Packit a6ee4b
#endif /* __GST_REGISTRYCHUNKS_H__ */