--- /dev/null
- upstream_branch = upstream/1.12
+[general]
++upstream_branch = upstream/1.16
+upstream_tag = ${upstreamversion}
# With XCode 8, clock_gettime will be incorrectly detected as being available
# regardless of what version of OS X you target because the symbol is available
# in the .tbd file as a weak symbol.
--# See: https://bugzilla.gnome.org/show_bug.cgi?id=772451
++# See: https://bugzilla.gnome.org/show_bug.cgi?id=772451
#
# We cannot simply do AC_CHECK_FUNCS with -Wl,-no_weak_imports because the
# autoconf check does its own prototype declaration that doesn't trigger that
enable_Bsymbolic=no)
LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
- yes) HAVE_TV_PROFILE="-DTIZEN_PROFILE_TV -DTIZEN_FEATURE_TRUSTZONE" ;;
+dnl Check for dlog
+AC_ARG_ENABLE(dlog, AC_HELP_STRING([--enable-dlog], [using dlog]),
+[
+ case "${enableval}" in
+ yes) USE_DLOG=yes ;;
+ no) USE_DLOG=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-dlog) ;;
+ esac
+],[USE_DLOG=no])
+
+if test "x$USE_DLOG" = "xyes"; then
+ PKG_CHECK_MODULES(DLOG, dlog)
+ AC_SUBST(DLOG_CFLAGS)
+ AC_SUBST(DLOG_LIBS)
+fi
+AM_CONDITIONAL(USE_DLOG, test "x$USE_DLOG" = "xyes")
+dnl end
+
+dnl Check for tv-profile
+AC_ARG_ENABLE(tv-profile, AC_HELP_STRING([--enable-tv-profile], [using tv-profile]),
+[
+ case "${enableval}" in
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-tv-profile) ;;
++ yes) HAVE_TV_PROFILE="-DTIZEN_PROFILE_TV -DTIZEN_FEATURE_TRUSTZONE" IS_TV_PROFILE=yes ;;
+ no) HAVE_TV_PROFILE= ;;
++ *) AC_MSG_ERROR(bad value ${enableval} for --enable-tv-profile) IS_TV_PROFILE=no ;;
+ esac
+],[HAVE_TV_PROFILE=])
+AC_SUBST(HAVE_TV_PROFILE)
++AM_CONDITIONAL([IS_TV_PROFILE], [test "x$IS_TV_PROFILE" = "xyes"])
+dnl end
dnl *** set variables based on configure arguments
</pads>
</element>
</elements>
--</plugin>
++</plugin>
libgstreamer_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst
++if IS_TV_PROFILE
++GST_QUERY_H = gstquery.h.tv
++else
++GST_QUERY_H = gstquery.h
++endif
++
gst_headers = \
gst.h \
glib-compat.h \
gstpoll.h \
gstpreset.h \
gstprotection.h \
-- gstquery.h \
++ $(GST_QUERY_H) \
+ gstpromise.h \
gstsample.h \
gstsegment.h \
gststreamcollection.h \
#define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
#define GST_ELEMENT_FACTORY_CAST(obj) ((GstElementFactory *)(obj))
+ GST_API
GType gst_element_factory_get_type (void);
+ GST_API
GstElementFactory * gst_element_factory_find (const gchar *name);
+ GST_API
GType gst_element_factory_get_element_type (GstElementFactory *factory);
+ GST_API
const gchar * gst_element_factory_get_metadata (GstElementFactory *factory, const gchar *key);
+
+ GST_API
gchar ** gst_element_factory_get_metadata_keys (GstElementFactory *factory);
+ GST_API
guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
+
+ GST_API
const GList * gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
+ GST_API
GstURIType gst_element_factory_get_uri_type (GstElementFactory *factory);
+
+ GST_API
const gchar * const * gst_element_factory_get_uri_protocols (GstElementFactory *factory);
+ GST_API
gboolean gst_element_factory_has_interface (GstElementFactory *factory,
const gchar *interfacename);
-
+ GST_API
GstElement* gst_element_factory_create (GstElementFactory *factory,
const gchar *name) G_GNUC_MALLOC;
+ GST_API
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name) 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 */
#endif /* __sgi__ */
#endif
- static const gchar *_gst_debug_filter = NULL;
-
+#if defined(USE_DLOG)
+#include <dlog.h>
+
+#define GST_SLOGW(fmt, arg...) \
+ ({ do { \
+ __dlog_print(LOG_ID_SYSTEM, DLOG_WARN, "GST_LOG", fmt, ##arg); \
+ } while (0); })
+
+#endif
+
static void gst_debug_reset_threshold (gpointer category, gpointer unused);
static void gst_debug_reset_all_thresholds (void);
GstClockTime elapsed;
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;
+#endif
gchar c;
+ /* 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);
+
/* __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
levelcolor = levelcolormap[level];
#define PRINT_FMT " %s"PID_FMT"%s "PTR_FMT" %s%s%s %s"CAT_FMT"%s %s\n"
- clear, gst_debug_message_get (message));
+
+#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,
- 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,
- gst_debug_category_get_name (category), file, line, function, obj,
- clear, gst_debug_message_get (message));
- fflush (log_file);
++ 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,
+ gst_debug_category_get_name (category), file, line, function, obj,
+ clear, message_str);
+ fflush (log_file);
+#endif
+
#undef PRINT_FMT
g_free (color);
#ifdef G_OS_WIN32
} else {
/* no color, all platforms */
#define PRINT_FMT " "PID_FMT" "PTR_FMT" %s "CAT_FMT" %s\n"
- gst_debug_message_get (message));
+
+ /* 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),
gst_debug_category_get_name (category), file, line, function, obj,
- gst_debug_message_get (message));
+ message_str);
fflush (log_file);
+#endif
+
#undef PRINT_FMT
}
"GstMessageStreamCollection", "collection", "stream", "stream-collection",
"GstMessageStreamsSelected", "GstMessageRedirect", "redirect-entry-locations",
"redirect-entry-taglists", "redirect-entry-structures",
- "GstEventStreamGroupDone"
+ "GstEventStreamGroupDone", "GstQueryBitrate", "nominal-bitrate",
+ "GstMessageDeviceChanged", "device-changed", "trickmode-interval",
+#ifdef TIZEN_PROFILE_TV
- ,"GstQuarkQueryResource"
++ "GstQuarkQueryResource",
+#endif
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
GST_QUARK_REDIRECT_ENTRY_TAGLISTS = 186,
GST_QUARK_REDIRECT_ENTRY_STRUCTURES = 187,
GST_QUARK_EVENT_STREAM_GROUP_DONE = 188,
- GST_QUARK_MAX = 189
+ GST_QUARK_QUERY_BITRATE = 189,
+ GST_QUARK_NOMINAL_BITRATE = 190,
+ GST_QUARK_MESSAGE_DEVICE_CHANGED = 191,
+ GST_QUARK_DEVICE_CHANGED = 192,
+ GST_QUARK_TRICKMODE_INTERVAL = 193,
+#ifndef TIZEN_PROFILE_TV
- GST_QUARK_QUERY_RESOURCE = 189,
- GST_QUARK_MAX = 190
+ GST_QUARK_MAX = 194
+#else
++ GST_QUARK_QUERY_RESOURCE = 194,
++ GST_QUARK_MAX = 195
+#endif
} GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
{GST_QUERY_CAPS, "caps", 0},
{GST_QUERY_DRAIN, "drain", 0},
{GST_QUERY_CONTEXT, "context", 0},
-
+ {GST_QUERY_BITRATE, "bitrate", 0},
+#ifdef TIZEN_PROFILE_TV
+ {GST_QUERY_RESOURCE, "resource", 0},
+#endif
{0, NULL, 0}
};
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_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 (200, FLAG (BOTH))
++ GST_QUERY_RESOURCE = GST_QUERY_MAKE_TYPE (210, FLAG (BOTH)), /*< skip >*/
+#endif
} GstQueryType;
#undef FLAG
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);
- GstQuery* gst_query_new_resource (gchar * resources) G_GNUC_MALLOC;
- void gst_query_add_resource (GstQuery * query, gint resource_id);
- gchar* gst_query_parse_resource (GstQuery * query);
+#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);
--- /dev/null
--- /dev/null
++/* 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))
++
++#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),
++ 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;
++#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);
++
++/* refcounting */
++/**
++ * gst_query_ref:
++ * @q: a #GstQuery to increase the refcount of.
++ *
++ * Increases the refcount of the given query by one.
++ *
++ * Returns: @q
++ */
++static inline GstQuery *
++gst_query_ref (GstQuery * q)
++{
++ return GST_QUERY_CAST (gst_mini_object_ref (GST_MINI_OBJECT_CAST (q)));
++}
++
++/**
++ * 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 void
++gst_query_unref (GstQuery * q)
++{
++ gst_mini_object_unref (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_clear_query (GstQuery ** query_ptr)
++{
++ gst_clear_mini_object ((GstMiniObject **) query_ptr);
++}
++
++/* copy query */
++/**
++ * 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 GstQuery *
++gst_query_copy (const GstQuery * q)
++{
++ return GST_QUERY_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (q)));
++}
++
++/**
++ * 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_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 gboolean
++gst_query_replace (GstQuery **old_query, GstQuery *new_query)
++{
++ return gst_mini_object_replace ((GstMiniObject **) old_query, (GstMiniObject *) new_query);
++}
++
++/**
++ * 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
++ */
++static inline gboolean
++gst_query_take (GstQuery **old_query, GstQuery *new_query)
++{
++ return gst_mini_object_take ((GstMiniObject **) old_query,
++ (GstMiniObject *) new_query);
++}
++
++/* 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);
++
++#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
++G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstQuery, gst_query_unref)
++#endif
++
++G_END_DECLS
++
++#endif /* __GST_QUERY_H__ */
++
gboolean gst_element_factory_can_src_any_caps (GstElementFactory *factory, const GstCaps *caps);
/* util query functions */
+
+ GST_API
gboolean gst_element_query_position (GstElement *element, GstFormat format, gint64 *cur);
+
+ GST_API
gboolean gst_element_query_duration (GstElement *element, GstFormat format, gint64 *duration);
+
+ GST_API
gboolean gst_element_query_convert (GstElement *element, GstFormat src_format, gint64 src_val,
GstFormat dest_format, gint64 *dest_val);
+#ifdef TIZEN_PROFILE_TV
+gboolean gst_element_query_resource (GstElement *element, GList **resource_list);
+#endif
+
/* pad functions */
+
+ GST_API
void gst_pad_use_fixed_caps (GstPad *pad);
+
+ GST_API
GstElement* gst_pad_get_parent_element (GstPad *pad);
/* util query functions */
GstTagList *parser_tags;
GstTagMergeMode parser_tags_merge_mode;
gboolean tags_changed;
+
+ /* Current segment seqnum */
+ guint32 segment_seqnum;
++
+#ifdef TIZEN_FEATURE_BASEPARSE_MODIFICATION
+ /* to get pad mode early */
+ GstPadMode expected_pad_mode;
+ /* check first frame in base parser */
+ gboolean first_frame;
+ /* remove zero padding */
+ gint64 remove_from_total;
+ gboolean accurate_index_seek;
+#endif
};
typedef struct _GstBaseParseSeek
* like tags added by pre_push_frame */
if (parse->priv->tags_changed) {
gst_base_parse_queue_tag_event_update (parse);
++#ifdef TIZEN_FEATURE_BASEPARSE_MODIFICATION
++ gst_base_parse_push_pending_events (parse);
++#endif
parse->priv->tags_changed = FALSE;
}
gst_base_parse_push_pending_events (parse);
void gst_base_parse_merge_tags (GstBaseParse * parse,
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 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__ */
#define DEFAULT_BLOCKSIZE 4096
#define DEFAULT_NUM_BUFFERS -1
- #define DEFAULT_TYPEFIND FALSE
#define DEFAULT_DO_TIMESTAMP FALSE
+#ifdef TIZEN_PROFILE_TV
+#define DEFAULT_SEGMENT_TIME -1
+#endif
enum
{
PROP_0,
PROP_BLOCKSIZE,
PROP_NUM_BUFFERS,
+ #ifndef GST_REMOVE_DEPRECATED
PROP_TYPEFIND,
+ #endif
PROP_DO_TIMESTAMP
+#ifdef TIZEN_PROFILE_TV
+ ,PROP_UPDATE_SEGMENT
+#endif
};
- #define GST_BASE_SRC_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_SRC, GstBaseSrcPrivate))
-
+ /* The basesrc implementation need to respect the following locking order:
+ * 1. STREAM_LOCK
+ * 2. LIVE_LOCK
+ * 3. OBJECT_LOCK
+ */
struct _GstBaseSrcPrivate
{
- gboolean discont;
- gboolean flushing;
+ gboolean discont; /* STREAM_LOCK */
+ gboolean flushing; /* LIVE_LOCK */
- GstFlowReturn start_result;
- gboolean async;
+ GstFlowReturn start_result; /* OBJECT_LOCK */
+ gboolean async; /* OBJECT_LOCK */
/* if a stream-start event should be sent */
- gboolean stream_start_pending;
+ gboolean stream_start_pending; /* STREAM_LOCK */
/* if segment should be sent and a
* seqnum if it was originated by a seek */
* discard when the create function returned _OK. */
if (G_UNLIKELY (g_atomic_int_get (&src->priv->has_pending_eos))) {
if (ret == GST_FLOW_OK) {
- if (*buf == NULL)
- {
+#ifdef TIZEN_FEATURE_TRUSTZONE
++ if (own_res_buf) {
+ /*tzappsrc patch : release handle when unref res_buf*/
+ if(bclass->tz_src_release_handle)
+ {
+ GST_INFO_OBJECT (src, "tzappsrc release the handle");
+ bclass->tz_src_release_handle(src,res_buf);
+ }
- #endif
+ gst_buffer_unref (res_buf);
+ }
++#else
+ if (own_res_buf)
+ gst_buffer_unref (res_buf);
++#endif
}
src->priv->forced_eos = TRUE;
goto eos;
/* this case is triggered when we were waiting for the clock and
* it got unlocked because we did a state change. In any case, get rid of
* the buffer. */
- if (*buf == NULL)
- {
+#ifdef TIZEN_FEATURE_TRUSTZONE
++ if (own_res_buf) {
++
+ /*tzappsrc patch : release handle when unref res_buf*/
+ GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+ if(klass->tz_src_release_handle)
+ {
+ GST_INFO_OBJECT (src, "tzappsrc release the handle");
+ klass->tz_src_release_handle(src,res_buf);
+ }
- #endif
++
+ gst_buffer_unref (res_buf);
+ }
-
++#else
+ if (own_res_buf)
+ gst_buffer_unref (res_buf);
-
++#endif
if (!src->live_running) {
/* We return FLUSHING when we are not running to stop the dataflow also
* get rid of the produced buffer. */
GST_ELEMENT_ERROR (src, CORE, CLOCK,
(_("Internal clock error.")),
("clock returned unexpected return value %d", status));
- if (*buf == NULL)
- {
+#ifdef TIZEN_FEATURE_TRUSTZONE
++ if (own_res_buf) {
+ /*tzappsrc patch : release handle when unref res_buf*/
+ GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+ if(klass->tz_src_release_handle)
+ {
+ GST_INFO_OBJECT (src, "tzappsrc release the handle");
+ klass->tz_src_release_handle(src,res_buf);
+ }
- #endif
+ gst_buffer_unref (res_buf);
+ }
++#else
+ if (own_res_buf)
+ gst_buffer_unref (res_buf);
++#endif
ret = GST_FLOW_ERROR;
break;
}
GST_ELEMENT_ERROR (src, RESOURCE, BUSY,
(_("Failed to map buffer.")),
("failed to map result buffer in WRITE mode"));
- if (*buf == NULL)
- {
+#ifdef TIZEN_FEATURE_TRUSTZONE
++ if (own_res_buf) {
+ /*tzappsrc patch : release handle when unref res_buf*/
+ GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+ if(klass->tz_src_release_handle)
+ {
+ GST_INFO_OBJECT (src, "tzappsrc release the handle");
+ klass->tz_src_release_handle(src,res_buf);
+ }
- #endif
+ gst_buffer_unref (res_buf);
+ }
++#else
+ if (own_res_buf)
+ gst_buffer_unref (res_buf);
++#endif
return GST_FLOW_ERROR;
}
not_started:
flushing:
{
GST_DEBUG_OBJECT (src, "we are flushing");
- if (*buf == NULL)
- {
+#ifdef TIZEN_FEATURE_TRUSTZONE
++ if (own_res_buf) {
+ /*tzappsrc patch : release handle when unref res_buf*/
+ GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+ if(klass->tz_src_release_handle)
+ {
+ GST_INFO_OBJECT (src, "tzappsrc release the handle");
+ klass->tz_src_release_handle(src,res_buf);
+ }
- #endif
+ gst_buffer_unref (res_buf);
+ }
++#else
+ if (own_res_buf)
+ gst_buffer_unref (res_buf);
++#endif
return GST_FLOW_FLUSHING;
}
eos:
}
GST_LIVE_UNLOCK (src);
- ret = gst_pad_push (pad, buf);
+ /* push buffer or buffer list */
+ if (src->priv->pending_bufferlist != NULL) {
+ ret = gst_pad_push_list (pad, src->priv->pending_bufferlist);
+ src->priv->pending_bufferlist = NULL;
+ } else {
+ ret = gst_pad_push (pad, buf);
+ }
+
if (G_UNLIKELY (ret != GST_FLOW_OK)) {
- GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
- if(klass->tz_src_release_handle)
- {
+#ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzappsrc patch : release handle when unref res_buf*/
- klass->tz_src_release_handle(src,buf);
++ GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS (src);
++ if (klass->tz_src_release_handle) {
+ GST_INFO_OBJECT (src, "tzappsrc release the handle");
++ klass->tz_src_release_handle (src,buf);
+ }
+#endif
if (ret == GST_FLOW_NOT_NEGOTIATED) {
goto not_negotiated;
}
/*< private >*/
gpointer _gst_reserved[GST_PADDING_LARGE];
+#ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzappsrc patch*/
+ int (*tz_flush) (GstBaseSrc *src, unsigned int handle);
+ int (*tz_src_flush) (GstBaseSrc *src);
+ int (*tz_src_release_handle) (GstBaseSrc *src, GstBuffer *buf);
+#endif
};
- GType gst_base_src_get_type (void);
+ GST_BASE_API
+ GType gst_base_src_get_type (void);
+ GST_BASE_API
GstFlowReturn gst_base_src_wait_playing (GstBaseSrc *src);
+ GST_BASE_API
void gst_base_src_set_live (GstBaseSrc *src, gboolean live);
+
+ GST_BASE_API
gboolean gst_base_src_is_live (GstBaseSrc *src);
+ GST_BASE_API
void gst_base_src_set_format (GstBaseSrc *src, GstFormat format);
+ GST_BASE_API
void gst_base_src_set_dynamic_size (GstBaseSrc * src, gboolean dynamic);
+ GST_BASE_API
void gst_base_src_set_automatic_eos (GstBaseSrc * src, gboolean automatic_eos);
+ GST_BASE_API
void gst_base_src_set_async (GstBaseSrc *src, gboolean async);
+
+ GST_BASE_API
gboolean gst_base_src_is_async (GstBaseSrc *src);
+ GST_BASE_API
void gst_base_src_start_complete (GstBaseSrc * basesrc, GstFlowReturn ret);
+
+ GST_BASE_API
GstFlowReturn gst_base_src_start_wait (GstBaseSrc * basesrc);
+ GST_BASE_API
gboolean gst_base_src_query_latency (GstBaseSrc *src, gboolean * live,
GstClockTime * min_latency,
GstClockTime * max_latency);
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.12.2
+%define gst_branch 1.0
+
+Name: gstreamer
- rm -rf %{buildroot}%{_libdir}/girepository-%{gst_branch}/*.typelib
++Version: 1.16.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: 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
+# 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
+export CFLAGS="%{optflags} \
+ -DTIZEN_FEATURE_QUEUE2_MODIFICATION\
+ -DTIZEN_FEATURE_FILESINK_MODIFICATION\
+ -DTIZEN_FEATURE_MQ_MODIFICATION\
+ -DTIZEN_FEATURE_MQ_MODIFICATION_EXTRA_SIZE_TIME\
+ -DTIZEN_FEATURE_BASEPARSE_MODIFICATION\
+ -DTIZEN_FEATURE_QUEUE_MODIFICATION\
+ -DTIZEN_FEATURE_FAKESINK_MODIFICATION\
+%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"
+
+%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
+
+make %{?_smp_mflags}
+
+%install
+%make_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
++rm -rf %{buildroot}%{_libdir}/girepository-1.0/*.typelib
+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
Description: Streaming media framework
Version: @VERSION@
Requires: glib-2.0, gobject-2.0
- Requires.private: gmodule-no-export-2.0
+ Requires.private: gmodule-no-export-2.0 @UNWIND_REQUIRE@ @DW_REQUIRE@
Libs: -L${libdir} -lgstreamer-@GST_API_VERSION@
-Cflags: -I${includedir}
+Cflags: -I${includedir} @HAVE_TV_PROFILE@
* The opaque #GstFakeSink data structure.
*/
struct _GstFakeSink {
- GstBaseSink element;
+ GstBaseSink element;
- gboolean silent;
- gboolean dump;
- gboolean signal_handoffs;
+ gboolean silent;
+ gboolean dump;
+ gboolean signal_handoffs;
GstFakeSinkStateError state_error;
- gchar *last_message;
- gint num_buffers;
- gint num_buffers_left;
-
+ gchar *last_message;
+ gint num_buffers;
+ gint num_buffers_left;
+#ifdef TIZEN_FEATURE_FAKESINK_MODIFICATION
- gint fps_n;
- gint fps_d;
++ gint fps_n;
++ gint fps_d;
+#endif
};
struct _GstFakeSinkClass {
* This is currently not yet implemented.
* Since we dynamically scale the queue buffer size up to the limits but avoid
* going above the max-size-buffers when we can, we don't really need this
- * aditional extra size. */
+ * additional extra size. */
#define DEFAULT_EXTRA_SIZE_BYTES 10 * 1024 * 1024 /* 10 MB */
#define DEFAULT_EXTRA_SIZE_BUFFERS 5
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION_EXTRA_SIZE_TIME
+#define DEFAULT_EXTRA_SIZE_TIME 10 * GST_SECOND
+#else
#define DEFAULT_EXTRA_SIZE_TIME 3 * GST_SECOND
+#endif
#define DEFAULT_USE_BUFFERING FALSE
#define DEFAULT_LOW_WATERMARK 0.01
gst_single_queue_flush (mq, sq, FALSE, FALSE);
gst_single_queue_start (mq, sq);
-
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+ /* need to reset the buffering data after seeking */
+ GList *tmp;
+ tmp = mq->queues;
+ while (tmp) {
+ GstSingleQueue *q = (GstSingleQueue *) tmp->data;
+ if (q->flushing)
+ goto done;
+ tmp = g_list_next (tmp);
+ }
+ recheck_buffering_status (mq);
+#endif
goto done;
+
case GST_EVENT_SEGMENT:
sq->is_segment_done = FALSE;
sref = gst_event_ref (event);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item);
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
- if (!res || sq->flushing) {
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
++ if (!res || sq->flushing) {
+ gst_multi_queue_item_destroy (item);
- #endif
+ goto out_flushing;
+ }
++#else
+ if (!res || sq->flushing)
+ goto out_flushing;
++#endif
/* it might be that the query has been taken out of the queue
* while we were unlocked. So, we need to check if the last
* handled query is the same one than the one we just
PROP_TEMP_REMOVE,
PROP_RING_BUFFER_MAX_SIZE,
PROP_AVG_IN_RATE,
+ PROP_USE_BITRATE_QUERY,
+ PROP_BITRATE,
+#ifdef TIZEN_FEATURE_RTSPSRC_MODIFICATION
+ PROP_BUFFER_MODE,
+#endif
PROP_LAST
};
"Average input data rate (bytes/s)",
0, G_MAXINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstQueue2:bitrate
+ *
+ * The value used to convert between byte and time values for limiting
+ * 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));
+
+#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;
queue->ring_buffer = NULL;
queue->ring_buffer_max_size = DEFAULT_RING_BUFFER_MAX_SIZE;
+
+ queue->use_bitrate_query = DEFAULT_USE_BITRATE_QUERY;
+
+#ifdef TIZEN_FEATURE_RTSPSRC_MODIFICATION
+ queue->mode = -1;
+#endif
GST_DEBUG_OBJECT (queue,
"initialized queue's not_empty & not_full conditions");
}
queue->starting_segment = NULL;
gst_event_replace (&queue->stream_start_event, NULL);
GST_QUEUE2_MUTEX_UNLOCK (queue);
+ query_downstream_bitrate (queue);
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;
case PROP_RING_BUFFER_MAX_SIZE:
queue->ring_buffer_max_size = g_value_get_uint64 (value);
break;
+ case PROP_USE_BITRATE_QUERY:
+ queue->use_bitrate_query = g_value_get_boolean (value);
+ break;
+#ifdef TIZEN_FEATURE_RTSPSRC_MODIFICATION
+ case PROP_BUFFER_MODE:
+ queue->mode = g_value_get_enum (value);
+ break;
+#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
g_value_set_int64 (value, (gint64) in_rate);
break;
}
+ case PROP_USE_BITRATE_QUERY:
+ g_value_set_boolean (value, queue->use_bitrate_query);
+ break;
+ case PROP_BITRATE:{
+ guint64 bitrate = 0;
+ if (bitrate == 0 && queue->use_tags_bitrate) {
+ if (queue->sink_tags_bitrate > 0)
+ bitrate = queue->sink_tags_bitrate;
+ else if (queue->src_tags_bitrate)
+ bitrate = queue->src_tags_bitrate;
+ }
+ if (bitrate == 0 && queue->use_bitrate_query) {
+ bitrate = queue->downstream_bitrate;
+ }
+ g_value_set_uint64 (value, (guint64) bitrate);
+ break;
+ }
+#ifdef TIZEN_FEATURE_RTSPSRC_MODIFICATION
+ case PROP_BUFFER_MODE:
+ g_value_set_enum (value, queue->mode);
+ break;
+#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;