[rhythmbox] media-types: add a helper for getting the encoder caps for a profile
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] media-types: add a helper for getting the encoder caps for a profile
- Date: Wed, 27 Jul 2016 12:25:50 +0000 (UTC)
commit 000666ed43a9bed8e1c70ca8fbade11e7b260b0f
Author: Jonathan Matthew <jonathan d14n org>
Date: Wed Jul 27 22:19:49 2016 +1000
media-types: add a helper for getting the encoder caps for a profile
lib/rb-gst-media-types.c | 17 ++++++++++++++++-
lib/rb-gst-media-types.h | 1 +
2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/lib/rb-gst-media-types.c b/lib/rb-gst-media-types.c
index 3e00554..36cec8d 100644
--- a/lib/rb-gst-media-types.c
+++ b/lib/rb-gst-media-types.c
@@ -379,7 +379,6 @@ get_audio_encoder_factory (GstEncodingProfile *profile)
if (fl != NULL) {
f = gst_object_ref (fl->data);
} else {
- g_warning ("no encoder factory for profile %s", gst_encoding_profile_get_name (profile));
f = NULL;
}
gst_plugin_feature_list_free (l);
@@ -489,6 +488,22 @@ rb_gst_encoding_profile_get_encoder (GstEncodingProfile *profile)
}
/**
+ * rb_gst_encoding_profile_get_encoder_caps:
+ * @profile: a #GstEncodingProfile
+ *
+ * Return value: (transfer full): output caps for the encoder
+ */
+GstCaps *
+rb_gst_encoding_profile_get_encoder_caps (GstEncodingProfile *profile)
+{
+ GstEncodingProfile *p = get_audio_encoding_profile (profile);
+ if (p != NULL)
+ return gst_encoding_profile_get_format (p);
+
+ return NULL;
+}
+
+/**
* rb_gst_encoding_profile_get_presets:
* @profile: profile to return presets for
*
diff --git a/lib/rb-gst-media-types.h b/lib/rb-gst-media-types.h
index 56e4380..439b49a 100644
--- a/lib/rb-gst-media-types.h
+++ b/lib/rb-gst-media-types.h
@@ -80,6 +80,7 @@ void rb_gst_encoding_profile_set_preset (GstEncodingProfile *profile, const cha
gboolean rb_gst_encoder_set_encoding_style (GstElement *element, const char *style);
GstElement * rb_gst_encoding_profile_get_encoder (GstEncodingProfile *profile);
+GstCaps * rb_gst_encoding_profile_get_encoder_caps (GstEncodingProfile *profile);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]