Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / tests / check / libs / profile.c
index c000208..629b5cd 100644 (file)
@@ -241,8 +241,7 @@ create_saveload_target (const gchar * targetname)
 
   caps = gst_caps_from_string ("video/x-glitter,sparkling=True");
   caps2 =
-      gst_caps_from_string
-      ("video/x-raw-yuv,width=640,height=480,framerate=15/1");
+      gst_caps_from_string ("video/x-raw,width=640,height=480,framerate=15/1");
   sprof = (GstEncodingProfile *)
       gst_encoding_video_profile_new (caps, "seriously glittery", caps2, 0);
   gst_encoding_video_profile_set_variableframerate ((GstEncodingVideoProfile *)
@@ -291,7 +290,8 @@ GST_START_TEST (test_saving_profile)
   fail_unless (gst_encoding_target_save (orig, NULL));
 
   /* Check we can load it */
-  profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
+  profile_file_name =
+      g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
       "encoding-profiles", "herding", "myponytarget2.gep", NULL);
   GST_DEBUG ("Loading target from '%s'", profile_file_name);
   loaded = gst_encoding_target_load_from_file (profile_file_name, NULL);
@@ -377,8 +377,7 @@ test_individual_target (GstEncodingTarget * target)
   GST_DEBUG ("Checking the container profile has the video//x-glitter stream");
   tmpcaps = gst_caps_from_string ("video/x-glitter,sparkling=True");
   tmpcaps2 =
-      gst_caps_from_string
-      ("video/x-raw-yuv,width=640,height=480,framerate=15/1");
+      gst_caps_from_string ("video/x-raw,width=640,height=480,framerate=15/1");
   sprof2 = (GstEncodingProfile *)
       gst_encoding_video_profile_new (tmpcaps, "seriously glittery", tmpcaps2,
       0);
@@ -398,7 +397,7 @@ GST_START_TEST (test_loading_profile)
   GstEncodingProfile *profile;
   GstCaps *tmpcaps;
   GValue strvalue = { 0, };
-  GValue miniobjectvalue = { 0, };
+  GValue objectvalue = { 0, };
 
   gst_debug_set_threshold_for_name ("default", GST_LEVEL_NONE);
 
@@ -415,7 +414,8 @@ GST_START_TEST (test_loading_profile)
   gst_encoding_target_unref (target);
 
   /* Test loading using fully specified path */
-  profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
+  profile_file_name =
+      g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
       "encoding-profiles", "herding", "myponytarget.gep", NULL);
 
   GST_DEBUG ("Loading target from '%s'", profile_file_name);
@@ -446,13 +446,13 @@ GST_START_TEST (test_loading_profile)
 
   /* For my next trick, I will need the assistance of a GValue */
   g_value_init (&strvalue, G_TYPE_STRING);
-  g_value_init (&miniobjectvalue, GST_TYPE_ENCODING_PROFILE);
+  g_value_init (&objectvalue, GST_TYPE_ENCODING_PROFILE);
   g_value_set_static_string (&strvalue, "myponytarget/pony");
-  fail_unless (g_value_transform (&strvalue, &miniobjectvalue));
-  profile = (GstEncodingProfile *) gst_value_dup_mini_object (&miniobjectvalue);
+  fail_unless (g_value_transform (&strvalue, &objectvalue));
+  profile = (GstEncodingProfile *) g_value_dup_object (&objectvalue);
   fail_if (profile == NULL);
   g_value_unset (&strvalue);
-  g_value_unset (&miniobjectvalue);
+  g_value_unset (&objectvalue);
   tmpcaps = gst_caps_from_string ("animal/x-pony");
   CHECK_PROFILE (profile, "pony", "I don't want a description !", tmpcaps, NULL,
       0, 0);
@@ -493,7 +493,7 @@ GST_START_TEST (test_target_list)
   /* If tmp is NULL, it means we iterated the whole list without finding
    * our target */
   fail_if (tmp == NULL);
-  g_list_foreach (targets, (GFunc) gst_mini_object_unref, NULL);
+  g_list_foreach (targets, (GFunc) g_object_unref, NULL);
   g_list_free (targets);
 
   /* Try getting all available targets without a specified category */
@@ -507,7 +507,7 @@ GST_START_TEST (test_target_list)
   /* If tmp is NULL, it means we iterated the whole list without finding
    * our target */
   fail_if (tmp == NULL);
-  g_list_foreach (targets, (GFunc) gst_mini_object_unref, NULL);
+  g_list_foreach (targets, (GFunc) g_object_unref, NULL);
   g_list_free (targets);
 }
 
@@ -538,7 +538,7 @@ parent=pony\n\
 type=video\n\
 preset=seriously glittery\n\
 format=video/x-glitter,sparkling=True\n\
-restriction=video/x-raw-yuv,width=640,height=480,framerate=15/1\n\
+restriction=video/x-raw,width=640,height=480,framerate=15/1\n\
 presence=0\n\
 variableframerate=true\n\
 ";
@@ -548,11 +548,13 @@ remove_profile_file (void)
 {
   gchar *profile_file_name;
 
-  profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
+  profile_file_name =
+      g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
       "encoding-profiles", "herding", "myponytarget.gep", NULL);
   g_unlink (profile_file_name);
   g_free (profile_file_name);
-  profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
+  profile_file_name =
+      g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
       "encoding-profiles", "herding", "myponytarget2.gep", NULL);
   g_unlink (profile_file_name);
   g_free (profile_file_name);
@@ -566,10 +568,10 @@ create_profile_file (void)
   GError *error = NULL;
 
   profile_dir =
-      g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
+      g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
       "encoding-profiles", "herding", NULL);
   profile_file_name =
-      g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
+      g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
       "encoding-profiles", "herding", "myponytarget.gep", NULL);
   g_mkdir_with_parents (profile_dir, S_IRUSR | S_IWUSR | S_IXUSR);
   if (!g_file_set_contents (profile_file_name, profile_string,
@@ -601,7 +603,7 @@ profile_suite (void)
   gchar *gst_dir;
 
   /* cehck if we can create profiles */
-  gst_dir = g_build_filename (g_get_home_dir (), ".gstreamer-0.10", NULL);
+  gst_dir = g_build_filename (g_get_user_data_dir (), "gstreamer-0.11", NULL);
   can_write = (g_access (gst_dir, R_OK | W_OK | X_OK) == 0);
   g_free (gst_dir);