summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xartigas@fluendo.com>2013-05-13 08:36:29 (GMT)
committerXavi Artigas <xartigas@fluendo.com>2013-05-13 08:36:29 (GMT)
commit4bd417f3398d2647b9a7598631e21065685e9463 (patch)
treebac8d228ae06dc2bc9c82596ac0940f2454e6820
parent217845f35d7379ba5bb8042bc8f8e86d12b8c8c5 (diff)
downloadgst-sdk-tutorials-4bd417f3398d2647b9a7598631e21065685e9463.tar.gz
gst-sdk-tutorials-4bd417f3398d2647b9a7598631e21065685e9463.tar.xz
Adapt tutorial code to new xcode ios templates
-rw-r--r--gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.c15
-rw-r--r--gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.h5
-rw-r--r--gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.c17
-rw-r--r--gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.h5
-rw-r--r--gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.c17
-rw-r--r--gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.h5
-rw-r--r--gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.c17
-rw-r--r--gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.h5
8 files changed, 76 insertions, 10 deletions
diff --git a/gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.c b/gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.c
index 9ece9ab..e60564a 100644
--- a/gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.c
+++ b/gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.c
@@ -496,7 +496,10 @@ GST_PLUGIN_STATIC_DECLARE(sdp);
void
gst_ios_init (void)
{
- gst_init (NULL, NULL);
+ GstPluginFeature *plugin;
+ GstRegistry *reg;
+
+ gst_init (NULL, NULL);
#if defined(GST_IOS_PLUGIN_COREELEMENTS) || defined(GST_IOS_PLUGINS_CORE)
GST_PLUGIN_STATIC_REGISTER(coreelements);
@@ -990,4 +993,14 @@ gst_ios_init (void)
#if defined(GST_IOS_PLUGIN_SDP) || defined(GST_IOS_PLUGINS_NET)
GST_PLUGIN_STATIC_REGISTER(sdp);
#endif
+
+ /* Lower the ranks of filesrc and giosrc so iosavassetsrc is
+ * tried first in gst_element_make_from_uri() for file:// */
+ reg = gst_registry_get_default();
+ plugin = gst_registry_lookup_feature(reg, "filesrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY);
+ plugin = gst_registry_lookup_feature(reg, "giosrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY-1);
}
diff --git a/gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.h b/gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.h
index ce2fef0..b47fa66 100644
--- a/gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.h
+++ b/gst-sdk/tutorials/xcode iOS/Tutorial 1/gst_ios_init.h
@@ -3,9 +3,12 @@
#include <gst/gst.h>
+G_BEGIN_DECLS
+
/* Uncomment each line to enable the plugin categories that your application needs.
* You can also enable individual plugins. See gst_ios_init.c to see their names
*/
+
#define GST_IOS_PLUGINS_CORE
//#define GST_IOS_PLUGINS_CAPTURE
//#define GST_IOS_PLUGINS_CODECS_RESTRICTED
@@ -22,4 +25,6 @@
void gst_ios_init ();
+G_END_DECLS
+
#endif
diff --git a/gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.c b/gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.c
index cffa57e..e60564a 100644
--- a/gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.c
+++ b/gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.c
@@ -496,9 +496,10 @@ GST_PLUGIN_STATIC_DECLARE(sdp);
void
gst_ios_init (void)
{
- gst_init (NULL, NULL);
- gst_debug_set_colored(FALSE);
- gst_debug_set_default_threshold(GST_LEVEL_WARNING);
+ GstPluginFeature *plugin;
+ GstRegistry *reg;
+
+ gst_init (NULL, NULL);
#if defined(GST_IOS_PLUGIN_COREELEMENTS) || defined(GST_IOS_PLUGINS_CORE)
GST_PLUGIN_STATIC_REGISTER(coreelements);
@@ -992,4 +993,14 @@ gst_ios_init (void)
#if defined(GST_IOS_PLUGIN_SDP) || defined(GST_IOS_PLUGINS_NET)
GST_PLUGIN_STATIC_REGISTER(sdp);
#endif
+
+ /* Lower the ranks of filesrc and giosrc so iosavassetsrc is
+ * tried first in gst_element_make_from_uri() for file:// */
+ reg = gst_registry_get_default();
+ plugin = gst_registry_lookup_feature(reg, "filesrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY);
+ plugin = gst_registry_lookup_feature(reg, "giosrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY-1);
}
diff --git a/gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.h b/gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.h
index 7b8e013..eefb194 100644
--- a/gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.h
+++ b/gst-sdk/tutorials/xcode iOS/Tutorial 2/gst_ios_init.h
@@ -3,9 +3,12 @@
#include <gst/gst.h>
+G_BEGIN_DECLS
+
/* Uncomment each line to enable the plugin categories that your application needs.
* You can also enable individual plugins. See gst_ios_init.c to see their names
*/
+
#define GST_IOS_PLUGINS_CORE
//#define GST_IOS_PLUGINS_CAPTURE
//#define GST_IOS_PLUGINS_CODECS_RESTRICTED
@@ -22,4 +25,6 @@
void gst_ios_init ();
+G_END_DECLS
+
#endif
diff --git a/gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.c b/gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.c
index cffa57e..e60564a 100644
--- a/gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.c
+++ b/gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.c
@@ -496,9 +496,10 @@ GST_PLUGIN_STATIC_DECLARE(sdp);
void
gst_ios_init (void)
{
- gst_init (NULL, NULL);
- gst_debug_set_colored(FALSE);
- gst_debug_set_default_threshold(GST_LEVEL_WARNING);
+ GstPluginFeature *plugin;
+ GstRegistry *reg;
+
+ gst_init (NULL, NULL);
#if defined(GST_IOS_PLUGIN_COREELEMENTS) || defined(GST_IOS_PLUGINS_CORE)
GST_PLUGIN_STATIC_REGISTER(coreelements);
@@ -992,4 +993,14 @@ gst_ios_init (void)
#if defined(GST_IOS_PLUGIN_SDP) || defined(GST_IOS_PLUGINS_NET)
GST_PLUGIN_STATIC_REGISTER(sdp);
#endif
+
+ /* Lower the ranks of filesrc and giosrc so iosavassetsrc is
+ * tried first in gst_element_make_from_uri() for file:// */
+ reg = gst_registry_get_default();
+ plugin = gst_registry_lookup_feature(reg, "filesrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY);
+ plugin = gst_registry_lookup_feature(reg, "giosrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY-1);
}
diff --git a/gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.h b/gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.h
index d60c337..3e3406e 100644
--- a/gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.h
+++ b/gst-sdk/tutorials/xcode iOS/Tutorial 3/gst_ios_init.h
@@ -3,9 +3,12 @@
#include <gst/gst.h>
+G_BEGIN_DECLS
+
/* Uncomment each line to enable the plugin categories that your application needs.
* You can also enable individual plugins. See gst_ios_init.c to see their names
*/
+
#define GST_IOS_PLUGINS_CORE
//#define GST_IOS_PLUGINS_CAPTURE
//#define GST_IOS_PLUGINS_CODECS_RESTRICTED
@@ -22,4 +25,6 @@
void gst_ios_init ();
+G_END_DECLS
+
#endif
diff --git a/gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.c b/gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.c
index cffa57e..e60564a 100644
--- a/gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.c
+++ b/gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.c
@@ -496,9 +496,10 @@ GST_PLUGIN_STATIC_DECLARE(sdp);
void
gst_ios_init (void)
{
- gst_init (NULL, NULL);
- gst_debug_set_colored(FALSE);
- gst_debug_set_default_threshold(GST_LEVEL_WARNING);
+ GstPluginFeature *plugin;
+ GstRegistry *reg;
+
+ gst_init (NULL, NULL);
#if defined(GST_IOS_PLUGIN_COREELEMENTS) || defined(GST_IOS_PLUGINS_CORE)
GST_PLUGIN_STATIC_REGISTER(coreelements);
@@ -992,4 +993,14 @@ gst_ios_init (void)
#if defined(GST_IOS_PLUGIN_SDP) || defined(GST_IOS_PLUGINS_NET)
GST_PLUGIN_STATIC_REGISTER(sdp);
#endif
+
+ /* Lower the ranks of filesrc and giosrc so iosavassetsrc is
+ * tried first in gst_element_make_from_uri() for file:// */
+ reg = gst_registry_get_default();
+ plugin = gst_registry_lookup_feature(reg, "filesrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY);
+ plugin = gst_registry_lookup_feature(reg, "giosrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY-1);
}
diff --git a/gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.h b/gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.h
index d60c337..3e3406e 100644
--- a/gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.h
+++ b/gst-sdk/tutorials/xcode iOS/Tutorial 4/gst_ios_init.h
@@ -3,9 +3,12 @@
#include <gst/gst.h>
+G_BEGIN_DECLS
+
/* Uncomment each line to enable the plugin categories that your application needs.
* You can also enable individual plugins. See gst_ios_init.c to see their names
*/
+
#define GST_IOS_PLUGINS_CORE
//#define GST_IOS_PLUGINS_CAPTURE
//#define GST_IOS_PLUGINS_CODECS_RESTRICTED
@@ -22,4 +25,6 @@
void gst_ios_init ();
+G_END_DECLS
+
#endif