Skip to content

Commit

Permalink
media-types: add a helper for getting the encoder caps for a profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Matthew committed Jul 27, 2016
1 parent 7de6cd5 commit 000666e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/rb-gst-media-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -488,6 +487,22 @@ rb_gst_encoding_profile_get_encoder (GstEncodingProfile *profile)
return gst_element_factory_create (factory, NULL);
}

/**
* 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
Expand Down
1 change: 1 addition & 0 deletions lib/rb-gst-media-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 000666e

Please sign in to comment.