[rygel-gst-0-10-media-engine] Replace tabs with 2 spaces.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel-gst-0-10-media-engine] Replace tabs with 2 spaces.
- Date: Wed, 19 Dec 2012 10:46:04 +0000 (UTC)
commit d257540bc32c070ea70c6b4606cf0b4bd5744f73
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Dec 19 11:45:58 2012 +0100
Replace tabs with 2 spaces.
src/rygel-aac-transcoder.c | 12 +-
src/rygel-avc-transcoder.c | 74 ++--
src/rygel-gst-data-source.c | 1394 +++++++++++++++++++++---------------------
src/rygel-gst-data-source.h | 4 +-
src/rygel-gst-media-engine.c | 4 +-
src/rygel-gst-sink.c | 558 +++++++++---------
src/rygel-gst-utils.c | 522 ++++++++--------
src/rygel-mp2ts-transcoder.c | 356 ++++++------
src/rygel-mp2ts-transcoder.h | 4 +-
src/rygel-mp3-transcoder.c | 10 +-
src/rygel-wmv-transcoder.c | 10 +-
11 files changed, 1474 insertions(+), 1474 deletions(-)
---
diff --git a/src/rygel-aac-transcoder.c b/src/rygel-aac-transcoder.c
index a147758..c111511 100644
--- a/src/rygel-aac-transcoder.c
+++ b/src/rygel-aac-transcoder.c
@@ -32,20 +32,20 @@ void rygel_gst_transcoder_set_preset (RygelGstTranscoder* self, const gchar* val
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");
- return self;
+ 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");
+ return self;
}
RygelAACTranscoder* rygel_aac_transcoder_new (void) {
- return rygel_aac_transcoder_construct (RYGEL_TYPE_AAC_TRANSCODER);
+ return rygel_aac_transcoder_construct (RYGEL_TYPE_AAC_TRANSCODER);
}
static void rygel_aac_transcoder_class_init (RygelAACTranscoderClass * klass) {
- rygel_aac_transcoder_parent_class = g_type_class_peek_parent (klass);
+ rygel_aac_transcoder_parent_class = g_type_class_peek_parent (klass);
}
diff --git a/src/rygel-avc-transcoder.c b/src/rygel-avc-transcoder.c
index 6bad8a9..334b0c2 100644
--- a/src/rygel-avc-transcoder.c
+++ b/src/rygel-avc-transcoder.c
@@ -35,55 +35,55 @@ static GUPnPDIDLLiteResource* rygel_avc_transcoder_real_add_resource (RygelTrans
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");
- return self;
+ 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");
+ return self;
}
RygelAVCTranscoder* rygel_avc_transcoder_new (void) {
- return rygel_avc_transcoder_construct (RYGEL_TYPE_AVC_TRANSCODER);
+ 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) {
- RygelAVCTranscoder * self;
- GUPnPDIDLLiteResource* result = NULL;
- GUPnPDIDLLiteItem* _tmp0_;
- RygelMediaItem* _tmp1_;
- RygelTranscodeManager* _tmp2_;
- GUPnPDIDLLiteResource* _tmp3_ = NULL;
- GUPnPDIDLLiteResource* resource;
- GError * _inner_error_ = NULL;
- self = (RygelAVCTranscoder*) base;
- 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_);
- return NULL;
- }
- if (resource == NULL) {
- result = NULL;
- _g_object_unref0 (resource);
- return result;
- }
- gupnp_didl_lite_resource_set_width (resource, 352);
- gupnp_didl_lite_resource_set_height (resource, 288);
- result = resource;
- return result;
+ RygelAVCTranscoder * self;
+ GUPnPDIDLLiteResource* result = NULL;
+ GUPnPDIDLLiteItem* _tmp0_;
+ RygelMediaItem* _tmp1_;
+ RygelTranscodeManager* _tmp2_;
+ GUPnPDIDLLiteResource* _tmp3_ = NULL;
+ GUPnPDIDLLiteResource* resource;
+ GError * _inner_error_ = NULL;
+ self = (RygelAVCTranscoder*) base;
+ 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_);
+ return NULL;
+ }
+ if (resource == NULL) {
+ result = NULL;
+ _g_object_unref0 (resource);
+ return result;
+ }
+ gupnp_didl_lite_resource_set_width (resource, 352);
+ gupnp_didl_lite_resource_set_height (resource, 288);
+ result = resource;
+ return result;
}
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;
+ rygel_avc_transcoder_parent_class = g_type_class_peek_parent (klass);
+ RYGEL_TRANSCODER_CLASS (klass)->add_resource = rygel_avc_transcoder_real_add_resource;
}
diff --git a/src/rygel-gst-data-source.c b/src/rygel-gst-data-source.c
index 836874b..2fbfe93 100644
--- a/src/rygel-gst-data-source.c
+++ b/src/rygel-gst-data-source.c
@@ -30,16 +30,16 @@ G_DEFINE_TYPE_WITH_CODE (RygelGstDataSource, rygel_gst_data_source, G_TYPE_OBJEC
G_IMPLEMENT_INTERFACE (RYGEL_TYPE_DATA_SOURCE, rygel_gst_data_source_rygel_data_source_interface_init))
typedef enum {
- RYGEL_GST_DATA_SOURCE_ERROR_NOT_COMPATIBLE
+ RYGEL_GST_DATA_SOURCE_ERROR_NOT_COMPATIBLE
} RygelGstDataSourceError;
#define RYGEL_GST_DATA_SOURCE_ERROR rygel_gst_data_source_error_quark ()
struct _RygelGstDataSourcePrivate {
- GstPipeline* pipeline;
- RygelHTTPSeek* seek;
- RygelGstSink* sink;
- guint bus_watch_id;
+ GstPipeline* pipeline;
+ RygelHTTPSeek* seek;
+ RygelGstSink* sink;
+ guint bus_watch_id;
};
static RygelDataSourceIface* rygel_gst_data_source_rygel_data_source_parent_iface = NULL;
@@ -47,7 +47,7 @@ static RygelDataSourceIface* rygel_gst_data_source_rygel_data_source_parent_ifac
GQuark rygel_gst_data_source_error_quark (void);
#define RYGEL_GST_DATA_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_TYPE_GST_DATA_SOURCE, RygelGstDataSourcePrivate))
enum {
- RYGEL_GST_DATA_SOURCE_DUMMY_PROPERTY
+ RYGEL_GST_DATA_SOURCE_DUMMY_PROPERTY
};
RygelGstDataSource* rygel_gst_data_source_new (const gchar* uri, GError** error);
RygelGstDataSource* rygel_gst_data_source_construct (GType object_type, const gchar* uri, GError** error);
@@ -81,800 +81,800 @@ static void rygel_gst_data_source_finalize (GObject* obj);
GQuark rygel_gst_data_source_error_quark (void) {
- return g_quark_from_static_string ("rygel_gst_data_source_error-quark");
+ return g_quark_from_static_string ("rygel_gst_data_source_error-quark");
}
RygelGstDataSource* rygel_gst_data_source_construct (GType object_type, const gchar* uri, GError** error) {
- RygelGstDataSource * self = NULL;
- const gchar* _tmp0_;
- GstElement* _tmp1_ = NULL;
- GstElement* _tmp2_;
- GError * _inner_error_ = NULL;
- g_return_val_if_fail (uri != NULL, NULL);
- self = (RygelGstDataSource*) g_object_new (object_type, NULL);
- _tmp0_ = uri;
- _tmp1_ = rygel_gst_utils_create_source_for_uri (_tmp0_);
- _gst_object_unref0 (self->src);
- self->src = _tmp1_;
- _tmp2_ = self->src;
- if (_tmp2_ == NULL) {
- const gchar* _tmp3_ = NULL;
- gchar* _tmp4_;
- gchar* msg;
- const gchar* _tmp5_;
- const gchar* _tmp6_;
- GError* _tmp7_;
- _tmp3_ = _ ("Could not create GstElement for URI %s");
- _tmp4_ = g_strdup (_tmp3_);
- msg = _tmp4_;
- _tmp5_ = msg;
- _tmp6_ = uri;
- _tmp7_ = g_error_new (RYGEL_GST_DATA_SOURCE_ERROR, RYGEL_GST_DATA_SOURCE_ERROR_NOT_COMPATIBLE, _tmp5_, _tmp6_);
- _inner_error_ = _tmp7_;
- g_propagate_error (error, _inner_error_);
- _g_free0 (msg);
- _g_object_unref0 (self);
- return NULL;
- }
- return self;
+ RygelGstDataSource * self = NULL;
+ const gchar* _tmp0_;
+ GstElement* _tmp1_ = NULL;
+ GstElement* _tmp2_;
+ GError * _inner_error_ = NULL;
+ g_return_val_if_fail (uri != NULL, NULL);
+ self = (RygelGstDataSource*) g_object_new (object_type, NULL);
+ _tmp0_ = uri;
+ _tmp1_ = rygel_gst_utils_create_source_for_uri (_tmp0_);
+ _gst_object_unref0 (self->src);
+ self->src = _tmp1_;
+ _tmp2_ = self->src;
+ if (_tmp2_ == NULL) {
+ const gchar* _tmp3_ = NULL;
+ gchar* _tmp4_;
+ gchar* msg;
+ const gchar* _tmp5_;
+ const gchar* _tmp6_;
+ GError* _tmp7_;
+ _tmp3_ = _ ("Could not create GstElement for URI %s");
+ _tmp4_ = g_strdup (_tmp3_);
+ msg = _tmp4_;
+ _tmp5_ = msg;
+ _tmp6_ = uri;
+ _tmp7_ = g_error_new (RYGEL_GST_DATA_SOURCE_ERROR, RYGEL_GST_DATA_SOURCE_ERROR_NOT_COMPATIBLE, _tmp5_, _tmp6_);
+ _inner_error_ = _tmp7_;
+ g_propagate_error (error, _inner_error_);
+ _g_free0 (msg);
+ _g_object_unref0 (self);
+ return NULL;
+ }
+ return self;
}
RygelGstDataSource* rygel_gst_data_source_new (const gchar* uri, GError** error) {
- return rygel_gst_data_source_construct (RYGEL_TYPE_GST_DATA_SOURCE, uri, error);
+ return rygel_gst_data_source_construct (RYGEL_TYPE_GST_DATA_SOURCE, uri, error);
}
static gpointer _gst_object_ref0 (gpointer self) {
- return self ? gst_object_ref (self) : NULL;
+ return self ? gst_object_ref (self) : NULL;
}
RygelGstDataSource* rygel_gst_data_source_construct_from_element (GType object_type, GstElement* element) {
- RygelGstDataSource * self = NULL;
- GstElement* _tmp0_;
- GstElement* _tmp1_;
- g_return_val_if_fail (element != NULL, NULL);
- self = (RygelGstDataSource*) g_object_new (object_type, NULL);
- _tmp0_ = element;
- _tmp1_ = _gst_object_ref0 (_tmp0_);
- _gst_object_unref0 (self->src);
- self->src = _tmp1_;
- return self;
+ RygelGstDataSource * self = NULL;
+ GstElement* _tmp0_;
+ GstElement* _tmp1_;
+ g_return_val_if_fail (element != NULL, NULL);
+ self = (RygelGstDataSource*) g_object_new (object_type, NULL);
+ _tmp0_ = element;
+ _tmp1_ = _gst_object_ref0 (_tmp0_);
+ _gst_object_unref0 (self->src);
+ self->src = _tmp1_;
+ return self;
}
RygelGstDataSource* rygel_gst_data_source_new_from_element (GstElement* element) {
- return rygel_gst_data_source_construct_from_element (RYGEL_TYPE_GST_DATA_SOURCE, element);
+ return rygel_gst_data_source_construct_from_element (RYGEL_TYPE_GST_DATA_SOURCE, element);
}
static gpointer _g_object_ref0 (gpointer self) {
- return self ? g_object_ref (self) : NULL;
+ return self ? g_object_ref (self) : NULL;
}
static void rygel_gst_data_source_real_start (RygelDataSource* base, RygelHTTPSeek* offsets, GError** error) {
- RygelGstDataSource * self;
- RygelHTTPSeek* _tmp0_;
- RygelHTTPSeek* _tmp1_;
- GstElement* _tmp2_;
- RygelHTTPSeek* _tmp3_;
- GError * _inner_error_ = NULL;
- self = (RygelGstDataSource*) base;
- _tmp0_ = offsets;
- _tmp1_ = _g_object_ref0 (_tmp0_);
- _g_object_unref0 (self->priv->seek);
- self->priv->seek = _tmp1_;
- _tmp2_ = self->src;
- rygel_gst_data_source_prepare_pipeline (self, "RygelGstDataSource", _tmp2_, &_inner_error_);
- if (_inner_error_ != NULL) {
- g_propagate_error (error, _inner_error_);
- return;
- }
- _tmp3_ = self->priv->seek;
- if (_tmp3_ != NULL) {
- GstPipeline* _tmp4_;
- _tmp4_ = self->priv->pipeline;
- gst_element_set_state ((GstElement*) _tmp4_, GST_STATE_PAUSED);
- } else {
- GstPipeline* _tmp5_;
- _tmp5_ = self->priv->pipeline;
- gst_element_set_state ((GstElement*) _tmp5_, GST_STATE_PLAYING);
- }
+ RygelGstDataSource * self;
+ RygelHTTPSeek* _tmp0_;
+ RygelHTTPSeek* _tmp1_;
+ GstElement* _tmp2_;
+ RygelHTTPSeek* _tmp3_;
+ GError * _inner_error_ = NULL;
+ self = (RygelGstDataSource*) base;
+ _tmp0_ = offsets;
+ _tmp1_ = _g_object_ref0 (_tmp0_);
+ _g_object_unref0 (self->priv->seek);
+ self->priv->seek = _tmp1_;
+ _tmp2_ = self->src;
+ rygel_gst_data_source_prepare_pipeline (self, "RygelGstDataSource", _tmp2_, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ g_propagate_error (error, _inner_error_);
+ return;
+ }
+ _tmp3_ = self->priv->seek;
+ if (_tmp3_ != NULL) {
+ GstPipeline* _tmp4_;
+ _tmp4_ = self->priv->pipeline;
+ gst_element_set_state ((GstElement*) _tmp4_, GST_STATE_PAUSED);
+ } else {
+ GstPipeline* _tmp5_;
+ _tmp5_ = self->priv->pipeline;
+ gst_element_set_state ((GstElement*) _tmp5_, GST_STATE_PLAYING);
+ }
}
static void rygel_gst_data_source_real_freeze (RygelDataSource* base) {
- RygelGstDataSource * self;
- RygelGstSink* _tmp0_;
- self = (RygelGstDataSource*) base;
- _tmp0_ = self->priv->sink;
- rygel_gst_sink_freeze (_tmp0_);
+ RygelGstDataSource * self;
+ RygelGstSink* _tmp0_;
+ self = (RygelGstDataSource*) base;
+ _tmp0_ = self->priv->sink;
+ rygel_gst_sink_freeze (_tmp0_);
}
static void rygel_gst_data_source_real_thaw (RygelDataSource* base) {
- RygelGstDataSource * self;
- RygelGstSink* _tmp0_;
- self = (RygelGstDataSource*) base;
- _tmp0_ = self->priv->sink;
- rygel_gst_sink_thaw (_tmp0_);
+ RygelGstDataSource * self;
+ RygelGstSink* _tmp0_;
+ self = (RygelGstDataSource*) base;
+ _tmp0_ = self->priv->sink;
+ rygel_gst_sink_thaw (_tmp0_);
}
static gboolean __lambda4_ (RygelGstDataSource* self) {
- gboolean result = FALSE;
- g_signal_emit_by_name ((RygelDataSource*) self, "done");
- result = FALSE;
- return result;
+ gboolean result = FALSE;
+ g_signal_emit_by_name ((RygelDataSource*) self, "done");
+ result = FALSE;
+ return result;
}
static gboolean ___lambda4__gsource_func (gpointer self) {
- gboolean result;
- result = __lambda4_ (self);
- return result;
+ gboolean result;
+ result = __lambda4_ (self);
+ return result;
}
static void rygel_gst_data_source_real_stop (RygelDataSource* base) {
- RygelGstDataSource * self;
- RygelGstSink* _tmp0_;
- GCancellable* _tmp1_;
- GstPipeline* _tmp2_;
- guint _tmp3_;
- self = (RygelGstDataSource*) base;
- _tmp0_ = self->priv->sink;
- _tmp1_ = _tmp0_->cancellable;
- g_cancellable_cancel (_tmp1_);
- _tmp2_ = self->priv->pipeline;
- gst_element_set_state ((GstElement*) _tmp2_, GST_STATE_NULL);
- _tmp3_ = self->priv->bus_watch_id;
- g_source_remove (_tmp3_);
- g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda4__gsource_func, g_object_ref (self), g_object_unref);
+ RygelGstDataSource * self;
+ RygelGstSink* _tmp0_;
+ GCancellable* _tmp1_;
+ GstPipeline* _tmp2_;
+ guint _tmp3_;
+ self = (RygelGstDataSource*) base;
+ _tmp0_ = self->priv->sink;
+ _tmp1_ = _tmp0_->cancellable;
+ g_cancellable_cancel (_tmp1_);
+ _tmp2_ = self->priv->pipeline;
+ gst_element_set_state ((GstElement*) _tmp2_, GST_STATE_NULL);
+ _tmp3_ = self->priv->bus_watch_id;
+ g_source_remove (_tmp3_);
+ g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda4__gsource_func, g_object_ref (self), g_object_unref);
}
static void _rygel_gst_data_source_src_pad_added_gst_element_pad_added (GstElement* _sender, GstPad* pad, gpointer self) {
- rygel_gst_data_source_src_pad_added (self, _sender, pad);
+ rygel_gst_data_source_src_pad_added (self, _sender, pad);
}
static gboolean _rygel_gst_data_source_bus_handler_gst_bus_func (GstBus* bus, GstMessage* message, gpointer self) {
- gboolean result;
- result = rygel_gst_data_source_bus_handler (self, bus, message);
- return result;
+ gboolean result;
+ result = rygel_gst_data_source_bus_handler (self, bus, message);
+ return result;
}
static void rygel_gst_data_source_prepare_pipeline (RygelGstDataSource* self, const gchar* name, GstElement* src, GError** error) {
- RygelHTTPSeek* _tmp0_;
- RygelGstSink* _tmp1_;
- const gchar* _tmp2_;
- GstPipeline* _tmp3_;
- GstPipeline* _tmp4_;
- GstPipeline* _tmp7_;
- GstElement* _tmp8_;
- RygelGstSink* _tmp9_;
- GstElement* _tmp10_;
- guint16 _tmp11_;
- GstPipeline* _tmp27_;
- GstBus* _tmp28_ = NULL;
- GstBus* bus;
- GstBus* _tmp29_;
- guint _tmp30_ = 0U;
- GError * _inner_error_ = NULL;
- g_return_if_fail (self != NULL);
- g_return_if_fail (name != NULL);
- g_return_if_fail (src != NULL);
- _tmp0_ = self->priv->seek;
- _tmp1_ = rygel_gst_sink_new ((RygelDataSource*) self, _tmp0_);
- gst_object_ref_sink (_tmp1_);
- _gst_object_unref0 (self->priv->sink);
- self->priv->sink = _tmp1_;
- _tmp2_ = name;
- _tmp3_ = (GstPipeline*) gst_pipeline_new (_tmp2_);
- gst_object_ref_sink (_tmp3_);
- _gst_object_unref0 (self->priv->pipeline);
- self->priv->pipeline = _tmp3_;
- _tmp4_ = self->priv->pipeline;
- if (_tmp4_ == NULL) {
- const gchar* _tmp5_ = NULL;
- GError* _tmp6_;
- _tmp5_ = _ ("Failed to create pipeline");
- _tmp6_ = g_error_new_literal (RYGEL_DATA_SOURCE_ERROR, RYGEL_DATA_SOURCE_ERROR_GENERAL, _tmp5_);
- _inner_error_ = _tmp6_;
- g_propagate_error (error, _inner_error_);
- return;
- }
- _tmp7_ = self->priv->pipeline;
- _tmp8_ = src;
- _tmp9_ = self->priv->sink;
- gst_bin_add_many ((GstBin*) _tmp7_, _tmp8_, (GstElement*) _tmp9_, NULL);
- _tmp10_ = src;
- _tmp11_ = _tmp10_->numsrcpads;
- if (((gint) _tmp11_) == 0) {
- GstElement* _tmp12_;
- _tmp12_ = src;
- g_signal_connect_object (_tmp12_, "pad-added", (GCallback) _rygel_gst_data_source_src_pad_added_gst_element_pad_added, self, 0);
- } else {
- GstElement* _tmp13_;
- RygelGstSink* _tmp14_;
- gboolean _tmp15_ = FALSE;
- _tmp13_ = src;
- _tmp14_ = self->priv->sink;
- _tmp15_ = gst_element_link (_tmp13_, (GstElement*) _tmp14_);
- if (!_tmp15_) {
- const gchar* _tmp16_ = NULL;
- GstElement* _tmp17_;
- gchar* _tmp18_;
- gchar* _tmp19_;
- gchar* _tmp20_;
- RygelGstSink* _tmp21_;
- gchar* _tmp22_;
- gchar* _tmp23_;
- gchar* _tmp24_;
- GError* _tmp25_;
- GError* _tmp26_;
- _tmp16_ = _ ("Failed to link %s to %s");
- _tmp17_ = src;
- _tmp18_ = gst_object_get_name ((GstObject*) _tmp17_);
- _tmp19_ = _tmp18_;
- _tmp20_ = _tmp19_;
- _tmp21_ = self->priv->sink;
- _tmp22_ = gst_object_get_name ((GstObject*) _tmp21_);
- _tmp23_ = _tmp22_;
- _tmp24_ = _tmp23_;
- _tmp25_ = g_error_new (RYGEL_GST_ERROR, RYGEL_GST_ERROR_LINK, _tmp16_, _tmp20_, _tmp24_);
- _tmp26_ = _tmp25_;
- _g_free0 (_tmp24_);
- _g_free0 (_tmp20_);
- _inner_error_ = _tmp26_;
- g_propagate_error (error, _inner_error_);
- return;
- }
- }
- _tmp27_ = self->priv->pipeline;
- _tmp28_ = gst_pipeline_get_bus (_tmp27_);
- bus = _tmp28_;
- _tmp29_ = bus;
- _tmp30_ = gst_bus_add_watch_full (_tmp29_, G_PRIORITY_DEFAULT, _rygel_gst_data_source_bus_handler_gst_bus_func, g_object_ref (self), g_object_unref);
- self->priv->bus_watch_id = _tmp30_;
- _gst_object_unref0 (bus);
+ RygelHTTPSeek* _tmp0_;
+ RygelGstSink* _tmp1_;
+ const gchar* _tmp2_;
+ GstPipeline* _tmp3_;
+ GstPipeline* _tmp4_;
+ GstPipeline* _tmp7_;
+ GstElement* _tmp8_;
+ RygelGstSink* _tmp9_;
+ GstElement* _tmp10_;
+ guint16 _tmp11_;
+ GstPipeline* _tmp27_;
+ GstBus* _tmp28_ = NULL;
+ GstBus* bus;
+ GstBus* _tmp29_;
+ guint _tmp30_ = 0U;
+ GError * _inner_error_ = NULL;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (name != NULL);
+ g_return_if_fail (src != NULL);
+ _tmp0_ = self->priv->seek;
+ _tmp1_ = rygel_gst_sink_new ((RygelDataSource*) self, _tmp0_);
+ gst_object_ref_sink (_tmp1_);
+ _gst_object_unref0 (self->priv->sink);
+ self->priv->sink = _tmp1_;
+ _tmp2_ = name;
+ _tmp3_ = (GstPipeline*) gst_pipeline_new (_tmp2_);
+ gst_object_ref_sink (_tmp3_);
+ _gst_object_unref0 (self->priv->pipeline);
+ self->priv->pipeline = _tmp3_;
+ _tmp4_ = self->priv->pipeline;
+ if (_tmp4_ == NULL) {
+ const gchar* _tmp5_ = NULL;
+ GError* _tmp6_;
+ _tmp5_ = _ ("Failed to create pipeline");
+ _tmp6_ = g_error_new_literal (RYGEL_DATA_SOURCE_ERROR, RYGEL_DATA_SOURCE_ERROR_GENERAL, _tmp5_);
+ _inner_error_ = _tmp6_;
+ g_propagate_error (error, _inner_error_);
+ return;
+ }
+ _tmp7_ = self->priv->pipeline;
+ _tmp8_ = src;
+ _tmp9_ = self->priv->sink;
+ gst_bin_add_many ((GstBin*) _tmp7_, _tmp8_, (GstElement*) _tmp9_, NULL);
+ _tmp10_ = src;
+ _tmp11_ = _tmp10_->numsrcpads;
+ if (((gint) _tmp11_) == 0) {
+ GstElement* _tmp12_;
+ _tmp12_ = src;
+ g_signal_connect_object (_tmp12_, "pad-added", (GCallback) _rygel_gst_data_source_src_pad_added_gst_element_pad_added, self, 0);
+ } else {
+ GstElement* _tmp13_;
+ RygelGstSink* _tmp14_;
+ gboolean _tmp15_ = FALSE;
+ _tmp13_ = src;
+ _tmp14_ = self->priv->sink;
+ _tmp15_ = gst_element_link (_tmp13_, (GstElement*) _tmp14_);
+ if (!_tmp15_) {
+ const gchar* _tmp16_ = NULL;
+ GstElement* _tmp17_;
+ gchar* _tmp18_;
+ gchar* _tmp19_;
+ gchar* _tmp20_;
+ RygelGstSink* _tmp21_;
+ gchar* _tmp22_;
+ gchar* _tmp23_;
+ gchar* _tmp24_;
+ GError* _tmp25_;
+ GError* _tmp26_;
+ _tmp16_ = _ ("Failed to link %s to %s");
+ _tmp17_ = src;
+ _tmp18_ = gst_object_get_name ((GstObject*) _tmp17_);
+ _tmp19_ = _tmp18_;
+ _tmp20_ = _tmp19_;
+ _tmp21_ = self->priv->sink;
+ _tmp22_ = gst_object_get_name ((GstObject*) _tmp21_);
+ _tmp23_ = _tmp22_;
+ _tmp24_ = _tmp23_;
+ _tmp25_ = g_error_new (RYGEL_GST_ERROR, RYGEL_GST_ERROR_LINK, _tmp16_, _tmp20_, _tmp24_);
+ _tmp26_ = _tmp25_;
+ _g_free0 (_tmp24_);
+ _g_free0 (_tmp20_);
+ _inner_error_ = _tmp26_;
+ g_propagate_error (error, _inner_error_);
+ return;
+ }
+ }
+ _tmp27_ = self->priv->pipeline;
+ _tmp28_ = gst_pipeline_get_bus (_tmp27_);
+ bus = _tmp28_;
+ _tmp29_ = bus;
+ _tmp30_ = gst_bus_add_watch_full (_tmp29_, G_PRIORITY_DEFAULT, _rygel_gst_data_source_bus_handler_gst_bus_func, g_object_ref (self), g_object_unref);
+ self->priv->bus_watch_id = _tmp30_;
+ _gst_object_unref0 (bus);
}
static void rygel_gst_data_source_src_pad_added (RygelGstDataSource* self, GstElement* src, GstPad* src_pad) {
- GstPad* _tmp0_;
- GstCaps* _tmp1_ = NULL;
- GstCaps* caps;
- GstPipeline* _tmp2_;
- GstElement* _tmp3_ = NULL;
- GstElement* sink;
- GstPad* sink_pad = NULL;
- GstCaps* _tmp4_;
- GstElement* _tmp5_ = NULL;
- GstElement* depay;
- GstElement* _tmp6_;
- GstPad* _tmp29_;
- GstPad* _tmp30_;
- GstPadLinkReturn _tmp31_ = 0;
- GstElement* _tmp41_;
- g_return_if_fail (self != NULL);
- g_return_if_fail (src != NULL);
- g_return_if_fail (src_pad != NULL);
- _tmp0_ = src_pad;
- _tmp1_ = gst_pad_get_caps_reffed (_tmp0_);
- caps = _tmp1_;
- _tmp2_ = self->priv->pipeline;
- _tmp3_ = gst_bin_get_by_name ((GstBin*) _tmp2_, RYGEL_GST_SINK_NAME);
- sink = _tmp3_;
- _tmp4_ = caps;
- _tmp5_ = rygel_gst_utils_get_rtp_depayloader (_tmp4_);
- depay = _tmp5_;
- _tmp6_ = depay;
- if (_tmp6_ != NULL) {
- GstPipeline* _tmp7_;
- GstElement* _tmp8_;
- GstElement* _tmp9_;
- GstElement* _tmp10_;
- gboolean _tmp11_ = FALSE;
- GstElement* _tmp21_;
- GstPad* _tmp22_;
- GstCaps* _tmp23_;
- GstPad* _tmp24_ = NULL;
- _tmp7_ = self->priv->pipeline;
- _tmp8_ = depay;
- gst_bin_add ((GstBin*) _tmp7_, _tmp8_);
- _tmp9_ = depay;
- _tmp10_ = sink;
- _tmp11_ = gst_element_link (_tmp9_, _tmp10_);
- if (!_tmp11_) {
- const gchar* _tmp12_ = NULL;
- GstElement* _tmp13_;
- gchar* _tmp14_;
- gchar* _tmp15_;
- gchar* _tmp16_;
- GstElement* _tmp17_;
- gchar* _tmp18_;
- gchar* _tmp19_;
- gchar* _tmp20_;
- _tmp12_ = _ ("Failed to link %s to %s");
- _tmp13_ = depay;
- _tmp14_ = gst_object_get_name ((GstObject*) _tmp13_);
- _tmp15_ = _tmp14_;
- _tmp16_ = _tmp15_;
- _tmp17_ = sink;
- _tmp18_ = gst_object_get_name ((GstObject*) _tmp17_);
- _tmp19_ = _tmp18_;
- _tmp20_ = _tmp19_;
- g_critical (_tmp12_, _tmp16_, _tmp20_);
- _g_free0 (_tmp20_);
- _g_free0 (_tmp16_);
- g_signal_emit_by_name ((RygelDataSource*) self, "done");
- _gst_object_unref0 (depay);
- _gst_object_unref0 (sink_pad);
- _gst_object_unref0 (sink);
- _gst_caps_unref0 (caps);
- return;
- }
- _tmp21_ = depay;
- _tmp22_ = src_pad;
- _tmp23_ = caps;
- _tmp24_ = gst_element_get_compatible_pad (_tmp21_, _tmp22_, _tmp23_);
- _gst_object_unref0 (sink_pad);
- sink_pad = _tmp24_;
- } else {
- GstElement* _tmp25_;
- GstPad* _tmp26_;
- GstCaps* _tmp27_;
- GstPad* _tmp28_ = NULL;
- _tmp25_ = sink;
- _tmp26_ = src_pad;
- _tmp27_ = caps;
- _tmp28_ = gst_element_get_compatible_pad (_tmp25_, _tmp26_, _tmp27_);
- _gst_object_unref0 (sink_pad);
- sink_pad = _tmp28_;
- }
- _tmp29_ = src_pad;
- _tmp30_ = sink_pad;
- _tmp31_ = gst_pad_link (_tmp29_, _tmp30_);
- if (_tmp31_ != GST_PAD_LINK_OK) {
- const gchar* _tmp32_ = NULL;
- GstPad* _tmp33_;
- gchar* _tmp34_;
- gchar* _tmp35_;
- gchar* _tmp36_;
- GstPad* _tmp37_;
- gchar* _tmp38_;
- gchar* _tmp39_;
- gchar* _tmp40_;
- _tmp32_ = _ ("Failed to link pad %s to %s");
- _tmp33_ = src_pad;
- _tmp34_ = gst_object_get_name ((GstObject*) _tmp33_);
- _tmp35_ = _tmp34_;
- _tmp36_ = _tmp35_;
- _tmp37_ = sink_pad;
- _tmp38_ = gst_object_get_name ((GstObject*) _tmp37_);
- _tmp39_ = _tmp38_;
- _tmp40_ = _tmp39_;
- g_critical (_tmp32_, _tmp36_, _tmp40_);
- _g_free0 (_tmp40_);
- _g_free0 (_tmp36_);
- g_signal_emit_by_name ((RygelDataSource*) self, "done");
- _gst_object_unref0 (depay);
- _gst_object_unref0 (sink_pad);
- _gst_object_unref0 (sink);
- _gst_caps_unref0 (caps);
- return;
- }
- _tmp41_ = depay;
- if (_tmp41_ != NULL) {
- GstElement* _tmp42_;
- _tmp42_ = depay;
- gst_element_sync_state_with_parent (_tmp42_);
- }
- _gst_object_unref0 (depay);
- _gst_object_unref0 (sink_pad);
- _gst_object_unref0 (sink);
- _gst_caps_unref0 (caps);
+ GstPad* _tmp0_;
+ GstCaps* _tmp1_ = NULL;
+ GstCaps* caps;
+ GstPipeline* _tmp2_;
+ GstElement* _tmp3_ = NULL;
+ GstElement* sink;
+ GstPad* sink_pad = NULL;
+ GstCaps* _tmp4_;
+ GstElement* _tmp5_ = NULL;
+ GstElement* depay;
+ GstElement* _tmp6_;
+ GstPad* _tmp29_;
+ GstPad* _tmp30_;
+ GstPadLinkReturn _tmp31_ = 0;
+ GstElement* _tmp41_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (src != NULL);
+ g_return_if_fail (src_pad != NULL);
+ _tmp0_ = src_pad;
+ _tmp1_ = gst_pad_get_caps_reffed (_tmp0_);
+ caps = _tmp1_;
+ _tmp2_ = self->priv->pipeline;
+ _tmp3_ = gst_bin_get_by_name ((GstBin*) _tmp2_, RYGEL_GST_SINK_NAME);
+ sink = _tmp3_;
+ _tmp4_ = caps;
+ _tmp5_ = rygel_gst_utils_get_rtp_depayloader (_tmp4_);
+ depay = _tmp5_;
+ _tmp6_ = depay;
+ if (_tmp6_ != NULL) {
+ GstPipeline* _tmp7_;
+ GstElement* _tmp8_;
+ GstElement* _tmp9_;
+ GstElement* _tmp10_;
+ gboolean _tmp11_ = FALSE;
+ GstElement* _tmp21_;
+ GstPad* _tmp22_;
+ GstCaps* _tmp23_;
+ GstPad* _tmp24_ = NULL;
+ _tmp7_ = self->priv->pipeline;
+ _tmp8_ = depay;
+ gst_bin_add ((GstBin*) _tmp7_, _tmp8_);
+ _tmp9_ = depay;
+ _tmp10_ = sink;
+ _tmp11_ = gst_element_link (_tmp9_, _tmp10_);
+ if (!_tmp11_) {
+ const gchar* _tmp12_ = NULL;
+ GstElement* _tmp13_;
+ gchar* _tmp14_;
+ gchar* _tmp15_;
+ gchar* _tmp16_;
+ GstElement* _tmp17_;
+ gchar* _tmp18_;
+ gchar* _tmp19_;
+ gchar* _tmp20_;
+ _tmp12_ = _ ("Failed to link %s to %s");
+ _tmp13_ = depay;
+ _tmp14_ = gst_object_get_name ((GstObject*) _tmp13_);
+ _tmp15_ = _tmp14_;
+ _tmp16_ = _tmp15_;
+ _tmp17_ = sink;
+ _tmp18_ = gst_object_get_name ((GstObject*) _tmp17_);
+ _tmp19_ = _tmp18_;
+ _tmp20_ = _tmp19_;
+ g_critical (_tmp12_, _tmp16_, _tmp20_);
+ _g_free0 (_tmp20_);
+ _g_free0 (_tmp16_);
+ g_signal_emit_by_name ((RygelDataSource*) self, "done");
+ _gst_object_unref0 (depay);
+ _gst_object_unref0 (sink_pad);
+ _gst_object_unref0 (sink);
+ _gst_caps_unref0 (caps);
+ return;
+ }
+ _tmp21_ = depay;
+ _tmp22_ = src_pad;
+ _tmp23_ = caps;
+ _tmp24_ = gst_element_get_compatible_pad (_tmp21_, _tmp22_, _tmp23_);
+ _gst_object_unref0 (sink_pad);
+ sink_pad = _tmp24_;
+ } else {
+ GstElement* _tmp25_;
+ GstPad* _tmp26_;
+ GstCaps* _tmp27_;
+ GstPad* _tmp28_ = NULL;
+ _tmp25_ = sink;
+ _tmp26_ = src_pad;
+ _tmp27_ = caps;
+ _tmp28_ = gst_element_get_compatible_pad (_tmp25_, _tmp26_, _tmp27_);
+ _gst_object_unref0 (sink_pad);
+ sink_pad = _tmp28_;
+ }
+ _tmp29_ = src_pad;
+ _tmp30_ = sink_pad;
+ _tmp31_ = gst_pad_link (_tmp29_, _tmp30_);
+ if (_tmp31_ != GST_PAD_LINK_OK) {
+ const gchar* _tmp32_ = NULL;
+ GstPad* _tmp33_;
+ gchar* _tmp34_;
+ gchar* _tmp35_;
+ gchar* _tmp36_;
+ GstPad* _tmp37_;
+ gchar* _tmp38_;
+ gchar* _tmp39_;
+ gchar* _tmp40_;
+ _tmp32_ = _ ("Failed to link pad %s to %s");
+ _tmp33_ = src_pad;
+ _tmp34_ = gst_object_get_name ((GstObject*) _tmp33_);
+ _tmp35_ = _tmp34_;
+ _tmp36_ = _tmp35_;
+ _tmp37_ = sink_pad;
+ _tmp38_ = gst_object_get_name ((GstObject*) _tmp37_);
+ _tmp39_ = _tmp38_;
+ _tmp40_ = _tmp39_;
+ g_critical (_tmp32_, _tmp36_, _tmp40_);
+ _g_free0 (_tmp40_);
+ _g_free0 (_tmp36_);
+ g_signal_emit_by_name ((RygelDataSource*) self, "done");
+ _gst_object_unref0 (depay);
+ _gst_object_unref0 (sink_pad);
+ _gst_object_unref0 (sink);
+ _gst_caps_unref0 (caps);
+ return;
+ }
+ _tmp41_ = depay;
+ if (_tmp41_ != NULL) {
+ GstElement* _tmp42_;
+ _tmp42_ = depay;
+ gst_element_sync_state_with_parent (_tmp42_);
+ }
+ _gst_object_unref0 (depay);
+ _gst_object_unref0 (sink_pad);
+ _gst_object_unref0 (sink);
+ _gst_caps_unref0 (caps);
}
static inline void _dynamic_set_streamable0 (GstElement* obj, gboolean value) {
- g_object_set (obj, "streamable", value, NULL);
+ g_object_set (obj, "streamable", value, NULL);
}
static inline void _dynamic_set_fragment_duration1 (GstElement* obj, gint value) {
- g_object_set (obj, "fragment-duration", value, NULL);
+ g_object_set (obj, "fragment-duration", value, NULL);
}
static gboolean ___lambda3_ (RygelGstDataSource* self) {
- gboolean result = FALSE;
- g_signal_emit_by_name ((RygelDataSource*) self, "done");
- result = FALSE;
- return result;
+ gboolean result = FALSE;
+ g_signal_emit_by_name ((RygelDataSource*) self, "done");
+ result = FALSE;
+ return result;
}
static gboolean ____lambda3__gsource_func (gpointer self) {
- gboolean result;
- result = ___lambda3_ (self);
- return result;
+ gboolean result;
+ result = ___lambda3_ (self);
+ return result;
}
static gboolean rygel_gst_data_source_bus_handler (RygelGstDataSource* self, GstBus* bus, GstMessage* message) {
- gboolean result = FALSE;
- gboolean ret;
- GstMessage* _tmp0_;
- GstMessageType _tmp1_;
- gboolean _tmp53_;
- g_return_val_if_fail (self != NULL, FALSE);
- g_return_val_if_fail (bus != NULL, FALSE);
- g_return_val_if_fail (message != NULL, FALSE);
- ret = TRUE;
- _tmp0_ = message;
- _tmp1_ = _tmp0_->type;
- if (_tmp1_ == GST_MESSAGE_EOS) {
- ret = FALSE;
- } else {
- GstMessage* _tmp2_;
- GstMessageType _tmp3_;
- _tmp2_ = message;
- _tmp3_ = _tmp2_->type;
- if (_tmp3_ == GST_MESSAGE_STATE_CHANGED) {
- GstMessage* _tmp4_;
- GstObject* _tmp5_;
- GstPipeline* _tmp6_;
- GstState old_state = 0;
- GstState new_state = 0;
- GstMessage* _tmp7_;
- GstState _tmp8_ = 0;
- GstState _tmp9_ = 0;
- gboolean _tmp10_ = FALSE;
- GstState _tmp11_;
- gboolean _tmp13_;
- RygelHTTPSeek* _tmp24_;
- _tmp4_ = message;
- _tmp5_ = _tmp4_->src;
- _tmp6_ = self->priv->pipeline;
- if (_tmp5_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GST_TYPE_OBJECT, GstObject)) {
- result = TRUE;
- return result;
- }
- _tmp7_ = message;
- gst_message_parse_state_changed (_tmp7_, &_tmp8_, &_tmp9_, NULL);
- old_state = _tmp8_;
- new_state = _tmp9_;
- _tmp11_ = old_state;
- if (_tmp11_ == GST_STATE_NULL) {
- GstState _tmp12_;
- _tmp12_ = new_state;
- _tmp10_ = _tmp12_ == GST_STATE_READY;
- } else {
- _tmp10_ = FALSE;
- }
- _tmp13_ = _tmp10_;
- if (_tmp13_) {
- GstPipeline* _tmp14_;
- GstElement* _tmp15_ = NULL;
- GstElement* element;
- GstElement* _tmp16_;
- _tmp14_ = self->priv->pipeline;
- _tmp15_ = gst_bin_get_by_name ((GstBin*) _tmp14_, "muxer");
- element = _tmp15_;
- _tmp16_ = element;
- if (_tmp16_ != NULL) {
- GstElement* _tmp17_;
- GstElementFactory* _tmp18_ = NULL;
- const gchar* _tmp19_ = NULL;
- gchar* _tmp20_;
- gchar* name;
- const gchar* _tmp21_;
- _tmp17_ = element;
- _tmp18_ = gst_element_get_factory (_tmp17_);
- _tmp19_ = gst_plugin_feature_get_name ((GstPluginFeature*) _tmp18_);
- _tmp20_ = g_strdup (_tmp19_);
- name = _tmp20_;
- _tmp21_ = name;
- if (g_strcmp0 (_tmp21_, "mp4mux") == 0) {
- GstElement* _tmp22_;
- GstElement* _tmp23_;
- _tmp22_ = element;
- _dynamic_set_streamable0 (_tmp22_, TRUE);
- _tmp23_ = element;
- _dynamic_set_fragment_duration1 (_tmp23_, 1000);
- }
- _g_free0 (name);
- }
- _gst_object_unref0 (element);
- }
- _tmp24_ = self->priv->seek;
- if (_tmp24_ != NULL) {
- gboolean _tmp25_ = FALSE;
- GstState _tmp26_;
- gboolean _tmp28_;
- _tmp26_ = old_state;
- if (_tmp26_ == GST_STATE_READY) {
- GstState _tmp27_;
- _tmp27_ = new_state;
- _tmp25_ = _tmp27_ == GST_STATE_PAUSED;
- } else {
- _tmp25_ = FALSE;
- }
- _tmp28_ = _tmp25_;
- if (_tmp28_) {
- gboolean _tmp29_ = FALSE;
- _tmp29_ = rygel_gst_data_source_perform_seek (self);
- if (_tmp29_) {
- GstPipeline* _tmp30_;
- _tmp30_ = self->priv->pipeline;
- gst_element_set_state ((GstElement*) _tmp30_, GST_STATE_PLAYING);
- }
- }
- }
- } else {
- GError* err = NULL;
- gchar* err_msg = NULL;
- GstMessage* _tmp31_;
- GstMessageType _tmp32_;
- _tmp31_ = message;
- _tmp32_ = _tmp31_->type;
- if (_tmp32_ == GST_MESSAGE_ERROR) {
- GstMessage* _tmp33_;
- GError* _tmp34_ = NULL;
- gchar* _tmp35_ = NULL;
- const gchar* _tmp36_ = NULL;
- GstPipeline* _tmp37_;
- gchar* _tmp38_;
- gchar* _tmp39_;
- gchar* _tmp40_;
- const gchar* _tmp41_;
- _tmp33_ = message;
- gst_message_parse_error (_tmp33_, &_tmp34_, &_tmp35_);
- _g_error_free0 (err);
- err = _tmp34_;
- _g_free0 (err_msg);
- err_msg = _tmp35_;
- _tmp36_ = _ ("Error from pipeline %s: %s");
- _tmp37_ = self->priv->pipeline;
- _tmp38_ = gst_object_get_name ((GstObject*) _tmp37_);
- _tmp39_ = _tmp38_;
- _tmp40_ = _tmp39_;
- _tmp41_ = err_msg;
- g_critical (_tmp36_, _tmp40_, _tmp41_);
- _g_free0 (_tmp40_);
- ret = FALSE;
- } else {
- GstMessage* _tmp42_;
- GstMessageType _tmp43_;
- _tmp42_ = message;
- _tmp43_ = _tmp42_->type;
- if (_tmp43_ == GST_MESSAGE_WARNING) {
- GstMessage* _tmp44_;
- GError* _tmp45_ = NULL;
- gchar* _tmp46_ = NULL;
- const gchar* _tmp47_ = NULL;
- GstPipeline* _tmp48_;
- gchar* _tmp49_;
- gchar* _tmp50_;
- gchar* _tmp51_;
- const gchar* _tmp52_;
- _tmp44_ = message;
- gst_message_parse_warning (_tmp44_, &_tmp45_, &_tmp46_);
- _g_error_free0 (err);
- err = _tmp45_;
- _g_free0 (err_msg);
- err_msg = _tmp46_;
- _tmp47_ = _ ("Warning from pipeline %s: %s");
- _tmp48_ = self->priv->pipeline;
- _tmp49_ = gst_object_get_name ((GstObject*) _tmp48_);
- _tmp50_ = _tmp49_;
- _tmp51_ = _tmp50_;
- _tmp52_ = err_msg;
- g_warning (_tmp47_, _tmp51_, _tmp52_);
- _g_free0 (_tmp51_);
- }
- }
- _g_free0 (err_msg);
- _g_error_free0 (err);
- }
- }
- _tmp53_ = ret;
- if (!_tmp53_) {
- g_idle_add_full (G_PRIORITY_DEFAULT, ____lambda3__gsource_func, g_object_ref (self), g_object_unref);
- }
- result = ret;
- return result;
+ gboolean result = FALSE;
+ gboolean ret;
+ GstMessage* _tmp0_;
+ GstMessageType _tmp1_;
+ gboolean _tmp53_;
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (bus != NULL, FALSE);
+ g_return_val_if_fail (message != NULL, FALSE);
+ ret = TRUE;
+ _tmp0_ = message;
+ _tmp1_ = _tmp0_->type;
+ if (_tmp1_ == GST_MESSAGE_EOS) {
+ ret = FALSE;
+ } else {
+ GstMessage* _tmp2_;
+ GstMessageType _tmp3_;
+ _tmp2_ = message;
+ _tmp3_ = _tmp2_->type;
+ if (_tmp3_ == GST_MESSAGE_STATE_CHANGED) {
+ GstMessage* _tmp4_;
+ GstObject* _tmp5_;
+ GstPipeline* _tmp6_;
+ GstState old_state = 0;
+ GstState new_state = 0;
+ GstMessage* _tmp7_;
+ GstState _tmp8_ = 0;
+ GstState _tmp9_ = 0;
+ gboolean _tmp10_ = FALSE;
+ GstState _tmp11_;
+ gboolean _tmp13_;
+ RygelHTTPSeek* _tmp24_;
+ _tmp4_ = message;
+ _tmp5_ = _tmp4_->src;
+ _tmp6_ = self->priv->pipeline;
+ if (_tmp5_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GST_TYPE_OBJECT, GstObject)) {
+ result = TRUE;
+ return result;
+ }
+ _tmp7_ = message;
+ gst_message_parse_state_changed (_tmp7_, &_tmp8_, &_tmp9_, NULL);
+ old_state = _tmp8_;
+ new_state = _tmp9_;
+ _tmp11_ = old_state;
+ if (_tmp11_ == GST_STATE_NULL) {
+ GstState _tmp12_;
+ _tmp12_ = new_state;
+ _tmp10_ = _tmp12_ == GST_STATE_READY;
+ } else {
+ _tmp10_ = FALSE;
+ }
+ _tmp13_ = _tmp10_;
+ if (_tmp13_) {
+ GstPipeline* _tmp14_;
+ GstElement* _tmp15_ = NULL;
+ GstElement* element;
+ GstElement* _tmp16_;
+ _tmp14_ = self->priv->pipeline;
+ _tmp15_ = gst_bin_get_by_name ((GstBin*) _tmp14_, "muxer");
+ element = _tmp15_;
+ _tmp16_ = element;
+ if (_tmp16_ != NULL) {
+ GstElement* _tmp17_;
+ GstElementFactory* _tmp18_ = NULL;
+ const gchar* _tmp19_ = NULL;
+ gchar* _tmp20_;
+ gchar* name;
+ const gchar* _tmp21_;
+ _tmp17_ = element;
+ _tmp18_ = gst_element_get_factory (_tmp17_);
+ _tmp19_ = gst_plugin_feature_get_name ((GstPluginFeature*) _tmp18_);
+ _tmp20_ = g_strdup (_tmp19_);
+ name = _tmp20_;
+ _tmp21_ = name;
+ if (g_strcmp0 (_tmp21_, "mp4mux") == 0) {
+ GstElement* _tmp22_;
+ GstElement* _tmp23_;
+ _tmp22_ = element;
+ _dynamic_set_streamable0 (_tmp22_, TRUE);
+ _tmp23_ = element;
+ _dynamic_set_fragment_duration1 (_tmp23_, 1000);
+ }
+ _g_free0 (name);
+ }
+ _gst_object_unref0 (element);
+ }
+ _tmp24_ = self->priv->seek;
+ if (_tmp24_ != NULL) {
+ gboolean _tmp25_ = FALSE;
+ GstState _tmp26_;
+ gboolean _tmp28_;
+ _tmp26_ = old_state;
+ if (_tmp26_ == GST_STATE_READY) {
+ GstState _tmp27_;
+ _tmp27_ = new_state;
+ _tmp25_ = _tmp27_ == GST_STATE_PAUSED;
+ } else {
+ _tmp25_ = FALSE;
+ }
+ _tmp28_ = _tmp25_;
+ if (_tmp28_) {
+ gboolean _tmp29_ = FALSE;
+ _tmp29_ = rygel_gst_data_source_perform_seek (self);
+ if (_tmp29_) {
+ GstPipeline* _tmp30_;
+ _tmp30_ = self->priv->pipeline;
+ gst_element_set_state ((GstElement*) _tmp30_, GST_STATE_PLAYING);
+ }
+ }
+ }
+ } else {
+ GError* err = NULL;
+ gchar* err_msg = NULL;
+ GstMessage* _tmp31_;
+ GstMessageType _tmp32_;
+ _tmp31_ = message;
+ _tmp32_ = _tmp31_->type;
+ if (_tmp32_ == GST_MESSAGE_ERROR) {
+ GstMessage* _tmp33_;
+ GError* _tmp34_ = NULL;
+ gchar* _tmp35_ = NULL;
+ const gchar* _tmp36_ = NULL;
+ GstPipeline* _tmp37_;
+ gchar* _tmp38_;
+ gchar* _tmp39_;
+ gchar* _tmp40_;
+ const gchar* _tmp41_;
+ _tmp33_ = message;
+ gst_message_parse_error (_tmp33_, &_tmp34_, &_tmp35_);
+ _g_error_free0 (err);
+ err = _tmp34_;
+ _g_free0 (err_msg);
+ err_msg = _tmp35_;
+ _tmp36_ = _ ("Error from pipeline %s: %s");
+ _tmp37_ = self->priv->pipeline;
+ _tmp38_ = gst_object_get_name ((GstObject*) _tmp37_);
+ _tmp39_ = _tmp38_;
+ _tmp40_ = _tmp39_;
+ _tmp41_ = err_msg;
+ g_critical (_tmp36_, _tmp40_, _tmp41_);
+ _g_free0 (_tmp40_);
+ ret = FALSE;
+ } else {
+ GstMessage* _tmp42_;
+ GstMessageType _tmp43_;
+ _tmp42_ = message;
+ _tmp43_ = _tmp42_->type;
+ if (_tmp43_ == GST_MESSAGE_WARNING) {
+ GstMessage* _tmp44_;
+ GError* _tmp45_ = NULL;
+ gchar* _tmp46_ = NULL;
+ const gchar* _tmp47_ = NULL;
+ GstPipeline* _tmp48_;
+ gchar* _tmp49_;
+ gchar* _tmp50_;
+ gchar* _tmp51_;
+ const gchar* _tmp52_;
+ _tmp44_ = message;
+ gst_message_parse_warning (_tmp44_, &_tmp45_, &_tmp46_);
+ _g_error_free0 (err);
+ err = _tmp45_;
+ _g_free0 (err_msg);
+ err_msg = _tmp46_;
+ _tmp47_ = _ ("Warning from pipeline %s: %s");
+ _tmp48_ = self->priv->pipeline;
+ _tmp49_ = gst_object_get_name ((GstObject*) _tmp48_);
+ _tmp50_ = _tmp49_;
+ _tmp51_ = _tmp50_;
+ _tmp52_ = err_msg;
+ g_warning (_tmp47_, _tmp51_, _tmp52_);
+ _g_free0 (_tmp51_);
+ }
+ }
+ _g_free0 (err_msg);
+ _g_error_free0 (err);
+ }
+ }
+ _tmp53_ = ret;
+ if (!_tmp53_) {
+ g_idle_add_full (G_PRIORITY_DEFAULT, ____lambda3__gsource_func, g_object_ref (self), g_object_unref);
+ }
+ result = ret;
+ return result;
}
static gboolean rygel_gst_data_source_perform_seek (RygelGstDataSource* self) {
- gboolean result = FALSE;
- gboolean _tmp0_ = FALSE;
- RygelHTTPSeek* _tmp1_;
- gboolean _tmp8_;
- GstSeekType stop_type;
- GstFormat format = 0;
- GstSeekFlags flags;
- gint64 start = 0LL;
- gint64 stop = 0LL;
- RygelHTTPSeek* _tmp9_;
- RygelHTTPSeekType _tmp10_;
- RygelHTTPSeekType _tmp11_;
- RygelHTTPSeek* _tmp26_;
- gint64 _tmp27_;
- gint64 _tmp28_;
- GstPipeline* _tmp29_;
- GstFormat _tmp30_;
- GstSeekFlags _tmp31_;
- gint64 _tmp32_;
- GstSeekType _tmp33_;
- gint64 _tmp34_;
- gboolean _tmp35_ = FALSE;
- g_return_val_if_fail (self != NULL, FALSE);
- _tmp1_ = self->priv->seek;
- if (_tmp1_ != NULL) {
- RygelHTTPSeek* _tmp2_;
- gint64 _tmp3_;
- gint64 _tmp4_;
- RygelHTTPSeek* _tmp5_;
- gint64 _tmp6_;
- gint64 _tmp7_;
- _tmp2_ = self->priv->seek;
- _tmp3_ = rygel_http_seek_get_length (_tmp2_);
- _tmp4_ = _tmp3_;
- _tmp5_ = self->priv->seek;
- _tmp6_ = rygel_http_seek_get_total_length (_tmp5_);
- _tmp7_ = _tmp6_;
- _tmp0_ = _tmp4_ >= _tmp7_;
- } else {
- _tmp0_ = FALSE;
- }
- _tmp8_ = _tmp0_;
- if (_tmp8_) {
- result = TRUE;
- return result;
- }
- stop_type = GST_SEEK_TYPE_NONE;
- flags = GST_SEEK_FLAG_FLUSH;
- _tmp9_ = self->priv->seek;
- _tmp10_ = rygel_http_seek_get_seek_type (_tmp9_);
- _tmp11_ = _tmp10_;
- if (_tmp11_ == RYGEL_HTTP_SEEK_TYPE_TIME) {
- GstSeekFlags _tmp12_;
- RygelHTTPSeek* _tmp13_;
- gint64 _tmp14_;
- gint64 _tmp15_;
- RygelHTTPSeek* _tmp16_;
- gint64 _tmp17_;
- gint64 _tmp18_;
- format = GST_FORMAT_TIME;
- _tmp12_ = flags;
- flags = _tmp12_ | GST_SEEK_FLAG_KEY_UNIT;
- _tmp13_ = self->priv->seek;
- _tmp14_ = rygel_http_seek_get_start (_tmp13_);
- _tmp15_ = _tmp14_;
- start = _tmp15_ * GST_USECOND;
- _tmp16_ = self->priv->seek;
- _tmp17_ = rygel_http_seek_get_stop (_tmp16_);
- _tmp18_ = _tmp17_;
- stop = _tmp18_ * GST_USECOND;
- } else {
- GstSeekFlags _tmp19_;
- RygelHTTPSeek* _tmp20_;
- gint64 _tmp21_;
- gint64 _tmp22_;
- RygelHTTPSeek* _tmp23_;
- gint64 _tmp24_;
- gint64 _tmp25_;
- format = GST_FORMAT_BYTES;
- _tmp19_ = flags;
- flags = _tmp19_ | GST_SEEK_FLAG_ACCURATE;
- _tmp20_ = self->priv->seek;
- _tmp21_ = rygel_http_seek_get_start (_tmp20_);
- _tmp22_ = _tmp21_;
- start = _tmp22_;
- _tmp23_ = self->priv->seek;
- _tmp24_ = rygel_http_seek_get_stop (_tmp23_);
- _tmp25_ = _tmp24_;
- stop = _tmp25_;
- }
- _tmp26_ = self->priv->seek;
- _tmp27_ = rygel_http_seek_get_stop (_tmp26_);
- _tmp28_ = _tmp27_;
- if (_tmp28_ > ((gint64) 0)) {
- stop_type = GST_SEEK_TYPE_SET;
- }
- _tmp29_ = self->priv->pipeline;
- _tmp30_ = format;
- _tmp31_ = flags;
- _tmp32_ = start;
- _tmp33_ = stop_type;
- _tmp34_ = stop;
- _tmp35_ = gst_element_seek ((GstElement*) _tmp29_, 1.0, _tmp30_, _tmp31_, GST_SEEK_TYPE_SET, _tmp32_, _tmp33_, _tmp34_ + 1);
- if (!_tmp35_) {
- const gchar* _tmp36_ = NULL;
- RygelHTTPSeek* _tmp37_;
- gint64 _tmp38_;
- gint64 _tmp39_;
- RygelHTTPSeek* _tmp40_;
- gint64 _tmp41_;
- gint64 _tmp42_;
- const gchar* _tmp43_ = NULL;
- GError* _tmp44_;
- GError* _tmp45_;
- _tmp36_ = _ ("Failed to seek to offsets %lld:%lld");
- _tmp37_ = self->priv->seek;
- _tmp38_ = rygel_http_seek_get_start (_tmp37_);
- _tmp39_ = _tmp38_;
- _tmp40_ = self->priv->seek;
- _tmp41_ = rygel_http_seek_get_stop (_tmp40_);
- _tmp42_ = _tmp41_;
- g_warning (_tmp36_, _tmp39_, _tmp42_);
- _tmp43_ = _ ("Failed to seek");
- _tmp44_ = g_error_new_literal (RYGEL_DATA_SOURCE_ERROR, RYGEL_DATA_SOURCE_ERROR_SEEK_FAILED, _tmp43_);
- _tmp45_ = _tmp44_;
- g_signal_emit_by_name ((RygelDataSource*) self, "error", _tmp45_);
- _g_error_free0 (_tmp45_);
- result = FALSE;
- return result;
- }
- result = TRUE;
- return result;
+ gboolean result = FALSE;
+ gboolean _tmp0_ = FALSE;
+ RygelHTTPSeek* _tmp1_;
+ gboolean _tmp8_;
+ GstSeekType stop_type;
+ GstFormat format = 0;
+ GstSeekFlags flags;
+ gint64 start = 0LL;
+ gint64 stop = 0LL;
+ RygelHTTPSeek* _tmp9_;
+ RygelHTTPSeekType _tmp10_;
+ RygelHTTPSeekType _tmp11_;
+ RygelHTTPSeek* _tmp26_;
+ gint64 _tmp27_;
+ gint64 _tmp28_;
+ GstPipeline* _tmp29_;
+ GstFormat _tmp30_;
+ GstSeekFlags _tmp31_;
+ gint64 _tmp32_;
+ GstSeekType _tmp33_;
+ gint64 _tmp34_;
+ gboolean _tmp35_ = FALSE;
+ g_return_val_if_fail (self != NULL, FALSE);
+ _tmp1_ = self->priv->seek;
+ if (_tmp1_ != NULL) {
+ RygelHTTPSeek* _tmp2_;
+ gint64 _tmp3_;
+ gint64 _tmp4_;
+ RygelHTTPSeek* _tmp5_;
+ gint64 _tmp6_;
+ gint64 _tmp7_;
+ _tmp2_ = self->priv->seek;
+ _tmp3_ = rygel_http_seek_get_length (_tmp2_);
+ _tmp4_ = _tmp3_;
+ _tmp5_ = self->priv->seek;
+ _tmp6_ = rygel_http_seek_get_total_length (_tmp5_);
+ _tmp7_ = _tmp6_;
+ _tmp0_ = _tmp4_ >= _tmp7_;
+ } else {
+ _tmp0_ = FALSE;
+ }
+ _tmp8_ = _tmp0_;
+ if (_tmp8_) {
+ result = TRUE;
+ return result;
+ }
+ stop_type = GST_SEEK_TYPE_NONE;
+ flags = GST_SEEK_FLAG_FLUSH;
+ _tmp9_ = self->priv->seek;
+ _tmp10_ = rygel_http_seek_get_seek_type (_tmp9_);
+ _tmp11_ = _tmp10_;
+ if (_tmp11_ == RYGEL_HTTP_SEEK_TYPE_TIME) {
+ GstSeekFlags _tmp12_;
+ RygelHTTPSeek* _tmp13_;
+ gint64 _tmp14_;
+ gint64 _tmp15_;
+ RygelHTTPSeek* _tmp16_;
+ gint64 _tmp17_;
+ gint64 _tmp18_;
+ format = GST_FORMAT_TIME;
+ _tmp12_ = flags;
+ flags = _tmp12_ | GST_SEEK_FLAG_KEY_UNIT;
+ _tmp13_ = self->priv->seek;
+ _tmp14_ = rygel_http_seek_get_start (_tmp13_);
+ _tmp15_ = _tmp14_;
+ start = _tmp15_ * GST_USECOND;
+ _tmp16_ = self->priv->seek;
+ _tmp17_ = rygel_http_seek_get_stop (_tmp16_);
+ _tmp18_ = _tmp17_;
+ stop = _tmp18_ * GST_USECOND;
+ } else {
+ GstSeekFlags _tmp19_;
+ RygelHTTPSeek* _tmp20_;
+ gint64 _tmp21_;
+ gint64 _tmp22_;
+ RygelHTTPSeek* _tmp23_;
+ gint64 _tmp24_;
+ gint64 _tmp25_;
+ format = GST_FORMAT_BYTES;
+ _tmp19_ = flags;
+ flags = _tmp19_ | GST_SEEK_FLAG_ACCURATE;
+ _tmp20_ = self->priv->seek;
+ _tmp21_ = rygel_http_seek_get_start (_tmp20_);
+ _tmp22_ = _tmp21_;
+ start = _tmp22_;
+ _tmp23_ = self->priv->seek;
+ _tmp24_ = rygel_http_seek_get_stop (_tmp23_);
+ _tmp25_ = _tmp24_;
+ stop = _tmp25_;
+ }
+ _tmp26_ = self->priv->seek;
+ _tmp27_ = rygel_http_seek_get_stop (_tmp26_);
+ _tmp28_ = _tmp27_;
+ if (_tmp28_ > ((gint64) 0)) {
+ stop_type = GST_SEEK_TYPE_SET;
+ }
+ _tmp29_ = self->priv->pipeline;
+ _tmp30_ = format;
+ _tmp31_ = flags;
+ _tmp32_ = start;
+ _tmp33_ = stop_type;
+ _tmp34_ = stop;
+ _tmp35_ = gst_element_seek ((GstElement*) _tmp29_, 1.0, _tmp30_, _tmp31_, GST_SEEK_TYPE_SET, _tmp32_, _tmp33_, _tmp34_ + 1);
+ if (!_tmp35_) {
+ const gchar* _tmp36_ = NULL;
+ RygelHTTPSeek* _tmp37_;
+ gint64 _tmp38_;
+ gint64 _tmp39_;
+ RygelHTTPSeek* _tmp40_;
+ gint64 _tmp41_;
+ gint64 _tmp42_;
+ const gchar* _tmp43_ = NULL;
+ GError* _tmp44_;
+ GError* _tmp45_;
+ _tmp36_ = _ ("Failed to seek to offsets %lld:%lld");
+ _tmp37_ = self->priv->seek;
+ _tmp38_ = rygel_http_seek_get_start (_tmp37_);
+ _tmp39_ = _tmp38_;
+ _tmp40_ = self->priv->seek;
+ _tmp41_ = rygel_http_seek_get_stop (_tmp40_);
+ _tmp42_ = _tmp41_;
+ g_warning (_tmp36_, _tmp39_, _tmp42_);
+ _tmp43_ = _ ("Failed to seek");
+ _tmp44_ = g_error_new_literal (RYGEL_DATA_SOURCE_ERROR, RYGEL_DATA_SOURCE_ERROR_SEEK_FAILED, _tmp43_);
+ _tmp45_ = _tmp44_;
+ g_signal_emit_by_name ((RygelDataSource*) self, "error", _tmp45_);
+ _g_error_free0 (_tmp45_);
+ result = FALSE;
+ return result;
+ }
+ result = TRUE;
+ return result;
}
static void rygel_gst_data_source_class_init (RygelGstDataSourceClass * klass) {
- rygel_gst_data_source_parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (RygelGstDataSourcePrivate));
- G_OBJECT_CLASS (klass)->finalize = rygel_gst_data_source_finalize;
+ rygel_gst_data_source_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (RygelGstDataSourcePrivate));
+ G_OBJECT_CLASS (klass)->finalize = rygel_gst_data_source_finalize;
}
static void rygel_gst_data_source_rygel_data_source_interface_init (RygelDataSourceIface * iface) {
- rygel_gst_data_source_rygel_data_source_parent_iface = g_type_interface_peek_parent (iface);
- iface->start = (void (*)(RygelDataSource*, RygelHTTPSeek*, GError**)) rygel_gst_data_source_real_start;
- iface->freeze = (void (*)(RygelDataSource*)) rygel_gst_data_source_real_freeze;
- iface->thaw = (void (*)(RygelDataSource*)) rygel_gst_data_source_real_thaw;
- iface->stop = (void (*)(RygelDataSource*)) rygel_gst_data_source_real_stop;
+ rygel_gst_data_source_rygel_data_source_parent_iface = g_type_interface_peek_parent (iface);
+ iface->start = (void (*)(RygelDataSource*, RygelHTTPSeek*, GError**)) rygel_gst_data_source_real_start;
+ iface->freeze = (void (*)(RygelDataSource*)) rygel_gst_data_source_real_freeze;
+ iface->thaw = (void (*)(RygelDataSource*)) rygel_gst_data_source_real_thaw;
+ iface->stop = (void (*)(RygelDataSource*)) rygel_gst_data_source_real_stop;
}
static void rygel_gst_data_source_init (RygelGstDataSource * self) {
- self->priv = RYGEL_GST_DATA_SOURCE_GET_PRIVATE (self);
- self->priv->seek = NULL;
+ self->priv = RYGEL_GST_DATA_SOURCE_GET_PRIVATE (self);
+ self->priv->seek = NULL;
}
static void rygel_gst_data_source_finalize (GObject* obj) {
- RygelGstDataSource * self;
- RygelGstSink* _tmp0_;
- GstPipeline* _tmp3_;
- self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_GST_DATA_SOURCE, RygelGstDataSource);
- _tmp0_ = self->priv->sink;
- if (_tmp0_ != NULL) {
- RygelGstSink* _tmp1_;
- GCancellable* _tmp2_;
- _tmp1_ = self->priv->sink;
- _tmp2_ = _tmp1_->cancellable;
- g_cancellable_cancel (_tmp2_);
- }
- _tmp3_ = self->priv->pipeline;
- if (_tmp3_ != NULL) {
- GstPipeline* _tmp4_;
- _tmp4_ = self->priv->pipeline;
- gst_element_set_state ((GstElement*) _tmp4_, GST_STATE_NULL);
- }
- _gst_object_unref0 (self->src);
- _gst_object_unref0 (self->priv->pipeline);
- _g_object_unref0 (self->priv->seek);
- _gst_object_unref0 (self->priv->sink);
- G_OBJECT_CLASS (rygel_gst_data_source_parent_class)->finalize (obj);
+ RygelGstDataSource * self;
+ RygelGstSink* _tmp0_;
+ GstPipeline* _tmp3_;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_GST_DATA_SOURCE, RygelGstDataSource);
+ _tmp0_ = self->priv->sink;
+ if (_tmp0_ != NULL) {
+ RygelGstSink* _tmp1_;
+ GCancellable* _tmp2_;
+ _tmp1_ = self->priv->sink;
+ _tmp2_ = _tmp1_->cancellable;
+ g_cancellable_cancel (_tmp2_);
+ }
+ _tmp3_ = self->priv->pipeline;
+ if (_tmp3_ != NULL) {
+ GstPipeline* _tmp4_;
+ _tmp4_ = self->priv->pipeline;
+ gst_element_set_state ((GstElement*) _tmp4_, GST_STATE_NULL);
+ }
+ _gst_object_unref0 (self->src);
+ _gst_object_unref0 (self->priv->pipeline);
+ _g_object_unref0 (self->priv->seek);
+ _gst_object_unref0 (self->priv->sink);
+ G_OBJECT_CLASS (rygel_gst_data_source_parent_class)->finalize (obj);
}
diff --git a/src/rygel-gst-data-source.h b/src/rygel-gst-data-source.h
index 98e427a..dfc48d2 100644
--- a/src/rygel-gst-data-source.h
+++ b/src/rygel-gst-data-source.h
@@ -60,8 +60,8 @@ RygelGstDataSource* rygel_gst_data_source_new (const gchar* uri, GError** error)
typedef enum {
- RYGEL_GST_ERROR_MISSING_PLUGIN,
- RYGEL_GST_ERROR_LINK
+ RYGEL_GST_ERROR_MISSING_PLUGIN,
+ RYGEL_GST_ERROR_LINK
} RygelGstError;
#define RYGEL_GST_ERROR rygel_gst_error_quark ()
diff --git a/src/rygel-gst-media-engine.c b/src/rygel-gst-media-engine.c
index caaa642..d6d18dc 100644
--- a/src/rygel-gst-media-engine.c
+++ b/src/rygel-gst-media-engine.c
@@ -205,8 +205,8 @@ static void
rygel_gst_media_engine_finalize (GObject *obj) {
RygelGstMediaEngine *self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_GST_MEDIA_ENGINE, RygelGstMediaEngine);
- g_list_free_full (self->priv->dlna_profiles, (GDestroyNotify) g_object_unref);
- g_list_free_full (self->priv->transcoders, (GDestroyNotify) g_object_unref);
+ g_list_free_full (self->priv->dlna_profiles, (GDestroyNotify) g_object_unref);
+ g_list_free_full (self->priv->transcoders, (GDestroyNotify) g_object_unref);
G_OBJECT_CLASS (rygel_gst_media_engine_parent_class)->finalize (obj);
}
diff --git a/src/rygel-gst-sink.c b/src/rygel-gst-sink.c
index fbc8a95..afcbb7e 100644
--- a/src/rygel-gst-sink.c
+++ b/src/rygel-gst-sink.c
@@ -37,21 +37,21 @@ typedef struct _Block1Data Block1Data;
struct _RygelGstSinkPrivate {
- gint priority;
- gint64 chunks_buffered;
- gint64 bytes_sent;
- gint64 max_bytes;
- GMutex buffer_mutex;
- GCond buffer_condition;
- RygelDataSource* source;
- RygelHTTPSeek* offsets;
- gboolean frozen;
+ gint priority;
+ gint64 chunks_buffered;
+ gint64 bytes_sent;
+ gint64 max_bytes;
+ GMutex buffer_mutex;
+ GCond buffer_condition;
+ RygelDataSource* source;
+ RygelHTTPSeek* offsets;
+ gboolean frozen;
};
struct _Block1Data {
- int _ref_count_;
- RygelGstSink * self;
- GstBuffer* buffer;
+ int _ref_count_;
+ RygelGstSink * self;
+ GstBuffer* buffer;
};
@@ -82,356 +82,356 @@ static void _vala_clear_GCond (GCond * mutex);
static gpointer _g_object_ref0 (gpointer self) {
- return self ? g_object_ref (self) : NULL;
+ return self ? g_object_ref (self) : NULL;
}
static void _rygel_gst_sink_on_cancelled_g_cancellable_cancelled (GCancellable* _sender, gpointer self) {
- rygel_gst_sink_on_cancelled (self);
+ rygel_gst_sink_on_cancelled (self);
}
RygelGstSink* rygel_gst_sink_construct (GType object_type, RygelDataSource* source, RygelHTTPSeek* offsets) {
- RygelGstSink * self = NULL;
- gint64 _tmp0_;
- RygelDataSource* _tmp1_;
- RygelHTTPSeek* _tmp2_;
- RygelHTTPSeek* _tmp3_;
- GCancellable* _tmp4_;
- RygelHTTPSeek* _tmp5_;
- GCancellable* _tmp12_;
- g_return_val_if_fail (source != NULL, NULL);
- self = (RygelGstSink*) g_object_new (object_type, NULL);
- self->priv->chunks_buffered = (gint64) 0;
- self->priv->bytes_sent = (gint64) 0;
- _tmp0_ = G_MAXINT64;
- self->priv->max_bytes = _tmp0_;
- _tmp1_ = source;
- self->priv->source = _tmp1_;
- _tmp2_ = offsets;
- _tmp3_ = _g_object_ref0 (_tmp2_);
- _g_object_unref0 (self->priv->offsets);
- self->priv->offsets = _tmp3_;
- _tmp4_ = g_cancellable_new ();
- _g_object_unref0 (self->cancellable);
- self->cancellable = _tmp4_;
- gst_base_sink_set_sync ((GstBaseSink*) self, FALSE);
- gst_object_set_name ((GstObject*) self, RYGEL_GST_SINK_NAME);
- self->priv->frozen = FALSE;
- _tmp5_ = self->priv->offsets;
- if (_tmp5_ != NULL) {
- RygelHTTPSeek* _tmp6_;
- RygelHTTPSeekType _tmp7_;
- RygelHTTPSeekType _tmp8_;
- _tmp6_ = self->priv->offsets;
- _tmp7_ = rygel_http_seek_get_seek_type (_tmp6_);
- _tmp8_ = _tmp7_;
- if (_tmp8_ == RYGEL_HTTP_SEEK_TYPE_BYTE) {
- RygelHTTPSeek* _tmp9_;
- gint64 _tmp10_;
- gint64 _tmp11_;
- _tmp9_ = self->priv->offsets;
- _tmp10_ = rygel_http_seek_get_length (_tmp9_);
- _tmp11_ = _tmp10_;
- self->priv->max_bytes = _tmp11_;
- }
- }
- _tmp12_ = self->cancellable;
- g_signal_connect_object (_tmp12_, "cancelled", (GCallback) _rygel_gst_sink_on_cancelled_g_cancellable_cancelled, self, 0);
- return self;
+ RygelGstSink * self = NULL;
+ gint64 _tmp0_;
+ RygelDataSource* _tmp1_;
+ RygelHTTPSeek* _tmp2_;
+ RygelHTTPSeek* _tmp3_;
+ GCancellable* _tmp4_;
+ RygelHTTPSeek* _tmp5_;
+ GCancellable* _tmp12_;
+ g_return_val_if_fail (source != NULL, NULL);
+ self = (RygelGstSink*) g_object_new (object_type, NULL);
+ self->priv->chunks_buffered = (gint64) 0;
+ self->priv->bytes_sent = (gint64) 0;
+ _tmp0_ = G_MAXINT64;
+ self->priv->max_bytes = _tmp0_;
+ _tmp1_ = source;
+ self->priv->source = _tmp1_;
+ _tmp2_ = offsets;
+ _tmp3_ = _g_object_ref0 (_tmp2_);
+ _g_object_unref0 (self->priv->offsets);
+ self->priv->offsets = _tmp3_;
+ _tmp4_ = g_cancellable_new ();
+ _g_object_unref0 (self->cancellable);
+ self->cancellable = _tmp4_;
+ gst_base_sink_set_sync ((GstBaseSink*) self, FALSE);
+ gst_object_set_name ((GstObject*) self, RYGEL_GST_SINK_NAME);
+ self->priv->frozen = FALSE;
+ _tmp5_ = self->priv->offsets;
+ if (_tmp5_ != NULL) {
+ RygelHTTPSeek* _tmp6_;
+ RygelHTTPSeekType _tmp7_;
+ RygelHTTPSeekType _tmp8_;
+ _tmp6_ = self->priv->offsets;
+ _tmp7_ = rygel_http_seek_get_seek_type (_tmp6_);
+ _tmp8_ = _tmp7_;
+ if (_tmp8_ == RYGEL_HTTP_SEEK_TYPE_BYTE) {
+ RygelHTTPSeek* _tmp9_;
+ gint64 _tmp10_;
+ gint64 _tmp11_;
+ _tmp9_ = self->priv->offsets;
+ _tmp10_ = rygel_http_seek_get_length (_tmp9_);
+ _tmp11_ = _tmp10_;
+ self->priv->max_bytes = _tmp11_;
+ }
+ }
+ _tmp12_ = self->cancellable;
+ g_signal_connect_object (_tmp12_, "cancelled", (GCallback) _rygel_gst_sink_on_cancelled_g_cancellable_cancelled, self, 0);
+ return self;
}
RygelGstSink* rygel_gst_sink_new (RygelDataSource* source, RygelHTTPSeek* offsets) {
- return rygel_gst_sink_construct (RYGEL_TYPE_GST_SINK, source, offsets);
+ return rygel_gst_sink_construct (RYGEL_TYPE_GST_SINK, source, offsets);
}
void rygel_gst_sink_freeze (RygelGstSink* self) {
- gboolean _tmp0_;
- g_return_if_fail (self != NULL);
- _tmp0_ = self->priv->frozen;
- if (_tmp0_) {
- return;
- }
- g_mutex_lock (&self->priv->buffer_mutex);
- self->priv->frozen = TRUE;
- g_mutex_unlock (&self->priv->buffer_mutex);
+ gboolean _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp0_ = self->priv->frozen;
+ if (_tmp0_) {
+ return;
+ }
+ g_mutex_lock (&self->priv->buffer_mutex);
+ self->priv->frozen = TRUE;
+ g_mutex_unlock (&self->priv->buffer_mutex);
}
void rygel_gst_sink_thaw (RygelGstSink* self) {
- gboolean _tmp0_;
- g_return_if_fail (self != NULL);
- _tmp0_ = self->priv->frozen;
- if (!_tmp0_) {
- return;
- }
- g_mutex_lock (&self->priv->buffer_mutex);
- self->priv->frozen = FALSE;
- g_cond_broadcast (&self->priv->buffer_condition);
- g_mutex_unlock (&self->priv->buffer_mutex);
+ gboolean _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp0_ = self->priv->frozen;
+ if (!_tmp0_) {
+ return;
+ }
+ g_mutex_lock (&self->priv->buffer_mutex);
+ self->priv->frozen = FALSE;
+ g_cond_broadcast (&self->priv->buffer_condition);
+ g_mutex_unlock (&self->priv->buffer_mutex);
}
static gpointer _gst_buffer_ref0 (gpointer self) {
- return self ? gst_buffer_ref (self) : NULL;
+ return self ? gst_buffer_ref (self) : NULL;
}
static Block1Data* block1_data_ref (Block1Data* _data1_) {
- g_atomic_int_inc (&_data1_->_ref_count_);
- return _data1_;
+ g_atomic_int_inc (&_data1_->_ref_count_);
+ return _data1_;
}
static void block1_data_unref (void * _userdata_) {
- Block1Data* _data1_;
- _data1_ = (Block1Data*) _userdata_;
- if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
- RygelGstSink * self;
- self = _data1_->self;
- _gst_buffer_unref0 (_data1_->buffer);
- _gst_object_unref0 (self);
- g_slice_free (Block1Data, _data1_);
- }
+ Block1Data* _data1_;
+ _data1_ = (Block1Data*) _userdata_;
+ if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
+ RygelGstSink * self;
+ self = _data1_->self;
+ _gst_buffer_unref0 (_data1_->buffer);
+ _gst_object_unref0 (self);
+ g_slice_free (Block1Data, _data1_);
+ }
}
static gboolean __lambda2_ (Block1Data* _data1_) {
- RygelGstSink * self;
- gboolean result = FALSE;
- GstBuffer* _tmp0_;
- gboolean _tmp1_ = FALSE;
- self = _data1_->self;
- _tmp0_ = _data1_->buffer;
- _tmp1_ = rygel_gst_sink_push_data (self, _tmp0_);
- result = _tmp1_;
- return result;
+ RygelGstSink * self;
+ gboolean result = FALSE;
+ GstBuffer* _tmp0_;
+ gboolean _tmp1_ = FALSE;
+ self = _data1_->self;
+ _tmp0_ = _data1_->buffer;
+ _tmp1_ = rygel_gst_sink_push_data (self, _tmp0_);
+ result = _tmp1_;
+ return result;
}
static gboolean ___lambda2__gsource_func (gpointer self) {
- gboolean result;
- result = __lambda2_ (self);
- return result;
+ gboolean result;
+ result = __lambda2_ (self);
+ return result;
}
static GstFlowReturn rygel_gst_sink_real_render (GstBaseSink* base, GstBuffer* buffer) {
- RygelGstSink * self;
- GstFlowReturn result = 0;
- Block1Data* _data1_;
- GstBuffer* _tmp0_;
- GstBuffer* _tmp1_;
- GCancellable* _tmp8_;
- gboolean _tmp9_ = FALSE;
- gint _tmp10_;
- self = (RygelGstSink*) base;
- g_return_val_if_fail (buffer != NULL, 0);
- _data1_ = g_slice_new0 (Block1Data);
- _data1_->_ref_count_ = 1;
- _data1_->self = gst_object_ref (self);
- _tmp0_ = buffer;
- _tmp1_ = _gst_buffer_ref0 (_tmp0_);
- _gst_buffer_unref0 (_data1_->buffer);
- _data1_->buffer = _tmp1_;
- g_mutex_lock (&self->priv->buffer_mutex);
- while (TRUE) {
- gboolean _tmp2_ = FALSE;
- GCancellable* _tmp3_;
- gboolean _tmp4_ = FALSE;
- gboolean _tmp6_;
- GMutex _tmp7_;
- _tmp3_ = self->cancellable;
- _tmp4_ = g_cancellable_is_cancelled (_tmp3_);
- if (!_tmp4_) {
- gboolean _tmp5_;
- _tmp5_ = self->priv->frozen;
- _tmp2_ = _tmp5_;
- } else {
- _tmp2_ = FALSE;
- }
- _tmp6_ = _tmp2_;
- if (!_tmp6_) {
- break;
- }
- _tmp7_ = self->priv->buffer_mutex;
- g_cond_wait (&self->priv->buffer_condition, &_tmp7_);
- }
- g_mutex_unlock (&self->priv->buffer_mutex);
- _tmp8_ = self->cancellable;
- _tmp9_ = g_cancellable_is_cancelled (_tmp8_);
- if (_tmp9_) {
- result = GST_FLOW_OK;
- block1_data_unref (_data1_);
- _data1_ = NULL;
- return result;
- }
- _tmp10_ = self->priv->priority;
- g_idle_add_full (_tmp10_, ___lambda2__gsource_func, block1_data_ref (_data1_), block1_data_unref);
- result = GST_FLOW_OK;
- block1_data_unref (_data1_);
- _data1_ = NULL;
- return result;
+ RygelGstSink * self;
+ GstFlowReturn result = 0;
+ Block1Data* _data1_;
+ GstBuffer* _tmp0_;
+ GstBuffer* _tmp1_;
+ GCancellable* _tmp8_;
+ gboolean _tmp9_ = FALSE;
+ gint _tmp10_;
+ self = (RygelGstSink*) base;
+ g_return_val_if_fail (buffer != NULL, 0);
+ _data1_ = g_slice_new0 (Block1Data);
+ _data1_->_ref_count_ = 1;
+ _data1_->self = gst_object_ref (self);
+ _tmp0_ = buffer;
+ _tmp1_ = _gst_buffer_ref0 (_tmp0_);
+ _gst_buffer_unref0 (_data1_->buffer);
+ _data1_->buffer = _tmp1_;
+ g_mutex_lock (&self->priv->buffer_mutex);
+ while (TRUE) {
+ gboolean _tmp2_ = FALSE;
+ GCancellable* _tmp3_;
+ gboolean _tmp4_ = FALSE;
+ gboolean _tmp6_;
+ GMutex _tmp7_;
+ _tmp3_ = self->cancellable;
+ _tmp4_ = g_cancellable_is_cancelled (_tmp3_);
+ if (!_tmp4_) {
+ gboolean _tmp5_;
+ _tmp5_ = self->priv->frozen;
+ _tmp2_ = _tmp5_;
+ } else {
+ _tmp2_ = FALSE;
+ }
+ _tmp6_ = _tmp2_;
+ if (!_tmp6_) {
+ break;
+ }
+ _tmp7_ = self->priv->buffer_mutex;
+ g_cond_wait (&self->priv->buffer_condition, &_tmp7_);
+ }
+ g_mutex_unlock (&self->priv->buffer_mutex);
+ _tmp8_ = self->cancellable;
+ _tmp9_ = g_cancellable_is_cancelled (_tmp8_);
+ if (_tmp9_) {
+ result = GST_FLOW_OK;
+ block1_data_unref (_data1_);
+ _data1_ = NULL;
+ return result;
+ }
+ _tmp10_ = self->priv->priority;
+ g_idle_add_full (_tmp10_, ___lambda2__gsource_func, block1_data_ref (_data1_), block1_data_unref);
+ result = GST_FLOW_OK;
+ block1_data_unref (_data1_);
+ _data1_ = NULL;
+ return result;
}
gboolean rygel_gst_sink_push_data (RygelGstSink* self, GstBuffer* buffer) {
- gboolean result = FALSE;
- gint64 _tmp0_;
- gint64 _tmp1_;
- gint64 left;
- gboolean _tmp2_ = FALSE;
- GCancellable* _tmp3_;
- gboolean _tmp4_ = FALSE;
- gboolean _tmp6_;
- GstBuffer* _tmp7_;
- guint _tmp8_;
- gint64 _tmp9_;
- gint64 _tmp10_ = 0LL;
- gint64 to_send;
- RygelDataSource* _tmp11_;
- GstBuffer* _tmp12_;
- guint8* _tmp13_;
- gint _tmp13__length1;
- gint64 _tmp14_;
- gint64 _tmp15_;
- gint64 _tmp16_;
- gint64 _tmp17_;
- g_return_val_if_fail (self != NULL, FALSE);
- g_return_val_if_fail (buffer != NULL, FALSE);
- _tmp0_ = self->priv->max_bytes;
- _tmp1_ = self->priv->bytes_sent;
- left = _tmp0_ - _tmp1_;
- _tmp3_ = self->cancellable;
- _tmp4_ = g_cancellable_is_cancelled (_tmp3_);
- if (_tmp4_) {
- _tmp2_ = TRUE;
- } else {
- gint64 _tmp5_;
- _tmp5_ = left;
- _tmp2_ = _tmp5_ <= ((gint64) 0);
- }
- _tmp6_ = _tmp2_;
- if (_tmp6_) {
- result = FALSE;
- return result;
- }
- _tmp7_ = buffer;
- _tmp8_ = _tmp7_->size;
- _tmp9_ = left;
- _tmp10_ = MIN ((gint64) _tmp8_, _tmp9_);
- to_send = _tmp10_;
- _tmp11_ = self->priv->source;
- _tmp12_ = buffer;
- _tmp13_ = _tmp12_->data;
- _tmp13__length1 = (gint) _tmp12_->size;
- _tmp14_ = to_send;
- g_signal_emit_by_name (_tmp11_, "data-available", _tmp13_ + 0, _tmp14_ - 0);
- _tmp15_ = self->priv->chunks_buffered;
- self->priv->chunks_buffered = _tmp15_ + 1;
- _tmp16_ = self->priv->bytes_sent;
- _tmp17_ = to_send;
- self->priv->bytes_sent = _tmp16_ + _tmp17_;
- result = FALSE;
- return result;
+ gboolean result = FALSE;
+ gint64 _tmp0_;
+ gint64 _tmp1_;
+ gint64 left;
+ gboolean _tmp2_ = FALSE;
+ GCancellable* _tmp3_;
+ gboolean _tmp4_ = FALSE;
+ gboolean _tmp6_;
+ GstBuffer* _tmp7_;
+ guint _tmp8_;
+ gint64 _tmp9_;
+ gint64 _tmp10_ = 0LL;
+ gint64 to_send;
+ RygelDataSource* _tmp11_;
+ GstBuffer* _tmp12_;
+ guint8* _tmp13_;
+ gint _tmp13__length1;
+ gint64 _tmp14_;
+ gint64 _tmp15_;
+ gint64 _tmp16_;
+ gint64 _tmp17_;
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (buffer != NULL, FALSE);
+ _tmp0_ = self->priv->max_bytes;
+ _tmp1_ = self->priv->bytes_sent;
+ left = _tmp0_ - _tmp1_;
+ _tmp3_ = self->cancellable;
+ _tmp4_ = g_cancellable_is_cancelled (_tmp3_);
+ if (_tmp4_) {
+ _tmp2_ = TRUE;
+ } else {
+ gint64 _tmp5_;
+ _tmp5_ = left;
+ _tmp2_ = _tmp5_ <= ((gint64) 0);
+ }
+ _tmp6_ = _tmp2_;
+ if (_tmp6_) {
+ result = FALSE;
+ return result;
+ }
+ _tmp7_ = buffer;
+ _tmp8_ = _tmp7_->size;
+ _tmp9_ = left;
+ _tmp10_ = MIN ((gint64) _tmp8_, _tmp9_);
+ to_send = _tmp10_;
+ _tmp11_ = self->priv->source;
+ _tmp12_ = buffer;
+ _tmp13_ = _tmp12_->data;
+ _tmp13__length1 = (gint) _tmp12_->size;
+ _tmp14_ = to_send;
+ g_signal_emit_by_name (_tmp11_, "data-available", _tmp13_ + 0, _tmp14_ - 0);
+ _tmp15_ = self->priv->chunks_buffered;
+ self->priv->chunks_buffered = _tmp15_ + 1;
+ _tmp16_ = self->priv->bytes_sent;
+ _tmp17_ = to_send;
+ self->priv->bytes_sent = _tmp16_ + _tmp17_;
+ result = FALSE;
+ return result;
}
static void rygel_gst_sink_on_cancelled (RygelGstSink* self) {
- g_return_if_fail (self != NULL);
- g_mutex_lock (&self->priv->buffer_mutex);
- g_cond_broadcast (&self->priv->buffer_condition);
- g_mutex_unlock (&self->priv->buffer_mutex);
+ g_return_if_fail (self != NULL);
+ g_mutex_lock (&self->priv->buffer_mutex);
+ g_cond_broadcast (&self->priv->buffer_condition);
+ g_mutex_unlock (&self->priv->buffer_mutex);
}
static gpointer _gst_caps_ref0 (gpointer self) {
- return self ? gst_caps_ref (self) : NULL;
+ return self ? gst_caps_ref (self) : NULL;
}
static void rygel_gst_sink_class_init (RygelGstSinkClass * klass) {
- GstCaps* _tmp0_;
- GstCaps* caps;
- GstCaps* _tmp1_;
- GstCaps* _tmp2_;
- GstPadTemplate* _tmp3_;
- GstPadTemplate* template;
- GstPadTemplate* _tmp4_;
- rygel_gst_sink_parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (RygelGstSinkPrivate));
- GST_BASE_SINK_CLASS (klass)->render = rygel_gst_sink_real_render;
- G_OBJECT_CLASS (klass)->finalize = rygel_gst_sink_finalize;
- _tmp0_ = gst_caps_new_any ();
- caps = _tmp0_;
- _tmp1_ = caps;
- _tmp2_ = _gst_caps_ref0 (_tmp1_);
- _tmp3_ = gst_pad_template_new (RYGEL_GST_SINK_PAD_NAME, GST_PAD_SINK, GST_PAD_ALWAYS, _tmp2_);
- gst_object_ref_sink (_tmp3_);
- template = _tmp3_;
- _tmp4_ = template;
- gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), _tmp4_);
- _gst_object_unref0 (template);
- _gst_caps_unref0 (caps);
+ GstCaps* _tmp0_;
+ GstCaps* caps;
+ GstCaps* _tmp1_;
+ GstCaps* _tmp2_;
+ GstPadTemplate* _tmp3_;
+ GstPadTemplate* template;
+ GstPadTemplate* _tmp4_;
+ rygel_gst_sink_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (RygelGstSinkPrivate));
+ GST_BASE_SINK_CLASS (klass)->render = rygel_gst_sink_real_render;
+ G_OBJECT_CLASS (klass)->finalize = rygel_gst_sink_finalize;
+ _tmp0_ = gst_caps_new_any ();
+ caps = _tmp0_;
+ _tmp1_ = caps;
+ _tmp2_ = _gst_caps_ref0 (_tmp1_);
+ _tmp3_ = gst_pad_template_new (RYGEL_GST_SINK_PAD_NAME, GST_PAD_SINK, GST_PAD_ALWAYS, _tmp2_);
+ gst_object_ref_sink (_tmp3_);
+ template = _tmp3_;
+ _tmp4_ = template;
+ gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), _tmp4_);
+ _gst_object_unref0 (template);
+ _gst_caps_unref0 (caps);
}
static void rygel_gst_sink_init (RygelGstSink * self) {
- GMutex _tmp0_ = {0};
- GCond _tmp1_ = {0};
- self->priv = RYGEL_GST_SINK_GET_PRIVATE (self);
- g_mutex_init (&_tmp0_);
- self->priv->buffer_mutex = _tmp0_;
- g_cond_init (&_tmp1_);
- self->priv->buffer_condition = _tmp1_;
+ GMutex _tmp0_ = {0};
+ GCond _tmp1_ = {0};
+ self->priv = RYGEL_GST_SINK_GET_PRIVATE (self);
+ g_mutex_init (&_tmp0_);
+ self->priv->buffer_mutex = _tmp0_;
+ g_cond_init (&_tmp1_);
+ self->priv->buffer_condition = _tmp1_;
}
static void rygel_gst_sink_finalize (GObject* obj) {
- RygelGstSink * self;
- self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_GST_SINK, RygelGstSink);
- _g_object_unref0 (self->cancellable);
- _vala_clear_GMutex (&self->priv->buffer_mutex);
- _vala_clear_GCond (&self->priv->buffer_condition);
- _g_object_unref0 (self->priv->offsets);
- G_OBJECT_CLASS (rygel_gst_sink_parent_class)->finalize (obj);
+ RygelGstSink * self;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_GST_SINK, RygelGstSink);
+ _g_object_unref0 (self->cancellable);
+ _vala_clear_GMutex (&self->priv->buffer_mutex);
+ _vala_clear_GCond (&self->priv->buffer_condition);
+ _g_object_unref0 (self->priv->offsets);
+ G_OBJECT_CLASS (rygel_gst_sink_parent_class)->finalize (obj);
}
static void _vala_clear_GMutex (GMutex * mutex) {
- GMutex zero_mutex = { 0 };
- if (memcmp (mutex, &zero_mutex, sizeof (GMutex))) {
- g_mutex_clear (mutex);
- memset (mutex, 0, sizeof (GMutex));
- }
+ GMutex zero_mutex = { 0 };
+ if (memcmp (mutex, &zero_mutex, sizeof (GMutex))) {
+ g_mutex_clear (mutex);
+ memset (mutex, 0, sizeof (GMutex));
+ }
}
static void _vala_clear_GRecMutex (GRecMutex * mutex) {
- GRecMutex zero_mutex = { 0 };
- if (memcmp (mutex, &zero_mutex, sizeof (GRecMutex))) {
- g_rec_mutex_clear (mutex);
- memset (mutex, 0, sizeof (GRecMutex));
- }
+ GRecMutex zero_mutex = { 0 };
+ if (memcmp (mutex, &zero_mutex, sizeof (GRecMutex))) {
+ g_rec_mutex_clear (mutex);
+ memset (mutex, 0, sizeof (GRecMutex));
+ }
}
static void _vala_clear_GRWLock (GRWLock * mutex) {
- GRWLock zero_mutex = { 0 };
- if (memcmp (mutex, &zero_mutex, sizeof (GRWLock))) {
- g_rw_lock_clear (mutex);
- memset (mutex, 0, sizeof (GRWLock));
- }
+ GRWLock zero_mutex = { 0 };
+ if (memcmp (mutex, &zero_mutex, sizeof (GRWLock))) {
+ g_rw_lock_clear (mutex);
+ memset (mutex, 0, sizeof (GRWLock));
+ }
}
static void _vala_clear_GCond (GCond * mutex) {
- GCond zero_mutex = { 0 };
- if (memcmp (mutex, &zero_mutex, sizeof (GCond))) {
- g_cond_clear (mutex);
- memset (mutex, 0, sizeof (GCond));
- }
+ GCond zero_mutex = { 0 };
+ if (memcmp (mutex, &zero_mutex, sizeof (GCond))) {
+ g_cond_clear (mutex);
+ memset (mutex, 0, sizeof (GCond));
+ }
}
diff --git a/src/rygel-gst-utils.c b/src/rygel-gst-utils.c
index 4597b22..646e2ae 100644
--- a/src/rygel-gst-utils.c
+++ b/src/rygel-gst-utils.c
@@ -34,307 +34,307 @@
static gboolean rygel_gst_utils_need_rtp_depayloader (GstCaps* caps);
GstElement* rygel_gst_utils_create_element (const gchar* factoryname, const gchar* name, GError** error) {
- GstElement* result = NULL;
- const gchar* _tmp0_;
- const gchar* _tmp1_;
- GstElement* _tmp2_ = NULL;
- GstElement* element;
- GstElement* _tmp3_;
- GError * _inner_error_ = NULL;
- g_return_val_if_fail (factoryname != NULL, NULL);
- _tmp0_ = factoryname;
- _tmp1_ = name;
- _tmp2_ = gst_element_factory_make (_tmp0_, _tmp1_);
- if (_tmp2_ != NULL) {
- gst_object_ref_sink (_tmp2_);
- }
- element = _tmp2_;
- _tmp3_ = element;
- if (_tmp3_ == NULL) {
- const gchar* _tmp4_ = NULL;
- const gchar* _tmp5_;
- GError* _tmp6_;
- _tmp4_ = _ ("Required element %s missing");
- _tmp5_ = factoryname;
- _tmp6_ = g_error_new (RYGEL_GST_ERROR, RYGEL_GST_ERROR_MISSING_PLUGIN, _tmp4_, _tmp5_);
- _inner_error_ = _tmp6_;
- g_propagate_error (error, _inner_error_);
- _gst_object_unref0 (element);
- return NULL;
- }
- result = element;
- return result;
+ GstElement* result = NULL;
+ const gchar* _tmp0_;
+ const gchar* _tmp1_;
+ GstElement* _tmp2_ = NULL;
+ GstElement* element;
+ GstElement* _tmp3_;
+ GError * _inner_error_ = NULL;
+ g_return_val_if_fail (factoryname != NULL, NULL);
+ _tmp0_ = factoryname;
+ _tmp1_ = name;
+ _tmp2_ = gst_element_factory_make (_tmp0_, _tmp1_);
+ if (_tmp2_ != NULL) {
+ gst_object_ref_sink (_tmp2_);
+ }
+ element = _tmp2_;
+ _tmp3_ = element;
+ if (_tmp3_ == NULL) {
+ const gchar* _tmp4_ = NULL;
+ const gchar* _tmp5_;
+ GError* _tmp6_;
+ _tmp4_ = _ ("Required element %s missing");
+ _tmp5_ = factoryname;
+ _tmp6_ = g_error_new (RYGEL_GST_ERROR, RYGEL_GST_ERROR_MISSING_PLUGIN, _tmp4_, _tmp5_);
+ _inner_error_ = _tmp6_;
+ g_propagate_error (error, _inner_error_);
+ _gst_object_unref0 (element);
+ return NULL;
+ }
+ result = element;
+ return result;
}
static inline void _dynamic_set_blocksize4 (GstElement* obj, glong value) {
- g_object_set (obj, "blocksize", value, NULL);
+ g_object_set (obj, "blocksize", value, NULL);
}
static inline void _dynamic_set_tcp_timeout5 (GstElement* obj, gint64 value) {
- g_object_set (obj, "tcp-timeout", value, NULL);
+ g_object_set (obj, "tcp-timeout", value, NULL);
}
GstElement* rygel_gst_utils_create_source_for_uri (const gchar* uri) {
- GstElement* result = NULL;
- const gchar* _tmp0_;
- GstElement* _tmp1_ = NULL;
- GstElement* src;
- GstElement* _tmp2_;
- g_return_val_if_fail (uri != NULL, NULL);
- _tmp0_ = uri;
- _tmp1_ = gst_element_make_from_uri (GST_URI_SRC, _tmp0_, NULL);
- if (_tmp1_ != NULL) {
- gst_object_ref_sink (_tmp1_);
- }
- src = _tmp1_;
- _tmp2_ = src;
- if (_tmp2_ != NULL) {
- GstElement* _tmp3_;
- gboolean _tmp4_ = FALSE;
- GstElement* _tmp6_;
- GObjectClass* _tmp7_ = NULL;
- GParamSpec* _tmp8_ = NULL;
- GstElement* _tmp10_;
- GObjectClass* _tmp11_ = NULL;
- GParamSpec* _tmp12_ = NULL;
- _tmp3_ = src;
- _tmp4_ = GST_OBJECT_IS_FLOATING ((GstObject*) _tmp3_);
- if (_tmp4_) {
- GstElement* _tmp5_;
- _tmp5_ = src;
- gst_object_ref_sink ((GstObject*) _tmp5_);
- }
- _tmp6_ = src;
- _tmp7_ = G_OBJECT_GET_CLASS ((GObject*) _tmp6_);
- _tmp8_ = g_object_class_find_property (_tmp7_, "blocksize");
- if (_tmp8_ != NULL) {
- GstElement* _tmp9_;
- _tmp9_ = src;
- _dynamic_set_blocksize4 (_tmp9_, (glong) 65536);
- }
- _tmp10_ = src;
- _tmp11_ = G_OBJECT_GET_CLASS ((GObject*) _tmp10_);
- _tmp12_ = g_object_class_find_property (_tmp11_, "tcp-timeout");
- if (_tmp12_ != NULL) {
- GstElement* _tmp13_;
- _tmp13_ = src;
- _dynamic_set_tcp_timeout5 (_tmp13_, (gint64) 60000000);
- }
- }
- result = src;
- return result;
+ GstElement* result = NULL;
+ const gchar* _tmp0_;
+ GstElement* _tmp1_ = NULL;
+ GstElement* src;
+ GstElement* _tmp2_;
+ g_return_val_if_fail (uri != NULL, NULL);
+ _tmp0_ = uri;
+ _tmp1_ = gst_element_make_from_uri (GST_URI_SRC, _tmp0_, NULL);
+ if (_tmp1_ != NULL) {
+ gst_object_ref_sink (_tmp1_);
+ }
+ src = _tmp1_;
+ _tmp2_ = src;
+ if (_tmp2_ != NULL) {
+ GstElement* _tmp3_;
+ gboolean _tmp4_ = FALSE;
+ GstElement* _tmp6_;
+ GObjectClass* _tmp7_ = NULL;
+ GParamSpec* _tmp8_ = NULL;
+ GstElement* _tmp10_;
+ GObjectClass* _tmp11_ = NULL;
+ GParamSpec* _tmp12_ = NULL;
+ _tmp3_ = src;
+ _tmp4_ = GST_OBJECT_IS_FLOATING ((GstObject*) _tmp3_);
+ if (_tmp4_) {
+ GstElement* _tmp5_;
+ _tmp5_ = src;
+ gst_object_ref_sink ((GstObject*) _tmp5_);
+ }
+ _tmp6_ = src;
+ _tmp7_ = G_OBJECT_GET_CLASS ((GObject*) _tmp6_);
+ _tmp8_ = g_object_class_find_property (_tmp7_, "blocksize");
+ if (_tmp8_ != NULL) {
+ GstElement* _tmp9_;
+ _tmp9_ = src;
+ _dynamic_set_blocksize4 (_tmp9_, (glong) 65536);
+ }
+ _tmp10_ = src;
+ _tmp11_ = G_OBJECT_GET_CLASS ((GObject*) _tmp10_);
+ _tmp12_ = g_object_class_find_property (_tmp11_, "tcp-timeout");
+ if (_tmp12_ != NULL) {
+ GstElement* _tmp13_;
+ _tmp13_ = src;
+ _dynamic_set_tcp_timeout5 (_tmp13_, (gint64) 60000000);
+ }
+ }
+ result = src;
+ return result;
}
static gpointer _gst_encoding_profile_ref0 (gpointer self) {
- return self ? gst_encoding_profile_ref (self) : NULL;
+ return self ? gst_encoding_profile_ref (self) : NULL;
}
void rygel_gst_utils_dump_encoding_profile (GstEncodingProfile* profile, gint indent) {
- gint _tmp0_;
- gchar* _tmp1_ = NULL;
- gchar* indent_s;
- const gchar* _tmp2_;
- gchar* _tmp3_;
- gchar* _tmp4_;
- GstEncodingProfile* _tmp5_;
- const gchar* _tmp6_ = NULL;
- const gchar* _tmp7_;
- gchar* _tmp8_;
- gchar* _tmp9_;
- GstEncodingProfile* _tmp10_;
- GstCaps* _tmp11_ = NULL;
- gchar* _tmp12_ = NULL;
- gchar* _tmp13_;
- GstEncodingProfile* _tmp14_;
- GstCaps* _tmp15_ = NULL;
- GstEncodingProfile* _tmp23_;
- g_return_if_fail (profile != NULL);
- _tmp0_ = indent;
- _tmp1_ = g_strnfill ((gsize) _tmp0_, ' ');
- indent_s = _tmp1_;
- _tmp2_ = indent_s;
- _tmp3_ = g_strconcat (_tmp2_, "%s:", NULL);
- _tmp4_ = _tmp3_;
- _tmp5_ = profile;
- _tmp6_ = gst_encoding_profile_get_name (_tmp5_);
- g_debug (_tmp4_, _tmp6_);
- _g_free0 (_tmp4_);
- _tmp7_ = indent_s;
- _tmp8_ = g_strconcat (_tmp7_, " Format: %s", NULL);
- _tmp9_ = _tmp8_;
- _tmp10_ = profile;
- _tmp11_ = gst_encoding_profile_get_format (_tmp10_);
- _tmp12_ = gst_caps_to_string (_tmp11_);
- _tmp13_ = _tmp12_;
- g_debug (_tmp9_, _tmp13_);
- _g_free0 (_tmp13_);
- _g_free0 (_tmp9_);
- _tmp14_ = profile;
- _tmp15_ = gst_encoding_profile_get_restriction (_tmp14_);
- if (_tmp15_ != NULL) {
- const gchar* _tmp16_;
- gchar* _tmp17_;
- gchar* _tmp18_;
- GstEncodingProfile* _tmp19_;
- GstCaps* _tmp20_ = NULL;
- gchar* _tmp21_ = NULL;
- gchar* _tmp22_;
- _tmp16_ = indent_s;
- _tmp17_ = g_strconcat (_tmp16_, " Restriction: %s", NULL);
- _tmp18_ = _tmp17_;
- _tmp19_ = profile;
- _tmp20_ = gst_encoding_profile_get_restriction (_tmp19_);
- _tmp21_ = gst_caps_to_string (_tmp20_);
- _tmp22_ = _tmp21_;
- g_debug (_tmp18_, _tmp22_);
- _g_free0 (_tmp22_);
- _g_free0 (_tmp18_);
- }
- _tmp23_ = profile;
- if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, GST_TYPE_ENCODING_CONTAINER_PROFILE)) {
- GstEncodingProfile* _tmp24_;
- GstEncodingContainerProfile* _tmp25_;
- GstEncodingContainerProfile* container;
- GstEncodingContainerProfile* _tmp26_;
- GList* _tmp27_ = NULL;
- _tmp24_ = profile;
- _tmp25_ = _gst_encoding_profile_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, GST_TYPE_ENCODING_CONTAINER_PROFILE) ? ((GstEncodingContainerProfile*) _tmp24_) : NULL);
- container = _tmp25_;
- _tmp26_ = container;
- _tmp27_ = gst_encoding_container_profile_get_profiles (_tmp26_);
- {
- GList* subprofile_collection = NULL;
- GList* subprofile_it = NULL;
- subprofile_collection = _tmp27_;
- for (subprofile_it = subprofile_collection; subprofile_it != NULL; subprofile_it = subprofile_it->next) {
- GstEncodingProfile* _tmp28_;
- GstEncodingProfile* subprofile = NULL;
- _tmp28_ = _gst_encoding_profile_ref0 ((GstEncodingProfile*) subprofile_it->data);
- subprofile = _tmp28_;
- {
- GstEncodingProfile* _tmp29_;
- gint _tmp30_;
- _tmp29_ = subprofile;
- _tmp30_ = indent;
- rygel_gst_utils_dump_encoding_profile (_tmp29_, _tmp30_ + 4);
- _gst_encoding_profile_unref0 (subprofile);
- }
- }
- }
- _gst_encoding_profile_unref0 (container);
- }
- _g_free0 (indent_s);
+ gint _tmp0_;
+ gchar* _tmp1_ = NULL;
+ gchar* indent_s;
+ const gchar* _tmp2_;
+ gchar* _tmp3_;
+ gchar* _tmp4_;
+ GstEncodingProfile* _tmp5_;
+ const gchar* _tmp6_ = NULL;
+ const gchar* _tmp7_;
+ gchar* _tmp8_;
+ gchar* _tmp9_;
+ GstEncodingProfile* _tmp10_;
+ GstCaps* _tmp11_ = NULL;
+ gchar* _tmp12_ = NULL;
+ gchar* _tmp13_;
+ GstEncodingProfile* _tmp14_;
+ GstCaps* _tmp15_ = NULL;
+ GstEncodingProfile* _tmp23_;
+ g_return_if_fail (profile != NULL);
+ _tmp0_ = indent;
+ _tmp1_ = g_strnfill ((gsize) _tmp0_, ' ');
+ indent_s = _tmp1_;
+ _tmp2_ = indent_s;
+ _tmp3_ = g_strconcat (_tmp2_, "%s:", NULL);
+ _tmp4_ = _tmp3_;
+ _tmp5_ = profile;
+ _tmp6_ = gst_encoding_profile_get_name (_tmp5_);
+ g_debug (_tmp4_, _tmp6_);
+ _g_free0 (_tmp4_);
+ _tmp7_ = indent_s;
+ _tmp8_ = g_strconcat (_tmp7_, " Format: %s", NULL);
+ _tmp9_ = _tmp8_;
+ _tmp10_ = profile;
+ _tmp11_ = gst_encoding_profile_get_format (_tmp10_);
+ _tmp12_ = gst_caps_to_string (_tmp11_);
+ _tmp13_ = _tmp12_;
+ g_debug (_tmp9_, _tmp13_);
+ _g_free0 (_tmp13_);
+ _g_free0 (_tmp9_);
+ _tmp14_ = profile;
+ _tmp15_ = gst_encoding_profile_get_restriction (_tmp14_);
+ if (_tmp15_ != NULL) {
+ const gchar* _tmp16_;
+ gchar* _tmp17_;
+ gchar* _tmp18_;
+ GstEncodingProfile* _tmp19_;
+ GstCaps* _tmp20_ = NULL;
+ gchar* _tmp21_ = NULL;
+ gchar* _tmp22_;
+ _tmp16_ = indent_s;
+ _tmp17_ = g_strconcat (_tmp16_, " Restriction: %s", NULL);
+ _tmp18_ = _tmp17_;
+ _tmp19_ = profile;
+ _tmp20_ = gst_encoding_profile_get_restriction (_tmp19_);
+ _tmp21_ = gst_caps_to_string (_tmp20_);
+ _tmp22_ = _tmp21_;
+ g_debug (_tmp18_, _tmp22_);
+ _g_free0 (_tmp22_);
+ _g_free0 (_tmp18_);
+ }
+ _tmp23_ = profile;
+ if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, GST_TYPE_ENCODING_CONTAINER_PROFILE)) {
+ GstEncodingProfile* _tmp24_;
+ GstEncodingContainerProfile* _tmp25_;
+ GstEncodingContainerProfile* container;
+ GstEncodingContainerProfile* _tmp26_;
+ GList* _tmp27_ = NULL;
+ _tmp24_ = profile;
+ _tmp25_ = _gst_encoding_profile_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, GST_TYPE_ENCODING_CONTAINER_PROFILE) ? ((GstEncodingContainerProfile*) _tmp24_) : NULL);
+ container = _tmp25_;
+ _tmp26_ = container;
+ _tmp27_ = gst_encoding_container_profile_get_profiles (_tmp26_);
+ {
+ GList* subprofile_collection = NULL;
+ GList* subprofile_it = NULL;
+ subprofile_collection = _tmp27_;
+ for (subprofile_it = subprofile_collection; subprofile_it != NULL; subprofile_it = subprofile_it->next) {
+ GstEncodingProfile* _tmp28_;
+ GstEncodingProfile* subprofile = NULL;
+ _tmp28_ = _gst_encoding_profile_ref0 ((GstEncodingProfile*) subprofile_it->data);
+ subprofile = _tmp28_;
+ {
+ GstEncodingProfile* _tmp29_;
+ gint _tmp30_;
+ _tmp29_ = subprofile;
+ _tmp30_ = indent;
+ rygel_gst_utils_dump_encoding_profile (_tmp29_, _tmp30_ + 4);
+ _gst_encoding_profile_unref0 (subprofile);
+ }
+ }
+ }
+ _gst_encoding_profile_unref0 (container);
+ }
+ _g_free0 (indent_s);
}
static void _gst_object_unref0_ (gpointer var) {
- (var == NULL) ? NULL : (var = (gst_object_unref (var), NULL));
+ (var == NULL) ? NULL : (var = (gst_object_unref (var), NULL));
}
static void _g_list_free__gst_object_unref0_ (GList* self) {
- g_list_foreach (self, (GFunc) _gst_object_unref0_, NULL);
- g_list_free (self);
+ g_list_foreach (self, (GFunc) _gst_object_unref0_, NULL);
+ g_list_free (self);
}
GstElement* rygel_gst_utils_get_rtp_depayloader (GstCaps* caps) {
- GstElement* result = NULL;
- GstCaps* _tmp0_;
- gboolean _tmp1_ = FALSE;
- GList* _tmp2_ = NULL;
- GList* features;
- GList* _tmp3_;
- GstCaps* _tmp4_;
- GList* _tmp5_ = NULL;
- GList* _tmp6_;
- gconstpointer _tmp7_;
- const gchar* _tmp8_ = NULL;
- g_return_val_if_fail (caps != NULL, NULL);
- _tmp0_ = caps;
- _tmp1_ = rygel_gst_utils_need_rtp_depayloader (_tmp0_);
- if (!_tmp1_) {
- result = NULL;
- return result;
- }
- _tmp2_ = gst_element_factory_list_get_elements ((GstElementFactoryListType) GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER, GST_RANK_NONE);
- features = _tmp2_;
- _tmp3_ = features;
- _tmp4_ = caps;
- _tmp5_ = gst_element_factory_list_filter (_tmp3_, _tmp4_, GST_PAD_SINK, FALSE);
- __g_list_free__gst_object_unref0_0 (features);
- features = _tmp5_;
- _tmp6_ = features;
- _tmp7_ = _tmp6_->data;
- _tmp8_ = gst_plugin_feature_get_name ((GstPluginFeature*) ((GstElementFactory*) _tmp7_));
- if (g_strcmp0 (_tmp8_, "rtpdepay") == 0) {
- GList* _tmp9_;
- GList* _tmp10_;
- _tmp9_ = features;
- _tmp10_ = _tmp9_->next;
- if (_tmp10_ != NULL) {
- GList* _tmp11_;
- GList* _tmp12_;
- gconstpointer _tmp13_;
- GstElement* _tmp14_ = NULL;
- _tmp11_ = features;
- _tmp12_ = _tmp11_->next;
- _tmp13_ = _tmp12_->data;
- _tmp14_ = gst_element_factory_create ((GstElementFactory*) _tmp13_, NULL);
- if (_tmp14_ != NULL) {
- gst_object_ref_sink (_tmp14_);
- }
- result = _tmp14_;
- __g_list_free__gst_object_unref0_0 (features);
- return result;
- }
- result = NULL;
- __g_list_free__gst_object_unref0_0 (features);
- return result;
- } else {
- GList* _tmp15_;
- gconstpointer _tmp16_;
- GstElement* _tmp17_ = NULL;
- _tmp15_ = features;
- _tmp16_ = _tmp15_->data;
- _tmp17_ = gst_element_factory_create ((GstElementFactory*) _tmp16_, NULL);
- if (_tmp17_ != NULL) {
- gst_object_ref_sink (_tmp17_);
- }
- result = _tmp17_;
- __g_list_free__gst_object_unref0_0 (features);
- return result;
- }
- __g_list_free__gst_object_unref0_0 (features);
+ GstElement* result = NULL;
+ GstCaps* _tmp0_;
+ gboolean _tmp1_ = FALSE;
+ GList* _tmp2_ = NULL;
+ GList* features;
+ GList* _tmp3_;
+ GstCaps* _tmp4_;
+ GList* _tmp5_ = NULL;
+ GList* _tmp6_;
+ gconstpointer _tmp7_;
+ const gchar* _tmp8_ = NULL;
+ g_return_val_if_fail (caps != NULL, NULL);
+ _tmp0_ = caps;
+ _tmp1_ = rygel_gst_utils_need_rtp_depayloader (_tmp0_);
+ if (!_tmp1_) {
+ result = NULL;
+ return result;
+ }
+ _tmp2_ = gst_element_factory_list_get_elements ((GstElementFactoryListType) GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER, GST_RANK_NONE);
+ features = _tmp2_;
+ _tmp3_ = features;
+ _tmp4_ = caps;
+ _tmp5_ = gst_element_factory_list_filter (_tmp3_, _tmp4_, GST_PAD_SINK, FALSE);
+ __g_list_free__gst_object_unref0_0 (features);
+ features = _tmp5_;
+ _tmp6_ = features;
+ _tmp7_ = _tmp6_->data;
+ _tmp8_ = gst_plugin_feature_get_name ((GstPluginFeature*) ((GstElementFactory*) _tmp7_));
+ if (g_strcmp0 (_tmp8_, "rtpdepay") == 0) {
+ GList* _tmp9_;
+ GList* _tmp10_;
+ _tmp9_ = features;
+ _tmp10_ = _tmp9_->next;
+ if (_tmp10_ != NULL) {
+ GList* _tmp11_;
+ GList* _tmp12_;
+ gconstpointer _tmp13_;
+ GstElement* _tmp14_ = NULL;
+ _tmp11_ = features;
+ _tmp12_ = _tmp11_->next;
+ _tmp13_ = _tmp12_->data;
+ _tmp14_ = gst_element_factory_create ((GstElementFactory*) _tmp13_, NULL);
+ if (_tmp14_ != NULL) {
+ gst_object_ref_sink (_tmp14_);
+ }
+ result = _tmp14_;
+ __g_list_free__gst_object_unref0_0 (features);
+ return result;
+ }
+ result = NULL;
+ __g_list_free__gst_object_unref0_0 (features);
+ return result;
+ } else {
+ GList* _tmp15_;
+ gconstpointer _tmp16_;
+ GstElement* _tmp17_ = NULL;
+ _tmp15_ = features;
+ _tmp16_ = _tmp15_->data;
+ _tmp17_ = gst_element_factory_create ((GstElementFactory*) _tmp16_, NULL);
+ if (_tmp17_ != NULL) {
+ gst_object_ref_sink (_tmp17_);
+ }
+ result = _tmp17_;
+ __g_list_free__gst_object_unref0_0 (features);
+ return result;
+ }
+ __g_list_free__gst_object_unref0_0 (features);
}
static gpointer _gst_structure_copy0 (gpointer self) {
- return self ? gst_structure_copy (self) : NULL;
+ return self ? gst_structure_copy (self) : NULL;
}
static gboolean rygel_gst_utils_need_rtp_depayloader (GstCaps* caps) {
- gboolean result = FALSE;
- GstCaps* _tmp0_;
- const GstStructure* _tmp1_ = NULL;
- GstStructure* _tmp2_;
- GstStructure* structure;
- const gchar* _tmp3_ = NULL;
- g_return_val_if_fail (caps != NULL, FALSE);
- _tmp0_ = caps;
- _tmp1_ = gst_caps_get_structure (_tmp0_, (guint) 0);
- _tmp2_ = _gst_structure_copy0 (_tmp1_);
- structure = _tmp2_;
- _tmp3_ = gst_structure_get_name (structure);
- result = g_strcmp0 (_tmp3_, "application/x-rtp") == 0;
- _gst_structure_free0 (structure);
- return result;
+ gboolean result = FALSE;
+ GstCaps* _tmp0_;
+ const GstStructure* _tmp1_ = NULL;
+ GstStructure* _tmp2_;
+ GstStructure* structure;
+ const gchar* _tmp3_ = NULL;
+ g_return_val_if_fail (caps != NULL, FALSE);
+ _tmp0_ = caps;
+ _tmp1_ = gst_caps_get_structure (_tmp0_, (guint) 0);
+ _tmp2_ = _gst_structure_copy0 (_tmp1_);
+ structure = _tmp2_;
+ _tmp3_ = gst_structure_get_name (structure);
+ result = g_strcmp0 (_tmp3_, "application/x-rtp") == 0;
+ _gst_structure_free0 (structure);
+ return result;
}
diff --git a/src/rygel-mp2ts-transcoder.c b/src/rygel-mp2ts-transcoder.c
index 929e9e1..2e4d7f0 100644
--- a/src/rygel-mp2ts-transcoder.c
+++ b/src/rygel-mp2ts-transcoder.c
@@ -28,7 +28,7 @@ G_DEFINE_TYPE (RygelMP2TSTranscoder, rygel_mp2_ts_transcoder, RYGEL_TYPE_VIDEO_T
#define RYGEL_TYPE_MP2_TS_PROFILE (rygel_mp2_ts_profile_get_type ())
struct _RygelMP2TSTranscoderPrivate {
- RygelMP2TSProfile profile;
+ RygelMP2TSProfile profile;
};
GType rygel_mp2_ts_profile_get_type (void) G_GNUC_CONST;
@@ -54,215 +54,215 @@ 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"};
GType rygel_mp2_ts_profile_get_type (void) {
- static volatile gsize rygel_mp2_ts_profile_type_id__volatile = 0;
- if (g_once_init_enter (&rygel_mp2_ts_profile_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 rygel_mp2_ts_profile_type_id;
- rygel_mp2_ts_profile_type_id = g_enum_register_static ("RygelMP2TSProfile", values);
- g_once_init_leave (&rygel_mp2_ts_profile_type_id__volatile, rygel_mp2_ts_profile_type_id);
- }
- return rygel_mp2_ts_profile_type_id__volatile;
+ static volatile gsize rygel_mp2_ts_profile_type_id__volatile = 0;
+ if (g_once_init_enter (&rygel_mp2_ts_profile_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 rygel_mp2_ts_profile_type_id;
+ rygel_mp2_ts_profile_type_id = g_enum_register_static ("RygelMP2TSProfile", values);
+ g_once_init_leave (&rygel_mp2_ts_profile_type_id__volatile, rygel_mp2_ts_profile_type_id);
+ }
+ return rygel_mp2_ts_profile_type_id__volatile;
}
RygelMP2TSTranscoder* rygel_mp2_ts_transcoder_construct (GType object_type, RygelMP2TSProfile profile) {
- RygelMP2TSTranscoder * self = NULL;
- RygelMP2TSProfile _tmp0_;
- const gchar* _tmp1_;
- RygelMP2TSProfile _tmp2_;
- gint _tmp3_;
- RygelMP2TSProfile _tmp4_;
- gint _tmp5_;
- RygelMP2TSProfile _tmp6_;
- gint _tmp7_;
- gchar* _tmp8_ = NULL;
- gchar* _tmp9_;
- RygelMP2TSProfile _tmp10_;
- _tmp0_ = profile;
- _tmp1_ = RYGEL_MP2_TS_TRANSCODER_PROFILES[_tmp0_];
- _tmp2_ = profile;
- _tmp3_ = RYGEL_MP2_TS_TRANSCODER_FRAME_RATE[_tmp2_];
- _tmp4_ = profile;
- _tmp5_ = RYGEL_MP2_TS_TRANSCODER_WIDTH[_tmp4_];
- _tmp6_ = profile;
- _tmp7_ = RYGEL_MP2_TS_TRANSCODER_HEIGHT[_tmp6_];
- _tmp8_ = g_strdup_printf (RYGEL_MP2_TS_TRANSCODER_RESTRICTION_TEMPLATE, _tmp3_, _tmp5_, _tmp7_);
- _tmp9_ = _tmp8_;
- self = (RygelMP2TSTranscoder*) rygel_video_transcoder_construct (object_type, "video/mpeg", _tmp1_, 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", _tmp9_);
- _g_free0 (_tmp9_);
- _tmp10_ = profile;
- self->priv->profile = _tmp10_;
- return self;
+ RygelMP2TSTranscoder * self = NULL;
+ RygelMP2TSProfile _tmp0_;
+ const gchar* _tmp1_;
+ RygelMP2TSProfile _tmp2_;
+ gint _tmp3_;
+ RygelMP2TSProfile _tmp4_;
+ gint _tmp5_;
+ RygelMP2TSProfile _tmp6_;
+ gint _tmp7_;
+ gchar* _tmp8_ = NULL;
+ gchar* _tmp9_;
+ RygelMP2TSProfile _tmp10_;
+ _tmp0_ = profile;
+ _tmp1_ = RYGEL_MP2_TS_TRANSCODER_PROFILES[_tmp0_];
+ _tmp2_ = profile;
+ _tmp3_ = RYGEL_MP2_TS_TRANSCODER_FRAME_RATE[_tmp2_];
+ _tmp4_ = profile;
+ _tmp5_ = RYGEL_MP2_TS_TRANSCODER_WIDTH[_tmp4_];
+ _tmp6_ = profile;
+ _tmp7_ = RYGEL_MP2_TS_TRANSCODER_HEIGHT[_tmp6_];
+ _tmp8_ = g_strdup_printf (RYGEL_MP2_TS_TRANSCODER_RESTRICTION_TEMPLATE, _tmp3_, _tmp5_, _tmp7_);
+ _tmp9_ = _tmp8_;
+ self = (RygelMP2TSTranscoder*) rygel_video_transcoder_construct (object_type, "video/mpeg", _tmp1_, 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", _tmp9_);
+ _g_free0 (_tmp9_);
+ _tmp10_ = profile;
+ self->priv->profile = _tmp10_;
+ return self;
}
RygelMP2TSTranscoder* rygel_mp2_ts_transcoder_new (RygelMP2TSProfile profile) {
- return rygel_mp2_ts_transcoder_construct (RYGEL_TYPE_MP2_TS_TRANSCODER, profile);
+ return rygel_mp2_ts_transcoder_construct (RYGEL_TYPE_MP2_TS_TRANSCODER, profile);
}
static GUPnPDIDLLiteResource* rygel_mp2_ts_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
- RygelMP2TSTranscoder * self;
- GUPnPDIDLLiteResource* result = NULL;
- GUPnPDIDLLiteItem* _tmp0_;
- RygelMediaItem* _tmp1_;
- RygelTranscodeManager* _tmp2_;
- GUPnPDIDLLiteResource* _tmp3_ = NULL;
- GUPnPDIDLLiteResource* resource;
- RygelMP2TSProfile _tmp4_;
- gint _tmp5_;
- RygelMP2TSProfile _tmp6_;
- gint _tmp7_;
- GError * _inner_error_ = NULL;
- self = (RygelMP2TSTranscoder*) base;
- 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_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_);
- return NULL;
- }
- if (resource == NULL) {
- result = NULL;
- _g_object_unref0 (resource);
- return result;
- }
- _tmp4_ = self->priv->profile;
- _tmp5_ = RYGEL_MP2_TS_TRANSCODER_WIDTH[_tmp4_];
- gupnp_didl_lite_resource_set_width (resource, _tmp5_);
- _tmp6_ = self->priv->profile;
- _tmp7_ = RYGEL_MP2_TS_TRANSCODER_HEIGHT[_tmp6_];
- gupnp_didl_lite_resource_set_height (resource, _tmp7_);
- gupnp_didl_lite_resource_set_bitrate (resource, ((RYGEL_MP2_TS_TRANSCODER_VIDEO_BITRATE + RYGEL_MP2_TS_TRANSCODER_AUDIO_BITRATE) * 1000) / 8);
- result = resource;
- return result;
+ RygelMP2TSTranscoder * self;
+ GUPnPDIDLLiteResource* result = NULL;
+ GUPnPDIDLLiteItem* _tmp0_;
+ RygelMediaItem* _tmp1_;
+ RygelTranscodeManager* _tmp2_;
+ GUPnPDIDLLiteResource* _tmp3_ = NULL;
+ GUPnPDIDLLiteResource* resource;
+ RygelMP2TSProfile _tmp4_;
+ gint _tmp5_;
+ RygelMP2TSProfile _tmp6_;
+ gint _tmp7_;
+ GError * _inner_error_ = NULL;
+ self = (RygelMP2TSTranscoder*) base;
+ 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_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_);
+ return NULL;
+ }
+ if (resource == NULL) {
+ result = NULL;
+ _g_object_unref0 (resource);
+ return result;
+ }
+ _tmp4_ = self->priv->profile;
+ _tmp5_ = RYGEL_MP2_TS_TRANSCODER_WIDTH[_tmp4_];
+ gupnp_didl_lite_resource_set_width (resource, _tmp5_);
+ _tmp6_ = self->priv->profile;
+ _tmp7_ = RYGEL_MP2_TS_TRANSCODER_HEIGHT[_tmp6_];
+ gupnp_didl_lite_resource_set_height (resource, _tmp7_);
+ gupnp_didl_lite_resource_set_bitrate (resource, ((RYGEL_MP2_TS_TRANSCODER_VIDEO_BITRATE + RYGEL_MP2_TS_TRANSCODER_AUDIO_BITRATE) * 1000) / 8);
+ result = resource;
+ return result;
}
static gpointer _g_object_ref0 (gpointer self) {
- return self ? g_object_ref (self) : NULL;
+ return self ? g_object_ref (self) : NULL;
}
static guint rygel_mp2_ts_transcoder_real_get_distance (RygelTranscoder* base, RygelMediaItem* item) {
- RygelMP2TSTranscoder * self;
- guint result = 0U;
- RygelMediaItem* _tmp0_;
- RygelMediaItem* _tmp2_;
- RygelVideoItem* _tmp3_;
- RygelVideoItem* video_item;
- RygelMediaItem* _tmp4_;
- guint _tmp5_ = 0U;
- guint distance;
- RygelVideoItem* _tmp6_;
- gint _tmp7_;
- gint _tmp8_;
- RygelVideoItem* _tmp14_;
- gint _tmp15_;
- gint _tmp16_;
- RygelVideoItem* _tmp24_;
- gint _tmp25_;
- gint _tmp26_;
- self = (RygelMP2TSTranscoder*) base;
- g_return_val_if_fail (item != NULL, 0U);
- _tmp0_ = item;
- if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, RYGEL_TYPE_VIDEO_ITEM)) {
- guint _tmp1_;
- _tmp1_ = G_MAXUINT;
- result = _tmp1_;
- return result;
- }
- _tmp2_ = item;
- _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, RYGEL_TYPE_VIDEO_ITEM) ? ((RygelVideoItem*) _tmp2_) : NULL);
- video_item = _tmp3_;
- _tmp4_ = item;
- _tmp5_ = RYGEL_TRANSCODER_CLASS (rygel_mp2_ts_transcoder_parent_class)->get_distance ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_VIDEO_TRANSCODER, RygelVideoTranscoder), _tmp4_);
- distance = _tmp5_;
- _tmp6_ = video_item;
- _tmp7_ = rygel_audio_item_get_bitrate ((RygelAudioItem*) _tmp6_);
- _tmp8_ = _tmp7_;
- if (_tmp8_ > 0) {
- guint _tmp9_;
- RygelVideoItem* _tmp10_;
- gint _tmp11_;
- gint _tmp12_;
- gint _tmp13_ = 0;
- _tmp9_ = distance;
- _tmp10_ = video_item;
- _tmp11_ = rygel_audio_item_get_bitrate ((RygelAudioItem*) _tmp10_);
- _tmp12_ = _tmp11_;
- _tmp13_ = abs (_tmp12_ - RYGEL_MP2_TS_TRANSCODER_VIDEO_BITRATE);
- distance = _tmp9_ + _tmp13_;
- }
- _tmp14_ = video_item;
- _tmp15_ = rygel_visual_item_get_width ((RygelVisualItem*) _tmp14_);
- _tmp16_ = _tmp15_;
- if (_tmp16_ > 0) {
- guint _tmp17_;
- RygelVideoItem* _tmp18_;
- gint _tmp19_;
- gint _tmp20_;
- RygelMP2TSProfile _tmp21_;
- gint _tmp22_;
- gint _tmp23_ = 0;
- _tmp17_ = distance;
- _tmp18_ = video_item;
- _tmp19_ = rygel_visual_item_get_width ((RygelVisualItem*) _tmp18_);
- _tmp20_ = _tmp19_;
- _tmp21_ = self->priv->profile;
- _tmp22_ = RYGEL_MP2_TS_TRANSCODER_WIDTH[_tmp21_];
- _tmp23_ = abs (_tmp20_ - _tmp22_);
- distance = _tmp17_ + _tmp23_;
- }
- _tmp24_ = video_item;
- _tmp25_ = rygel_visual_item_get_height ((RygelVisualItem*) _tmp24_);
- _tmp26_ = _tmp25_;
- if (_tmp26_ > 0) {
- guint _tmp27_;
- RygelVideoItem* _tmp28_;
- gint _tmp29_;
- gint _tmp30_;
- RygelMP2TSProfile _tmp31_;
- gint _tmp32_;
- gint _tmp33_ = 0;
- _tmp27_ = distance;
- _tmp28_ = video_item;
- _tmp29_ = rygel_visual_item_get_height ((RygelVisualItem*) _tmp28_);
- _tmp30_ = _tmp29_;
- _tmp31_ = self->priv->profile;
- _tmp32_ = RYGEL_MP2_TS_TRANSCODER_HEIGHT[_tmp31_];
- _tmp33_ = abs (_tmp30_ - _tmp32_);
- distance = _tmp27_ + _tmp33_;
- }
- result = distance;
- _g_object_unref0 (video_item);
- return result;
+ RygelMP2TSTranscoder * self;
+ guint result = 0U;
+ RygelMediaItem* _tmp0_;
+ RygelMediaItem* _tmp2_;
+ RygelVideoItem* _tmp3_;
+ RygelVideoItem* video_item;
+ RygelMediaItem* _tmp4_;
+ guint _tmp5_ = 0U;
+ guint distance;
+ RygelVideoItem* _tmp6_;
+ gint _tmp7_;
+ gint _tmp8_;
+ RygelVideoItem* _tmp14_;
+ gint _tmp15_;
+ gint _tmp16_;
+ RygelVideoItem* _tmp24_;
+ gint _tmp25_;
+ gint _tmp26_;
+ self = (RygelMP2TSTranscoder*) base;
+ g_return_val_if_fail (item != NULL, 0U);
+ _tmp0_ = item;
+ if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, RYGEL_TYPE_VIDEO_ITEM)) {
+ guint _tmp1_;
+ _tmp1_ = G_MAXUINT;
+ result = _tmp1_;
+ return result;
+ }
+ _tmp2_ = item;
+ _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, RYGEL_TYPE_VIDEO_ITEM) ? ((RygelVideoItem*) _tmp2_) : NULL);
+ video_item = _tmp3_;
+ _tmp4_ = item;
+ _tmp5_ = RYGEL_TRANSCODER_CLASS (rygel_mp2_ts_transcoder_parent_class)->get_distance ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_VIDEO_TRANSCODER, RygelVideoTranscoder), _tmp4_);
+ distance = _tmp5_;
+ _tmp6_ = video_item;
+ _tmp7_ = rygel_audio_item_get_bitrate ((RygelAudioItem*) _tmp6_);
+ _tmp8_ = _tmp7_;
+ if (_tmp8_ > 0) {
+ guint _tmp9_;
+ RygelVideoItem* _tmp10_;
+ gint _tmp11_;
+ gint _tmp12_;
+ gint _tmp13_ = 0;
+ _tmp9_ = distance;
+ _tmp10_ = video_item;
+ _tmp11_ = rygel_audio_item_get_bitrate ((RygelAudioItem*) _tmp10_);
+ _tmp12_ = _tmp11_;
+ _tmp13_ = abs (_tmp12_ - RYGEL_MP2_TS_TRANSCODER_VIDEO_BITRATE);
+ distance = _tmp9_ + _tmp13_;
+ }
+ _tmp14_ = video_item;
+ _tmp15_ = rygel_visual_item_get_width ((RygelVisualItem*) _tmp14_);
+ _tmp16_ = _tmp15_;
+ if (_tmp16_ > 0) {
+ guint _tmp17_;
+ RygelVideoItem* _tmp18_;
+ gint _tmp19_;
+ gint _tmp20_;
+ RygelMP2TSProfile _tmp21_;
+ gint _tmp22_;
+ gint _tmp23_ = 0;
+ _tmp17_ = distance;
+ _tmp18_ = video_item;
+ _tmp19_ = rygel_visual_item_get_width ((RygelVisualItem*) _tmp18_);
+ _tmp20_ = _tmp19_;
+ _tmp21_ = self->priv->profile;
+ _tmp22_ = RYGEL_MP2_TS_TRANSCODER_WIDTH[_tmp21_];
+ _tmp23_ = abs (_tmp20_ - _tmp22_);
+ distance = _tmp17_ + _tmp23_;
+ }
+ _tmp24_ = video_item;
+ _tmp25_ = rygel_visual_item_get_height ((RygelVisualItem*) _tmp24_);
+ _tmp26_ = _tmp25_;
+ if (_tmp26_ > 0) {
+ guint _tmp27_;
+ RygelVideoItem* _tmp28_;
+ gint _tmp29_;
+ gint _tmp30_;
+ RygelMP2TSProfile _tmp31_;
+ gint _tmp32_;
+ gint _tmp33_ = 0;
+ _tmp27_ = distance;
+ _tmp28_ = video_item;
+ _tmp29_ = rygel_visual_item_get_height ((RygelVisualItem*) _tmp28_);
+ _tmp30_ = _tmp29_;
+ _tmp31_ = self->priv->profile;
+ _tmp32_ = RYGEL_MP2_TS_TRANSCODER_HEIGHT[_tmp31_];
+ _tmp33_ = abs (_tmp30_ - _tmp32_);
+ distance = _tmp27_ + _tmp33_;
+ }
+ result = distance;
+ _g_object_unref0 (video_item);
+ return result;
}
static void rygel_mp2_ts_transcoder_class_init (RygelMP2TSTranscoderClass * klass) {
- rygel_mp2_ts_transcoder_parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (RygelMP2TSTranscoderPrivate));
- 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;
+ rygel_mp2_ts_transcoder_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (RygelMP2TSTranscoderPrivate));
+ 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;
}
static void rygel_mp2_ts_transcoder_init (RygelMP2TSTranscoder * self) {
- self->priv = RYGEL_MP2_TS_TRANSCODER_GET_PRIVATE (self);
+ self->priv = RYGEL_MP2_TS_TRANSCODER_GET_PRIVATE (self);
}
static void rygel_mp2_ts_transcoder_finalize (GObject* obj) {
- RygelMP2TSTranscoder * self;
- self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_MP2_TS_TRANSCODER, RygelMP2TSTranscoder);
- G_OBJECT_CLASS (rygel_mp2_ts_transcoder_parent_class)->finalize (obj);
+ RygelMP2TSTranscoder * self;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_MP2_TS_TRANSCODER, RygelMP2TSTranscoder);
+ G_OBJECT_CLASS (rygel_mp2_ts_transcoder_parent_class)->finalize (obj);
}
diff --git a/src/rygel-mp2ts-transcoder.h b/src/rygel-mp2ts-transcoder.h
index 18442f4..e0f02ae 100644
--- a/src/rygel-mp2ts-transcoder.h
+++ b/src/rygel-mp2ts-transcoder.h
@@ -55,8 +55,8 @@ struct _RygelMP2TSTranscoderClass {
};
typedef enum {
- RYGEL_MP2_TS_PROFILE_SD = 0,
- RYGEL_MP2_TS_PROFILE_HD
+ RYGEL_MP2_TS_PROFILE_SD = 0,
+ RYGEL_MP2_TS_PROFILE_HD
} RygelMP2TSProfile;
GType rygel_mp2_ts_transcoder_get_type (void) G_GNUC_CONST;
diff --git a/src/rygel-mp3-transcoder.c b/src/rygel-mp3-transcoder.c
index ad3727b..1bb1d4f 100644
--- a/src/rygel-mp3-transcoder.c
+++ b/src/rygel-mp3-transcoder.c
@@ -37,19 +37,19 @@ RygelMP3Transcoder* rygel_mp3_transcoder_new (void);
RygelMP3Transcoder* rygel_mp3_transcoder_construct (GType object_type);
RygelMP3Transcoder* rygel_mp3_transcoder_construct (GType object_type) {
- RygelMP3Transcoder * self = NULL;
- self = (RygelMP3Transcoder*) 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 * self = NULL;
+ self = (RygelMP3Transcoder*) 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_construct (RYGEL_TYPE_MP3_TRANSCODER);
}
static void rygel_mp3_transcoder_class_init (RygelMP3TranscoderClass * klass) {
- rygel_mp3_transcoder_parent_class = g_type_class_peek_parent (klass);
+ rygel_mp3_transcoder_parent_class = g_type_class_peek_parent (klass);
}
diff --git a/src/rygel-wmv-transcoder.c b/src/rygel-wmv-transcoder.c
index 1f80e81..3e9328b 100644
--- a/src/rygel-wmv-transcoder.c
+++ b/src/rygel-wmv-transcoder.c
@@ -31,19 +31,19 @@ RygelWMVTranscoder* rygel_wmv_transcoder_new (void);
RygelWMVTranscoder* rygel_wmv_transcoder_construct (GType object_type);
RygelWMVTranscoder* rygel_wmv_transcoder_construct (GType object_type) {
- RygelWMVTranscoder * self = NULL;
- self = (RygelWMVTranscoder*) 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 * self = NULL;
+ self = (RygelWMVTranscoder*) 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_construct (RYGEL_TYPE_WMV_TRANSCODER);
}
static void rygel_wmv_transcoder_class_init (RygelWMVTranscoderClass * klass) {
- rygel_wmv_transcoder_parent_class = g_type_class_peek_parent (klass);
+ rygel_wmv_transcoder_parent_class = g_type_class_peek_parent (klass);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]