[rygel-gst-0-10-media-engine] cleanup



commit a94e9105bf99abd5522021f47e0e5d58cf6eedd7
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Dec 20 17:21:09 2012 +0100

    cleanup

 src/rygel-aac-transcoder.c   |   25 +++++++----------
 src/rygel-audio-transcoder.c |   10 +++---
 src/rygel-avc-transcoder.c   |   60 +++++++++++++++++++-----------------------
 src/rygel-l16-transcoder.c   |    8 +++---
 src/rygel-mp2ts-transcoder.c |    8 +++---
 src/rygel-video-transcoder.c |   10 +++---
 6 files changed, 55 insertions(+), 66 deletions(-)
---
diff --git a/src/rygel-aac-transcoder.c b/src/rygel-aac-transcoder.c
index c111511..f46da27 100644
--- a/src/rygel-aac-transcoder.c
+++ b/src/rygel-aac-transcoder.c
@@ -26,30 +26,25 @@ G_DEFINE_TYPE (RygelAACTranscoder, rygel_aac_transcoder, RYGEL_TYPE_AUDIO_TRANSC
 
 #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_new (void);
-RygelAACTranscoder* rygel_aac_transcoder_construct (GType object_type);
-void rygel_gst_transcoder_set_preset (RygelGstTranscoder* self, const gchar* value);
 
-
-RygelAACTranscoder* rygel_aac_transcoder_construct (GType object_type) {
-  RygelAACTranscoder * self = NULL;
-  self = (RygelAACTranscoder*) 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 ((RygelGstTranscoder*) self, "Rygel AAC_ADTS_320 preset");
+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;
 }
 
-
-RygelAACTranscoder* rygel_aac_transcoder_new (void) {
+RygelAACTranscoder*
+rygel_aac_transcoder_new (void) {
   return rygel_aac_transcoder_construct (RYGEL_TYPE_AAC_TRANSCODER);
 }
 
-
-static void rygel_aac_transcoder_class_init (RygelAACTranscoderClass * klass) {
+static void
+rygel_aac_transcoder_class_init (RygelAACTranscoderClass * klass) {
   rygel_aac_transcoder_parent_class = g_type_class_peek_parent (klass);
 }
 
-
-static void rygel_aac_transcoder_init (RygelAACTranscoder * self) {
+static void
+rygel_aac_transcoder_init (RygelAACTranscoder * self) {
 }
 
-
diff --git a/src/rygel-audio-transcoder.c b/src/rygel-audio-transcoder.c
index 3ee8631..a3f04d7 100644
--- a/src/rygel-audio-transcoder.c
+++ b/src/rygel-audio-transcoder.c
@@ -76,13 +76,13 @@ static GUPnPDIDLLiteResource*
 rygel_audio_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
   RygelAudioTranscoder * self;
   GUPnPDIDLLiteResource* resource;
-  GError *_inner_error_ = NULL;
+  GError *inner_error = NULL;
 
   self = RYGEL_AUDIO_TRANSCODER (base);
 
-  resource = RYGEL_TRANSCODER_CLASS (rygel_audio_transcoder_parent_class)->add_resource (RYGEL_TRANSCODER (self), didl_item, item, manager, &_inner_error_);
-  if (_inner_error_ != NULL) {
-    g_propagate_error (error, _inner_error_);
+  resource = RYGEL_TRANSCODER_CLASS (rygel_audio_transcoder_parent_class)->add_resource (RYGEL_TRANSCODER (self), didl_item, item, manager, &inner_error);
+  if (inner_error != NULL) {
+    g_propagate_error (error, inner_error);
     return NULL;
   }
 
@@ -128,7 +128,7 @@ rygel_audio_transcoder_real_get_encoding_profile (RygelGstTranscoder* base) {
 
   self = RYGEL_AUDIO_TRANSCODER (base);
 
-  preset = rygel_gst_transcoder_get_preset ((RygelGstTranscoder*) self);
+  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);
   gst_encoding_profile_set_name (enc_audio_profile, "audio");
 
diff --git a/src/rygel-avc-transcoder.c b/src/rygel-avc-transcoder.c
index 334b0c2..2cd7bb1 100644
--- a/src/rygel-avc-transcoder.c
+++ b/src/rygel-avc-transcoder.c
@@ -31,62 +31,56 @@ G_DEFINE_TYPE (RygelAVCTranscoder, rygel_avc_transcoder, RYGEL_TYPE_VIDEO_TRANSC
 #define RYGEL_AVC_TRANSCODER_VIDEO_CAPS "video/x-h264,stream-format=avc"
 #define RYGEL_AVC_TRANSCODER_RESTRICTIONS "video/x-raw-yuv,framerate=(fraction)15/1,width=352,height=288"
 
-static GUPnPDIDLLiteResource* rygel_avc_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error);
+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 = NULL;
-  self = (RygelAVCTranscoder*) 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 ((RygelGstTranscoder*) self, "Rygel AVC_MP4_BL_CIF15_AAC_520 preset");
+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) {
+RygelAVCTranscoder*
+rygel_avc_transcoder_new (void) {
   return rygel_avc_transcoder_construct (RYGEL_TYPE_AVC_TRANSCODER);
 }
 
-
-static GUPnPDIDLLiteResource* rygel_avc_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
+static GUPnPDIDLLiteResource*
+rygel_avc_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
   RygelAVCTranscoder * self;
-  GUPnPDIDLLiteResource* result = NULL;
-  GUPnPDIDLLiteItem* _tmp0_;
-  RygelMediaItem* _tmp1_;
-  RygelTranscodeManager* _tmp2_;
-  GUPnPDIDLLiteResource* _tmp3_ = NULL;
   GUPnPDIDLLiteResource* resource;
-  GError * _inner_error_ = NULL;
-  self = (RygelAVCTranscoder*) base;
+  GError* inner_error = NULL;
+
   g_return_val_if_fail (didl_item != NULL, NULL);
   g_return_val_if_fail (item != NULL, NULL);
   g_return_val_if_fail (manager != NULL, NULL);
-  _tmp0_ = didl_item;
-  _tmp1_ = item;
-  _tmp2_ = manager;
-  _tmp3_ = RYGEL_TRANSCODER_CLASS (rygel_avc_transcoder_parent_class)->add_resource ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_VIDEO_TRANSCODER, RygelVideoTranscoder), _tmp0_, _tmp1_, _tmp2_, &_inner_error_);
-  resource = _tmp3_;
-  if (_inner_error_ != NULL) {
-    g_propagate_error (error, _inner_error_);
+
+  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);
     return NULL;
   }
-  if (resource == NULL) {
-    result = NULL;
-    _g_object_unref0 (resource);
-    return result;
+
+  if (!resource) {
+    return NULL;
   }
+
   gupnp_didl_lite_resource_set_width (resource, 352);
   gupnp_didl_lite_resource_set_height (resource, 288);
-  result = resource;
-  return result;
-}
 
+  return resource;
+}
 
-static void rygel_avc_transcoder_class_init (RygelAVCTranscoderClass * klass) {
+static void
+rygel_avc_transcoder_class_init (RygelAVCTranscoderClass * klass) {
   rygel_avc_transcoder_parent_class = g_type_class_peek_parent (klass);
   RYGEL_TRANSCODER_CLASS (klass)->add_resource = rygel_avc_transcoder_real_add_resource;
 }
 
-
-static void rygel_avc_transcoder_init (RygelAVCTranscoder * self) {
+static void
+rygel_avc_transcoder_init (RygelAVCTranscoder * self) {
 }
 
diff --git a/src/rygel-l16-transcoder.c b/src/rygel-l16-transcoder.c
index 5f8a1e1..4786997 100644
--- a/src/rygel-l16-transcoder.c
+++ b/src/rygel-l16-transcoder.c
@@ -202,7 +202,7 @@ rygel_l16_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem
   RygelTranscodeManager* _tmp2_;
   GUPnPDIDLLiteResource* _tmp3_ = NULL;
   GUPnPDIDLLiteResource* resource;
-  GError * _inner_error_ = NULL;
+  GError * inner_error = NULL;
   self = (RygelL16Transcoder*) base;
   g_return_val_if_fail (didl_item != NULL, NULL);
   g_return_val_if_fail (item != NULL, NULL);
@@ -210,10 +210,10 @@ rygel_l16_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem
   _tmp0_ = didl_item;
   _tmp1_ = item;
   _tmp2_ = manager;
-  _tmp3_ = RYGEL_TRANSCODER_CLASS (rygel_l16_transcoder_parent_class)->add_resource ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoder), _tmp0_, _tmp1_, _tmp2_, &_inner_error_);
+  _tmp3_ = RYGEL_TRANSCODER_CLASS (rygel_l16_transcoder_parent_class)->add_resource ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoder), _tmp0_, _tmp1_, _tmp2_, &inner_error);
   resource = _tmp3_;
