metacontainer: Finnish GESMetaContainer implementation

This commit is contained in:
Thibault Saunier 2012-12-17 15:23:39 -03:00
parent 97862bbe48
commit 3de2670b00
6 changed files with 947 additions and 448 deletions

View file

@ -32,9 +32,12 @@ GESVideoTestPattern
GESPipelineFlags
GESEdge
GESEditMode
GESMetaFlag
<SUBSECTION Standard>
GES_TYPE_TRACK_TYPE
ges_track_type_get_type
GES_META_FLAG_TYPE
ges_meta_flag_get_type
GES_VIDEO_STANDARD_TRANSITION_TYPE_TYPE
ges_video_standard_transition_type_get_type
GES_TEXT_HALIGN_TYPE
@ -917,10 +920,29 @@ ges_meta_container_set_int64
ges_meta_container_set_string
ges_meta_container_set_uint
ges_meta_container_set_uint64
ges_meta_container_set_value
ges_meta_container_to_string
ges_meta_container_set_meta
ges_meta_container_register_meta_boolean
ges_meta_container_register_meta_int
ges_meta_container_register_meta_uint
ges_meta_container_register_meta_int64
ges_meta_container_register_meta_uint64
ges_meta_container_register_meta_float
ges_meta_container_register_meta_double
ges_meta_container_register_meta_date
ges_meta_container_register_meta_date_time
ges_meta_container_register_meta_string
ges_meta_container_register_meta
ges_meta_container_metas_to_string
ges_meta_container_add_metas_from_string
ges_meta_container_get_type
GES_META_FORMATTER_NAME
GES_META_FORMATTER_MIMETYPE
GES_META_FORMATTER_EXTENSION
GES_META_FORMATTER_VERSION
GES_META_FORMATTER_RANK
GES_META_DESCRIPTION
<SUBSECTION Standard>
GESMetaContainerInterface
GES_IS_META_CONTAINER

View file

@ -618,3 +618,26 @@ ges_video_test_pattern_get_type (void)
return theType;
}
static void
register_ges_meta_flag (GType * id)
{
static const GFlagsValue values[] = {
{C_ENUM (GES_META_READABLE), "GES_META_READABLE", "readable"},
{C_ENUM (GES_META_WRITABLE), "GES_META_WRITABLE", "writable"},
{C_ENUM (GES_META_READ_WRITE), "GES_META_READ_WRITE", "readwrite"},
{0, NULL, NULL}
};
*id = g_flags_register_static ("GESMetaFlag", values);
}
GType
ges_meta_flag_get_type (void)
{
static GType id;
static GOnce once = G_ONCE_INIT;
g_once (&once, (GThreadFunc) register_ges_meta_flag, &id);
return id;
}

View file

