examples: fix compilation when WITH_AUTH is defined
authorAleix Conchillo Flaque <aleix@oblong.com>
Tue, 15 Oct 2013 23:37:34 +0000 (16:37 -0700)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 30 Oct 2013 18:12:10 +0000 (19:12 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=710228

examples/.gitignore
examples/test-video.c

index 6912d88..82e4c5e 100644 (file)
@@ -1,3 +1,4 @@
+test-appsrc
 test-launch
 test-mp4
 test-ogg
index 4a8e205..9bfb9d6 100644 (file)
@@ -25,7 +25,8 @@
  * user/password as the password */
 #undef WITH_AUTH
 
-/* define this if you want the server to use TLS */
+/* define this if you want the server to use TLS (it will also need WITH_AUTH
+ * to be defined) */
 #undef WITH_TLS
 
 /* this timeout is periodically run to clean up the expired sessions from the
@@ -53,7 +54,6 @@ main (int argc, char *argv[])
 #ifdef WITH_AUTH
   GstRTSPAuth *auth;
   GstRTSPToken *token;
-  GstStructure *s;
   gchar *basic;
   GstRTSPPermissions *permissions;
 #endif
@@ -101,9 +101,9 @@ main (int argc, char *argv[])
 #endif
 
   /* make user token */
-  token = gst_rtsp_token_new ();
-  s = gst_rtsp_token_writable_structure (token);
-  gst_structure_set (s, "media.factory.role", G_TYPE_STRING, "user", NULL);
+  token =
+      gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING,
+      "user", NULL);
   basic = gst_rtsp_auth_make_basic ("user", "password");
   gst_rtsp_auth_add_basic (auth, basic, token);
   g_free (basic);
@@ -118,7 +118,7 @@ main (int argc, char *argv[])
   mounts = gst_rtsp_server_get_mount_points (server);
 
   /* make a media factory for a test stream. The default media factory can use
-   * gst-launch syntax to create pipelines. 
+   * gst-launch syntax to create pipelines.
    * any launch line works as long as it contains elements named pay%d. Each
    * element with pay%d names will be a stream */
   factory = gst_rtsp_media_factory_new ();
@@ -131,9 +131,8 @@ main (int argc, char *argv[])
   /* add permissions for the user media role */
   permissions = gst_rtsp_permissions_new ();
   gst_rtsp_permissions_add_role (permissions, "user",
-      gst_structure_new ("user",
-          "media.factory.access", G_TYPE_BOOLEAN, TRUE,
-          "media.factory.construct", G_TYPE_BOOLEAN, TRUE, NULL));
+      GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE,
+      GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, TRUE, NULL);
   gst_rtsp_media_factory_set_permissions (factory, permissions);
   gst_rtsp_permissions_unref (permissions);
 #endif