-  if (_inner_error_ != NULL) {
-    g_propagate_error (error, _inner_error_);
+  if (inner_error != NULL) {
+    g_propagate_error (error, inner_error);
     return NULL;
   }
   if (resource == NULL) {
diff --git a/src/rygel-mp2ts-transcoder.c b/src/rygel-mp2ts-transcoder.c
index daf84d6..5562afd 100644
--- a/src/rygel-mp2ts-transcoder.c
+++ b/src/rygel-mp2ts-transcoder.c
@@ -113,7 +113,7 @@ static GUPnPDIDLLiteResource* rygel_mp2_ts_transcoder_real_add_resource (RygelTr
   gint _tmp5_;
   RygelMP2TSProfile _tmp6_;
   gint _tmp7_;
-  GError * _inner_error_ = NULL;
+  GError * inner_error = NULL;
   self = (RygelMP2TSTranscoder*) base;
   g_return_val_if_fail (didl_item != NULL, NULL);
   g_return_val_if_fail (item != NULL, NULL);
@@ -121,10 +121,10 @@ static GUPnPDIDLLiteResource* rygel_mp2_ts_transcoder_real_add_resource (RygelTr
   _tmp0_ = didl_item;
   _tmp1_ = item;
   _tmp2_ = manager;
-  _tmp3_ = RYGEL_TRANSCODER_CLASS (rygel_mp2_ts_transcoder_parent_class)->add_resource ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_VIDEO_TRANSCODER, RygelVideoTranscoder), _tmp0_, _tmp1_, _tmp2_, &_inner_error_);
+  _tmp3_ = RYGEL_TRANSCODER_CLASS (rygel_mp2_ts_transcoder_parent_class)->add_resource ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_VIDEO_TRANSCODER, RygelVideoTranscoder), _tmp0_, _tmp1_, _tmp2_, &inner_error);
   resource = _tmp3_;
