summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParthasarathi Susarla <partha.susarla@collabora.co.uk>2011-01-19 12:03:40 +0530
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2011-01-21 20:15:16 +0200
commit5735728f2608d2e055a9417bd775c4353b3496c3 (patch)
tree6e41572f7003e1afb2fe4676e98df4c4657a8b42
parentb1c0653b1cfff963e90bfbbbb262a4e75f7e0b30 (diff)
downloadgupnp-dlna-5735728f2608d2e055a9417bd775c4353b3496c3.tar.gz
libgupnp-dlna: Add encoding_profile prop to GUPnPDLNAProfile
Add "encoding_profile" property to GUPnPDLNAProfile. This makes for nicer code in bindings.
-rw-r--r--libgupnp-dlna/gupnp-dlna-load.c9
-rw-r--r--libgupnp-dlna/gupnp-dlna-profile.c21
-rw-r--r--libgupnp-dlna/gupnp-dlna-profiles.c25
3 files changed, 37 insertions, 18 deletions
diff --git a/libgupnp-dlna/gupnp-dlna-load.c b/libgupnp-dlna/gupnp-dlna-load.c
index d9203a2..126e591 100644
--- a/libgupnp-dlna/gupnp-dlna-load.c
+++ b/libgupnp-dlna/gupnp-dlna-load.c
@@ -630,9 +630,10 @@ process_dlna_profile (xmlTextReaderPtr reader,
/* Inherit from base profile, if it exists*/
if (base) {
- const GstCaps *video_caps = gupnp_dlna_profile_get_video_caps (base);
- const GstCaps *audio_caps = gupnp_dlna_profile_get_audio_caps (base);
-
+ const GstCaps *video_caps =
+ gupnp_dlna_profile_get_video_caps (base);
+ const GstCaps *audio_caps =
+ gupnp_dlna_profile_get_audio_caps (base);
if (GST_IS_CAPS (video_caps))
gst_caps_merge (temp_video,
@@ -647,7 +648,7 @@ process_dlna_profile (xmlTextReaderPtr reader,
/* The merged caps will be our new GUPnPDLNAProfile */
if (GST_IS_CAPS (temp_container))
gupnp_dlna_profile_set_container_caps (profile, temp_container);
- if (GST_IS_CAPS (temp_video))
+ if (GST_IS_CAPS (temp_video))
gupnp_dlna_profile_set_video_caps (profile, temp_video);
if (GST_IS_CAPS (temp_audio))
gupnp_dlna_profile_set_audio_caps (profile, temp_audio);
diff --git a/libgupnp-dlna/gupnp-dlna-profile.c b/libgupnp-dlna/gupnp-dlna-profile.c
index 9cb4f9c..3d1df94 100644
--- a/libgupnp-dlna/gupnp-dlna-profile.c
+++ b/libgupnp-dlna/gupnp-dlna-profile.c
@@ -55,6 +55,7 @@ enum {
PROP_0,
PROP_DLNA_NAME,
PROP_DLNA_MIME,
+ PROP_ENCODING_PROFILE,
PROP_DLNA_EXTENDED,
};
@@ -76,6 +77,11 @@ gupnp_dlna_profile_get_property (GObject *object,
g_value_set_string (value, priv->mime);
break;
+ case PROP_ENCODING_PROFILE:
+ gst_value_set_mini_object (value,
+ GST_MINI_OBJECT (priv->enc_profile));
+ break;
+
case PROP_DLNA_EXTENDED:
g_value_set_boolean (value, priv->extended);
break;
@@ -162,6 +168,17 @@ gupnp_dlna_profile_class_init (GUPnPDLNAProfileClass *klass)
G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (object_class, PROP_DLNA_MIME, pspec);
+ pspec = gst_param_spec_mini_object ("encoding-profile",
+ "Encoding Profile for the "
+ "DLNA Profile",
+ "GstEncodingProfile object"
+ "corresponding to the DLNA profile",
+ GST_TYPE_ENCODING_PROFILE,
+ G_PARAM_READABLE);
+ g_object_class_install_property (object_class,
+ PROP_ENCODING_PROFILE,
+ pspec);
+
pspec = g_param_spec_boolean ("extended",
"Extended mode property",
"Indicates that this profile is not "
@@ -312,8 +329,8 @@ gupnp_dlna_profile_get_encoding_profile (GUPnPDLNAProfile *self)
} else {
/* create an encoding-profile */
if (GST_IS_CAPS (priv->container_caps)) {
- priv->enc_profile =
- (GstEncodingProfile *)gst_encoding_container_profile_new
+ priv->enc_profile = (GstEncodingProfile *)
+ gst_encoding_container_profile_new
(priv->name,
priv->mime,
priv->container_caps,
diff --git a/libgupnp-dlna/gupnp-dlna-profiles.c b/libgupnp-dlna/gupnp-dlna-profiles.c
index 027982a..aca6f53 100644
--- a/libgupnp-dlna/gupnp-dlna-profiles.c
+++ b/libgupnp-dlna/gupnp-dlna-profiles.c
@@ -76,13 +76,13 @@ do { \
static gboolean
is_video_profile (const GstEncodingProfile *profile)
{
- const GList *i;
+ const GList *i, *profiles_list;
if (GST_IS_ENCODING_CONTAINER_PROFILE (profile)) {
- for (i = gst_encoding_container_profile_get_profiles
- (GST_ENCODING_CONTAINER_PROFILE (profile));
- i;
- i = i->next)
+ profiles_list = gst_encoding_container_profile_get_profiles
+ (GST_ENCODING_CONTAINER_PROFILE (profile));
+
+ for (i = profiles_list ; i; i = i->next)
if (GST_IS_ENCODING_VIDEO_PROFILE (i->data))
return TRUE;
}
@@ -136,7 +136,8 @@ structure_is_subset (const GstStructure *st1, const GstStructure *st2)
* restrictions)
*/
static gboolean
-caps_can_intersect_and_is_subset (GstCaps *stream_caps, const GstCaps *profile_caps)
+caps_can_intersect_and_is_subset (GstCaps *stream_caps,
+ const GstCaps *profile_caps)
{
int i;
GstStructure *stream_st, *profile_st;
@@ -159,7 +160,7 @@ match_profile (GstEncodingProfile *profile,
GstCaps *caps,
GType type)
{
- const GList *i;
+ const GList *i, *profiles_list;
const gchar *name;
/* Profiles with an empty name are used only for inheritance and should
@@ -168,10 +169,10 @@ match_profile (GstEncodingProfile *profile,
if (name[0] == '\0')
return FALSE;
- for (i = gst_encoding_container_profile_get_profiles
- (GST_ENCODING_CONTAINER_PROFILE (profile));
- i;
- i = i->next){
+ profiles_list = gst_encoding_container_profile_get_profiles
+ (GST_ENCODING_CONTAINER_PROFILE (profile));
+
+ for (i = profiles_list; i; i = i->next){
GstEncodingProfile *enc_profile = GST_ENCODING_PROFILE
(i->data);
const GstCaps *format = gst_encoding_profile_get_format
@@ -371,7 +372,7 @@ caps_from_video_stream_info (GstDiscovererStreamInfo *info)
guint bitrate;
if (gst_tag_list_get_uint (stream_tag_list, "bitrate", &bitrate))
gst_caps_set_simple
- (caps, "bitrate", G_TYPE_INT, (int) bitrate, NULL);
+ (caps, "bitrate", G_TYPE_INT, (int) bitrate, NULL);
if (gst_tag_list_get_uint (stream_tag_list,
"maximum-bitrate",