GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name) G_GNUC_MALLOC;
GST_API
+ GstElement* gst_element_factory_make_full (const gchar *factoryname,
+ const gchar *first, ...) G_GNUC_MALLOC;
+ GST_API
+ GstElement* gst_element_factory_make_valist (const gchar *factoryname,
+ const gchar *first, va_list properties) G_GNUC_MALLOC;
+ GST_API
+ GstElement* gst_element_factory_make_with_properties (const gchar *factoryname,
+ guint n, const gchar *names[], const GValue values[]) G_GNUC_MALLOC;
+ GST_API
gboolean gst_element_register (GstPlugin *plugin, const gchar *name,
guint rank, GType type);
+#ifdef TIZEN_PROFILE_TV
+GST_API
+GstElement *gst_element_factory_get (GstElementFactory * factory, const gchar * name);
+#endif
/* Factory list functions */
gchar *obj = NULL;
GstDebugColorMode color_mode;
const gchar *message_str;
+#if defined(G_OS_WIN32) || !defined(USE_DLOG)
FILE *log_file = user_data ? user_data : stderr;
- gchar c;
+#endif
+ #ifdef G_OS_WIN32
+ #define FPRINTF_DEBUG _gst_debug_fprintf
+ /* _gst_debug_fprintf will do fflush if it's required */
+ #define FFLUSH_DEBUG(f) ((void)(f))
+ #else
+ #define FPRINTF_DEBUG fprintf
+ #define FFLUSH_DEBUG(f) G_STMT_START { \
+ fflush (f); \
+ } G_STMT_END
+ #endif
- /* Get message string first because printing it might call into our custom
- * printf format extension mechanism which in turn might log something, e.g.
- * from inside gst_structure_to_string() when something can't be serialised.
- * This means we either need to do this outside of any critical section or
- * use a recursive lock instead. As we always need the message string in all
- * code paths, we might just as well get it here first thing and outside of
- * the win_print_mutex critical section. */
- message_str = gst_debug_message_get (message);
+ #ifdef GST_ENABLE_EXTRA_CHECKS
+ g_warn_if_fail (object == NULL || G_IS_OBJECT (object));
+ #endif
- /* __FILE__ might be a file name or an absolute path or a
- * relative path, irrespective of the exact compiler used,
- * in which case we want to shorten it to the filename for
- * readability. */
- c = file[0];
- if (c == '.' || c == '/' || c == '\\' || (c != '\0' && file[1] == ':')) {
- file = gst_path_basename (file);
- }
+ _gst_debug_log_preamble (message, object, &file, &message_str, &obj,
+ &elapsed);
pid = getpid ();
color_mode = gst_debug_get_color_mode ();
levelcolor = levelcolormap[level];
#define PRINT_FMT " %s"PID_FMT"%s "PTR_FMT" %s%s%s %s"CAT_FMT"%s %s\n"
-
+#if defined(USE_DLOG)
+ GST_SLOGW("%" GST_TIME_FORMAT "%s "PTR_FMT" %s%s%s %s"CAT_FMT"%s %s\n", GST_TIME_ARGS (elapsed),
+ clear, g_thread_self (), levelcolor,
+ gst_debug_level_get_name (level), clear, color,
+ gst_debug_category_get_name (category), file, line, function, obj,
+ clear, message_str);
+#else
- fprintf (log_file, "%" GST_TIME_FORMAT PRINT_FMT, GST_TIME_ARGS (elapsed),
- pidcolor, pid, clear, g_thread_self (), levelcolor,
- gst_debug_level_get_name (level), clear, color,
+ FPRINTF_DEBUG (log_file, "%" GST_TIME_FORMAT PRINT_FMT,
+ GST_TIME_ARGS (elapsed), pidcolor, pid, clear, g_thread_self (),
+ levelcolor, gst_debug_level_get_name (level), clear, color,
gst_debug_category_get_name (category), file, line, function, obj,
clear, message_str);
- fflush (log_file);
+ FFLUSH_DEBUG (log_file);
+#endif
-
#undef PRINT_FMT
g_free (color);
#ifdef G_OS_WIN32
#endif
} else {
/* no color, all platforms */
- #define PRINT_FMT " "PID_FMT" "PTR_FMT" %s "CAT_FMT" %s\n"
-
- /* Tizen doesn't care about Win32 */
+#if defined(USE_DLOG) && !defined(G_OS_WIN32)
+ GST_SLOGW("%" GST_TIME_FORMAT " "PTR_FMT" %s "CAT_FMT" %s\n", GST_TIME_ARGS (elapsed),
+ g_thread_self (), gst_debug_level_get_name (level),
+ gst_debug_category_get_name (category), file, line, function, obj,
+ message_str);
+#else
- fprintf (log_file, "%" GST_TIME_FORMAT PRINT_FMT, GST_TIME_ARGS (elapsed),
- pid, g_thread_self (), gst_debug_level_get_name (level),
+ FPRINTF_DEBUG (log_file, "%" GST_TIME_FORMAT NOCOLOR_PRINT_FMT,
+ GST_TIME_ARGS (elapsed), pid, g_thread_self (),
+ gst_debug_level_get_name (level),
gst_debug_category_get_name (category), file, line, function, obj,
message_str);
- fflush (log_file);
+ FFLUSH_DEBUG (log_file);
+#endif
-
- #undef PRINT_FMT
}
if (object != NULL)
*/
properties[PROP_PARENT] =
g_param_spec_object ("parent", "Parent", "The parent of the object",
- GST_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ GST_TYPE_OBJECT,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_DOC_SHOW_DEFAULT);
+
+#ifdef TIZEN_PROFILE_TV
+ properties[PROP_FAMILY_ID] =
+ g_param_spec_int ("family-id", "Family Id",
+ "The family id of this object group, usually inherit from parent.",
+ -G_MAXINT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+#endif
++
g_object_class_install_properties (gobject_class, PROP_LAST, properties);
/**
GValue value = { 0 };
if (type == GST_STREAM_STATUS_TYPE_ENTER) {
- gchar *tname, *ename, *pname;
+ gchar *tname;
- /* create a good task name */
- ename = gst_element_get_name (parent);
- pname = gst_pad_get_name (pad);
+ /* create a good task name (we can directly grab the parent and pad
+ * names since they both exist at this point, and changing the name of
+ * parent and pad when a pad is activating is a big no-no). */
+#ifdef TIZEN_PROFILE_TV
- tname = g_strdup_printf ("%s-%s", ename, pname);
- #else
- tname = g_strdup_printf ("%s:%s", ename, pname);
- #endif
- g_free (ename);
- g_free (pname);
++ tname = g_strdup_printf ("%s-%s", GST_DEBUG_PAD_NAME (pad));
++#else
+ tname = g_strdup_printf ("%s:%s", GST_DEBUG_PAD_NAME (pad));
++#endif
gst_object_set_name (GST_OBJECT_CAST (task), tname);
g_free (tname);
"redirect-entry-taglists", "redirect-entry-structures",
"GstEventStreamGroupDone", "GstQueryBitrate", "nominal-bitrate",
"GstMessageDeviceChanged", "device-changed", "trickmode-interval",
+#ifdef TIZEN_PROFILE_TV
+ "GstQuarkQueryResource",
+#endif
+ "GstEventInstantRateChange",
+ "GstEventInstantRateSyncTime", "GstMessageInstantRateRequest",
+ "upstream-running-time", "base", "offset", "plugin-api", "plugin-api-flags",
+ "gap-flags"
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
GST_QUARK_MESSAGE_DEVICE_CHANGED = 191,
GST_QUARK_DEVICE_CHANGED = 192,
GST_QUARK_TRICKMODE_INTERVAL = 193,
- GST_QUARK_MAX = 194
+ GST_QUARK_EVENT_INSTANT_RATE_CHANGE = 194,
+ GST_QUARK_EVENT_INSTANT_RATE_SYNC_TIME = 195,
+ GST_QUARK_MESSAGE_INSTANT_RATE_REQUEST = 196,
+ GST_QUARK_UPSTREAM_RUNNING_TIME = 197,
+ GST_QUARK_BASE = 198,
+ GST_QUARK_OFFSET = 199,
+ GST_QUARK_PLUGIN_API = 200,
+ GST_QUARK_PLUGIN_API_FLAGS = 201,
+ GST_QUARK_GAP_FLAGS = 202,
+#ifndef TIZEN_PROFILE_TV
- GST_QUARK_QUERY_RESOURCE = 194,
- GST_QUARK_MAX = 195
+ GST_QUARK_MAX = 203
+#else
++ GST_QUARK_QUERY_RESOURCE = 203,
++ GST_QUARK_MAX = 204
+#endif
} GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
* this enum */
typedef enum {
GST_QUERY_UNKNOWN = GST_QUERY_MAKE_TYPE (0, 0),
- GST_QUERY_POSITION = GST_QUERY_MAKE_TYPE (10, FLAG(BOTH)),
- GST_QUERY_DURATION = GST_QUERY_MAKE_TYPE (20, FLAG(BOTH)),
- GST_QUERY_LATENCY = GST_QUERY_MAKE_TYPE (30, FLAG(BOTH)),
- GST_QUERY_JITTER = GST_QUERY_MAKE_TYPE (40, FLAG(BOTH)),
- GST_QUERY_RATE = GST_QUERY_MAKE_TYPE (50, FLAG(BOTH)),
- GST_QUERY_SEEKING = GST_QUERY_MAKE_TYPE (60, FLAG(BOTH)),
- GST_QUERY_SEGMENT = GST_QUERY_MAKE_TYPE (70, FLAG(BOTH)),
- GST_QUERY_CONVERT = GST_QUERY_MAKE_TYPE (80, FLAG(BOTH)),
- GST_QUERY_FORMATS = GST_QUERY_MAKE_TYPE (90, FLAG(BOTH)),
- GST_QUERY_BUFFERING = GST_QUERY_MAKE_TYPE (110, FLAG(BOTH)),
- GST_QUERY_CUSTOM = GST_QUERY_MAKE_TYPE (120, FLAG(BOTH)),
- GST_QUERY_URI = GST_QUERY_MAKE_TYPE (130, FLAG(BOTH)),
- GST_QUERY_ALLOCATION = GST_QUERY_MAKE_TYPE (140, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
- GST_QUERY_SCHEDULING = GST_QUERY_MAKE_TYPE (150, FLAG(UPSTREAM)),
- GST_QUERY_ACCEPT_CAPS = GST_QUERY_MAKE_TYPE (160, FLAG(BOTH)),
- GST_QUERY_CAPS = GST_QUERY_MAKE_TYPE (170, FLAG(BOTH)),
- GST_QUERY_DRAIN = GST_QUERY_MAKE_TYPE (180, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
- GST_QUERY_CONTEXT = GST_QUERY_MAKE_TYPE (190, FLAG(BOTH)),
- GST_QUERY_BITRATE = GST_QUERY_MAKE_TYPE (200, FLAG(DOWNSTREAM)),
+ GST_QUERY_POSITION = GST_QUERY_MAKE_TYPE (10, _FLAG(BOTH)),
+ GST_QUERY_DURATION = GST_QUERY_MAKE_TYPE (20, _FLAG(BOTH)),
+ GST_QUERY_LATENCY = GST_QUERY_MAKE_TYPE (30, _FLAG(BOTH)),
+ GST_QUERY_JITTER = GST_QUERY_MAKE_TYPE (40, _FLAG(BOTH)),
+ GST_QUERY_RATE = GST_QUERY_MAKE_TYPE (50, _FLAG(BOTH)),
+ GST_QUERY_SEEKING = GST_QUERY_MAKE_TYPE (60, _FLAG(BOTH)),
+ GST_QUERY_SEGMENT = GST_QUERY_MAKE_TYPE (70, _FLAG(BOTH)),
+ GST_QUERY_CONVERT = GST_QUERY_MAKE_TYPE (80, _FLAG(BOTH)),
+ GST_QUERY_FORMATS = GST_QUERY_MAKE_TYPE (90, _FLAG(BOTH)),
+ GST_QUERY_BUFFERING = GST_QUERY_MAKE_TYPE (110, _FLAG(BOTH)),
+ GST_QUERY_CUSTOM = GST_QUERY_MAKE_TYPE (120, _FLAG(BOTH)),
+ GST_QUERY_URI = GST_QUERY_MAKE_TYPE (130, _FLAG(BOTH)),
+ GST_QUERY_ALLOCATION = GST_QUERY_MAKE_TYPE (140, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)),
+ GST_QUERY_SCHEDULING = GST_QUERY_MAKE_TYPE (150, _FLAG(UPSTREAM)),
+ GST_QUERY_ACCEPT_CAPS = GST_QUERY_MAKE_TYPE (160, _FLAG(BOTH)),
+ GST_QUERY_CAPS = GST_QUERY_MAKE_TYPE (170, _FLAG(BOTH)),
+ GST_QUERY_DRAIN = GST_QUERY_MAKE_TYPE (180, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)),
+ GST_QUERY_CONTEXT = GST_QUERY_MAKE_TYPE (190, _FLAG(BOTH)),
+ GST_QUERY_BITRATE = GST_QUERY_MAKE_TYPE (200, _FLAG(DOWNSTREAM)),
+#ifdef TIZEN_PROFILE_TV
+ GST_QUERY_RESOURCE = GST_QUERY_MAKE_TYPE (210, FLAG (BOTH)), /*< skip >*/
+#endif
} GstQueryType;
- #undef FLAG
+ #undef _FLAG
GST_API GType _gst_query_type;
--- /dev/null
- #define FLAG(name) GST_QUERY_TYPE_##name
+/* GStreamer
+ * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
+ * 2000 Wim Taymans <wim.taymans@chello.be>
+ * 2005 Wim Taymans <wim@fluendo.com>
+ * 2011 Wim Taymans <wim.taymans@gmail.com>
+ *
+ * gstquery.h: GstQuery API declaration
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef __GST_QUERY_H__
+#define __GST_QUERY_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gst/gstconfig.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GstQuery GstQuery;
+
+#include <gst/gstminiobject.h>
+
+/**
+ * GstQueryTypeFlags:
+ * @GST_QUERY_TYPE_UPSTREAM: Set if the query can travel upstream.
+ * @GST_QUERY_TYPE_DOWNSTREAM: Set if the query can travel downstream.
+ * @GST_QUERY_TYPE_SERIALIZED: Set if the query should be serialized with data
+ * flow.
+ *
+ * #GstQueryTypeFlags indicate the aspects of the different #GstQueryType
+ * values. You can get the type flags of a #GstQueryType with the
+ * gst_query_type_get_flags() function.
+ */
+typedef enum {
+ GST_QUERY_TYPE_UPSTREAM = 1 << 0,
+ GST_QUERY_TYPE_DOWNSTREAM = 1 << 1,
+ GST_QUERY_TYPE_SERIALIZED = 1 << 2
+} GstQueryTypeFlags;
+
+/**
+ * GST_QUERY_TYPE_BOTH: (value 3) (type GstQueryTypeFlags)
+ *
+ * The same thing as #GST_QUERY_TYPE_UPSTREAM | #GST_QUERY_TYPE_DOWNSTREAM.
+ */
+#define GST_QUERY_TYPE_BOTH \
+ ((GstQueryTypeFlags)(GST_QUERY_TYPE_UPSTREAM | GST_QUERY_TYPE_DOWNSTREAM))
+
+#define GST_QUERY_NUM_SHIFT (8)
+
+/**
+ * GST_QUERY_MAKE_TYPE:
+ * @num: the query number to create
+ * @flags: the query flags
+ *
+ * when making custom query types, use this macro with the num and
+ * the given flags
+ */
+#define GST_QUERY_MAKE_TYPE(num,flags) \
+ (((num) << GST_QUERY_NUM_SHIFT) | (flags))
+
- GST_QUERY_POSITION = GST_QUERY_MAKE_TYPE (10, FLAG(BOTH)),
- GST_QUERY_DURATION = GST_QUERY_MAKE_TYPE (20, FLAG(BOTH)),
- GST_QUERY_LATENCY = GST_QUERY_MAKE_TYPE (30, FLAG(BOTH)),
- GST_QUERY_JITTER = GST_QUERY_MAKE_TYPE (40, FLAG(BOTH)),
- GST_QUERY_RATE = GST_QUERY_MAKE_TYPE (50, FLAG(BOTH)),
- GST_QUERY_SEEKING = GST_QUERY_MAKE_TYPE (60, FLAG(BOTH)),
- GST_QUERY_SEGMENT = GST_QUERY_MAKE_TYPE (70, FLAG(BOTH)),
- GST_QUERY_CONVERT = GST_QUERY_MAKE_TYPE (80, FLAG(BOTH)),
- GST_QUERY_FORMATS = GST_QUERY_MAKE_TYPE (90, FLAG(BOTH)),
- GST_QUERY_BUFFERING = GST_QUERY_MAKE_TYPE (110, FLAG(BOTH)),
- GST_QUERY_CUSTOM = GST_QUERY_MAKE_TYPE (120, FLAG(BOTH)),
- GST_QUERY_URI = GST_QUERY_MAKE_TYPE (130, FLAG(BOTH)),
- GST_QUERY_ALLOCATION = GST_QUERY_MAKE_TYPE (140, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
- GST_QUERY_SCHEDULING = GST_QUERY_MAKE_TYPE (150, FLAG(UPSTREAM)),
- GST_QUERY_ACCEPT_CAPS = GST_QUERY_MAKE_TYPE (160, FLAG(BOTH)),
- GST_QUERY_CAPS = GST_QUERY_MAKE_TYPE (170, FLAG(BOTH)),
- GST_QUERY_DRAIN = GST_QUERY_MAKE_TYPE (180, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
- GST_QUERY_CONTEXT = GST_QUERY_MAKE_TYPE (190, FLAG(BOTH)),
- GST_QUERY_BITRATE = GST_QUERY_MAKE_TYPE (200, FLAG(DOWNSTREAM)),
++#define _FLAG(name) GST_QUERY_TYPE_##name
+
+
+/**
+ * GstQueryType:
+ * @GST_QUERY_UNKNOWN: unknown query type
+ * @GST_QUERY_POSITION: current position in stream
+ * @GST_QUERY_DURATION: total duration of the stream
+ * @GST_QUERY_LATENCY: latency of stream
+ * @GST_QUERY_JITTER: current jitter of stream
+ * @GST_QUERY_RATE: current rate of the stream
+ * @GST_QUERY_SEEKING: seeking capabilities
+ * @GST_QUERY_SEGMENT: segment start/stop positions
+ * @GST_QUERY_CONVERT: convert values between formats
+ * @GST_QUERY_FORMATS: query supported formats for convert
+ * @GST_QUERY_BUFFERING: query available media for efficient seeking.
+ * @GST_QUERY_CUSTOM: a custom application or element defined query.
+ * @GST_QUERY_URI: query the URI of the source or sink.
+ * @GST_QUERY_ALLOCATION: the buffer allocation properties
+ * @GST_QUERY_SCHEDULING: the scheduling properties
+ * @GST_QUERY_ACCEPT_CAPS: the accept caps query
+ * @GST_QUERY_CAPS: the caps query
+ * @GST_QUERY_DRAIN: wait till all serialized data is consumed downstream
+ * @GST_QUERY_CONTEXT: query the pipeline-local context from
+ * downstream or upstream (since 1.2)
+ * @GST_QUERY_BITRATE: the bitrate query (since 1.16)
+ *
+ * Standard predefined Query types
+ */
+/* NOTE: don't forget to update the table in gstquery.c when changing
+ * this enum */
+typedef enum {
+ GST_QUERY_UNKNOWN = GST_QUERY_MAKE_TYPE (0, 0),
- #undef FLAG
++ GST_QUERY_POSITION = GST_QUERY_MAKE_TYPE (10, _FLAG(BOTH)),
++ GST_QUERY_DURATION = GST_QUERY_MAKE_TYPE (20, _FLAG(BOTH)),
++ GST_QUERY_LATENCY = GST_QUERY_MAKE_TYPE (30, _FLAG(BOTH)),
++ GST_QUERY_JITTER = GST_QUERY_MAKE_TYPE (40, _FLAG(BOTH)),
++ GST_QUERY_RATE = GST_QUERY_MAKE_TYPE (50, _FLAG(BOTH)),
++ GST_QUERY_SEEKING = GST_QUERY_MAKE_TYPE (60, _FLAG(BOTH)),
++ GST_QUERY_SEGMENT = GST_QUERY_MAKE_TYPE (70, _FLAG(BOTH)),
++ GST_QUERY_CONVERT = GST_QUERY_MAKE_TYPE (80, _FLAG(BOTH)),
++ GST_QUERY_FORMATS = GST_QUERY_MAKE_TYPE (90, _FLAG(BOTH)),
++ GST_QUERY_BUFFERING = GST_QUERY_MAKE_TYPE (110, _FLAG(BOTH)),
++ GST_QUERY_CUSTOM = GST_QUERY_MAKE_TYPE (120, _FLAG(BOTH)),
++ GST_QUERY_URI = GST_QUERY_MAKE_TYPE (130, _FLAG(BOTH)),
++ GST_QUERY_ALLOCATION = GST_QUERY_MAKE_TYPE (140, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)),
++ GST_QUERY_SCHEDULING = GST_QUERY_MAKE_TYPE (150, _FLAG(UPSTREAM)),
++ GST_QUERY_ACCEPT_CAPS = GST_QUERY_MAKE_TYPE (160, _FLAG(BOTH)),
++ GST_QUERY_CAPS = GST_QUERY_MAKE_TYPE (170, _FLAG(BOTH)),
++ GST_QUERY_DRAIN = GST_QUERY_MAKE_TYPE (180, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)),
++ GST_QUERY_CONTEXT = GST_QUERY_MAKE_TYPE (190, _FLAG(BOTH)),
++ GST_QUERY_BITRATE = GST_QUERY_MAKE_TYPE (200, _FLAG(DOWNSTREAM)),
+ GST_QUERY_RESOURCE = GST_QUERY_MAKE_TYPE (210, FLAG (BOTH)),
+} GstQueryType;
- /**
- * gst_query_ref:
- * @q: a #GstQuery to increase the refcount of.
- *
- * Increases the refcount of the given query by one.
- *
- * Returns: @q
- */
++#undef _FLAG
+
+GST_API GType _gst_query_type;
+
+#define GST_TYPE_QUERY (_gst_query_type)
+#define GST_IS_QUERY(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_QUERY))
+#define GST_QUERY_CAST(obj) ((GstQuery*)(obj))
+#define GST_QUERY(obj) (GST_QUERY_CAST(obj))
+
+/**
+ * GST_QUERY_TYPE:
+ * @query: the query to query
+ *
+ * Get the #GstQueryType of the query.
+ */
+#define GST_QUERY_TYPE(query) (((GstQuery*)(query))->type)
+
+/**
+ * GST_QUERY_TYPE_NAME:
+ * @query: the query to query
+ *
+ * Get a constant string representation of the #GstQueryType of the query.
+ */
+#define GST_QUERY_TYPE_NAME(query) (gst_query_type_get_name(GST_QUERY_TYPE(query)))
+
+/**
+ * GST_QUERY_IS_UPSTREAM:
+ * @ev: the query to query
+ *
+ * Check if an query can travel upstream.
+ */
+#define GST_QUERY_IS_UPSTREAM(ev) !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_UPSTREAM)
+/**
+ * GST_QUERY_IS_DOWNSTREAM:
+ * @ev: the query to query
+ *
+ * Check if an query can travel downstream.
+ */
+#define GST_QUERY_IS_DOWNSTREAM(ev) !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_DOWNSTREAM)
+/**
+ * GST_QUERY_IS_SERIALIZED:
+ * @ev: the query to query
+ *
+ * Check if an query is serialized with the data stream.
+ */
+#define GST_QUERY_IS_SERIALIZED(ev) !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_SERIALIZED)
+
+
+/**
+ * GstQuery:
+ * @mini_object: The parent #GstMiniObject type
+ * @type: the #GstQueryType
+ *
+ * The #GstQuery structure.
+ */
+struct _GstQuery
+{
+ GstMiniObject mini_object;
+
+ /*< public > *//* with COW */
+ GstQueryType type;
+};
+
+/**
+ * GstBufferingMode:
+ * @GST_BUFFERING_STREAM: a small amount of data is buffered
+ * @GST_BUFFERING_DOWNLOAD: the stream is being downloaded
+ * @GST_BUFFERING_TIMESHIFT: the stream is being downloaded in a ringbuffer
+ * @GST_BUFFERING_LIVE: the stream is a live stream
+ *
+ * The different types of buffering methods.
+ */
+typedef enum {
+ GST_BUFFERING_STREAM,
+ GST_BUFFERING_DOWNLOAD,
+ GST_BUFFERING_TIMESHIFT,
+ GST_BUFFERING_LIVE
+} GstBufferingMode;
+
+#include <gst/gstiterator.h>
+#include <gst/gststructure.h>
+#include <gst/gstformat.h>
+#include <gst/gstpad.h>
+#include <gst/gstallocator.h>
+#include <gst/gsttoc.h>
+#include <gst/gstcontext.h>
+
+GST_API
+const gchar* gst_query_type_get_name (GstQueryType type);
+
+GST_API
+GQuark gst_query_type_to_quark (GstQueryType type);
+
+GST_API
+GstQueryTypeFlags
+ gst_query_type_get_flags (GstQueryType type);
+
+
+GST_API
+GType gst_query_get_type (void);
+
++#ifndef GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS
+/* refcounting */
- /**
- * gst_query_unref:
- * @q: a #GstQuery to decrease the refcount of.
- *
- * Decreases the refcount of the query. If the refcount reaches 0, the query
- * will be freed.
- */
+static inline GstQuery *
+gst_query_ref (GstQuery * q)
+{
+ return GST_QUERY_CAST (gst_mini_object_ref (GST_MINI_OBJECT_CAST (q)));
+}
+
- /**
- * gst_clear_query: (skip)
- * @query_ptr: a pointer to a #GstQuery reference
- *
- * Clears a reference to a #GstQuery.
- *
- * @query_ptr must not be %NULL.
- *
- * If the reference is %NULL then this function does nothing. Otherwise, the
- * reference count of the query is decreased and the pointer is set to %NULL.
- *
- * Since: 1.16
- */
+static inline void
+gst_query_unref (GstQuery * q)
+{
+ gst_mini_object_unref (GST_MINI_OBJECT_CAST (q));
+}
+
- /**
- * gst_query_copy:
- * @q: a #GstQuery to copy.
- *
- * Copies the given query using the copy function of the parent #GstStructure.
- *
- * Free-function: gst_query_unref
- *
- * Returns: (transfer full): a new copy of @q.
- */
+static inline void
+gst_clear_query (GstQuery ** query_ptr)
+{
+ gst_clear_mini_object ((GstMiniObject **) query_ptr);
+}
+
+/* copy query */
- /**
- * gst_query_replace:
- * @old_query: (inout) (transfer full) (nullable): pointer to a pointer to a
- * #GstQuery to be replaced.
- * @new_query: (allow-none) (transfer none): pointer to a #GstQuery that will
- * replace the query pointed to by @old_query.
- *
- * Modifies a pointer to a #GstQuery to point to a different #GstQuery. The
- * modification is done atomically (so this is useful for ensuring thread safety
- * in some cases), and the reference counts are updated appropriately (the old
- * query is unreffed, the new one is reffed).
- *
- * Either @new_query or the #GstQuery pointed to by @old_query may be %NULL.
- *
- * Returns: %TRUE if @new_query was different from @old_query
- */
+static inline GstQuery *
+gst_query_copy (const GstQuery * q)
+{
+ return GST_QUERY_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (q)));
+}
++#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
++GST_API
++GstQuery * gst_query_ref (GstQuery * q);
++
++GST_API
++void gst_query_unref (GstQuery * q);
++
++GST_API
++void gst_clear_query (GstQuery ** query_ptr);
++
++GST_API
++GstQuery * gst_query_copy (const GstQuery * q);
++#endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
+
+/**
+ * gst_query_is_writable:
+ * @q: a #GstQuery
+ *
+ * Tests if you can safely write data into a query's structure.
+ */
+#define gst_query_is_writable(q) gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (q))
+/**
+ * gst_query_make_writable:
+ * @q: (transfer full): a #GstQuery to make writable
+ *
+ * Makes a writable query from the given query.
+ *
+ * Returns: (transfer full): a new writable query (possibly same as @q)
+ */
+#define gst_query_make_writable(q) GST_QUERY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (q)))
- /**
- * gst_query_take:
- * @old_query: (inout) (transfer full) (nullable): pointer to a
- * pointer to a #GstQuery to be stolen.
- * @new_query: (allow-none) (transfer full): pointer to a #GstQuery that will
- * replace the query pointed to by @old_query.
- *
- * Modifies a pointer to a #GstQuery to point to a different #GstQuery. This
- * function is similar to gst_query_replace() except that it takes ownership of
- * @new_query.
- *
- * Either @new_query or the #GstQuery pointed to by @old_query may be %NULL.
- *
- * Returns: %TRUE if @new_query was different from @old_query
- *
- * Since: 1.16
- */
++
++#ifndef GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS
+static inline gboolean
+gst_query_replace (GstQuery **old_query, GstQuery *new_query)
+{
+ return gst_mini_object_replace ((GstMiniObject **) old_query, (GstMiniObject *) new_query);
+}
+
- #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+static inline gboolean
+gst_query_take (GstQuery **old_query, GstQuery *new_query)
+{
+ return gst_mini_object_take ((GstMiniObject **) old_query,
+ (GstMiniObject *) new_query);
+}
++#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
++GST_API
++gboolean gst_query_replace (GstQuery ** old_query,
++ GstQuery * new_query);
++
++GST_API
++gboolean gst_query_take (GstQuery ** old_query,
++ GstQuery * new_query);
++#endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
+
+/* application specific query */
+
+GST_API
+GstQuery * gst_query_new_custom (GstQueryType type, GstStructure *structure) G_GNUC_MALLOC;
+
+GST_API
+const GstStructure *
+ gst_query_get_structure (GstQuery *query);
+
+GST_API
+GstStructure * gst_query_writable_structure (GstQuery *query);
+
+/* position query */
+
+GST_API
+GstQuery* gst_query_new_position (GstFormat format) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_position (GstQuery *query, GstFormat format, gint64 cur);
+
+GST_API
+void gst_query_parse_position (GstQuery *query, GstFormat *format, gint64 *cur);
+
+/* duration query */
+
+GST_API
+GstQuery* gst_query_new_duration (GstFormat format) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_duration (GstQuery *query, GstFormat format, gint64 duration);
+
+GST_API
+void gst_query_parse_duration (GstQuery *query, GstFormat *format, gint64 *duration);
+
+#ifdef TIZEN_PROFILE_TV
+/* resrource query */
+GST_API
+GstQuery* gst_query_new_resource (gchar * resources) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_add_resource (GstQuery * query, gint resource_id);
+
+GST_API
+gchar* gst_query_parse_resource (GstQuery * query);
+#endif
+
+/* latency query */
+
+GST_API
+GstQuery* gst_query_new_latency (void) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_latency (GstQuery *query, gboolean live, GstClockTime min_latency,
+ GstClockTime max_latency);
+
+GST_API
+void gst_query_parse_latency (GstQuery *query, gboolean *live, GstClockTime *min_latency,
+ GstClockTime *max_latency);
+
+/* convert query */
+
+GST_API
+GstQuery* gst_query_new_convert (GstFormat src_format, gint64 value, GstFormat dest_format) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_convert (GstQuery *query, GstFormat src_format, gint64 src_value,
+ GstFormat dest_format, gint64 dest_value);
+
+GST_API
+void gst_query_parse_convert (GstQuery *query, GstFormat *src_format, gint64 *src_value,
+ GstFormat *dest_format, gint64 *dest_value);
+/* segment query */
+
+GST_API
+GstQuery* gst_query_new_segment (GstFormat format) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_segment (GstQuery *query, gdouble rate, GstFormat format,
+ gint64 start_value, gint64 stop_value);
+
+GST_API
+void gst_query_parse_segment (GstQuery *query, gdouble *rate, GstFormat *format,
+ gint64 *start_value, gint64 *stop_value);
+
+/* seeking query */
+
+GST_API
+GstQuery* gst_query_new_seeking (GstFormat format) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_seeking (GstQuery *query, GstFormat format,
+ gboolean seekable,
+ gint64 segment_start,
+ gint64 segment_end);
+
+GST_API
+void gst_query_parse_seeking (GstQuery *query, GstFormat *format,
+ gboolean *seekable,
+ gint64 *segment_start,
+ gint64 *segment_end);
+/* formats query */
+
+GST_API
+GstQuery* gst_query_new_formats (void) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_formats (GstQuery *query, gint n_formats, ...);
+
+GST_API
+void gst_query_set_formatsv (GstQuery *query, gint n_formats, const GstFormat *formats);
+
+GST_API
+void gst_query_parse_n_formats (GstQuery *query, guint *n_formats);
+
+GST_API
+void gst_query_parse_nth_format (GstQuery *query, guint nth, GstFormat *format);
+
+/* buffering query */
+
+GST_API
+GstQuery* gst_query_new_buffering (GstFormat format) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_buffering_percent (GstQuery *query, gboolean busy, gint percent);
+
+GST_API
+void gst_query_parse_buffering_percent (GstQuery *query, gboolean *busy, gint *percent);
+
+GST_API
+void gst_query_set_buffering_stats (GstQuery *query, GstBufferingMode mode,
+ gint avg_in, gint avg_out,
+ gint64 buffering_left);
+
+GST_API
+void gst_query_parse_buffering_stats (GstQuery *query, GstBufferingMode *mode,
+ gint *avg_in, gint *avg_out,
+ gint64 *buffering_left);
+
+GST_API
+void gst_query_set_buffering_range (GstQuery *query, GstFormat format,
+ gint64 start, gint64 stop,
+ gint64 estimated_total);
+
+GST_API
+void gst_query_parse_buffering_range (GstQuery *query, GstFormat *format,
+ gint64 *start, gint64 *stop,
+ gint64 *estimated_total);
+
+GST_API
+gboolean gst_query_add_buffering_range (GstQuery *query,
+ gint64 start, gint64 stop);
+
+GST_API
+guint gst_query_get_n_buffering_ranges (GstQuery *query);
+
+GST_API
+gboolean gst_query_parse_nth_buffering_range (GstQuery *query,
+ guint index, gint64 *start,
+ gint64 *stop);
+
+/* URI query */
+
+GST_API
+GstQuery * gst_query_new_uri (void) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_parse_uri (GstQuery *query, gchar **uri);
+
+GST_API
+void gst_query_set_uri (GstQuery *query, const gchar *uri);
+
+GST_API
+void gst_query_parse_uri_redirection (GstQuery *query, gchar **uri);
+
+GST_API
+void gst_query_set_uri_redirection (GstQuery *query, const gchar *uri);
+
+GST_API
+void gst_query_parse_uri_redirection_permanent (GstQuery *query, gboolean * permanent);
+
+GST_API
+void gst_query_set_uri_redirection_permanent (GstQuery *query, gboolean permanent);
+
+/* allocation query */
+
+GST_API
+GstQuery * gst_query_new_allocation (GstCaps *caps, gboolean need_pool) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_parse_allocation (GstQuery *query, GstCaps **caps, gboolean *need_pool);
+
+/* pools */
+
+GST_API
+void gst_query_add_allocation_pool (GstQuery *query, GstBufferPool *pool,
+ guint size, guint min_buffers,
+ guint max_buffers);
+
+GST_API
+guint gst_query_get_n_allocation_pools (GstQuery *query);
+
+GST_API
+void gst_query_parse_nth_allocation_pool (GstQuery *query, guint index,
+ GstBufferPool **pool,
+ guint *size, guint *min_buffers,
+ guint *max_buffers);
+
+GST_API
+void gst_query_set_nth_allocation_pool (GstQuery *query, guint index,
+ GstBufferPool *pool,
+ guint size, guint min_buffers,
+ guint max_buffers);
+
+GST_API
+void gst_query_remove_nth_allocation_pool (GstQuery *query, guint index);
+
+/* allocators */
+
+GST_API
+void gst_query_add_allocation_param (GstQuery *query, GstAllocator *allocator,
+ const GstAllocationParams *params);
+
+GST_API
+guint gst_query_get_n_allocation_params (GstQuery *query);
+
+GST_API
+void gst_query_parse_nth_allocation_param (GstQuery *query, guint index,
+ GstAllocator **allocator,
+ GstAllocationParams *params);
+
+GST_API
+void gst_query_set_nth_allocation_param (GstQuery *query, guint index,
+ GstAllocator *allocator,
+ const GstAllocationParams *params);
+
+GST_API
+void gst_query_remove_nth_allocation_param (GstQuery *query, guint index);
+
+/* metadata */
+
+GST_API
+void gst_query_add_allocation_meta (GstQuery *query, GType api, const GstStructure *params);
+
+GST_API
+guint gst_query_get_n_allocation_metas (GstQuery *query);
+
+GST_API
+GType gst_query_parse_nth_allocation_meta (GstQuery *query, guint index,
+ const GstStructure **params);
+
+GST_API
+void gst_query_remove_nth_allocation_meta (GstQuery *query, guint index);
+
+GST_API
+gboolean gst_query_find_allocation_meta (GstQuery *query, GType api, guint *index);
+
+
+/* scheduling query */
+/**
+ * GstSchedulingFlags:
+ * @GST_SCHEDULING_FLAG_SEEKABLE: if seeking is possible
+ * @GST_SCHEDULING_FLAG_SEQUENTIAL: if sequential access is recommended
+ * @GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED: if bandwidth is limited and buffering possible (since 1.2)
+ *
+ * The different scheduling flags.
+ */
+typedef enum {
+ GST_SCHEDULING_FLAG_SEEKABLE = (1 << 0),
+ GST_SCHEDULING_FLAG_SEQUENTIAL = (1 << 1),
+ GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED = (1 << 2)
+} GstSchedulingFlags;
+
+GST_API
+GstQuery * gst_query_new_scheduling (void) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_scheduling (GstQuery *query, GstSchedulingFlags flags,
+ gint minsize, gint maxsize, gint align);
+
+GST_API
+void gst_query_parse_scheduling (GstQuery *query, GstSchedulingFlags *flags,
+ gint *minsize, gint *maxsize, gint *align);
+
+GST_API
+void gst_query_add_scheduling_mode (GstQuery *query, GstPadMode mode);
+
+GST_API
+guint gst_query_get_n_scheduling_modes (GstQuery *query);
+
+GST_API
+GstPadMode gst_query_parse_nth_scheduling_mode (GstQuery *query, guint index);
+
+GST_API
+gboolean gst_query_has_scheduling_mode (GstQuery *query, GstPadMode mode);
+
+GST_API
+gboolean gst_query_has_scheduling_mode_with_flags (GstQuery * query, GstPadMode mode,
+ GstSchedulingFlags flags);
+
+/* accept-caps query */
+
+GST_API
+GstQuery * gst_query_new_accept_caps (GstCaps *caps) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_parse_accept_caps (GstQuery *query, GstCaps **caps);
+
+GST_API
+void gst_query_set_accept_caps_result (GstQuery *query, gboolean result);
+
+GST_API
+void gst_query_parse_accept_caps_result (GstQuery *query, gboolean *result);
+
+/* caps query */
+
+GST_API
+GstQuery * gst_query_new_caps (GstCaps *filter) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_parse_caps (GstQuery *query, GstCaps **filter);
+
+GST_API
+void gst_query_set_caps_result (GstQuery *query, GstCaps *caps);
+
+GST_API
+void gst_query_parse_caps_result (GstQuery *query, GstCaps **caps);
+
+/* drain query */
+
+GST_API
+GstQuery * gst_query_new_drain (void) G_GNUC_MALLOC;
+
+/* context query */
+
+GST_API
+GstQuery * gst_query_new_context (const gchar * context_type) G_GNUC_MALLOC;
+
+GST_API
+gboolean gst_query_parse_context_type (GstQuery * query, const gchar ** context_type);
+
+GST_API
+void gst_query_set_context (GstQuery *query, GstContext *context);
+
+GST_API
+void gst_query_parse_context (GstQuery *query, GstContext **context);
+
+/* bitrate query */
+
+GST_API
+GstQuery * gst_query_new_bitrate (void) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_bitrate (GstQuery * query, guint nominal_bitrate);
+
+GST_API
+void gst_query_parse_bitrate (GstQuery * query, guint * nominal_bitrate);
+
- #endif
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstQuery, gst_query_unref)
+
+G_END_DECLS
+
+#endif /* __GST_QUERY_H__ */
+
#include "gst-i18n-lib.h"
#include "glib-compat-private.h"
#include <math.h>
+#ifdef TIZEN_PROFILE_TV
+#include "gstchildproxy.h"
+#endif
- /**
- * gst_util_dump_mem:
- * @mem: (array length=size): a pointer to the memory to dump
- * @size: the size of the memory block to dump
- *
- * Dumps the memory block into a hex representation. Useful for debugging.
- */
- void
- gst_util_dump_mem (const guchar * mem, guint size)
+
+ static void
+ gst_util_dump_mem_offset (const guchar * mem, guint size, guint offset)
{
guint i, j;
GString *string = g_string_sized_new (50);
}
}
+#ifdef TIZEN_PROFILE_TV
+/**
+ * gst_element_query_resource
+ * @element: (in): a #GstElement to invoke the resource query on.
+ * @resources: (out): a pointer to the list of resources asked for.
+ * Returns: TRUE if the query could be performed.
+ */
+gboolean
+gst_element_query_resource (GstElement * element, GList ** resource_list)
+{
+ GstQuery *query;
+ gboolean ret;
+ char resources[250];
+ char *element_resource;
+ guint count = 0, i = 0;
+ GstObject *object;
+ int resource_num;
+
+ if (resource_list == NULL) {
+ return FALSE;
+ }
+
+ query = gst_query_new_resource (resources);
+ if (GST_IS_BIN (element)) {
+ count = gst_child_proxy_get_children_count ((GstChildProxy *)element);
+ for (i = 0; i < count; i++) {
+ if (!(object = gst_child_proxy_get_child_by_index ((GstChildProxy *)element, i)))
+ continue;
+
+ if (GST_IS_BIN (object)) {
+ ret = gst_element_query_resource ((GstElement *)object, resource_list);
+ gst_object_unref (object);
+ continue;
+ }
+
+ ret = gst_element_query ((GstElement *) object, query);
+ if (ret) {
+ element_resource = gst_query_parse_resource (query);
+ resource_num = (int) atoi (element_resource);
+ GST_DEBUG_OBJECT (element,
+ "\n resource ID received after query is :%d\n", resource_num);
+ if (NULL == (g_list_find (*resource_list, (gconstpointer)resource_num))) {
+ *resource_list =
+ g_list_append (*resource_list, GINT_TO_POINTER (resource_num));
+ }
+ }
+ gst_object_unref (object);
+ }
+ } else {
+ ret = gst_element_query ((GstElement *) element, query);
+ if (ret) {
+ element_resource = gst_query_parse_resource (query);
+ resource_num = (int) atoi (element_resource);
+ GST_DEBUG_OBJECT (element, "\n resource ID received after query is :%d\n",
+ resource_num);
+ if (NULL == (g_list_find (*resource_list, (gconstpointer)resource_num))) {
+ *resource_list =
+ g_list_append (*resource_list, GINT_TO_POINTER (resource_num));
+ }
+ }
+ }
+ gst_query_unref (query);
+ return TRUE;
+}
+
+static void
+set_family_id (const GValue * item, gpointer user_data)
+{
+ gpointer object = g_value_get_object (item);
+ if (GST_IS_PAD (object)) {
+ GstPad *pad = GST_PAD_CAST (object);
+ g_object_set (G_OBJECT (pad), "family-id", (int) user_data, NULL);
+ } else if (GST_IS_ELEMENT (object)) {
+ gst_set_family_id_to_child (GST_ELEMENT_CAST (object), (int) user_data);
+ }
+ return;
+}
+
+void
+gst_set_family_id_to_child (GstElement * child, int id)
+{
+ GstIterator *it;
+ if (!GST_IS_ELEMENT (child))
+ return;
+ g_object_set (G_OBJECT (child), "family-id", id, NULL);
+ it = gst_element_iterate_pads (child);
+ gst_iterator_foreach (it, (GstIteratorForeachFunction) set_family_id,
+ (gpointer) id);
+ gst_iterator_free (it);
+ it = NULL;
+
+ if (!GST_IS_BIN (child))
+ return;
+ it = gst_bin_iterate_recurse (GST_BIN (child));
+ gst_iterator_foreach (it, (GstIteratorForeachFunction) set_family_id,
+ (gpointer) id);
+ gst_iterator_free (it);
+ it = NULL;
+ return;
+}
+
+#endif
++
+ /**
+ * gst_type_mark_as_plugin_api:
+ * @type: a GType
+ * @flags: a set of #GstPluginAPIFlags to further inform cache generation.
+ *
+ * Marks @type as plugin API. This should be called in `class_init` of
+ * elements that expose new types (i.e. enums, flags or internal GObjects) via
+ * properties, signals or pad templates.
+ *
+ * Types exposed by plugins are not automatically added to the documentation
+ * as they might originate from another library and should in that case be
+ * documented via that library instead.
+ *
+ * By marking a type as plugin API it will be included in the documentation of
+ * the plugin that defines it.
+ *
+ * Since: 1.18
+ */
+ void
+ gst_type_mark_as_plugin_api (GType type, GstPluginAPIFlags flags)
+ {
+ g_type_set_qdata (type, GST_QUARK (PLUGIN_API), GINT_TO_POINTER (TRUE));
+ g_type_set_qdata (type, GST_QUARK (PLUGIN_API_FLAGS),
+ GINT_TO_POINTER (flags));
+ }
+
+ /**
+ * gst_type_is_plugin_api:
+ * @type: a GType
+ * @flags: (out) (nullable): What #GstPluginAPIFlags the plugin was marked with
+ *
+ * Checks if @type is plugin API. See gst_type_mark_as_plugin_api() for
+ * details.
+ *
+ * Returns: %TRUE if @type is plugin API or %FALSE otherwise.
+ *
+ * Since: 1.18
+ */
+ gboolean
+ gst_type_is_plugin_api (GType type, GstPluginAPIFlags * flags)
+ {
+ gboolean ret =
+ ! !GPOINTER_TO_INT (g_type_get_qdata (type, GST_QUARK (PLUGIN_API)));
+
+ if (ret && flags) {
+ *flags =
+ GPOINTER_TO_INT (g_type_get_qdata (type, GST_QUARK (PLUGIN_API_FLAGS)));
+ }
+
+ return ret;
+ }
GstClockTime * b, GstClockTime * xbase,
gdouble * r_squared);
+ GST_API
+ void gst_type_mark_as_plugin_api (GType type, GstPluginAPIFlags flags);
+
+ GST_API
+ gboolean gst_type_is_plugin_api (GType type, GstPluginAPIFlags *flags);
+#ifdef TIZEN_PROFILE_TV
+void gst_set_family_id_to_child (GstElement* child, int id);
+#endif
G_END_DECLS
#endif /* __GST_UTILS_H__ */
GstTagList * tags,
GstTagMergeMode mode);
- #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBaseParseFrame, gst_base_parse_frame_free)
- #endif
- #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBaseParse, gst_object_unref)
- #endif
+#ifdef TIZEN_FEATURE_BASEPARSE_MODIFICATION
+GST_BASE_API
+void gst_base_parse_get_upstream_size (GstBaseParse * parse,
+ gint64 * upstream_size);
+
+GST_BASE_API
+void gst_base_parse_get_index_last_offset (GstBaseParse * parse,
+ gint64 * index_last_offset);
+
+GST_BASE_API
+void gst_base_parse_get_index_last_ts (GstBaseParse * parse,
+ GstClockTime * index_last_ts);
+
+GST_BASE_API
+void gst_base_parse_get_pad_mode (GstBaseParse * parse,
+ GstPadMode * pad_mode);
+
+GST_BASE_API
+void gst_base_parse_set_seek_mode (GstBaseParse * parse,
+ gboolean seek_mode);
+#endif
G_END_DECLS
#endif /* __GST_BASE_PARSE_H__ */
void gst_base_src_submit_buffer_list (GstBaseSrc * src,
GstBufferList * buffer_list);
- #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBaseSrc, gst_object_unref)
- #endif
+#ifdef TIZEN_PROFILE_TV
+GST_BASE_API
+void gst_base_src_update_segment (GstBaseSrc * src, gint64 timestamp);
+#endif
+
G_END_DECLS
#endif /* __GST_BASE_SRC_H__ */
--- /dev/null
- Version: 1.16.2
- Release: 5
+%define gst_branch 1.0
+
+Name: gstreamer
- # FIXME: GTKDOC_CFLAGS, GST_OBJ_CFLAGS:
- # Silently ignored compilation of uninstalled gtk-doc scanners without RPM_OPT_FLAGS.
- export V=1
- NOCONFIGURE=1 ./autogen.sh
++Version: 1.19.2
++Release: 0
+Summary: Streaming-Media Framework Runtime
+License: LGPL-2.0+
+Group: Multimedia/Framework
+Url: http://gstreamer.freedesktop.org/
+Source0: http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-%{version}.tar.xz
+Source100: common.tar.gz
++BuildRequires: meson >= 0.48.0
+BuildRequires: bison
+BuildRequires: gettext-tools
+BuildRequires: check-devel
+BuildRequires: fdupes
+BuildRequires: flex
+BuildRequires: pkgconfig(glib-2.0) >= 2.32.0
+BuildRequires: libtool
+BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.31.1
+BuildRequires: pkgconfig(dlog)
+
+%description
+GStreamer is a streaming-media framework, based on graphs of filters
+which operate on media data. Applications using this library can do
+anything from real-time sound processing to playing videos, and just
+about anything else media-related. Its plug-in-based architecture
+means that new data types or processing capabilities can be added by
+installing new plug-ins.
+
+%package utils
+Summary: Streaming-Media Framework Runtime
+Group: Multimedia/Framework
+Provides: gstreamer:%{_bindir}/gst-launch-%{gst_branch} = %{version}
+# Symbol for unversioned wrappers:
+Provides: gstreamer-utils_versioned = %{version}
+
+%description utils
+GStreamer is a streaming-media framework, based on graphs of filters
+which operate on media data. Applications using this library can do
+anything from real-time sound processing to playing videos, and just
+about anything else media-related. Its plug-in-based architecture
+means that new data types or processing capabilities can be added by
+installing new plug-ins.
+
+%package devel
+Summary: Include Files and Libraries mandatory for Development
+Group: Development/Libraries
+# gstreamer-utils is required for the gstreamer-provides rpm magic.
+Requires: gstreamer-utils = %{version}
+Requires: %{name} = %{version}
+
+%description devel
+This package contains all necessary include files and libraries needed
+to develop applications that require these.
+
+%lang_package
+
+%prep
+%setup -q -n gstreamer-%{version}
+%setup -q -T -D -a 100
+
+%build
- %configure\
- %if %{with introspection}
- --enable-introspection\
- %endif
- --disable-static\
- --disable-docbook\
- --disable-gtk-doc\
- --enable-dlog\
- %if "%{tizen_profile_name}" == "tv"
- --enable-tv-profile\
- %endif
- --disable-examples\
- --disable-tests\
- --with-ptp-helper-permissions=none
+export CFLAGS="%{optflags} \
+ -DTIZEN_FEATURE_QUEUE2_MODIFICATION\
+ -DTIZEN_FEATURE_FILESINK_MODIFICATION\
+ -DTIZEN_FEATURE_MQ_MODIFICATION\
+ -DTIZEN_FEATURE_MQ_MODIFICATION_EXTRA_SIZE_TIME\
+ -DTIZEN_FEATURE_MQ_SKIP_BUFFERING\
+ -DTIZEN_FEATURE_BASEPARSE_MODIFICATION\
+ -DTIZEN_FEATURE_QUEUE_MODIFICATION\
+ -DTIZEN_FEATURE_FAKESINK_MODIFICATION\
+ -DTIZEN_FEATURE_INPUT_SELECTOR_MODIFICATION\
+ -DTIZEN_FEATURE_UPSTREAM\
+ -DTIZEN_FEATURE_SEEK_THRESHOLD\
+%if "%{tizen_profile_name}" == "tv"
+ -DTIZEN_PROFILE_TV\
+ -DTIZEN_FEATURE_TRUSTZONE\
+%endif
+ -DTIZEN_FEATURE_RTSPSRC_MODIFICATION\
+ -fno-strict-aliasing\
+ -fstack-protector-strong\
+ -Wl,-z,relro\
+ -D_FORTIFY_SOURCE=2"
+
- make %{?_smp_mflags}
++%meson --auto-feature=auto \
++ -D bash-completion=disabled \
++ -D check=disabled \
++ -D examples=disabled \
++ -D tests=disabled \
++ -D doc=disabled \
++ -D ptp-helper-permissions=none
+
- %make_install
++%meson_build
+
+%install
- %{_libdir}/girepository-1.0/GstCheck-1.0.typelib
++%meson_install
+mkdir -p %{buildroot}%{_datadir}/gstreamer-%{gst_branch}/presets
+mkdir -p %{buildroot}%{_docdir}/%{name}
+%find_lang %{name}-%{gst_branch}
+mv %{name}-%{gst_branch}.lang %{name}.lang
+rm -rf %{buildroot}%{_datadir}/gtk-doc
+rm -rf %{buildroot}%{_docdir}/%{name}/manual
+rm -rf %{buildroot}%{_docdir}/%{name}/pwg
+mkdir -p %{buildroot}%{_datadir}/gstreamer-%{gst_branch}/presets
+%fdupes %{buildroot}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%license COPYING
+
+%dir %{_datadir}/gstreamer-%{gst_branch}
+%dir %{_datadir}/gstreamer-%{gst_branch}/presets
+%dir %{_libdir}/gstreamer-%{gst_branch}
+%{_libdir}/gstreamer-%{gst_branch}/*.so
+%dir %{_libexecdir}/gstreamer-%{gst_branch}
+%{_libexecdir}/gstreamer-%{gst_branch}/gst-plugin-scanner
+%{_libexecdir}/gstreamer-%{gst_branch}/gst-ptp-helper
+%{_libdir}/*.so.*
+%{_libdir}/girepository-1.0/Gst-1.0.typelib
+%{_libdir}/girepository-1.0/GstBase-1.0.typelib
++#%{_libdir}/girepository-1.0/GstCheck-1.0.typelib
+%{_libdir}/girepository-1.0/GstController-1.0.typelib
+%{_libdir}/girepository-1.0/GstNet-1.0.typelib
+%{_datadir}/gdb/auto-load/usr/%{_lib}/libgstreamer*-gdb.py
+%{_datadir}/gstreamer-1.0/gdb/glib_gobject_helper.py
+%{_datadir}/gstreamer-1.0/gdb/gst_gdb.py
+
+%files utils
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%license COPYING
+%{_bindir}/*-%{gst_branch}
+%doc %{_mandir}/man?/*-%{gst_branch}.*
+
+%files devel
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%{_datadir}/aclocal/*.m4
+%{_includedir}/*
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
+%{_datadir}/gir-1.0/*.gir
+
+%changelog
gstbase_sink_class->preroll = GST_DEBUG_FUNCPTR (gst_fake_sink_preroll);
gstbase_sink_class->render = GST_DEBUG_FUNCPTR (gst_fake_sink_render);
gstbase_sink_class->query = GST_DEBUG_FUNCPTR (gst_fake_sink_query);
+#ifdef TIZEN_FEATURE_FAKESINK_MODIFICATION
+ gstbase_sink_class->set_caps = GST_DEBUG_FUNCPTR (gst_fake_sink_set_caps);
+ gstbase_sink_class->get_times = GST_DEBUG_FUNCPTR (gst_fake_sink_get_times);
+#endif
+
+ gst_type_mark_as_plugin_api (GST_TYPE_FAKE_SINK_STATE_ERROR, 0);
}
static void
PROP_BUFFER_MODE,
PROP_BUFFER_SIZE,
PROP_APPEND,
+#ifdef TIZEN_FEATURE_FILESINK_MODIFICATION
+ PROP_CURRENT_BYTES,
+#endif
+ PROP_O_SYNC,
+ PROP_MAX_TRANSIENT_ERROR_TIMEOUT,
PROP_LAST
};
case PROP_APPEND:
g_value_set_boolean (value, sink->append);
break;
+#ifdef TIZEN_FEATURE_FILESINK_MODIFICATION
+ case PROP_CURRENT_BYTES:
+ g_value_set_uint64(value, sink->current_pos);
+ break;
+#endif
+ case PROP_O_SYNC:
+ g_value_set_boolean (value, sink->o_sync);
+ break;
+ case PROP_MAX_TRANSIENT_ERROR_TIMEOUT:
+ g_value_set_int (value, sink->max_transient_error_timeout);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+static guint
+get_current_size_bytes (GstMultiQueue * mq)
+{
+ GList *tmp;
+ guint current_size_bytes = 0;
+
+ for (tmp = mq->queues; tmp; tmp = g_list_next (tmp)) {
+ GstSingleQueue *sq = (GstSingleQueue *) tmp->data;
+ GstDataQueueSize size;
+
+ gst_data_queue_get_level (sq->queue, &size);
+
+ current_size_bytes += size.bytes;
+
+ GST_DEBUG_OBJECT (mq,
+ "queue %d: bytes %u/%u, time %" G_GUINT64_FORMAT "/%"
+ G_GUINT64_FORMAT, sq->id, size.bytes, sq->max_size.bytes,
+ sq->cur_time, sq->max_size.time);
+ }
+
+ GST_INFO_OBJECT (mq, "current_size_bytes : %u", current_size_bytes);
+
+ return current_size_bytes;
+}
+#endif
+
+ /* Called with mutex held */
+ static GstStructure *
+ gst_multi_queue_get_stats (GstMultiQueue * mq)
+ {
+ GstStructure *ret =
+ gst_structure_new_empty ("application/x-gst-multi-queue-stats");
+ GList *tmp;
+ GstSingleQueue *sq;
+
+ if (mq->queues != NULL) {
+ GValue queues = G_VALUE_INIT;
+ GValue v = G_VALUE_INIT;
+
+ g_value_init (&queues, GST_TYPE_ARRAY);
+
+ for (tmp = mq->queues; tmp; tmp = g_list_next (tmp)) {
+ GstDataQueueSize level;
+ GstStructure *s;
+ gchar *id;
+ g_value_init (&v, GST_TYPE_STRUCTURE);
+
+ sq = (GstSingleQueue *) tmp->data;
+ gst_data_queue_get_level (sq->queue, &level);
+ id = g_strdup_printf ("queue_%d", sq->id);
+ s = gst_structure_new (id,
+ "buffers", G_TYPE_UINT, level.visible,
+ "bytes", G_TYPE_UINT, level.bytes,
+ "time", G_TYPE_UINT64, sq->cur_time, NULL);
+ g_value_take_boxed (&v, s);
+ gst_value_array_append_and_take_value (&queues, &v);
+ g_free (id);
+ }
+ gst_structure_take_value (ret, "queues", &queues);
+ }
+
+ return ret;
+ }
+
static void
gst_multi_queue_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
if (!mq->use_buffering)
return;
- GstCaps *caps = gst_pad_get_current_caps(sq->sinkpad);
- GstStructure *s;
-
- if (caps) {
- /* skip buffering except audio and video */
- if ((s = gst_caps_get_structure (caps, 0)) &&
- (!g_strrstr (gst_structure_get_name (s), "video")) &&
- (!g_strrstr (gst_structure_get_name (s), "audio"))) {
- gst_caps_unref(caps);
- return;
+#ifdef TIZEN_FEATURE_MQ_SKIP_BUFFERING
- gst_caps_unref(caps);
++ GstPad *sinkpad = g_weak_ref_get (&sq->sinkpad);
++ if (sinkpad) {
++ GstCaps *caps = gst_pad_get_current_caps (sinkpad);
++ GstStructure *s;
++
++ if (caps) {
++ /* skip buffering except audio and video */
++ if ((s = gst_caps_get_structure (caps, 0)) &&
++ (!g_strrstr (gst_structure_get_name (s), "video")) &&
++ (!g_strrstr (gst_structure_get_name (s), "audio"))) {
++ gst_caps_unref (caps);
++ gst_clear_object (&sinkpad);
++ return;
++ }
++ gst_caps_unref (caps);
+ }
- buffering_level = get_buffering_level (sq);
+ }
++ gst_clear_object (&sinkpad);
+#endif
+
+ buffering_level = get_buffering_level (mq, sq);
/* scale so that if buffering_level equals the high watermark,
* the percentage is 100% */
sq->max_size.bytes, sq->cur_time, sq->max_size.time);
/* we are always filled on EOS */
- if (sq->is_eos || sq->is_segment_done)
- return TRUE;
+ if (sq->is_eos || sq->is_segment_done) {
+ res = TRUE;
+ goto done;
+ }
/* we never go past the max visible items unless we are in buffering mode */
- if (!mq->use_buffering && IS_FILLED (sq, visible, visible))
- return TRUE;
+ if (!mq->use_buffering && IS_FILLED (sq, visible, visible)) {
+ res = TRUE;
+ goto done;
+ }
/* check time or bytes */
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION_EXTRA_SIZE_TIME
+ res = IS_FILLED_EXTRA (sq, time, sq->cur_time) || IS_FILLED (sq, bytes, bytes);
+#else
res = IS_FILLED (sq, bytes, bytes);
+#endif
/* We only care about limits in time if we're not a sparse stream or
* we're not syncing by running time */
if (!sq->is_sparse || !mq->sync_by_running_time) {
G_PARAM_READWRITE | GST_PARAM_MUTABLE_PLAYING |
G_PARAM_STATIC_STRINGS));
+#ifdef TIZEN_FEATURE_QUEUE_MODIFICATION
+ g_object_class_install_property (gobject_class, PROP_EMPTY_BUFFERS,
+ g_param_spec_boolean ("empty-buffers", "empty_buffers",
+ "Drop all the incomming buffers and flush buffers in queue",
+ FALSE, G_PARAM_READWRITE));
+#endif /* TIZEN_FEATURE_QUEUE_MODIFICATION */
+
/**
- * GstQueue:flush-on-eos
+ * queue:flush-on-eos:
*
* Discard all data in the queue when an EOS event is received, and pass
* on the EOS event as soon as possible (instead of waiting until all
PROP_AVG_IN_RATE,
PROP_USE_BITRATE_QUERY,
PROP_BITRATE,
+#ifdef TIZEN_FEATURE_RTSPSRC_MODIFICATION
+ PROP_BUFFER_MODE,
+#endif
PROP_LAST
};
+ static GParamSpec *obj_props[PROP_LAST] = { NULL, };
/* Explanation for buffer levels and percentages:
*
* the size of the queue. Values are taken from either the upstream tags
* or from the downstream bitrate query.
*/
- g_object_class_install_property (gobject_class, PROP_BITRATE,
- g_param_spec_uint64 ("bitrate", "Bitrate (bits/s)",
- "Conversion value between data size and time",
- 0, G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ obj_props[PROP_BITRATE] = g_param_spec_uint64 ("bitrate", "Bitrate (bits/s)",
+ "Conversion value between data size and time",
+ 0, G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
+#ifdef TIZEN_FEATURE_RTSPSRC_MODIFICATION
+ /**
+ * GstQueue2:buffer-mode:
+ *
+ * Control the buffering mode used by the queue2.
+ */
+ g_object_class_install_property (gobject_class, PROP_BUFFER_MODE,
+ g_param_spec_enum ("buffer-mode", "Buffer Mode",
+ "Control the buffering algorithm in use",
+ GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#endif
+
/* set several parent class virtual functions */
gobject_class->finalize = gst_queue2_finalize;
{
gboolean pull_mode;
GstSchedulingFlags flags = 0;
- if ((!QUEUE_IS_USING_QUEUE (queue)) && !gst_pad_peer_query (queue->sinkpad, query))
+ GstQuery *upstream;
+
+ upstream = gst_query_new_scheduling ();
+#ifdef TIZEN_FEATURE_QUEUE2_MODIFICATION
- if (!gst_pad_peer_query (queue->sinkpad, query))
++ if (!(QUEUE_IS_USING_QUEUE (queue)) && !gst_pad_peer_query (queue->sinkpad, upstream)) {
+#else
+ if (!gst_pad_peer_query (queue->sinkpad, upstream)) {
+#endif
+ gst_query_unref (upstream);
goto peer_failed;
+ }
- gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL);
+ gst_query_parse_scheduling (upstream, &flags, NULL, NULL, NULL);
+ gst_query_unref (upstream);
+#ifdef TIZEN_FEATURE_QUEUE2_MODIFICATION
+ if (!(flags & GST_SCHEDULING_FLAG_SEEKABLE)) {
+ GST_DEBUG_OBJECT(queue, "peer can support only push mode");
+ gst_query_set_scheduling (query, flags, 0, -1, 0);
+ gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH);
+ break;
+ }
+#endif
+ GST_DEBUG_OBJECT(queue, "peer can support pull mode");
+
/* we can operate in pull mode when we are using a tempfile */
pull_mode = !QUEUE_IS_USING_QUEUE (queue);
queue->starting_segment = NULL;
gst_event_replace (&queue->stream_start_event, NULL);
GST_QUEUE2_MUTEX_UNLOCK (queue);
- query_downstream_bitrate (queue);
+
+ /* Mark the srcpad as reconfigured to trigger querying
+ * the downstream bitrate next time it tries to push */
+ gst_pad_mark_reconfigure (queue->srcpad);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
+#ifdef TIZEN_FEATURE_QUEUE2_MODIFICATION
+ GST_QUEUE2_MUTEX_LOCK (queue);
+ queue->is_buffering = FALSE;
+ GST_QUEUE2_MUTEX_UNLOCK (queue);
+#endif
break;
default:
break;