-  if (_inner_error_ != NULL) {
-    g_propagate_error (error, _inner_error_);
+  if (inner_error != NULL) {
+    g_propagate_error (error, inner_error);
     return NULL;
   }
   if (resource == NULL) {
diff --git a/src/rygel-video-transcoder.c b/src/rygel-video-transcoder.c
index 2e175a1..2c35309 100644
--- a/src/rygel-video-transcoder.c
+++ b/src/rygel-video-transcoder.c
@@ -110,7 +110,7 @@ static GUPnPDIDLLiteResource* rygel_video_transcoder_real_add_resource (RygelTra
   gint _tmp11_;
   gint _tmp12_;
   gint _tmp13_;
-  GError * _inner_error_ = NULL;
+  GError * inner_error = NULL;
   self = (RygelVideoTranscoder*) base;
   g_return_val_if_fail (didl_item != NULL, NULL);
   g_return_val_if_fail (item != NULL, NULL);
@@ -118,10 +118,10 @@ static GUPnPDIDLLiteResource* rygel_video_transcoder_real_add_resource (RygelTra
   _tmp0_ = didl_item;
   _tmp1_ = item;
   _tmp2_ = manager;
-  _tmp3_ = RYGEL_TRANSCODER_CLASS (rygel_video_transcoder_parent_class)->add_resource ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoder), _tmp0_, _tmp1_, _tmp2_, &_inner_error_);
+  _tmp3_ = RYGEL_TRANSCODER_CLASS (rygel_video_transcoder_parent_class)->add_resource ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoder), _tmp0_, _tmp1_, _tmp2_, &inner_error);
   resource = _tmp3_;
-  if (_inner_error_ != NULL) {
-    g_propagate_error (error, _inner_error_);
+  if (inner_error != NULL) {
+    g_propagate_error (error, inner_error);
     return NULL;
   }
   if (resource == NULL) {
@@ -220,7 +220,7 @@ static GstEncodingProfile* rygel_video_transcoder_real_get_encoding_profile (Ryg
   _tmp0_ = RYGEL_GST_TRANSCODER_CLASS (rygel_video_transcoder_parent_class)->get_encoding_profile ((RygelGstTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoder));
   enc_container_profile = GST_IS_ENCODING_CONTAINER_PROFILE (_tmp0_) ? ((GstEncodingContainerProfile*) _tmp0_) : NULL;
   _tmp1_ = self->priv->video_codec_format;
-  _tmp2_ = rygel_gst_transcoder_get_preset ((RygelGstTranscoder*) self);
+  _tmp2_ = rygel_gst_transcoder_get_preset (RYGEL_GST_TRANSCODER (self));
   _tmp3_ = _tmp2_;
   _tmp4_ = self->priv->video_restrictions;
   _tmp5_ = gst_encoding_video_profile_new (_tmp1_, _tmp3_, _tmp4_, (guint) 1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]