[rygel-gst-0-10-media-engine] Clean up of transcoders code.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel-gst-0-10-media-engine] Clean up of transcoders code.
- Date: Tue, 8 Jan 2013 15:34:17 +0000 (UTC)
commit b36fd3eb1c6056eabf3ef4f3e15b831d88cc0fae
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Tue Jan 8 16:31:02 2013 +0100
Clean up of transcoders code.
Whitespace fixes, _construct functions removal, data hiding and
warnings elimination.
configure.ac | 2 +-
src/rygel-aac-transcoder.c | 21 +++---
src/rygel-aac-transcoder.h | 4 +-
src/rygel-audio-transcoder.c | 143 +++++++++++++++++++++++++---------------
src/rygel-audio-transcoder.h | 14 +---
src/rygel-avc-transcoder.c | 26 ++++----
src/rygel-gst-data-source.h | 13 +++-
src/rygel-gst-media-engine.c | 8 +-
src/rygel-gst-transcoder.c | 114 ++++++++++++++------------------
src/rygel-gst-transcoder.h | 18 ++++--
src/rygel-gst-utils.h | 1 -
src/rygel-l16-transcoder.c | 61 +++++++-----------
src/rygel-mp2ts-transcoder.c | 148 +++++++++++++++++++++++++++++++-----------
src/rygel-mp2ts-transcoder.h | 9 ++-
src/rygel-mp3-transcoder.c | 20 +++---
src/rygel-video-transcoder.c | 108 +++++++++++++++++++++----------
src/rygel-video-transcoder.h | 2 -
src/rygel-wmv-transcoder.c | 23 ++++---
18 files changed, 434 insertions(+), 301 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4a553c0..d2ff8d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@ fi
dnl Gettext
GETTEXT_PACKAGE=rygel-gst-0-10-media-engine
AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"],
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"],
[Define the gettext package to be used])
AM_GLIB_GNU_GETTEXT
diff --git a/src/rygel-aac-transcoder.c b/src/rygel-aac-transcoder.c
index 9b486d4..ae0bc9b 100644
--- a/src/rygel-aac-transcoder.c
+++ b/src/rygel-aac-transcoder.c
@@ -27,18 +27,19 @@
G_DEFINE_TYPE (RygelAACTranscoder, rygel_aac_transcoder, RYGEL_TYPE_AUDIO_TRANSCODER)
#define RYGEL_AAC_TRANSCODER_BITRATE 256
-#define RYGEL_AAC_TRANSCODER_CODEC "audio/mpeg,mpegversion=4," "stream-format=adts,rate=44100,base-profile=lc"
-
-RygelAACTranscoder*
-rygel_aac_transcoder_construct (GType object_type) {
- RygelAACTranscoder *self = RYGEL_AAC_TRANSCODER (rygel_audio_transcoder_construct (object_type, "audio/vnd.dlna.adts", "AAC_ADTS_320", RYGEL_AAC_TRANSCODER_BITRATE, NULL, RYGEL_AAC_TRANSCODER_CODEC, "adts"));
- rygel_gst_transcoder_set_preset (RYGEL_GST_TRANSCODER (self), "Rygel AAC_ADTS_320 preset");
- return self;
-}
+#define RYGEL_AAC_TRANSCODER_CODEC "audio/mpeg,mpegversion=4,stream-format=adts,rate=44100,base-profile=lc"
RygelAACTranscoder*
rygel_aac_transcoder_new (void) {
- return rygel_aac_transcoder_construct (RYGEL_TYPE_AAC_TRANSCODER);
+ return RYGEL_AAC_TRANSCODER (g_object_new (RYGEL_TYPE_AAC_TRANSCODER,
+ "mime-type", "audio/vnd.dlna.adts",
+ "dlna-profile", "AAC_ADTS_320",
+ "extension", "adts",
+ "preset", "Rygel AAC_ADTS_320 preset",
+ "audio-bitrate", RYGEL_AAC_TRANSCODER_BITRATE,
+ "audio-caps", RYGEL_AAC_TRANSCODER_CODEC,
+ /* No "container-caps" here. */
+ NULL));
}
static void
@@ -47,5 +48,5 @@ rygel_aac_transcoder_class_init (RygelAACTranscoderClass *klass) {
}
static void
-rygel_aac_transcoder_init (RygelAACTranscoder *self) {
+rygel_aac_transcoder_init (RygelAACTranscoder *self G_GNUC_UNUSED) {
}
diff --git a/src/rygel-aac-transcoder.h b/src/rygel-aac-transcoder.h
index 0ae3075..3625d64 100644
--- a/src/rygel-aac-transcoder.h
+++ b/src/rygel-aac-transcoder.h
@@ -56,9 +56,7 @@ struct _RygelAACTranscoderClass {
GType rygel_aac_transcoder_get_type (void) G_GNUC_CONST;
-RygelAACTranscoder* rygel_aac_transcoder_new (void);
-
-void rygel_gst_transcoder_set_preset (RygelGstTranscoder* self, const gchar *value);
+RygelAACTranscoder *rygel_aac_transcoder_new (void);
G_END_DECLS
diff --git a/src/rygel-audio-transcoder.c b/src/rygel-audio-transcoder.c
index 4f0cd4a..18eb43b 100644
--- a/src/rygel-audio-transcoder.c
+++ b/src/rygel-audio-transcoder.c
@@ -30,48 +30,22 @@
G_DEFINE_TYPE (RygelAudioTranscoder, rygel_audio_transcoder, RYGEL_TYPE_GST_TRANSCODER)
-static void rygel_audio_transcoder_finalize (GObject* obj);
-
-RygelAudioTranscoder*
-rygel_audio_transcoder_construct (GType object_type, const gchar *content_type, gint audio_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *extension) {
- RygelAudioTranscoder *self = NULL;
-
- g_return_val_if_fail (content_type != NULL, NULL);
- g_return_val_if_fail (audio_codec_caps != NULL, NULL);
- g_return_val_if_fail (extension != NULL, NULL);
-
- self = RYGEL_AUDIO_TRANSCODER (rygel_gst_transcoder_construct (object_type, content_type, RYGEL_AUDIO_ITEM_UPNP_CLASS, extension));
- self->audio_bitrate = audio_bitrate;
- self->container_format = container_caps;
- self->audio_codec_format = audio_codec_caps;
+struct _RygelAudioTranscoderPrivate {
+ gint audio_bitrate;
+ GstCaps* container_format;
+ GstCaps* audio_codec_format;
+};
+
+enum {
+ RYGEL_AUDIO_TRANSCODER_DUMMY_PROPERTY,
+ RYGEL_AUDIO_TRANSCODER_AUDIO_BITRATE,
+ RYGEL_AUDIO_TRANSCODER_AUDIO_CAPS,
+ RYGEL_AUDIO_TRANSCODER_CONTAINER_CAPS
+};
- return self;
-}
-
-RygelAudioTranscoder*
-rygel_audio_transcoder_new (const gchar *content_type, gint audio_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *extension) {
- return rygel_audio_transcoder_construct (RYGEL_TYPE_AUDIO_TRANSCODER, content_type, audio_bitrate, container_caps, audio_codec_caps, extension);
-}
-
-RygelAudioTranscoder*
-rygel_audio_transcoder_construct_with_class (GType object_type, const gchar *content_type, const gchar *upnp_class, gint audio_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *extension) {
- RygelAudioTranscoder *self = NULL;
-
- g_return_val_if_fail (content_type != NULL, NULL);
- g_return_val_if_fail (upnp_class != NULL, NULL);
- g_return_val_if_fail (audio_codec_caps != NULL, NULL);
- g_return_val_if_fail (extension != NULL, NULL);
-
- self = RYGEL_AUDIO_TRANSCODER (rygel_gst_transcoder_construct (object_type, content_type, upnp_class, extension));
- self->audio_bitrate = audio_bitrate;
- self->container_format = container_caps;
- self->audio_codec_format = audio_codec_caps;
-}
-
-RygelAudioTranscoder*
-rygel_audio_transcoder_new_with_class (const gchar *content_type, const gchar *upnp_class, gint audio_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *extension) {
- return rygel_audio_transcoder_construct_with_class (RYGEL_TYPE_AUDIO_TRANSCODER, content_type, upnp_class, audio_bitrate, container_caps, audio_codec_caps, extension);
-}
+static void rygel_audio_transcoder_finalize (GObject* obj);
+static void rygel_audio_transcoder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void rygel_audio_transcoder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
static GUPnPDIDLLiteResource*
rygel_audio_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteItem *didl_item, RygelMediaItem *item, RygelTranscodeManager *manager, GError **error) {
@@ -91,7 +65,7 @@ rygel_audio_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteIt
return NULL;
}
- gupnp_didl_lite_resource_set_bitrate (resource, (self->audio_bitrate * 1000) / 8);
+ gupnp_didl_lite_resource_set_bitrate (resource, (self->priv->audio_bitrate * 1000) / 8);
return resource;
}
@@ -102,7 +76,7 @@ rygel_audio_transcoder_real_get_distance (RygelTranscoder *base, RygelMediaItem
guint distance;
guint bitrate;
- g_return_val_if_fail (item, NULL);
+ g_return_val_if_fail (item, 0U);
self = RYGEL_AUDIO_TRANSCODER (base);
@@ -115,7 +89,7 @@ rygel_audio_transcoder_real_get_distance (RygelTranscoder *base, RygelMediaItem
bitrate = rygel_audio_item_get_bitrate (audio_item);
distance = 0;
if(bitrate > 0) {
- distance += abs(bitrate - self->audio_bitrate);
+ distance += abs(bitrate - self->priv->audio_bitrate);
}
return distance;
@@ -130,14 +104,14 @@ rygel_audio_transcoder_real_get_encoding_profile (RygelGstTranscoder *base) {
self = RYGEL_AUDIO_TRANSCODER (base);
preset = rygel_gst_transcoder_get_preset (RYGEL_GST_TRANSCODER (self));
- enc_audio_profile = gst_encoding_audio_profile_new (self->audio_codec_format, preset, NULL, 1);
+ enc_audio_profile = GST_ENCODING_PROFILE (gst_encoding_audio_profile_new (self->priv->audio_codec_format, preset, NULL, 1));
gst_encoding_profile_set_name (enc_audio_profile, "audio");
- if (self->container_format) {
+ if (self->priv->container_format) {
GstEncodingContainerProfile* enc_container_profile
- = gst_encoding_container_profile_new ("container", NULL, self->container_format, preset);
+ = gst_encoding_container_profile_new ("container", NULL, self->priv->container_format, preset);
gst_encoding_container_profile_add_profile (enc_container_profile, enc_audio_profile);
- return enc_container_profile;
+ return GST_ENCODING_PROFILE (enc_container_profile);
}
return enc_audio_profile;
@@ -150,12 +124,17 @@ rygel_audio_transcoder_class_init (RygelAudioTranscoderClass *klass) {
RYGEL_TRANSCODER_CLASS (klass)->get_distance = rygel_audio_transcoder_real_get_distance;
RYGEL_GST_TRANSCODER_CLASS (klass)->get_encoding_profile = rygel_audio_transcoder_real_get_encoding_profile;
G_OBJECT_CLASS (klass)->finalize = rygel_audio_transcoder_finalize;
+ G_OBJECT_CLASS (klass)->get_property = rygel_audio_transcoder_get_property;
+ G_OBJECT_CLASS (klass)->set_property = rygel_audio_transcoder_set_property;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_AUDIO_TRANSCODER_AUDIO_BITRATE, g_param_spec_int ("audio-bitrate", "audio-bitrate", "audio-bitrate", 0, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_AUDIO_TRANSCODER_AUDIO_CAPS, g_param_spec_string ("audio-caps", "audio-caps", "audio-caps", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_AUDIO_TRANSCODER_CONTAINER_CAPS, g_param_spec_string ("container-caps", "container-caps", "container-caps", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}
static void
rygel_audio_transcoder_init (RygelAudioTranscoder *self) {
- self->container_format = NULL;
- self->audio_codec_format = NULL;
+ self->priv->container_format = NULL;
+ self->priv->audio_codec_format = NULL;
}
static void
@@ -163,13 +142,69 @@ rygel_audio_transcoder_finalize (GObject* obj) {
RygelAudioTranscoder *self;
self = RYGEL_AUDIO_TRANSCODER (obj);
- if (self->container_format) {
- gst_caps_unref (self->container_format);
+ if (self->priv->container_format) {
+ gst_caps_unref (self->priv->container_format);
}
- if (self->audio_codec_format) {
- gst_caps_unref (self->audio_codec_format);
+ if (self->priv->audio_codec_format) {
+ gst_caps_unref (self->priv->audio_codec_format);
}
G_OBJECT_CLASS (rygel_audio_transcoder_parent_class)->finalize (obj);
}
+
+static void
+rygel_audio_transcoder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) {
+ RygelAudioTranscoder *self = RYGEL_AUDIO_TRANSCODER (object);
+ RygelAudioTranscoderPrivate *priv = self->priv;
+
+ switch (property_id) {
+ case RYGEL_AUDIO_TRANSCODER_AUDIO_BITRATE:
+ g_value_set_int (value, priv->audio_bitrate);
+ break;
+ case RYGEL_AUDIO_TRANSCODER_AUDIO_CAPS:
+ g_value_take_string (value, gst_caps_to_string (priv->audio_codec_format));
+ break;
+ case RYGEL_AUDIO_TRANSCODER_CONTAINER_CAPS:
+ g_value_take_string (value, gst_caps_to_string (priv->container_format));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
+rygel_audio_transcoder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) {
+ RygelAudioTranscoder *self = RYGEL_AUDIO_TRANSCODER (object);
+ RygelAudioTranscoderPrivate *priv = self->priv;
+
+ switch (property_id) {
+ case RYGEL_AUDIO_TRANSCODER_AUDIO_BITRATE:
+ priv->audio_bitrate = g_value_get_int (value);
+ break;
+ case RYGEL_AUDIO_TRANSCODER_AUDIO_CAPS:
+ if (priv->audio_codec_format) {
+ gst_caps_unref (priv->audio_codec_format);
+ }
+ priv->audio_codec_format = gst_caps_from_string (g_value_get_string (value));
+ break;
+ case RYGEL_AUDIO_TRANSCODER_CONTAINER_CAPS:
+ if (priv->container_format) {
+ gst_caps_unref (priv->container_format);
+ }
+ priv->container_format = gst_caps_from_string (g_value_get_string (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+gint
+rygel_audio_transcoder_get_audio_bitrate (RygelAudioTranscoder *transcoder)
+{
+ g_return_val_if_fail (RYGEL_IS_AUDIO_TRANSCODER (transcoder), 0);
+
+ return transcoder->priv->audio_bitrate;
+}
diff --git a/src/rygel-audio-transcoder.h b/src/rygel-audio-transcoder.h
index d9361cf..5382541 100644
--- a/src/rygel-audio-transcoder.h
+++ b/src/rygel-audio-transcoder.h
@@ -48,23 +48,17 @@ typedef struct _RygelAudioTranscoderPrivate RygelAudioTranscoderPrivate;
struct _RygelAudioTranscoder {
RygelGstTranscoder parent_instance;
RygelAudioTranscoderPrivate *priv;
-
- /* TODO: Put this in priv? */
- gint audio_bitrate;
- GstCaps* container_format;
- GstCaps* audio_codec_format;
};
struct _RygelAudioTranscoderClass {
RygelGstTranscoderClass parent_class;
};
-GType rygel_audio_transcoder_get_type (void) G_GNUC_CONST;
-
-RygelAudioTranscoder* rygel_audio_transcoder_new (const gchar *content_type, gint audio_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *extension);
-RygelAudioTranscoder* rygel_audio_transcoder_new_with_class (const gchar *content_type, const gchar *upnp_class, gint audio_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *extension);
+GType
+rygel_audio_transcoder_get_type (void) G_GNUC_CONST;
-#define RYGEL_AUDIO_TRANSCODER_NO_CONTAINER NULL
+gint
+rygel_audio_transcoder_get_audio_bitrate (RygelAudioTranscoder *transcoder);
G_END_DECLS
diff --git a/src/rygel-avc-transcoder.c b/src/rygel-avc-transcoder.c
index 584c1b6..fca1b5a 100644
--- a/src/rygel-avc-transcoder.c
+++ b/src/rygel-avc-transcoder.c
@@ -36,20 +36,23 @@ G_DEFINE_TYPE (RygelAVCTranscoder, rygel_avc_transcoder, RYGEL_TYPE_VIDEO_TRANSC
static GUPnPDIDLLiteResource* rygel_avc_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteItem *didl_item, RygelMediaItem *item, RygelTranscodeManager *manager, GError **error);
RygelAVCTranscoder*
-rygel_avc_transcoder_construct (GType object_type) {
- RygelAVCTranscoder *self = RYGEL_AVC_TRANSCODER (rygel_video_transcoder_construct (object_type, "video/mp4", "AVC_MP4_BL_CIF15_AAC_520", RYGEL_AVC_TRANSCODER_AUDIO_BITRATE, RYGEL_AVC_TRANSCODER_VIDEO_BITRATE, RYGEL_AVC_TRANSCODER_CONTAINER, RYGEL_AVC_TRANSCODER_AUDIO_CAPS, RYGEL_AVC_TRANSCODER_VIDEO_CAPS, "mp4", RYGEL_AVC_TRANSCODER_RESTRICTIONS));
- rygel_gst_transcoder_set_preset (RYGEL_GST_TRANSCODER (self), "Rygel AVC_MP4_BL_CIF15_AAC_520 preset");
- return self;
-}
-
-RygelAVCTranscoder*
rygel_avc_transcoder_new (void) {
- return rygel_avc_transcoder_construct (RYGEL_TYPE_AVC_TRANSCODER);
+ return RYGEL_AVC_TRANSCODER (g_object_new (RYGEL_TYPE_AVC_TRANSCODER,
+ "mime-type", "video/mp4",
+ "dlna-profile", "AVC_MP4_BL_CIF15_AAC_520",
+ "extension", "mp4",
+ "preset", "Rygel AVC_MP4_BL_CIF15_AAC_520 preset",
+ "audio-bitrate", RYGEL_AVC_TRANSCODER_AUDIO_BITRATE,
+ "container-caps", RYGEL_AVC_TRANSCODER_CONTAINER,
+ "audio-caps", RYGEL_AVC_TRANSCODER_AUDIO_CAPS,
+ "video-bitrate", RYGEL_AVC_TRANSCODER_VIDEO_BITRATE,
+ "video-caps", RYGEL_AVC_TRANSCODER_VIDEO_CAPS,
+ "video-restrictions", RYGEL_AVC_TRANSCODER_RESTRICTIONS,
+ NULL));
}
static GUPnPDIDLLiteResource*
rygel_avc_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteItem *didl_item, RygelMediaItem *item, RygelTranscodeManager *manager, GError **error) {
- RygelAVCTranscoder *self;
GUPnPDIDLLiteResource* resource;
GError* inner_error = NULL;
@@ -57,8 +60,6 @@ rygel_avc_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteItem
g_return_val_if_fail (item != NULL, NULL);
g_return_val_if_fail (manager != NULL, NULL);
- self = RYGEL_AVC_TRANSCODER (base);
-
resource = RYGEL_TRANSCODER_CLASS (rygel_avc_transcoder_parent_class)->add_resource (base, didl_item, item, manager, &inner_error);
if (inner_error != NULL) {
g_propagate_error (error, inner_error);
@@ -82,6 +83,5 @@ rygel_avc_transcoder_class_init (RygelAVCTranscoderClass *klass) {
}
static void
-rygel_avc_transcoder_init (RygelAVCTranscoder *self) {
+rygel_avc_transcoder_init (RygelAVCTranscoder *self G_GNUC_UNUSED) {
}
-
diff --git a/src/rygel-gst-data-source.h b/src/rygel-gst-data-source.h
index 95061fd..3c93ec7 100644
--- a/src/rygel-gst-data-source.h
+++ b/src/rygel-gst-data-source.h
@@ -53,11 +53,18 @@ struct _RygelGstDataSourceClass {
GObjectClass parent_class;
};
-GType rygel_gst_data_source_get_type (void) G_GNUC_CONST;
+GType
+rygel_gst_data_source_get_type (void) G_GNUC_CONST;
-RygelGstDataSource* rygel_gst_data_source_new (const gchar *uri, GError **error);
+RygelGstDataSource *
+rygel_gst_data_source_new (const gchar *uri,
+ GError **error);
-GstElement* rygel_gst_data_source_get_gst_element (RygelGstDataSource *self);
+RygelGstDataSource *
+rygel_gst_data_source_new_from_element (GstElement *element);
+
+GstElement *
+rygel_gst_data_source_get_gst_element (RygelGstDataSource *self);
typedef enum {
RYGEL_GST_ERROR_MISSING_PLUGIN,
diff --git a/src/rygel-gst-media-engine.c b/src/rygel-gst-media-engine.c
index 93cf1df..4d1595e 100644
--- a/src/rygel-gst-media-engine.c
+++ b/src/rygel-gst-media-engine.c
@@ -85,7 +85,7 @@ rygel_gst_media_engine_construct (GType object_type) {
* so this forces them to use other formats.
*/
config = rygel_meta_config_get_default ();
-
+
transcoding = rygel_configuration_get_transcoding (config, &error);
if (error) {
g_clear_error (&error);
@@ -115,7 +115,7 @@ rygel_gst_media_engine_construct (GType object_type) {
while (TRUE) {
gchar *transcoder_name;
- transcoder_index += 1;
+ transcoder_index += 1;
if (!(transcoder_index < transcoder_size)) {
break;
}
@@ -128,9 +128,9 @@ rygel_gst_media_engine_construct (GType object_type) {
RygelMP3Transcoder *transcoder = rygel_mp3_transcoder_new ();
self->priv->transcoders = g_list_prepend (self->priv->transcoders, RYGEL_TRANSCODER (transcoder));
} else if (g_strcmp0 (transcoder_name, "mp2ts")) {
- RygelMP2TSTranscoder *transcoder = rygel_mp2_ts_transcoder_new (RYGEL_MP2_TS_PROFILE_SD);
+ RygelMP2TSTranscoder *transcoder = rygel_mp2_ts_transcoder_new_sd_eu ();
self->priv->transcoders = g_list_prepend (self->priv->transcoders, RYGEL_TRANSCODER (transcoder));
- transcoder = rygel_mp2_ts_transcoder_new (RYGEL_MP2_TS_PROFILE_HD);
+ transcoder = rygel_mp2_ts_transcoder_new_hd_na ();
self->priv->transcoders = g_list_prepend (self->priv->transcoders, RYGEL_TRANSCODER (transcoder));
} else if (g_strcmp0 (transcoder_name, "wmv")) {
RygelWMVTranscoder *transcoder = rygel_wmv_transcoder_new ();
diff --git a/src/rygel-gst-transcoder.c b/src/rygel-gst-transcoder.c
index eed1f24..5ee14b0 100644
--- a/src/rygel-gst-transcoder.c
+++ b/src/rygel-gst-transcoder.c
@@ -19,6 +19,7 @@
#include "rygel-gst-transcoder.h"
#include "rygel-gst-data-source.h"
+#include "rygel-gst-utils.h"
/* TODO: Rename these? */
#define RYGEL_GST_TRANSCODER_DEFAULT_ENCODING_PRESET "Rygel DLNA preset"
@@ -34,9 +35,9 @@ enum {
G_DEFINE_TYPE (RygelGstTranscoder, rygel_gst_transcoder, RYGEL_TYPE_TRANSCODER)
struct _RygelGstTranscoderPrivate {
- gchar *_preset;
- GstElement* decoder;
- GstElement* encoder;
+ gchar *preset;
+ GstElement *decoder;
+ GstElement *encoder;
gboolean link_failed;
};
@@ -44,30 +45,14 @@ struct _RygelGstTranscoderPrivate {
static void rygel_gst_transcoder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void rygel_gst_transcoder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
-static void rygel_gst_transcoder_finalize (GObject* obj);
-
-RygelGstTranscoder*
-rygel_gst_transcoder_construct (GType object_type, const gchar *mime_type, const gchar *dlna_profile, const gchar *extension) {
- RygelGstTranscoder *self;
-
- g_return_val_if_fail (mime_type != NULL, NULL);
- g_return_val_if_fail (dlna_profile != NULL, NULL);
- g_return_val_if_fail (extension != NULL, NULL);
-
- self = RYGEL_GST_TRANSCODER (rygel_transcoder_construct (object_type));
-
- rygel_transcoder_set_mime_type (RYGEL_TRANSCODER (self), mime_type);
- rygel_transcoder_set_dlna_profile (RYGEL_TRANSCODER (self), dlna_profile);
- self->priv->link_failed = TRUE;
- rygel_transcoder_set_extension (RYGEL_TRANSCODER (self), extension);
-
- return self;
-}
+static void rygel_gst_transcoder_finalize (GObject* obj);
static void
-on_decoder_pad_added (GstElement* decodebin, GstPad* new_pad, gpointer user_data) {
+on_decoder_pad_added (GstElement* decodebin G_GNUC_UNUSED,
+ GstPad* new_pad,
+ gpointer user_data) {
RygelGstTranscoder* self = RYGEL_GST_TRANSCODER (user_data);
-
+
GstPad* sinkpad = gst_element_get_compatible_pad (self->priv->encoder, new_pad, NULL);
if (!sinkpad) {
@@ -77,57 +62,62 @@ on_decoder_pad_added (GstElement* decodebin, GstPad* new_pad, gpointer user_data
}
if (!sinkpad) {
- g_debug ("No compatible encodebin pad found for pad '%s'. Ignoring.", gst_object_get_name (new_pad));
+ g_debug ("No compatible encodebin pad found for pad '%s'. Ignoring.", gst_object_get_name (GST_OBJECT (new_pad)));
return;
}
-
+
if (gst_pad_link (new_pad, sinkpad) == GST_PAD_LINK_OK) {
self->priv->link_failed = FALSE;
} else {
- g_warning ("Failed to link pad '%s' to '%s'", gst_object_get_name (new_pad), gst_object_get_name (sinkpad));
+ g_warning ("Failed to link pad '%s' to '%s'", gst_object_get_name (GST_OBJECT (new_pad)), gst_object_get_name (GST_OBJECT (sinkpad)));
}
-
- gst_object_unref (sinkpad);
- return;
+ gst_object_unref (sinkpad);
}
static gboolean
-on_decoder_autoplug_continue (GstElement* decodebin, GstPad* new_pad, GstCaps* caps, gpointer user_data) {
+on_decoder_autoplug_continue (GstElement* decodebin G_GNUC_UNUSED,
+ GstPad* new_pad G_GNUC_UNUSED,
+ GstCaps* caps,
+ gpointer user_data) {
RygelGstTranscoder* self = RYGEL_GST_TRANSCODER (user_data);
-
+
GstPad* sinkpad = NULL;
g_signal_emit_by_name (self->priv->encoder, "request-pad", caps, &sinkpad, NULL);
if (!sinkpad) {
return TRUE;
}
-
+
gst_object_unref (sinkpad);
return FALSE;
}
static void
-on_decoder_no_more_pads (GstElement* decodebin, gpointer user_data) {
+on_decoder_no_more_pads (GstElement* decodebin G_GNUC_UNUSED,
+ gpointer user_data) {
RygelGstTranscoder* self = RYGEL_GST_TRANSCODER (user_data);
-
+
/* We haven't found any pads we could link */
if (self->priv->link_failed) {
/* Signal that error. */
- GstBin *bin = gst_object_get_parent (GST_OBJECT (self->priv->encoder));
+ GstBin *bin = GST_BIN (gst_object_get_parent (GST_OBJECT (self->priv->encoder)));
GError *error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, "Could not link");
GstMessage* message = gst_message_new_error (GST_OBJECT (bin), error, RYGEL_GST_TRANSCODER_DESCRIPTION);
GstBus* bus = gst_element_get_bus (GST_ELEMENT (bin));
gst_bus_post (bus, message);
-
+
gst_object_unref (bus);
- g_clear_error (error);
+ g_error_free (error);
gst_object_unref (bin);
}
}
-static RygelDataSource*
-rygel_gst_transcoder_create_source (RygelTranscoder *base, RygelMediaItem *item, RygelDataSource* src, GError **error) {
+static RygelDataSource *
+rygel_gst_transcoder_create_source (RygelTranscoder *base,
+ RygelMediaItem *item,
+ RygelDataSource *src,
+ GError **error) {
RygelGstTranscoder *self;
RygelGstDataSource *data_source;
GstEncodingProfile *encoding_profile;
@@ -136,22 +126,22 @@ rygel_gst_transcoder_create_source (RygelTranscoder *base, RygelMediaItem *item,
g_return_val_if_fail (item != NULL, NULL);
g_return_val_if_fail (src != NULL, NULL);
-
+
/* We can only link GStreamer data sources together,
* so check that the RygelDataSource is of the expected type:
*/
g_return_val_if_fail (RYGEL_IS_GST_DATA_SOURCE (src), NULL);
-
- self = RYGEL_GST_TRANSCODER (self);
+
+ self = RYGEL_GST_TRANSCODER (base);
data_source = RYGEL_GST_DATA_SOURCE (src);
-
+
if (self->priv->decoder) {
g_object_unref (self->priv->decoder);
}
self->priv->decoder =
rygel_gst_utils_create_element (RYGEL_GST_TRANSCODER_DECODE_BIN,
- RYGEL_GST_TRANSCODER_DECODE_BIN,
+ RYGEL_GST_TRANSCODER_DECODE_BIN,
&inner_error);
if (inner_error) {
g_propagate_error (error, inner_error);
@@ -170,7 +160,7 @@ rygel_gst_transcoder_create_source (RygelTranscoder *base, RygelMediaItem *item,
g_propagate_error (error, inner_error);
return NULL;
}
-
+
encoding_profile = rygel_gst_transcoder_get_encoding_profile (self);
g_object_set (self->priv->encoder, "profile", encoding_profile, NULL);
gst_object_unref (encoding_profile);
@@ -179,24 +169,24 @@ rygel_gst_transcoder_create_source (RygelTranscoder *base, RygelMediaItem *item,
bin = GST_BIN (gst_bin_new ("transcoder-source"));
gst_object_ref_sink (bin);
-
+
/* Use the RygelGstDataSource-specific API to get the underlying Gstreamer element.
- */
+ */
GstElement *element = rygel_gst_data_source_get_gst_element (data_source);
gst_bin_add_many (bin, element, self->priv->decoder, self->priv->encoder, NULL);
-
+
gst_element_link (element, self->priv->decoder);
g_signal_connect_object (self->priv->decoder, "pad-added", (GCallback) on_decoder_pad_added, self, 0);
g_signal_connect_object (self->priv->decoder, "autoplug_continue", (GCallback) on_decoder_autoplug_continue, self, 0);
g_signal_connect_object (self->priv->decoder, "no-more-pads", (GCallback) on_decoder_no_more_pads, self, 0);
-
+
GstPad *pad = gst_element_get_static_pad (self->priv->encoder, "src");
GstGhostPad *ghost_pad = GST_GHOST_PAD (gst_ghost_pad_new (NULL, pad));
gst_object_ref_sink (ghost_pad);
gst_element_add_pad (GST_ELEMENT (bin), GST_PAD (ghost_pad));
- RygelDataSource *result = rygel_gst_data_source_new_from_element (bin);
+ RygelDataSource *result = RYGEL_DATA_SOURCE (rygel_gst_data_source_new_from_element (GST_ELEMENT (bin)));
gst_object_unref (ghost_pad);
gst_object_unref (pad);
gst_object_unref (bin);
@@ -224,20 +214,20 @@ rygel_gst_transcoder_get_encoding_profile (RygelGstTranscoder* self) {
const gchar*
rygel_gst_transcoder_get_preset (RygelGstTranscoder* self) {
- return self->priv->_preset;
+ return self->priv->preset;
}
void
rygel_gst_transcoder_set_preset (RygelGstTranscoder* self, const gchar *value) {
g_return_if_fail (self != NULL);
-
- if (self->priv->_preset) {
- g_free (self->priv->_preset);
- self->priv->_preset = NULL;
+
+ if (self->priv->preset) {
+ g_free (self->priv->preset);
+ self->priv->preset = NULL;
}
-
+
if (value) {
- self->priv->_preset = g_strdup (value);
+ self->priv->preset = g_strdup (value);
}
g_object_notify (G_OBJECT (self), "preset");
@@ -258,7 +248,8 @@ void rygel_gst_transcoder_class_init (RygelGstTranscoderClass *klass) {
static
void rygel_gst_transcoder_init (RygelGstTranscoder *self) {
self->priv = RYGEL_GST_TRANSCODER_GET_PRIVATE (self);
- self->priv->_preset = g_strdup (RYGEL_GST_TRANSCODER_DEFAULT_ENCODING_PRESET);
+ self->priv->preset = g_strdup (RYGEL_GST_TRANSCODER_DEFAULT_ENCODING_PRESET);
+ self->priv->link_failed = TRUE;
}
static
@@ -266,7 +257,7 @@ void rygel_gst_transcoder_finalize (GObject* obj) {
RygelGstTranscoder *self;
self = RYGEL_GST_TRANSCODER (obj);
- g_free (self->priv->_preset);
+ g_free (self->priv->preset);
gst_object_unref (self->priv->decoder);
gst_object_unref (self->priv->encoder);
@@ -302,6 +293,3 @@ rygel_gst_transcoder_set_property (GObject *object, guint property_id, const GVa
break;
}
}
-
-
-
diff --git a/src/rygel-gst-transcoder.h b/src/rygel-gst-transcoder.h
index 2786053..f281010 100644
--- a/src/rygel-gst-transcoder.h
+++ b/src/rygel-gst-transcoder.h
@@ -55,15 +55,21 @@ struct _RygelGstTranscoderClass {
GstEncodingProfile* (*get_encoding_profile) (RygelGstTranscoder* self);
};
-GType rygel_gst_transcoder_get_type (void) G_GNUC_CONST;
+GType
+rygel_gst_transcoder_get_type (void) G_GNUC_CONST;
-RygelGstTranscoder* rygel_gst_transcoder_new (void);
+RygelGstTranscoder *
+rygel_gst_transcoder_new (void);
-RygelGstTranscoder* rygel_gst_transcoder_construct (GType object_type, const gchar *mime_type, const gchar *dlna_profile, const gchar *extension);
+GstEncodingProfile *
+rygel_gst_transcoder_get_encoding_profile (RygelGstTranscoder *self);
-GstEncodingProfile* rygel_gst_transcoder_get_encoding_profile (RygelGstTranscoder *self);
-const gchar *rygel_gst_transcoder_get_preset (RygelGstTranscoder *self);
-void rygel_gst_transcoder_set_preset (RygelGstTranscoder *self, const gchar *value);
+const gchar *
+rygel_gst_transcoder_get_preset (RygelGstTranscoder *self);
+
+void
+rygel_gst_transcoder_set_preset (RygelGstTranscoder *self,
+ const gchar *value);
G_END_DECLS
diff --git a/src/rygel-gst-utils.h b/src/rygel-gst-utils.h
index 58d542e..65996ce 100644
--- a/src/rygel-gst-utils.h
+++ b/src/rygel-gst-utils.h
@@ -39,7 +39,6 @@ GstElement* rygel_gst_utils_create_element (const gchar *factoryname, const gcha
GstElement* rygel_gst_utils_create_source_for_uri (const gchar *uri);
void rygel_gst_utils_dump_encoding_profile (GstEncodingProfile* profile, gint indent);
GstElement* rygel_gst_utils_get_rtp_depayloader (GstCaps* caps);
-static gboolean rygel_gst_utils_need_rtp_depayloader (GstCaps* caps);
G_END_DECLS
diff --git a/src/rygel-l16-transcoder.c b/src/rygel-l16-transcoder.c
index 80fde5d..eadab15 100644
--- a/src/rygel-l16-transcoder.c
+++ b/src/rygel-l16-transcoder.c
@@ -25,43 +25,33 @@ G_DEFINE_TYPE (RygelL16Transcoder, rygel_l16_transcoder, RYGEL_TYPE_AUDIO_TRANSC
#define RYGEL_L16_TRANSCODER_FREQUENCY 44100
#define RYGEL_L16_TRANSCODER_WIDTH 16
#define RYGEL_L16_TRANSCODER_DEPTH 16
-#define RYGEL_L16_TRANSCODER_SIGNED TRUE
+#define RYGEL_L16_TRANSCODER_SIGNED true
#define RYGEL_L16_TRANSCODER_ENDIANNESS ((gint) G_BIG_ENDIAN)
+#define RYGEL_L16_MIME_TYPE "audio/L" G_STRINGIFY (RYGEL_L16_TRANSCODER_WIDTH) \
+ ";rate=" G_STRINGIFY (RYGEL_L16_TRANSCODER_FREQUENCY) \
+ ";channels=" G_STRINGIFY (RYGEL_L16_TRANSCODER_CHANNELS)
+#define RYGEL_L16_AUDIO_CAPS "audio/format=S16BE" \
+ ",rate=" G_STRINGIFY (RYGEL_L16_TRANSCODER_FREQUENCY) \
+ ",width=" G_STRINGIFY (RYGEL_L16_TRANSCODER_WIDTH) \
+ ",depth=" G_STRINGIFY (RYGEL_L16_TRANSCODER_DEPTH) \
+ ",signed=" G_STRINGIFY (RYGEL_L16_TRANSCODER_SIGNED) \
+ ",endianness=" G_STRINGIFY (RYGEL_L16_TRANSCODER_ENDIANNESS)
+
static GUPnPDIDLLiteResource* rygel_l16_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteItem *didl_item, RygelMediaItem *item, RygelTranscodeManager *manager, GError **error);
static guint rygel_l16_transcoder_real_get_distance (RygelTranscoder *base, RygelMediaItem *item);
RygelL16Transcoder*
-rygel_l16_transcoder_construct (GType object_type) {
- RygelL16Transcoder *self;
-
- gchar *mime_type = g_strdup_printf ("audio/L%i"
- ";rate=%i"
- ";channels=%i",
- RYGEL_L16_TRANSCODER_WIDTH, RYGEL_L16_TRANSCODER_FREQUENCY, RYGEL_L16_TRANSCODER_CHANNELS);
-
- gchar *caps_str = g_strdup_printf ("audio/format=S16BE"
- ",rate=%i"
- ",width=%i"
- ",depth=%i"
- ",signed=%s"
- ",endianness=%i",
- RYGEL_L16_TRANSCODER_FREQUENCY,
- RYGEL_L16_TRANSCODER_WIDTH,
- RYGEL_L16_TRANSCODER_DEPTH,
- (RYGEL_L16_TRANSCODER_SIGNED ? "true" : "false"),
- RYGEL_L16_TRANSCODER_ENDIANNESS);
-
- self = RYGEL_L16_TRANSCODER (rygel_audio_transcoder_construct (object_type, mime_type, "LPCM", 0, RYGEL_AUDIO_TRANSCODER_NO_CONTAINER, caps_str, "lpcm"));
-
- g_free (caps_str);
- g_free (mime_type);
- return self;
-}
-
-RygelL16Transcoder*
rygel_l16_transcoder_new (void) {
- return rygel_l16_transcoder_construct (RYGEL_TYPE_L16_TRANSCODER);
+ return RYGEL_L16_TRANSCODER (g_object_new (RYGEL_TYPE_L16_TRANSCODER,
+ "mime-type", RYGEL_L16_MIME_TYPE,
+ "dlna-profile", "LPCM",
+ "extension", "lpcm",
+ /* No "preset". */
+ /* No "audio-bitrate". */
+ /* No "container-caps" */
+ "audio-caps", RYGEL_L16_AUDIO_CAPS,
+ NULL));
}
static GUPnPDIDLLiteResource*
@@ -94,8 +84,8 @@ rygel_l16_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteItem
}
static guint
-rygel_l16_transcoder_real_get_distance (RygelTranscoder *base, RygelMediaItem *item) {
- RygelL16Transcoder *self = RYGEL_L16_TRANSCODER (base);
+rygel_l16_transcoder_real_get_distance (RygelTranscoder *base G_GNUC_UNUSED,
+ RygelMediaItem *item) {
RygelAudioItem *audio_item;
guint distance;
guint sample_freq;
@@ -124,7 +114,7 @@ rygel_l16_transcoder_real_get_distance (RygelTranscoder *base, RygelMediaItem *i
bits_per_sample = rygel_audio_item_get_bits_per_sample (audio_item);
if(bits_per_sample > 0) {
distance += abs(bits_per_sample - RYGEL_L16_TRANSCODER_WIDTH);
- }
+ }
return distance;
}
@@ -137,8 +127,5 @@ rygel_l16_transcoder_class_init (RygelL16TranscoderClass *klass) {
}
static void
-rygel_l16_transcoder_init (RygelL16Transcoder *self) {
+rygel_l16_transcoder_init (RygelL16Transcoder *self G_GNUC_UNUSED) {
}
-
-
-
diff --git a/src/rygel-mp2ts-transcoder.c b/src/rygel-mp2ts-transcoder.c
index 5e5f7ee..e3fcb86 100644
--- a/src/rygel-mp2ts-transcoder.c
+++ b/src/rygel-mp2ts-transcoder.c
@@ -31,7 +31,31 @@
G_DEFINE_TYPE (RygelMP2TSTranscoder, rygel_mp2_ts_transcoder, RYGEL_TYPE_VIDEO_TRANSCODER)
-#define RYGEL_TYPE_MP2_TS_PROFILE (rygel_mp2_ts_profile_get_type ())
+enum
+{
+ RYGEL_MP2_TS_TRANSCODER_DUMMY_PROPERTY,
+ RYGEL_MP2_TS_TRANSCODER_PROFILE
+};
+
+GType
+rygel_mp2_ts_profile_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+
+ if (g_once_init_enter (&g_define_type_id__volatile))
+ {
+ static const GEnumValue values[] = {
+ { RYGEL_MP2_TS_PROFILE_SD, "RYGEL_MP2_TS_PROFILE_SD", "sd" },
+ { RYGEL_MP2_TS_PROFILE_HD, "RYGEL_MP2_TS_PROFILE_HD", "hd" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id =
+ g_enum_register_static (g_intern_static_string ("RygelMP2TSProfile"), values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+
+ return g_define_type_id__volatile;
+}
struct _RygelMP2TSTranscoderPrivate {
RygelMP2TSProfile profile;
@@ -45,46 +69,65 @@ struct _RygelMP2TSTranscoderPrivate {
#define RYGEL_MP2_TS_TRANSCODER_AUDIO_FORMAT "audio/mpeg,mpegversion=1,layer=2"
#define RYGEL_MP2_TS_TRANSCODER_BASE_VIDEO_FORMAT "video/mpeg,mpegversion=2,systemstream=false"
#define RYGEL_MP2_TS_TRANSCODER_RESTRICTION_TEMPLATE "video/x-raw-yuv,framerate=(fraction)%d/1,width=%d,height=%d"
+#define RYGEL_MP2_TS_TRANSCODER_WIDTH_SD_EU 720
+#define RYGEL_MP2_TS_TRANSCODER_WIDTH_HD_NA 1280
+#define RYGEL_MP2_TS_TRANSCODER_HEIGHT_SD_EU 576
+#define RYGEL_MP2_TS_TRANSCODER_HEIGHT_HD_NA 720
+#define RYGEL_MP2_TS_TRANSCODER_FRAME_RATE_SD_EU 25
+#define RYGEL_MP2_TS_TRANSCODER_FRAME_RATE_HD_NA 30
+#define RYGEL_MP2_TS_TRANSCODER_PROFILE_SD_EU "MPEG_TS_SD_EU_ISO"
+#define RYGEL_MP2_TS_TRANSCODER_PROFILE_HD_NA "MPEG_TS_HD_NA_ISO"
+#define RYGEL_MP2_TS_TRANSCODER_RESTRICTION(fr, w, h) "video/x-raw-yuv" \
+ ",framerate=(fraction)" G_STRINGIFY (fr) "/1" \
+ ",width=" G_STRINGIFY (w) \
+ ",height=" G_STRINGIFY (h)
+#define RYGEL_MP2_TS_TRANSCODER_RESTRICTION_SD_EU RYGEL_MP2_TS_TRANSCODER_RESTRICTION (RYGEL_MP2_TS_TRANSCODER_FRAME_RATE_SD_EU, RYGEL_MP2_TS_TRANSCODER_WIDTH_SD_EU, RYGEL_MP2_TS_TRANSCODER_HEIGHT_SD_EU)
+#define RYGEL_MP2_TS_TRANSCODER_RESTRICTION_HD_NA RYGEL_MP2_TS_TRANSCODER_RESTRICTION (RYGEL_MP2_TS_TRANSCODER_FRAME_RATE_HD_NA, RYGEL_MP2_TS_TRANSCODER_WIDTH_HD_NA, RYGEL_MP2_TS_TRANSCODER_HEIGHT_HD_NA)
static GUPnPDIDLLiteResource* rygel_mp2_ts_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteItem *didl_item, RygelMediaItem *item, RygelTranscodeManager *manager, GError **error);
static guint rygel_mp2_ts_transcoder_real_get_distance (RygelTranscoder *base, RygelMediaItem *item);
static void rygel_mp2_ts_transcoder_finalize (GObject* obj);
-
-static const gint RYGEL_MP2_TS_TRANSCODER_WIDTH[2] = {720, 1280};
-static const gint RYGEL_MP2_TS_TRANSCODER_HEIGHT[2] = {576, 720};
-static const gint RYGEL_MP2_TS_TRANSCODER_FRAME_RATE[2] = {25, 30};
-static const gchar *RYGEL_MP2_TS_TRANSCODER_PROFILES[2] = {"MPEG_TS_SD_EU_ISO", "MPEG_TS_HD_NA_ISO"};
-
-RygelMP2TSTranscoder* rygel_mp2_ts_transcoder_construct (GType object_type, RygelMP2TSProfile profile) {
- RygelMP2TSTranscoder *self;
- gchar *restriction_template;
-
- restriction_template = g_strdup_printf (
- RYGEL_MP2_TS_TRANSCODER_RESTRICTION_TEMPLATE,
- RYGEL_MP2_TS_TRANSCODER_FRAME_RATE,
- RYGEL_MP2_TS_TRANSCODER_WIDTH,
- RYGEL_MP2_TS_TRANSCODER_HEIGHT);
-
- self = RYGEL_MP2_TS_TRANSCODER (rygel_video_transcoder_construct (object_type,
- "video/mpeg", RYGEL_MP2_TS_TRANSCODER_PROFILES[profile],
- RYGEL_MP2_TS_TRANSCODER_AUDIO_BITRATE,
- RYGEL_MP2_TS_TRANSCODER_VIDEO_BITRATE,
- RYGEL_MP2_TS_TRANSCODER_CONTAINER,
- RYGEL_MP2_TS_TRANSCODER_AUDIO_FORMAT,
- RYGEL_MP2_TS_TRANSCODER_BASE_VIDEO_FORMAT,
- "mpg",
- restriction_template));
-
- g_free (restriction_template);
-
- self->priv->profile = profile;
-
- return self;
+static void rygel_mp2_ts_transcoder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void rygel_mp2_ts_transcoder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+
+static const gint RYGEL_MP2_TS_TRANSCODER_WIDTH[2] = {RYGEL_MP2_TS_TRANSCODER_WIDTH_SD_EU, RYGEL_MP2_TS_TRANSCODER_WIDTH_HD_NA};
+static const gint RYGEL_MP2_TS_TRANSCODER_HEIGHT[2] = {RYGEL_MP2_TS_TRANSCODER_HEIGHT_SD_EU, RYGEL_MP2_TS_TRANSCODER_HEIGHT_HD_NA};
+static const gint RYGEL_MP2_TS_TRANSCODER_FRAME_RATE[2] = {RYGEL_MP2_TS_TRANSCODER_FRAME_RATE_SD_EU, RYGEL_MP2_TS_TRANSCODER_FRAME_RATE_HD_NA};
+
+RygelMP2TSTranscoder *
+rygel_mp2_ts_transcoder_new_sd_eu (void)
+{
+ return RYGEL_MP2_TS_TRANSCODER (g_object_new (RYGEL_TYPE_MP2_TS_TRANSCODER,
+ "mime-type", "video/mpeg",
+ "dlna-profile", RYGEL_MP2_TS_TRANSCODER_PROFILE_SD_EU,
+ "extension", "mpg",
+ /* No "preset". */
+ "audio-bitrate", RYGEL_MP2_TS_TRANSCODER_AUDIO_BITRATE,
+ "container-caps", RYGEL_MP2_TS_TRANSCODER_CONTAINER,
+ "audio-caps", RYGEL_MP2_TS_TRANSCODER_AUDIO_FORMAT,
+ "video-bitrate", RYGEL_MP2_TS_TRANSCODER_VIDEO_BITRATE,
+ "video-caps", RYGEL_MP2_TS_TRANSCODER_BASE_VIDEO_FORMAT,
+ "video-restrictions", RYGEL_MP2_TS_TRANSCODER_RESTRICTION_SD_EU,
+ "mp2-profile", RYGEL_MP2_TS_PROFILE_SD,
+ NULL));
}
-RygelMP2TSTranscoder*
-rygel_mp2_ts_transcoder_new (RygelMP2TSProfile profile) {
- return rygel_mp2_ts_transcoder_construct (RYGEL_TYPE_MP2_TS_TRANSCODER, profile);
+RygelMP2TSTranscoder *
+rygel_mp2_ts_transcoder_new_hd_na (void)
+{
+ return RYGEL_MP2_TS_TRANSCODER (g_object_new (RYGEL_TYPE_MP2_TS_TRANSCODER,
+ "mime-type", "video/mpeg",
+ "dlna-profile", RYGEL_MP2_TS_TRANSCODER_PROFILE_HD_NA,
+ "extension", "mpg",
+ /* No "preset". */
+ "audio-bitrate", RYGEL_MP2_TS_TRANSCODER_AUDIO_BITRATE,
+ "container-caps", RYGEL_MP2_TS_TRANSCODER_CONTAINER,
+ "audio-caps", RYGEL_MP2_TS_TRANSCODER_AUDIO_FORMAT,
+ "video-bitrate", RYGEL_MP2_TS_TRANSCODER_VIDEO_BITRATE,
+ "video-caps", RYGEL_MP2_TS_TRANSCODER_BASE_VIDEO_FORMAT,
+ "video-restrictions", RYGEL_MP2_TS_TRANSCODER_RESTRICTION_HD_NA,
+ "mp2-profile", RYGEL_MP2_TS_PROFILE_HD,
+ NULL));
}
static GUPnPDIDLLiteResource*
@@ -137,7 +180,7 @@ rygel_mp2_ts_transcoder_real_get_distance (RygelTranscoder *base, RygelMediaItem
bitrate = rygel_audio_item_get_bits_per_sample (RYGEL_AUDIO_ITEM (video_item));
if(bitrate > 0) {
distance += abs(bitrate - RYGEL_MP2_TS_TRANSCODER_VIDEO_BITRATE);
- }
+ }
width = rygel_visual_item_get_width (RYGEL_VISUAL_ITEM (video_item));
if(width > 0) {
@@ -159,6 +202,9 @@ rygel_mp2_ts_transcoder_class_init (RygelMP2TSTranscoderClass *klass) {
RYGEL_TRANSCODER_CLASS (klass)->add_resource = rygel_mp2_ts_transcoder_real_add_resource;
RYGEL_TRANSCODER_CLASS (klass)->get_distance = rygel_mp2_ts_transcoder_real_get_distance;
G_OBJECT_CLASS (klass)->finalize = rygel_mp2_ts_transcoder_finalize;
+ G_OBJECT_CLASS (klass)->get_property = rygel_mp2_ts_transcoder_get_property;
+ G_OBJECT_CLASS (klass)->set_property = rygel_mp2_ts_transcoder_set_property;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_MP2_TS_TRANSCODER_PROFILE, g_param_spec_enum ("mp2-profile", "mp2-profile", "mp2-profile", RYGEL_TYPE_MP2_TS_PROFILE, RYGEL_MP2_TS_PROFILE_SD, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}
@@ -169,9 +215,35 @@ rygel_mp2_ts_transcoder_init (RygelMP2TSTranscoder *self) {
static void
rygel_mp2_ts_transcoder_finalize (GObject* obj) {
- RygelMP2TSTranscoder *self;
- self = RYGEL_MP2_TS_TRANSCODER (obj);
G_OBJECT_CLASS (rygel_mp2_ts_transcoder_parent_class)->finalize (obj);
}
+static void
+rygel_mp2_ts_transcoder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) {
+ RygelMP2TSTranscoder *self = RYGEL_MP2_TS_TRANSCODER (object);
+ RygelMP2TSTranscoderPrivate *priv = self->priv;
+
+ switch (property_id) {
+ case RYGEL_MP2_TS_TRANSCODER_PROFILE:
+ g_value_set_enum (value, priv->profile);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+static void
+rygel_mp2_ts_transcoder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) {
+ RygelMP2TSTranscoder *self = RYGEL_MP2_TS_TRANSCODER (object);
+ RygelMP2TSTranscoderPrivate *priv = self->priv;
+
+ switch (property_id) {
+ case RYGEL_MP2_TS_TRANSCODER_PROFILE:
+ priv->profile = g_value_get_enum (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
diff --git a/src/rygel-mp2ts-transcoder.h b/src/rygel-mp2ts-transcoder.h
index 932b39b..f2a57e8 100644
--- a/src/rygel-mp2ts-transcoder.h
+++ b/src/rygel-mp2ts-transcoder.h
@@ -59,9 +59,16 @@ typedef enum {
RYGEL_MP2_TS_PROFILE_HD
} RygelMP2TSProfile;
+#define RYGEL_TYPE_MP2_TS_PROFILE (rygel_mp2_ts_profile_get_type ())
+
+GType rygel_mp2_ts_profile_get_type (void) G_GNUC_CONST;
GType rygel_mp2_ts_transcoder_get_type (void) G_GNUC_CONST;
-RygelMP2TSTranscoder* rygel_mp2_ts_transcoder_new (RygelMP2TSProfile profile);
+RygelMP2TSTranscoder *
+rygel_mp2_ts_transcoder_new_sd_eu (void);
+
+RygelMP2TSTranscoder *
+rygel_mp2_ts_transcoder_new_hd_na (void);
G_END_DECLS
diff --git a/src/rygel-mp3-transcoder.c b/src/rygel-mp3-transcoder.c
index a23083b..906fc5e 100644
--- a/src/rygel-mp3-transcoder.c
+++ b/src/rygel-mp3-transcoder.c
@@ -35,15 +35,17 @@ G_DEFINE_TYPE (RygelMP3Transcoder, rygel_mp3_transcoder, RYGEL_TYPE_AUDIO_TRANSC
#define RYGEL_MP3_TRANSCODER_BITRATE 128
#define RYGEL_MP3_TRANSCODER_FORMAT "audio/mpeg,mpegversion=1,layer=3"
-RygelMP3Transcoder* rygel_mp3_transcoder_construct (GType object_type) {
- RygelMP3Transcoder *self = RYGEL_MP3_TRANSCODER (rygel_audio_transcoder_construct (object_type, "audio/mpeg", "MP3", RYGEL_MP3_TRANSCODER_BITRATE, RYGEL_AUDIO_TRANSCODER_NO_CONTAINER, RYGEL_MP3_TRANSCODER_FORMAT, "mp3"));
-
- return self;
-}
-
RygelMP3Transcoder*
rygel_mp3_transcoder_new (void) {
- return rygel_mp3_transcoder_construct (RYGEL_TYPE_MP3_TRANSCODER);
+ return RYGEL_MP3_TRANSCODER (g_object_new (RYGEL_TYPE_MP3_TRANSCODER,
+ "mime-type", "audio/mpeg",
+ "dlna-profile", "MP3",
+ "extension", "mp3",
+ /* No "preset". */
+ "audio-bitrate", RYGEL_MP3_TRANSCODER_BITRATE,
+ /* No "container-caps". */
+ "audio-caps", RYGEL_MP3_TRANSCODER_FORMAT,
+ NULL));
}
static void
@@ -52,7 +54,5 @@ rygel_mp3_transcoder_class_init (RygelMP3TranscoderClass *klass) {
}
static void
-rygel_mp3_transcoder_init (RygelMP3Transcoder *self) {
+rygel_mp3_transcoder_init (RygelMP3Transcoder *self G_GNUC_UNUSED) {
}
-
-
diff --git a/src/rygel-video-transcoder.c b/src/rygel-video-transcoder.c
index f7dedfc..e4eea2e 100644
--- a/src/rygel-video-transcoder.c
+++ b/src/rygel-video-transcoder.c
@@ -35,35 +35,18 @@ struct _RygelVideoTranscoderPrivate {
GstCaps* video_restrictions;
};
-#define RYGEL_VIDEO_TRANSCODER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_TYPE_VIDEO_TRANSCODER, RygelGstTranscoderPrivate))
-
-static void rygel_video_transcoder_finalize (GObject* obj);
-
-RygelVideoTranscoder*
-rygel_video_transcoder_construct (GType object_type, const gchar *content_type, gint audio_bitrate, gint video_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *video_codec_caps, const gchar *extension, const gchar *restrictions) {
- RygelVideoTranscoder *self = NULL;
-
- g_return_val_if_fail (content_type != NULL, NULL);
- g_return_val_if_fail (container_caps != NULL, NULL);
- g_return_val_if_fail (audio_codec_caps != NULL, NULL);
- g_return_val_if_fail (video_codec_caps != NULL, NULL);
- g_return_val_if_fail (extension != NULL, NULL);
-
- self = RYGEL_VIDEO_TRANSCODER (rygel_audio_transcoder_construct_with_class (object_type, content_type, RYGEL_VIDEO_ITEM_UPNP_CLASS, audio_bitrate, container_caps, audio_codec_caps));
-
- self->priv->video_bitrate = video_bitrate;
- self->priv->video_codec_format = gst_caps_from_string (video_codec_caps);
- if (restrictions) {
- self->priv->video_restrictions = gst_caps_from_string (restrictions);
- }
+enum {
+ RYGEL_VIDEO_TRANSCODER_DUMMY_PROPERTY,
+ RYGEL_VIDEO_TRANSCODER_VIDEO_BITRATE,
+ RYGEL_VIDEO_TRANSCODER_VIDEO_CAPS,
+ RYGEL_VIDEO_TRANSCODER_VIDEO_RESTRICTIONS
+};
- return self;
-}
+#define RYGEL_VIDEO_TRANSCODER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_TYPE_VIDEO_TRANSCODER, RygelVideoTranscoderPrivate))
-RygelVideoTranscoder*
-rygel_video_transcoder_new (const gchar *content_type, gint audio_bitrate, gint video_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *video_codec_caps, const gchar *extension, const gchar *restrictions) {
- return rygel_video_transcoder_construct (RYGEL_TYPE_VIDEO_TRANSCODER, content_type, audio_bitrate, video_bitrate, container_caps, audio_codec_caps, video_codec_caps, extension, restrictions);
-}
+static void rygel_video_transcoder_finalize (GObject* obj);
+static void rygel_video_transcoder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void rygel_video_transcoder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
static GUPnPDIDLLiteResource* rygel_video_transcoder_real_add_resource (RygelTranscoder *base, GUPnPDIDLLiteItem *didl_item, RygelMediaItem *item, RygelTranscodeManager *manager, GError **error) {
RygelVideoTranscoder *self;
@@ -76,6 +59,7 @@ static GUPnPDIDLLiteResource* rygel_video_transcoder_real_add_resource (RygelTra
g_return_val_if_fail (manager != NULL, NULL);
self = RYGEL_VIDEO_TRANSCODER (base);
+ video_item = RYGEL_VIDEO_ITEM (item);
resource = RYGEL_TRANSCODER_CLASS (rygel_video_transcoder_parent_class)->add_resource (RYGEL_TRANSCODER (self), didl_item, item, manager, &inner_error);
if (inner_error != NULL) {
@@ -87,13 +71,15 @@ static GUPnPDIDLLiteResource* rygel_video_transcoder_real_add_resource (RygelTra
return NULL;
}
+ gint audio_bitrate = rygel_audio_transcoder_get_audio_bitrate (RYGEL_AUDIO_TRANSCODER (self));
+
gupnp_didl_lite_resource_set_width (resource,
rygel_visual_item_get_width (RYGEL_VISUAL_ITEM (video_item)));
gupnp_didl_lite_resource_set_height (resource,
rygel_visual_item_get_height (RYGEL_VISUAL_ITEM (video_item)));
gupnp_didl_lite_resource_set_bitrate (resource,
- (self->priv->video_bitrate + RYGEL_AUDIO_TRANSCODER (self)->audio_bitrate) * 1000 / 8);
-
+ (self->priv->video_bitrate + audio_bitrate) * 1000 / 8);
+
return resource;
}
@@ -104,7 +90,7 @@ rygel_video_transcoder_real_get_distance (RygelTranscoder *base, RygelMediaItem
guint distance;
guint bitrate;
- g_return_val_if_fail (item, NULL);
+ g_return_val_if_fail (item != NULL, G_MAXUINT);
self = RYGEL_VIDEO_TRANSCODER (base);
@@ -131,17 +117,17 @@ rygel_video_transcoder_real_get_encoding_profile (RygelGstTranscoder *base) {
self = RYGEL_VIDEO_TRANSCODER (base);
- enc_container_profile = RYGEL_GST_TRANSCODER_CLASS (rygel_video_transcoder_parent_class)->get_encoding_profile (RYGEL_GST_TRANSCODER (self));
- enc_video_profile = gst_encoding_video_profile_new (self->priv->video_codec_format,
+ enc_container_profile = GST_ENCODING_CONTAINER_PROFILE (RYGEL_GST_TRANSCODER_CLASS (rygel_video_transcoder_parent_class)->get_encoding_profile (RYGEL_GST_TRANSCODER (self)));
+ enc_video_profile = GST_ENCODING_PROFILE (gst_encoding_video_profile_new (self->priv->video_codec_format,
rygel_gst_transcoder_get_preset (RYGEL_GST_TRANSCODER (self)),
self->priv->video_restrictions,
- (guint) 1);
-
+ 1));
+
gst_encoding_profile_set_name (enc_video_profile, "video");
gst_encoding_container_profile_add_profile (enc_container_profile, enc_video_profile);
gst_encoding_profile_unref (enc_video_profile);
- return enc_container_profile;
+ return GST_ENCODING_PROFILE (enc_container_profile);
}
static void
@@ -152,6 +138,11 @@ rygel_video_transcoder_class_init (RygelVideoTranscoderClass *klass) {
RYGEL_TRANSCODER_CLASS (klass)->get_distance = rygel_video_transcoder_real_get_distance;
RYGEL_GST_TRANSCODER_CLASS (klass)->get_encoding_profile = rygel_video_transcoder_real_get_encoding_profile;
G_OBJECT_CLASS (klass)->finalize = rygel_video_transcoder_finalize;
+ G_OBJECT_CLASS (klass)->get_property = rygel_video_transcoder_get_property;
+ G_OBJECT_CLASS (klass)->set_property = rygel_video_transcoder_set_property;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_VIDEO_TRANSCODER_VIDEO_BITRATE, g_param_spec_int ("video-bitrate", "video-bitrate", "video-bitrate", 0, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_VIDEO_TRANSCODER_VIDEO_CAPS, g_param_spec_string ("video-caps", "video-caps", "video-caps", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_VIDEO_TRANSCODER_VIDEO_RESTRICTIONS, g_param_spec_string ("video-restrictions", "video-restrictions", "video-restrictions", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}
static void
@@ -169,3 +160,50 @@ rygel_video_transcoder_finalize (GObject* obj) {
G_OBJECT_CLASS (rygel_video_transcoder_parent_class)->finalize (obj);
}
+static void
+rygel_video_transcoder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) {
+ RygelVideoTranscoder *self = RYGEL_VIDEO_TRANSCODER (object);
+ RygelVideoTranscoderPrivate *priv = self->priv;
+
+ switch (property_id) {
+ case RYGEL_VIDEO_TRANSCODER_VIDEO_BITRATE:
+ g_value_set_int (value, priv->video_bitrate);
+ break;
+ case RYGEL_VIDEO_TRANSCODER_VIDEO_CAPS:
+ g_value_take_string (value, gst_caps_to_string (priv->video_codec_format));
+ break;
+ case RYGEL_VIDEO_TRANSCODER_VIDEO_RESTRICTIONS:
+ g_value_take_string (value, gst_caps_to_string (priv->video_restrictions));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
+rygel_video_transcoder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) {
+ RygelVideoTranscoder *self = RYGEL_VIDEO_TRANSCODER (object);
+ RygelVideoTranscoderPrivate *priv = self->priv;
+
+ switch (property_id) {
+ case RYGEL_VIDEO_TRANSCODER_VIDEO_BITRATE:
+ priv->video_bitrate = g_value_get_int (value);
+ break;
+ case RYGEL_VIDEO_TRANSCODER_VIDEO_CAPS:
+ if (priv->video_codec_format) {
+ gst_caps_unref (priv->video_codec_format);
+ }
+ priv->video_codec_format = gst_caps_from_string (g_value_get_string (value));
+ break;
+ case RYGEL_VIDEO_TRANSCODER_VIDEO_RESTRICTIONS:
+ if (priv->video_restrictions) {
+ gst_caps_unref (priv->video_restrictions);
+ }
+ priv->video_restrictions = gst_caps_from_string (g_value_get_string (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
diff --git a/src/rygel-video-transcoder.h b/src/rygel-video-transcoder.h
index 90acaca..c03fdf2 100644
--- a/src/rygel-video-transcoder.h
+++ b/src/rygel-video-transcoder.h
@@ -57,8 +57,6 @@ struct _RygelVideoTranscoderClass {
GType rygel_video_transcoder_get_type (void) G_GNUC_CONST;
-RygelVideoTranscoder* rygel_video_transcoder_new (const gchar *content_type, gint audio_bitrate, gint video_bitrate, const gchar *container_caps, const gchar *audio_codec_caps, const gchar *video_codec_caps, const gchar *extension, const gchar *restrictions);
-
G_END_DECLS
#endif /* __RYGEL_GST_0_10_MEDIA_ENGINE_VIDEO_TRANSCODER_H__ */
diff --git a/src/rygel-wmv-transcoder.c b/src/rygel-wmv-transcoder.c
index c5d2f4c..76ffbe8 100644
--- a/src/rygel-wmv-transcoder.c
+++ b/src/rygel-wmv-transcoder.c
@@ -29,15 +29,20 @@ G_DEFINE_TYPE (RygelWMVTranscoder, rygel_wmv_transcoder, RYGEL_TYPE_VIDEO_TRANSC
#define RYGEL_WMV_TRANSCODER_VIDEO_BITRATE 1200
#define RYGEL_WMV_TRANSCODER_AUDIO_BITRATE 64
-RygelWMVTranscoder* rygel_wmv_transcoder_construct (GType object_type) {
- RygelWMVTranscoder *self = NULL;
- self = RYGEL_WMV_TRANSCODER (rygel_video_transcoder_construct (object_type, "video/x-ms-wmv", "WMVHIGH_FULL", RYGEL_WMV_TRANSCODER_AUDIO_BITRATE, RYGEL_WMV_TRANSCODER_VIDEO_BITRATE, "video/x-ms-asf,parsed=true", "audio/x-wma,channels=2,wmaversion=1", "video/x-wmv,wmvversion=1", "wmv", NULL));
- return self;
-}
-
RygelWMVTranscoder*
rygel_wmv_transcoder_new (void) {
- return rygel_wmv_transcoder_construct (RYGEL_TYPE_WMV_TRANSCODER);
+ return RYGEL_WMV_TRANSCODER (g_object_new (RYGEL_TYPE_WMV_TRANSCODER,
+ "mime-type", "video/x-ms-wmv",
+ "dlna-profile", "WMVHIGH_FULL",
+ "extension", "wmv",
+ /* No "preset". */
+ "audio-bitrate", RYGEL_WMV_TRANSCODER_AUDIO_BITRATE,
+ "container-caps", "video/x-ms-asf,parsed=true",
+ "audio-caps", "audio/x-wma,channels=2,wmaversion=1",
+ "video-bitrate", RYGEL_WMV_TRANSCODER_VIDEO_BITRATE,
+ "video-caps", "video/x-wmv,wmvversion=1",
+ /* No "video-restrictions". */
+ NULL));
}
static void
@@ -46,7 +51,5 @@ rygel_wmv_transcoder_class_init (RygelWMVTranscoderClass *klass) {
}
static void
-rygel_wmv_transcoder_init (RygelWMVTranscoder *self) {
+rygel_wmv_transcoder_init (RygelWMVTranscoder *self G_GNUC_UNUSED) {
}
-
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]