#define GST_ENCODING_TARGET_HEADER "_gstencodingtarget_"
+#define GST_ENCODING_TARGET_DIRECTORY "encoding-profiles"
+#define GST_ENCODING_TARGET_SUFFIX ".gep"
struct _GstEncodingTarget
{
if (category && !validate_name (category))
goto invalid_category;
- lfilename = g_strdup_printf ("%s.gstprofile", name);
+ lfilename = g_strdup_printf ("%s" GST_ENCODING_TARGET_SUFFIX, name);
/* Try from local profiles */
tldir =
- g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", NULL);
+ g_build_filename (g_get_home_dir (), ".gstreamer-" GST_MAJORMINOR,
+ GST_ENCODING_TARGET_DIRECTORY, NULL);
target = gst_encoding_target_subload (tldir, category, lfilename, error);
g_free (tldir);
/* Try from system-wide profiles */
tldir =
g_build_filename (GST_DATADIR, "gstreamer-" GST_MAJORMINOR,
- "encoding-profile", NULL);
+ GST_ENCODING_TARGET_DIRECTORY, NULL);
target = gst_encoding_target_subload (tldir, category, lfilename, error);
g_free (tldir);
}
g_return_val_if_fail (GST_IS_ENCODING_TARGET (target), FALSE);
g_return_val_if_fail (target->category != NULL, FALSE);
- lfilename = g_strdup_printf ("%s.gstprofile", target->name);
+ lfilename = g_strdup_printf ("%s" GST_ENCODING_TARGET_SUFFIX, target->name);
filename =
- g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", target->category, lfilename, NULL);
+ g_build_filename (g_get_home_dir (), ".gstreamer-" GST_MAJORMINOR,
+ GST_ENCODING_TARGET_DIRECTORY, target->category, lfilename, NULL);
g_free (lfilename);
res = gst_encoding_target_save_to (target, filename, error);
gchar *topdir;
/* First try user-local categories */
- topdir = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", NULL);
+ topdir = g_build_filename (g_get_home_dir (), ".gstreamer-" GST_MAJORMINOR,
+ GST_ENCODING_TARGET_DIRECTORY, NULL);
res = get_categories (topdir);
g_free (topdir);
/* Extend with system-wide categories */
topdir = g_build_filename (GST_DATADIR, "gstreamer-" GST_MAJORMINOR,
- "encoding-profile", NULL);
+ GST_ENCODING_TARGET_DIRECTORY, NULL);
tmp1 = get_categories (topdir);
g_free (topdir);
gchar *fullname;
/* Only try files ending with .gstprofile */
- if (!g_str_has_suffix (filename, ".gstprofile"))
+ if (!g_str_has_suffix (filename, GST_ENCODING_TARGET_SUFFIX))
continue;
fullname = g_build_filename (subdir, filename, NULL);
gchar *topdir;
/* Get user-locals */
- topdir = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", NULL);
+ topdir = g_build_filename (g_get_home_dir (), ".gstreamer-" GST_MAJORMINOR,
+ GST_ENCODING_TARGET_DIRECTORY, NULL);
res = get_all_targets (topdir, categoryname);
g_free (topdir);
/* Get system-wide */
topdir = g_build_filename (GST_DATADIR, "gstreamer-" GST_MAJORMINOR,
- "encoding-profile", NULL);
+ GST_ENCODING_TARGET_DIRECTORY, NULL);
tmp1 = get_all_targets (topdir, categoryname);
g_free (topdir);
/* Check we can load it */
profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", "herding", "myponytarget2.gstprofile", NULL);
+ "encoding-profiles", "herding", "myponytarget2.gep", NULL);
GST_DEBUG ("Loading target from '%s'", profile_file_name);
loaded = gst_encoding_target_load_from (profile_file_name, NULL);
fail_unless (loaded != NULL);
/* Test loading using fully specified path */
profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", "herding", "myponytarget.gstprofile", NULL);
+ "encoding-profiles", "herding", "myponytarget.gep", NULL);
GST_DEBUG ("Loading target from '%s'", profile_file_name);
target = gst_encoding_target_load_from (profile_file_name, NULL);
gchar *profile_file_name;
profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", "herding", "myponytarget.gstprofile", NULL);
+ "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",
- "encoding-profile", "herding", "myponytarget2.gstprofile", NULL);
+ "encoding-profiles", "herding", "myponytarget2.gep", NULL);
g_unlink (profile_file_name);
g_free (profile_file_name);
}
profile_dir =
g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", "herding", NULL);
+ "encoding-profiles", "herding", NULL);
profile_file_name =
g_build_filename (g_get_home_dir (), ".gstreamer-0.10",
- "encoding-profile", "herding", "myponytarget.gstprofile", NULL);
+ "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,
strlen (profile_string), &error))