gst_encoding_profile_get_file_extension
gst_encoding_profile_set_name
gst_encoding_profile_set_description
+gst_encoding_profile_set_enabled
gst_encoding_profile_set_format
gst_encoding_profile_set_preset
gst_encoding_profile_set_preset_name
gst_encoding_profile_set_restriction
gst_encoding_profile_set_presence
gst_encoding_profile_is_equal
+gst_encoding_profile_is_enabled
gst_encoding_profile_get_input_caps
gst_encoding_profile_get_type_nick
<SUBSECTION container>
guint presence;
GstCaps *restriction;
gboolean allow_dynamic_output;
+ gboolean enabled;
};
struct _GstEncodingProfileClass
}
/**
+ * gst_encoding_profile_get_enabled:
+ * @profile: a #GstEncodingProfile
+ *
+ * Returns: Whther @profile is enabled or not
+ */
+gboolean
+gst_encoding_profile_is_enabled (GstEncodingProfile * profile)
+{
+ g_return_val_if_fail (GST_IS_ENCODING_PROFILE (profile), FALSE);
+
+ return profile->enabled;
+}
+
+/**
* gst_encoding_profile_get_restriction:
* @profile: a #GstEncodingProfile
*
}
/**
+ * gst_encoding_profile_set_enabled:
+ * @profile: a #GstEncodingProfile
+ * @enabled: %FALSE to disable #profile, %TRUE to enable it
+ *
+ * Set whether the profile should be used or not.
+ */
+void
+gst_encoding_profile_set_enabled (GstEncodingProfile * profile,
+ gboolean enabled)
+{
+ g_return_if_fail (GST_IS_ENCODING_PROFILE (profile));
+
+ profile->enabled = enabled;
+}
+
+/**
* gst_encoding_profile_set_restriction:
* @profile: a #GstEncodingProfile
* @restriction: (transfer full): the restriction to apply
prof->presence = presence;
prof->preset_name = NULL;
prof->allow_dynamic_output = TRUE;
+ prof->enabled = TRUE;
return prof;
}
const gchar *profilename,
const gchar *category);
+gboolean gst_encoding_profile_is_enabled (GstEncodingProfile *profile);
+void gst_encoding_profile_set_enabled (GstEncodingProfile *profile,
+ gboolean enabled);
/* GstEncodingContainerProfile API */
gboolean gst_encoding_container_profile_add_profile (GstEncodingContainerProfile *container,
GstEncodingProfile *profile);
if (profilename && !strcmp (name, profilename)) {
guint presence = gst_encoding_profile_get_presence (sprof);
+
GST_DEBUG ("Found profile matching the requested name");
+ if (!gst_encoding_profile_is_enabled (sprof)) {
+ GST_INFO_OBJECT (ebin, "%p is disabled, not using it", sprof);
+
+ return NULL;
+ }
+
if (presence == 0
|| presence > stream_profile_used_count (ebin, sprof))
return sprof;
if (G_TYPE_FROM_INSTANCE (sprof) == ptype) {
guint presence = gst_encoding_profile_get_presence (sprof);
GST_DEBUG ("Found a stream profile with the same type");
- if (presence == 0
+ if (!gst_encoding_profile_is_enabled (sprof)) {
+ GST_INFO_OBJECT (ebin, "%p is disabled, not using it", sprof);
+ } else if (presence == 0
|| (presence > stream_profile_used_count (ebin, sprof)))
return sprof;
} else if (caps && ptype == G_TYPE_NONE) {
GST_DEBUG ("Trying stream profile with presence %d",
gst_encoding_profile_get_presence (sprof));
- if (gst_encoding_profile_get_presence (sprof) != 0) {
+ if (gst_encoding_profile_get_presence (sprof) != 0 &&
+ gst_encoding_profile_is_enabled (sprof)) {
if (G_UNLIKELY (_create_stream_group (ebin, sprof, NULL, NULL) == NULL))
goto stream_error;
}