@ -52,6 +52,21 @@ typedef enum {
GES_TRACK_TYPE_CUSTOM = 1 << 4,
} GESTrackType;
#define GES_META_FLAG_TYPE (ges_meta_flag_get_type ())
GType ges_meta_flag_get_type (void);
/**
* GESMetaFlag:
* @GES_META_READABLE: The metadata is readable
* @GES_META_WRITABLE: The metadata is writable
* @GES_META_READ_WRITE: The metadata is readable and writable
*/
typedef enum {
GES_META_READABLE = 1 << 0,
GES_META_WRITABLE = 1 << 1,
GES_META_READ_WRITE = GES_META_READABLE | GES_META_WRITABLE
} GESMetaFlag;
/**
* GESVideoStandardTransitionType:
* @GES_VIDEO_STANDARD_TRANSITION_TYPE_NONE: Transition type has not been set,

File diff suppressed because it is too large Load diff

View file

@ -17,24 +17,84 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef _GES_METADATA_CONTAINER
#define _GES_METADATA_CONTAINER
#ifndef _GES_META_CONTAINER
#define _GES_META_CONTAINER
#include <glib-object.h>
#include <gst/gst.h>
#include <ges/ges-types.h>
#include "ges-enums.h"
G_BEGIN_DECLS
#define GES_TYPE_METADATA_CONTAINER (ges_meta_container_get_type ())
#define GES_METADATA_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_METADATA_CONTAINER, GESMetadataContainer))
#define GES_IS_METADATA_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_METADATA_CONTAINER))
#define GES_METADATA_CONTAINER_GET_INTERFACE (inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GES_TYPE_METADATA_CONTAINER, GESMetadataContainerInterface))
#define GES_TYPE_META_CONTAINER (ges_meta_container_get_type ())
#define GES_META_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_META_CONTAINER, GESMetaContainer))
#define GES_IS_META_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_META_CONTAINER))
#define GES_META_CONTAINER_GET_INTERFACE (inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GES_TYPE_META_CONTAINER, GESMetaContainerInterface))
typedef struct _GESMetadataContainer GESMetadataContainer;
typedef struct _GESMetadataContainerInterface GESMetadataContainerInterface;
/**
* GES_META_FORMATTER_NAME:
*
* Name of a formatter it is used as ID of Formater assets (string)
*
* The name of the formatter
*/
#define GES_META_FORMATTER_NAME "name"
struct _GESMetadataContainerInterface {
/**
* GES_META_DESCRIPTION:
*
* The description of an object, can be used in various context (string)
*
* The description
*/
#define GES_META_DESCRIPTION "description"
/**
* GES_META_FORMATTER_MIMETYPE:
*
* Mimetype used for the file produced by a formatter (string)
*
* The mime type
*/
#define GES_META_FORMATTER_MIMETYPE "mimetype"
/**
* GES_META_FORMATTER_EXTENSION:
*
* The extension of the files produced by a formatter (string)
*/
#define GES_META_FORMATTER_EXTENSION "extension"
/**
* GES_META_FORMATTER_VERSION:
*
* The version of a formatter (double)
*
* The formatter version
*/
#define GES_META_FORMATTER_VERSION "version"
/**
* GES_META_FORMATTER_RANK:
*
* The rank of a formatter (GstRank)
*
* The rank of a formatter
*/
#define GES_META_FORMATTER_RANK "rank"
/**
* GES_META_TIMELINE_OBJECT_SUPPORTED_FORMATS:
*
* The GESTrackType on which a GESTimelineObject can create GESTrackObjects
*/
#define GES_META_TIMELINE_OBJECT_SUPPORTED_FORMATS "supported-formats"
typedef struct _GESMetaContainer GESMetaContainer;
typedef struct _GESMetaContainerInterface GESMetaContainerInterface;
struct _GESMetaContainerInterface {
GTypeInterface parent_iface;
gpointer _ges_reserved[GES_PADDING];
@ -42,136 +102,203 @@ struct _GESMetadataContainerInterface {
GType ges_meta_container_get_type (void);
void
ges_meta_container_set_boolean (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_boolean (GESMetaContainer *container,
const gchar* meta_item,
gboolean value);
void
ges_meta_container_set_int (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_int (GESMetaContainer *container,
const gchar* meta_item,
gint value);
void
ges_meta_container_set_uint (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_uint (GESMetaContainer *container,
const gchar* meta_item,
guint value);
void
ges_meta_container_set_int64 (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_int64 (GESMetaContainer *container,
const gchar* meta_item,
gint64 value);
void
ges_meta_container_set_uint64 (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_uint64 (GESMetaContainer *container,
const gchar* meta_item,
guint64 value);
void
ges_meta_container_set_float (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_float (GESMetaContainer *container,
const gchar* meta_item,
gfloat value);
void
ges_meta_container_set_double (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_double (GESMetaContainer *container,
const gchar* meta_item,
gdouble value);
void
ges_meta_container_set_date (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_date (GESMetaContainer *container,
const gchar* meta_item,
const GDate* value);
void
ges_meta_container_set_date_time (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_date_time (GESMetaContainer *container,
const gchar* meta_item,
const GstDateTime* value);
void
ges_meta_container_set_string (GESMetadataContainer *container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_string (GESMetaContainer *container,
const gchar* meta_item,
const gchar* value);
void
ges_meta_container_set_meta (GESMetadataContainer * container,
const gchar* metadata_item,
gboolean
ges_meta_container_set_meta (GESMetaContainer * container,
const gchar* meta_item,
const GValue *value);
gboolean
ges_meta_container_get_boolean (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_register_meta_boolean (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
gboolean value);
gboolean
ges_meta_container_register_meta_int (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
gint value);
gboolean
ges_meta_container_register_meta_uint (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
guint value);
gboolean
ges_meta_container_register_meta_int64 (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
gint64 value);
gboolean
ges_meta_container_register_meta_uint64 (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
guint64 value);
gboolean
ges_meta_container_register_meta_float (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
gfloat value);
gboolean
ges_meta_container_register_meta_double (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
gdouble value);
gboolean
ges_meta_container_register_meta_date (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
const GDate* value);
gboolean
ges_meta_container_register_meta_date_time (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
const GstDateTime* value);
gboolean
ges_meta_container_register_meta_string (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
const gchar* value);
gboolean
ges_meta_container_register_meta (GESMetaContainer *container,
GESMetaFlag flags,
const gchar* meta_item,
const GValue * value);
gboolean
ges_meta_container_check_meta_registered (GESMetaContainer *container,
const gchar * meta_item,
GESMetaFlag * flags,
GType * type);
gboolean
ges_meta_container_get_boolean (GESMetaContainer *container,
const gchar* meta_item,
gboolean* dest);
gboolean
ges_meta_container_get_int (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_get_int (GESMetaContainer *container,
const gchar* meta_item,
gint* dest);
gboolean
ges_meta_container_get_uint (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_get_uint (GESMetaContainer *container,
const gchar* meta_item,
guint* dest);
gboolean
ges_meta_container_get_int64 (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_get_int64 (GESMetaContainer *container,
const gchar* meta_item,
gint64* dest);
gboolean
ges_meta_container_get_uint64 (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_get_uint64 (GESMetaContainer *container,
const gchar* meta_item,
guint64* dest);
gboolean
ges_meta_container_get_float (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_get_float (GESMetaContainer *container,
const gchar* meta_item,
gfloat* dest);
gboolean
ges_meta_container_get_double (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_get_double (GESMetaContainer *container,
const gchar* meta_item,
gdouble* dest);
gboolean
ges_meta_container_get_date (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_get_date (GESMetaContainer *container,
const gchar* meta_item,
GDate** dest);
gboolean
ges_meta_container_get_date_time (GESMetadataContainer *container,
const gchar* metadata_item,
ges_meta_container_get_date_time (GESMetaContainer *container,
const gchar* meta_item,
GstDateTime** dest);
gboolean
ges_meta_container_get_string (GESMetadataContainer * container,
const gchar * metadata_item,
gchar** dest);
const gchar *
ges_meta_container_get_string (GESMetaContainer * container,
const gchar * meta_item);
gboolean
ges_meta_container_get_meta (GESMetadataContainer * container,
const gchar* metadata_item,
GValue* value);
const GValue *
ges_meta_container_get_meta (GESMetaContainer * container,
const gchar * key);
typedef void
(*GESMetadataForeachFunc) (const GESMetadataContainer *container,
(*GESMetaForeachFunc) (const GESMetaContainer *container,
const gchar *key,
GValue *value,
const GValue *value,
gpointer user_data);
void
ges_metadata_container_foreach (GESMetadataContainer *container,
GESMetadataForeachFunc func,
ges_meta_container_foreach (GESMetaContainer *container,
GESMetaForeachFunc func,
gpointer user_data);
gchar *
ges_metadata_container_to_string (GESMetadataContainer *container);
ges_meta_container_metas_to_string (GESMetaContainer *container);
GESMetadataContainer *
ges_metadata_container_new_from_string (const gchar *str);
void
ges_metadata_register (const gchar *name,
GType type);
gboolean
ges_meta_container_add_metas_from_string (GESMetaContainer *container,
const gchar *str);
G_END_DECLS
#endif /* _GES_METADATA_CONTAINER */
#endif /* _GES_META_CONTAINER */

View file

@ -72,7 +72,8 @@ ges_init (void)
/* register formatter types with the system */
GES_TYPE_PITIVI_FORMATTER;
GES_TYPE_METADATA_CONTAINER;
GES_TYPE_META_CONTAINER;
/* check the gnonlin elements are available */
if (!ges_check_gnonlin_availability ())