mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
metacontainer: Finnish GESMetaContainer implementation
This commit is contained in:
parent
97862bbe48
commit
3de2670b00
6 changed files with 947 additions and 448 deletions
|
@ -32,9 +32,12 @@ GESVideoTestPattern
|
||||||
GESPipelineFlags
|
GESPipelineFlags
|
||||||
GESEdge
|
GESEdge
|
||||||
GESEditMode
|
GESEditMode
|
||||||
|
GESMetaFlag
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GES_TYPE_TRACK_TYPE
|
GES_TYPE_TRACK_TYPE
|
||||||
ges_track_type_get_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_TYPE
|
||||||
ges_video_standard_transition_type_get_type
|
ges_video_standard_transition_type_get_type
|
||||||
GES_TEXT_HALIGN_TYPE
|
GES_TEXT_HALIGN_TYPE
|
||||||
|
@ -917,10 +920,29 @@ ges_meta_container_set_int64
|
||||||
ges_meta_container_set_string
|
ges_meta_container_set_string
|
||||||
ges_meta_container_set_uint
|
ges_meta_container_set_uint
|
||||||
ges_meta_container_set_uint64
|
ges_meta_container_set_uint64
|
||||||
ges_meta_container_set_value
|
ges_meta_container_set_meta
|
||||||
ges_meta_container_to_string
|
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_add_metas_from_string
|
||||||
ges_meta_container_get_type
|
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>
|
<SUBSECTION Standard>
|
||||||
GESMetaContainerInterface
|
GESMetaContainerInterface
|
||||||
GES_IS_META_CONTAINER
|
GES_IS_META_CONTAINER
|
||||||
|
|
|
@ -618,3 +618,26 @@ ges_video_test_pattern_get_type (void)
|
||||||
|
|
||||||
return theType;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -52,6 +52,21 @@ typedef enum {
|
||||||
GES_TRACK_TYPE_CUSTOM = 1 << 4,
|
GES_TRACK_TYPE_CUSTOM = 1 << 4,
|
||||||
} GESTrackType;
|
} 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:
|
* GESVideoStandardTransitionType:
|
||||||
* @GES_VIDEO_STANDARD_TRANSITION_TYPE_NONE: Transition type has not been set,
|
* @GES_VIDEO_STANDARD_TRANSITION_TYPE_NONE: Transition type has not been set,
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,24 +17,84 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _GES_METADATA_CONTAINER
|
#ifndef _GES_META_CONTAINER
|
||||||
#define _GES_METADATA_CONTAINER
|
#define _GES_META_CONTAINER
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <ges/ges-types.h>
|
#include <ges/ges-types.h>
|
||||||
|
#include "ges-enums.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GES_TYPE_METADATA_CONTAINER (ges_meta_container_get_type ())
|
#define GES_TYPE_META_CONTAINER (ges_meta_container_get_type ())
|
||||||
#define GES_METADATA_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_METADATA_CONTAINER, GESMetadataContainer))
|
#define GES_META_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_META_CONTAINER, GESMetaContainer))
|
||||||
#define GES_IS_METADATA_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_METADATA_CONTAINER))
|
#define GES_IS_META_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_META_CONTAINER))
|
||||||
#define GES_METADATA_CONTAINER_GET_INTERFACE (inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GES_TYPE_METADATA_CONTAINER, GESMetadataContainerInterface))
|
#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;
|
GTypeInterface parent_iface;
|
||||||
|
|
||||||
gpointer _ges_reserved[GES_PADDING];
|
gpointer _ges_reserved[GES_PADDING];
|
||||||
|
@ -42,136 +102,203 @@ struct _GESMetadataContainerInterface {
|
||||||
|
|
||||||
GType ges_meta_container_get_type (void);
|
GType ges_meta_container_get_type (void);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_boolean (GESMetadataContainer *container,
|
ges_meta_container_set_boolean (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gboolean value);
|
gboolean value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_int (GESMetadataContainer *container,
|
ges_meta_container_set_int (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gint value);
|
gint value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_uint (GESMetadataContainer *container,
|
ges_meta_container_set_uint (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
guint value);
|
guint value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_int64 (GESMetadataContainer *container,
|
ges_meta_container_set_int64 (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gint64 value);
|
gint64 value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_uint64 (GESMetadataContainer *container,
|
ges_meta_container_set_uint64 (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
guint64 value);
|
guint64 value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_float (GESMetadataContainer *container,
|
ges_meta_container_set_float (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gfloat value);
|
gfloat value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_double (GESMetadataContainer *container,
|
ges_meta_container_set_double (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gdouble value);
|
gdouble value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_date (GESMetadataContainer *container,
|
ges_meta_container_set_date (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
const GDate* value);
|
const GDate* value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_date_time (GESMetadataContainer *container,
|
ges_meta_container_set_date_time (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
const GstDateTime* value);
|
const GstDateTime* value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_string (GESMetadataContainer *container,
|
ges_meta_container_set_string (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
const gchar* value);
|
const gchar* value);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_meta_container_set_meta (GESMetadataContainer * container,
|
ges_meta_container_set_meta (GESMetaContainer * container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
const GValue *value);
|
const GValue *value);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_boolean (GESMetadataContainer *container,
|
ges_meta_container_register_meta_boolean (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
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* dest);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_int (GESMetadataContainer *container,
|
ges_meta_container_get_int (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gint* dest);
|
gint* dest);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_uint (GESMetadataContainer *container,
|
ges_meta_container_get_uint (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
guint* dest);
|
guint* dest);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_int64 (GESMetadataContainer *container,
|
ges_meta_container_get_int64 (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gint64* dest);
|
gint64* dest);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_uint64 (GESMetadataContainer *container,
|
ges_meta_container_get_uint64 (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
guint64* dest);
|
guint64* dest);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_float (GESMetadataContainer *container,
|
ges_meta_container_get_float (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gfloat* dest);
|
gfloat* dest);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_double (GESMetadataContainer *container,
|
ges_meta_container_get_double (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
gdouble* dest);
|
gdouble* dest);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_date (GESMetadataContainer *container,
|
ges_meta_container_get_date (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
GDate** dest);
|
GDate** dest);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_meta_container_get_date_time (GESMetadataContainer *container,
|
ges_meta_container_get_date_time (GESMetaContainer *container,
|
||||||
const gchar* metadata_item,
|
const gchar* meta_item,
|
||||||
GstDateTime** dest);
|
GstDateTime** dest);
|
||||||
|
|
||||||
gboolean
|
const gchar *
|
||||||
ges_meta_container_get_string (GESMetadataContainer * container,
|
ges_meta_container_get_string (GESMetaContainer * container,
|
||||||
const gchar * metadata_item,
|
const gchar * meta_item);
|
||||||
gchar** dest);
|
|
||||||
|
|
||||||
gboolean
|
const GValue *
|
||||||
ges_meta_container_get_meta (GESMetadataContainer * container,
|
ges_meta_container_get_meta (GESMetaContainer * container,
|
||||||
const gchar* metadata_item,
|
const gchar * key);
|
||||||
GValue* value);
|
|
||||||
|
|
||||||
typedef void
|
typedef void
|
||||||
(*GESMetadataForeachFunc) (const GESMetadataContainer *container,
|
(*GESMetaForeachFunc) (const GESMetaContainer *container,
|
||||||
const gchar *key,
|
const gchar *key,
|
||||||
GValue *value,
|
const GValue *value,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
void
|
void
|
||||||
ges_metadata_container_foreach (GESMetadataContainer *container,
|
ges_meta_container_foreach (GESMetaContainer *container,
|
||||||
GESMetadataForeachFunc func,
|
GESMetaForeachFunc func,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
ges_metadata_container_to_string (GESMetadataContainer *container);
|
ges_meta_container_metas_to_string (GESMetaContainer *container);
|
||||||
|
|
||||||
GESMetadataContainer *
|
gboolean
|
||||||
ges_metadata_container_new_from_string (const gchar *str);
|
ges_meta_container_add_metas_from_string (GESMetaContainer *container,
|
||||||
|
const gchar *str);
|
||||||
void
|
|
||||||
ges_metadata_register (const gchar *name,
|
|
||||||
GType type);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
#endif /* _GES_METADATA_CONTAINER */
|
#endif /* _GES_META_CONTAINER */
|
||||||
|
|
|
@ -72,7 +72,8 @@ ges_init (void)
|
||||||
|
|
||||||
/* register formatter types with the system */
|
/* register formatter types with the system */
|
||||||
GES_TYPE_PITIVI_FORMATTER;
|
GES_TYPE_PITIVI_FORMATTER;
|
||||||
GES_TYPE_METADATA_CONTAINER;
|
|
||||||
|
GES_TYPE_META_CONTAINER;
|
||||||
|
|
||||||
/* check the gnonlin elements are available */
|
/* check the gnonlin elements are available */
|
||||||
if (!ges_check_gnonlin_availability ())
|
if (!ges_check_gnonlin_availability ())
|
||||||
|
|
Loading…
Reference in a new issue