Пример #1
0
static GstElement* rygel_gst_utils_get_best_depay (GList* features, GstCaps* caps) {
#line 236 "rygel-gst-utils.c"
	GstElement* result = NULL;
	GList* relevant_factories;
	GstElementFactory* factory;
#line 66 "rygel-gst-utils.vala"
	g_return_val_if_fail (caps != NULL, NULL);
#line 69 "rygel-gst-utils.vala"
	relevant_factories = NULL;
#line 244 "rygel-gst-utils.c"
	{
		GList* feature_collection;
		GList* feature_it;
#line 72 "rygel-gst-utils.vala"
		feature_collection = features;
#line 250 "rygel-gst-utils.c"
		for (feature_it = feature_collection; feature_it != NULL; feature_it = feature_it->next) {
			GstPluginFeature* feature;
#line 72 "rygel-gst-utils.vala"
			feature = _gst_object_ref0 ((GstPluginFeature*) feature_it->data);
#line 255 "rygel-gst-utils.c"
			{
				GstElementFactory* factory;
#line 73 "rygel-gst-utils.vala"
				factory = _gst_object_ref0 (GST_ELEMENT_FACTORY (feature));
#line 74 "rygel-gst-utils.vala"
				if (gst_element_factory_can_sink_caps (factory, caps)) {
#line 75 "rygel-gst-utils.vala"
					relevant_factories = g_list_append (relevant_factories, _gst_object_ref0 (factory));
#line 264 "rygel-gst-utils.c"
				}
				_gst_object_unref0 (feature);
				_gst_object_unref0 (factory);
			}
		}
	}
#line 79 "rygel-gst-utils.vala"
	if (g_list_length (relevant_factories) == 0) {
#line 273 "rygel-gst-utils.c"
		result = NULL;
		__g_list_free_gst_object_unref0 (relevant_factories);
#line 81 "rygel-gst-utils.vala"
		return result;
#line 278 "rygel-gst-utils.c"
	}
#line 85 "rygel-gst-utils.vala"
	relevant_factories = g_list_sort (relevant_factories, _rygel_gst_utils_compare_factories_gcompare_func);
#line 88 "rygel-gst-utils.vala"
	factory = _gst_object_ref0 ((GstElementFactory*) relevant_factories->data);
#line 284 "rygel-gst-utils.c"
	result = gst_element_factory_make (gst_plugin_feature_get_name ((GstPluginFeature*) factory), NULL);
	__g_list_free_gst_object_unref0 (relevant_factories);
	_gst_object_unref0 (factory);
#line 90 "rygel-gst-utils.vala"
	return result;
#line 290 "rygel-gst-utils.c"
}
Пример #2
0
RygelWMATranscoderBin* rygel_wma_transcoder_bin_construct (GType object_type, RygelMediaItem* item, GstElement* src, RygelWMATranscoder* transcoder, GError** error) {
#line 147 "rygel-wma-transcoder-bin.c"
	GError * _inner_error_;
	RygelWMATranscoderBin * self;
	GstElement* decodebin;
	GstElement* _tmp0_;
	GstElement* _tmp1_;
	GstPad* src_pad;
	GstGhostPad* ghost;
#line 32 "rygel-wma-transcoder-bin.vala"
	g_return_val_if_fail (item != NULL, NULL);
#line 32 "rygel-wma-transcoder-bin.vala"
	g_return_val_if_fail (src != NULL, NULL);
#line 32 "rygel-wma-transcoder-bin.vala"
	g_return_val_if_fail (transcoder != NULL, NULL);
#line 161 "rygel-wma-transcoder-bin.c"
	_inner_error_ = NULL;
	self = g_object_newv (object_type, 0, NULL);
#line 35 "rygel-wma-transcoder-bin.vala"
	decodebin = rygel_gst_utils_create_element (RYGEL_WMA_TRANSCODER_BIN_DECODEBIN, RYGEL_WMA_TRANSCODER_BIN_DECODEBIN, &_inner_error_);
#line 166 "rygel-wma-transcoder-bin.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		gst_object_unref (self);
		return NULL;
	}
#line 37 "rygel-wma-transcoder-bin.vala"
	_tmp0_ = rygel_wma_transcoder_create_encoder (transcoder, item, RYGEL_WMA_TRANSCODER_BIN_AUDIO_SRC_PAD, RYGEL_WMA_TRANSCODER_BIN_AUDIO_SINK_PAD, &_inner_error_);
#line 174 "rygel-wma-transcoder-bin.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_gst_object_unref0 (decodebin);
		gst_object_unref (self);
		return NULL;
	}
#line 37 "rygel-wma-transcoder-bin.vala"
	self->priv->audio_enc = (_tmp1_ = _tmp0_, _gst_object_unref0 (self->priv->audio_enc), _tmp1_);
#line 41 "rygel-wma-transcoder-bin.vala"
	gst_bin_add_many ((GstBin*) self, _gst_object_ref0 (src), _gst_object_ref0 (decodebin), _gst_object_ref0 (self->priv->audio_enc), NULL);
#line 42 "rygel-wma-transcoder-bin.vala"
	gst_element_link (src, decodebin);
#line 44 "rygel-wma-transcoder-bin.vala"
	src_pad = gst_element_get_static_pad (self->priv->audio_enc, RYGEL_WMA_TRANSCODER_BIN_AUDIO_SRC_PAD);
#line 45 "rygel-wma-transcoder-bin.vala"
	ghost = (GstGhostPad*) gst_ghost_pad_new (NULL, src_pad);
#line 46 "rygel-wma-transcoder-bin.vala"
	gst_element_add_pad ((GstElement*) self, _gst_object_ref0 ((GstPad*) ghost));
#line 48 "rygel-wma-transcoder-bin.vala"
	g_signal_connect_object (decodebin, "pad-added", (GCallback) _rygel_wma_transcoder_bin_decodebin_pad_added_gst_element_pad_added, self, 0);
#line 195 "rygel-wma-transcoder-bin.c"
	_gst_object_unref0 (decodebin);
	_gst_object_unref0 (src_pad);
	_gst_object_unref0 (ghost);
	return self;
}
Пример #3
0
static void player_gstreamer_stop (PlayerGstreamer* self, FsoDevicePlayingSound* sound) {
	FsoDevicePlayingSound* _tmp0_;
	guint32 _tmp1_;
	GstPipeline* _tmp2_;
	GstPipeline* pipeline;
	GeeHashMap* _tmp3_;
	FsoDevicePlayingSound* _tmp4_;
	const gchar* _tmp5_;
	GeeHashMap* _tmp6_;
	FsoDevicePlayingSound* _tmp7_;
	const gchar* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sound != NULL);
	_tmp0_ = sound;
	_tmp1_ = _tmp0_->data;
	_tmp2_ = _gst_object_ref0 (GST_IS_PIPELINE (_tmp1_) ? ((GstPipeline*) _tmp1_) : NULL);
	pipeline = _tmp2_;
	gst_element_set_state ((GstElement*) pipeline, GST_STATE_NULL);
	_tmp3_ = ((FsoDeviceBaseAudioPlayer*) self)->sounds;
	_tmp4_ = sound;
	_tmp5_ = _tmp4_->name;
	gee_map_remove ((GeeMap*) _tmp3_, _tmp5_, NULL);
	_tmp6_ = self->priv->pipelines;
	_tmp7_ = sound;
	_tmp8_ = _tmp7_->name;
	gee_map_remove ((GeeMap*) _tmp6_, _tmp8_, NULL);
	_gst_object_unref0 (pipeline);
}
Пример #4
0
static gboolean rygel_wmv_transcoder_bin_autoplug_continue (RygelWMVTranscoderBin* self, GstElement* decodebin, GstPad* new_pad, GstCaps* caps) {
#line 282 "rygel-wmv-transcoder-bin.c"
	gboolean result = FALSE;
	GstPad* muxer_pad;
#line 67 "rygel-wmv-transcoder-bin.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 67 "rygel-wmv-transcoder-bin.vala"
	g_return_val_if_fail (decodebin != NULL, FALSE);
#line 67 "rygel-wmv-transcoder-bin.vala"
	g_return_val_if_fail (new_pad != NULL, FALSE);
#line 67 "rygel-wmv-transcoder-bin.vala"
	g_return_val_if_fail (caps != NULL, FALSE);
#line 70 "rygel-wmv-transcoder-bin.vala"
	muxer_pad = _gst_object_ref0 (gst_element_get_compatible_pad (self->priv->muxer, new_pad, NULL));
#line 72 "rygel-wmv-transcoder-bin.vala"
	if (muxer_pad == NULL) {
#line 297 "rygel-wmv-transcoder-bin.c"
		result = TRUE;
		_gst_object_unref0 (muxer_pad);
#line 73 "rygel-wmv-transcoder-bin.vala"
		return result;
#line 302 "rygel-wmv-transcoder-bin.c"
	} else {
		result = gst_pad_link (new_pad, muxer_pad) != GST_PAD_LINK_OK;
		_gst_object_unref0 (muxer_pad);
#line 75 "rygel-wmv-transcoder-bin.vala"
		return result;
#line 308 "rygel-wmv-transcoder-bin.c"
	}
	_gst_object_unref0 (muxer_pad);
}
Пример #5
0
static gint rygel_gst_utils_compare_factories (void* a, void* b) {
#line 338 "rygel-gst-utils.c"
	gint result = 0;
	GstElementFactory* factory_a;
	GstElementFactory* factory_b;
#line 104 "rygel-gst-utils.vala"
	factory_a = _gst_object_ref0 (GST_ELEMENT_FACTORY (a));
#line 105 "rygel-gst-utils.vala"
	factory_b = _gst_object_ref0 (GST_ELEMENT_FACTORY (b));
#line 346 "rygel-gst-utils.c"
	result = (gint) (gst_plugin_feature_get_rank ((GstPluginFeature*) factory_b) - gst_plugin_feature_get_rank ((GstPluginFeature*) factory_a));
	_gst_object_unref0 (factory_a);
	_gst_object_unref0 (factory_b);
#line 107 "rygel-gst-utils.vala"
	return result;
#line 352 "rygel-gst-utils.c"
}
Пример #6
0
static gboolean rygel_gst_utils_rtp_depay_filter (GstPluginFeature* feature) {
#line 312 "rygel-gst-utils.c"
	gboolean result = FALSE;
	GstElementFactory* factory;
#line 93 "rygel-gst-utils.vala"
	g_return_val_if_fail (feature != NULL, FALSE);
#line 94 "rygel-gst-utils.vala"
	if (!g_type_is_a (G_TYPE_FROM_INSTANCE ((GObject*) feature), GST_TYPE_ELEMENT_FACTORY)) {
#line 319 "rygel-gst-utils.c"
		result = FALSE;
#line 95 "rygel-gst-utils.vala"
		return result;
#line 323 "rygel-gst-utils.c"
	}
#line 98 "rygel-gst-utils.vala"
	factory = _gst_object_ref0 (GST_ELEMENT_FACTORY (feature));
#line 327 "rygel-gst-utils.c"
	result = string_contains (gst_element_factory_get_klass (factory), "Depayloader");
	_gst_object_unref0 (factory);
#line 100 "rygel-gst-utils.vala"
	return result;
#line 332 "rygel-gst-utils.c"
}
Пример #7
0
static void rygel_wma_transcoder_bin_decodebin_pad_added (RygelWMATranscoderBin* self, GstElement* decodebin, GstPad* new_pad) {
#line 213 "rygel-wma-transcoder-bin.c"
	GstPad* enc_pad;
#line 51 "rygel-wma-transcoder-bin.vala"
	g_return_if_fail (self != NULL);
#line 51 "rygel-wma-transcoder-bin.vala"
	g_return_if_fail (decodebin != NULL);
#line 51 "rygel-wma-transcoder-bin.vala"
	g_return_if_fail (new_pad != NULL);
#line 52 "rygel-wma-transcoder-bin.vala"
	enc_pad = _gst_object_ref0 (gst_element_get_pad (self->priv->audio_enc, RYGEL_WMA_TRANSCODER_BIN_AUDIO_SINK_PAD));
#line 53 "rygel-wma-transcoder-bin.vala"
	if (!gst_pad_can_link (new_pad, enc_pad)) {
#line 225 "rygel-wma-transcoder-bin.c"
		_gst_object_unref0 (enc_pad);
#line 54 "rygel-wma-transcoder-bin.vala"
		return;
#line 229 "rygel-wma-transcoder-bin.c"
	}
#line 57 "rygel-wma-transcoder-bin.vala"
	if (gst_pad_link (new_pad, enc_pad) != GST_PAD_LINK_OK) {
#line 233 "rygel-wma-transcoder-bin.c"
		GError* _error_;
#line 58 "rygel-wma-transcoder-bin.vala"
		_error_ = g_error_new (RYGEL_GST_ERROR, RYGEL_GST_ERROR_LINK, _ ("Failed to link pad %s to %s"), gst_object_get_name ((GstObject*) new_pad), gst_object_get_name ((GstObject*) enc_pad));
#line 61 "rygel-wma-transcoder-bin.vala"
		rygel_gst_utils_post_error ((GstElement*) self, _error_);
#line 239 "rygel-wma-transcoder-bin.c"
		_g_error_free0 (_error_);
		_gst_object_unref0 (enc_pad);
#line 63 "rygel-wma-transcoder-bin.vala"
		return;
#line 244 "rygel-wma-transcoder-bin.c"
	}
	_gst_object_unref0 (enc_pad);
}
Пример #8
0
static gboolean player_gstreamer_onGstreamerMessage (PlayerGstreamer* self, GstBus* bus, GstMessage* message, FsoDevicePlayingSound* sound) {
	gboolean result = FALSE;
	Block1Data* _data1_;
	FsoDevicePlayingSound* _tmp0_;
	FsoDevicePlayingSound* _tmp1_;
	FsoFrameworkLogger* _tmp2_;
	GstMessage* _tmp3_;
	GstMessageType _tmp4_;
	const gchar* _tmp5_ = NULL;
	FsoDevicePlayingSound* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_;
	gboolean _tmp11_ = FALSE;
	FsoDevicePlayingSound* _tmp12_;
	guint32 _tmp13_;
	GstPipeline* _tmp14_;
	GstPipeline* pipeline;
	GstMessage* _tmp15_;
	GstMessageType _tmp16_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (bus != NULL, FALSE);
	g_return_val_if_fail (message != NULL, FALSE);
	g_return_val_if_fail (sound != NULL, FALSE);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = sound;
	_tmp1_ = _fso_device_playing_sound_ref0 (_tmp0_);
	_data1_->sound = _tmp1_;
	_tmp2_ = fso_framework_theLogger;
	_tmp3_ = message;
	_tmp4_ = _tmp3_->type;
	_tmp5_ = gst_message_type_get_name (_tmp4_);
	_tmp6_ = _data1_->sound;
	_tmp7_ = _tmp6_->name;
	_tmp8_ = string_to_string (_tmp7_);
	_tmp9_ = g_strconcat ("Gstreamer: ", _tmp5_, " for sound ", _tmp8_, NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = fso_framework_logger_debug (_tmp2_, _tmp10_);
	g_assert (_tmp11_);
	_g_free0 (_tmp10_);
	_tmp12_ = _data1_->sound;
	_tmp13_ = _tmp12_->data;
	_tmp14_ = _gst_object_ref0 (GST_IS_PIPELINE (_tmp13_) ? ((GstPipeline*) _tmp13_) : NULL);
	pipeline = _tmp14_;
	_tmp15_ = message;
	_tmp16_ = _tmp15_->type;
	switch (_tmp16_) {
		case GST_MESSAGE_EOS:
		{
			{
				FsoDevicePlayingSound* _tmp17_;
				gint _tmp18_;
				_tmp17_ = _data1_->sound;
				_tmp18_ = _tmp17_->loop;
				_tmp17_->loop = _tmp18_ - 1;
				if (_tmp18_ > 0) {
					GstPipeline* _tmp19_;
					_tmp19_ = pipeline;
					gst_element_seek_simple ((GstElement*) _tmp19_, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, (gint64) 0);
				} else {
					FsoDevicePlayingSound* _tmp20_;
					_tmp20_ = _data1_->sound;
					player_gstreamer_stop (self, _tmp20_);
				}
				break;
			}
		}
		case GST_MESSAGE_ERROR:
		{
			{
				GError* e = NULL;
				gchar* debug = NULL;
				GstMessage* _tmp21_;
				GError* _tmp22_ = NULL;
				gchar* _tmp23_ = NULL;
				FsoFrameworkLogger* _tmp24_;
				GError* _tmp25_;
				const gchar* _tmp26_;
				const gchar* _tmp27_ = NULL;
				const gchar* _tmp28_;
				const gchar* _tmp29_ = NULL;
				gchar* _tmp30_ = NULL;
				gchar* _tmp31_;
				_tmp21_ = message;
				gst_message_parse_error (_tmp21_, &_tmp22_, &_tmp23_);
				_g_error_free0 (e);
				e = _tmp22_;
				_g_free0 (debug);
				debug = _tmp23_;
				_tmp24_ = fso_framework_theLogger;
				_tmp25_ = e;
				_tmp26_ = _tmp25_->message;
				_tmp27_ = string_to_string (_tmp26_);
				_tmp28_ = debug;
				_tmp29_ = string_to_string (_tmp28_);
				_tmp30_ = g_strconcat ("Gstreamer: Error ", _tmp27_, ": ", _tmp29_, NULL);
				_tmp31_ = _tmp30_;
				fso_framework_logger_warning (_tmp24_, _tmp31_);
				_g_free0 (_tmp31_);
				_g_free0 (debug);
				_g_error_free0 (e);
				break;
			}
		}
		case GST_MESSAGE_STATE_CHANGED:
		{
			{
				GstState previous = 0;
				GstState current = 0;
				GstState pending = 0;
				GstMessage* _tmp32_;
				GstState _tmp33_ = 0;
				GstState _tmp34_ = 0;
				GstState _tmp35_ = 0;
				gboolean _tmp36_ = FALSE;
				gboolean _tmp37_ = FALSE;
				GstState _tmp38_;
				gboolean _tmp40_;
				gboolean _tmp42_;
				_tmp32_ = message;
				gst_message_parse_state_changed (_tmp32_, &_tmp33_, &_tmp34_, &_tmp35_);
				previous = _tmp33_;
				current = _tmp34_;
				pending = _tmp35_;
				_tmp38_ = previous;
				if (_tmp38_ == GST_STATE_READY) {
					GstState _tmp39_;
					_tmp39_ = current;
					_tmp37_ = _tmp39_ == GST_STATE_PAUSED;
				} else {
					_tmp37_ = FALSE;
				}
				_tmp40_ = _tmp37_;
				if (_tmp40_) {
					GstState _tmp41_;
					_tmp41_ = pending;
					_tmp36_ = _tmp41_ == GST_STATE_PLAYING;
				} else {
					_tmp36_ = FALSE;
				}
				_tmp42_ = _tmp36_;
				if (_tmp42_) {
					FsoDevicePlayingSound* _tmp43_;
					gint _tmp44_;
					_tmp43_ = _data1_->sound;
					_tmp44_ = _tmp43_->length;
					if (_tmp44_ > 0) {
						FsoDevicePlayingSound* _tmp45_;
						gint _tmp46_;
						_tmp45_ = _data1_->sound;
						_tmp46_ = _tmp45_->length;
						g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) _tmp46_, _______lambda2__gsource_func, block1_data_ref (_data1_), block1_data_unref);
					}
				} else {
					gboolean _tmp47_ = FALSE;
					gboolean _tmp48_ = FALSE;
					GstState _tmp49_;
					gboolean _tmp51_;
					gboolean _tmp53_;
					_tmp49_ = previous;
					if (_tmp49_ == GST_STATE_PLAYING) {
						GstState _tmp50_;
						_tmp50_ = current;
						_tmp48_ = _tmp50_ == GST_STATE_PAUSED;
					} else {
						_tmp48_ = FALSE;
					}
					_tmp51_ = _tmp48_;
					if (_tmp51_) {
						GstState _tmp52_;
						_tmp52_ = pending;
						_tmp47_ = _tmp52_ == GST_STATE_READY;
					} else {
						_tmp47_ = FALSE;
					}
					_tmp53_ = _tmp47_;
					if (_tmp53_) {
						FsoDevicePlayingSound* _tmp54_;
						_tmp54_ = _data1_->sound;
						player_gstreamer_stop (self, _tmp54_);
					} else {
					}
				}
				break;
			}
		}
		default:
		{
			{
				FsoFrameworkLogger* _tmp55_;
				GstMessage* _tmp56_;
				GstMessageType _tmp57_;
				const gchar* _tmp58_ = NULL;
				gchar* _tmp59_ = NULL;
				gchar* _tmp60_;
				_tmp55_ = fso_framework_theLogger;
				_tmp56_ = message;
				_tmp57_ = _tmp56_->type;
				_tmp58_ = gst_message_type_get_name (_tmp57_);
				_tmp59_ = g_strconcat ("Gstreamer: Unhandled message w/ type ", _tmp58_, NULL);
				_tmp60_ = _tmp59_;
				fso_framework_logger_warning (_tmp55_, _tmp60_);
				_g_free0 (_tmp60_);
				break;
			}
		}
	}
	result = TRUE;
	_gst_object_unref0 (pipeline);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return result;
}
Пример #9
0
static void rygel_wmv_transcoder_bin_decodebin_pad_added (RygelWMVTranscoderBin* self, GstElement* decodebin, GstPad* new_pad) {
#line 316 "rygel-wmv-transcoder-bin.c"
	GstElement* encoder;
	GstPad* enc_pad;
	GstPad* audio_enc_pad;
	GstPad* video_enc_pad;
#line 79 "rygel-wmv-transcoder-bin.vala"
	g_return_if_fail (self != NULL);
#line 79 "rygel-wmv-transcoder-bin.vala"
	g_return_if_fail (decodebin != NULL);
#line 79 "rygel-wmv-transcoder-bin.vala"
	g_return_if_fail (new_pad != NULL);
#line 327 "rygel-wmv-transcoder-bin.c"
	encoder = NULL;
	enc_pad = NULL;
#line 83 "rygel-wmv-transcoder-bin.vala"
	audio_enc_pad = _gst_object_ref0 (gst_element_get_pad (self->priv->audio_enc, RYGEL_WMV_TRANSCODER_BIN_AUDIO_ENC_SINK));
#line 84 "rygel-wmv-transcoder-bin.vala"
	video_enc_pad = _gst_object_ref0 (gst_element_get_pad (self->priv->video_enc, RYGEL_WMV_TRANSCODER_BIN_VIDEO_ENC_SINK));
#line 87 "rygel-wmv-transcoder-bin.vala"
	if (gst_pad_can_link (new_pad, audio_enc_pad)) {
#line 336 "rygel-wmv-transcoder-bin.c"
		GstElement* _tmp0_;
		GstPad* _tmp1_;
#line 88 "rygel-wmv-transcoder-bin.vala"
		encoder = (_tmp0_ = _gst_object_ref0 (self->priv->audio_enc), _gst_object_unref0 (encoder), _tmp0_);
#line 89 "rygel-wmv-transcoder-bin.vala"
		enc_pad = (_tmp1_ = _gst_object_ref0 (audio_enc_pad), _gst_object_unref0 (enc_pad), _tmp1_);
#line 343 "rygel-wmv-transcoder-bin.c"
	} else {
#line 90 "rygel-wmv-transcoder-bin.vala"
		if (gst_pad_can_link (new_pad, video_enc_pad)) {
#line 347 "rygel-wmv-transcoder-bin.c"
			GstElement* _tmp2_;
			GstPad* _tmp3_;
#line 91 "rygel-wmv-transcoder-bin.vala"
			encoder = (_tmp2_ = _gst_object_ref0 (self->priv->video_enc), _gst_object_unref0 (encoder), _tmp2_);
#line 92 "rygel-wmv-transcoder-bin.vala"
			enc_pad = (_tmp3_ = _gst_object_ref0 (video_enc_pad), _gst_object_unref0 (enc_pad), _tmp3_);
#line 354 "rygel-wmv-transcoder-bin.c"
		} else {
			_gst_object_unref0 (encoder);
			_gst_object_unref0 (enc_pad);
			_gst_object_unref0 (audio_enc_pad);
			_gst_object_unref0 (video_enc_pad);
#line 94 "rygel-wmv-transcoder-bin.vala"
			return;
#line 362 "rygel-wmv-transcoder-bin.c"
		}
	}
#line 97 "rygel-wmv-transcoder-bin.vala"
	gst_element_link (encoder, self->priv->muxer);
#line 99 "rygel-wmv-transcoder-bin.vala"
	if (gst_pad_link (new_pad, enc_pad) != GST_PAD_LINK_OK) {
#line 369 "rygel-wmv-transcoder-bin.c"
		GError* _error_;
#line 100 "rygel-wmv-transcoder-bin.vala"
		_error_ = g_error_new (RYGEL_GST_ERROR, RYGEL_GST_ERROR_LINK, _ ("Failed to link pad %s to %s"), gst_object_get_name ((GstObject*) new_pad), gst_object_get_name ((GstObject*) enc_pad));
#line 103 "rygel-wmv-transcoder-bin.vala"
		rygel_gst_utils_post_error ((GstElement*) self, _error_);
#line 375 "rygel-wmv-transcoder-bin.c"
		_g_error_free0 (_error_);
	}
	_gst_object_unref0 (encoder);
	_gst_object_unref0 (enc_pad);
	_gst_object_unref0 (audio_enc_pad);
	_gst_object_unref0 (video_enc_pad);
}
Пример #10
0
RygelWMVTranscoderBin* rygel_wmv_transcoder_bin_construct (GType object_type, RygelMediaItem* item, GstElement* src, RygelWMVTranscoder* transcoder, GError** error) {
#line 181 "rygel-wmv-transcoder-bin.c"
	GError * _inner_error_;
	RygelWMVTranscoderBin * self;
	GstElement* decodebin;
	RygelWMATranscoder* wma_transcoder;
	GstElement* _tmp0_;
	GstElement* _tmp1_;
	GstElement* _tmp2_;
	GstElement* _tmp3_;
	GstElement* _tmp4_;
	GstElement* _tmp5_;
	GstPad* src_pad;
	GstGhostPad* ghost;
#line 39 "rygel-wmv-transcoder-bin.vala"
	g_return_val_if_fail (item != NULL, NULL);
#line 39 "rygel-wmv-transcoder-bin.vala"
	g_return_val_if_fail (src != NULL, NULL);
#line 39 "rygel-wmv-transcoder-bin.vala"
	g_return_val_if_fail (transcoder != NULL, NULL);
#line 200 "rygel-wmv-transcoder-bin.c"
	_inner_error_ = NULL;
	self = g_object_newv (object_type, 0, NULL);
#line 43 "rygel-wmv-transcoder-bin.vala"
	decodebin = rygel_gst_utils_create_element (RYGEL_WMV_TRANSCODER_BIN_DECODEBIN, RYGEL_WMV_TRANSCODER_BIN_DECODEBIN, &_inner_error_);
#line 205 "rygel-wmv-transcoder-bin.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		gst_object_unref (self);
		return NULL;
	}
#line 45 "rygel-wmv-transcoder-bin.vala"
	wma_transcoder = rygel_wma_transcoder_new ();
#line 46 "rygel-wmv-transcoder-bin.vala"
	_tmp0_ = rygel_wma_transcoder_create_encoder (wma_transcoder, item, NULL, RYGEL_WMV_TRANSCODER_BIN_AUDIO_ENC_SINK, &_inner_error_);
#line 215 "rygel-wmv-transcoder-bin.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_gst_object_unref0 (decodebin);
		_g_object_unref0 (wma_transcoder);
		gst_object_unref (self);
		return NULL;
	}
#line 46 "rygel-wmv-transcoder-bin.vala"
	self->priv->audio_enc = (_tmp1_ = _tmp0_, _gst_object_unref0 (self->priv->audio_enc), _tmp1_);
#line 49 "rygel-wmv-transcoder-bin.vala"
	_tmp2_ = rygel_wmv_transcoder_create_encoder (transcoder, item, NULL, RYGEL_WMV_TRANSCODER_BIN_VIDEO_ENC_SINK, &_inner_error_);
#line 227 "rygel-wmv-transcoder-bin.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_gst_object_unref0 (decodebin);
		_g_object_unref0 (wma_transcoder);
		gst_object_unref (self);
		return NULL;
	}
#line 49 "rygel-wmv-transcoder-bin.vala"
	self->priv->video_enc = (_tmp3_ = _tmp2_, _gst_object_unref0 (self->priv->video_enc), _tmp3_);
#line 50 "rygel-wmv-transcoder-bin.vala"
	_tmp4_ = rygel_gst_utils_create_element (RYGEL_WMV_TRANSCODER_BIN_MUXER, RYGEL_WMV_TRANSCODER_BIN_MUXER, &_inner_error_);
#line 239 "rygel-wmv-transcoder-bin.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_gst_object_unref0 (decodebin);
		_g_object_unref0 (wma_transcoder);
		gst_object_unref (self);
		return NULL;
	}
#line 50 "rygel-wmv-transcoder-bin.vala"
	self->priv->muxer = (_tmp5_ = _tmp4_, _gst_object_unref0 (self->priv->muxer), _tmp5_);
#line 52 "rygel-wmv-transcoder-bin.vala"
	gst_bin_add_many ((GstBin*) self, _gst_object_ref0 (src), _gst_object_ref0 (decodebin), _gst_object_ref0 (self->priv->audio_enc), _gst_object_ref0 (self->priv->video_enc), _gst_object_ref0 (self->priv->muxer), NULL);
#line 57 "rygel-wmv-transcoder-bin.vala"
	gst_element_link (src, decodebin);
#line 59 "rygel-wmv-transcoder-bin.vala"
	src_pad = gst_element_get_static_pad (self->priv->muxer, "src");
#line 60 "rygel-wmv-transcoder-bin.vala"
	ghost = (GstGhostPad*) gst_ghost_pad_new (NULL, src_pad);
#line 61 "rygel-wmv-transcoder-bin.vala"
	gst_element_add_pad ((GstElement*) self, _gst_object_ref0 ((GstPad*) ghost));
#line 63 "rygel-wmv-transcoder-bin.vala"
	g_signal_connect_object (decodebin, "pad-added", (GCallback) _rygel_wmv_transcoder_bin_decodebin_pad_added_gst_element_pad_added, self, 0);
#line 64 "rygel-wmv-transcoder-bin.vala"
	_dynamic_autoplug_continue5_connect (decodebin, "autoplug_continue", (GCallback) _rygel_wmv_transcoder_bin_autoplug_continue_dynamic_autoplug_continue4_, self);
#line 263 "rygel-wmv-transcoder-bin.c"
	_gst_object_unref0 (decodebin);
	_g_object_unref0 (wma_transcoder);
	_gst_object_unref0 (src_pad);
	_gst_object_unref0 (ghost);
	return self;
}
Пример #11
0
GstElement* rygel_l16_transcoder_create_encoder (RygelL16Transcoder* self, RygelMediaItem* item, const char* src_pad_name, const char* sink_pad_name, GError** error) {
#line 463 "rygel-l16-transcoder.c"
	GstElement* result = NULL;
	GError * _inner_error_;
	GstElement* convert1;
	GstElement* resample;
	GstElement* audiorate;
	GstElement* convert2;
	GstElement* capsfilter;
	GstBin* bin;
	GstCaps* _tmp0_;
	GstPad* pad;
	GstGhostPad* ghost;
	GstPad* _tmp1_;
	GstGhostPad* _tmp2_;
#line 113 "rygel-l16-transcoder.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 113 "rygel-l16-transcoder.vala"
	g_return_val_if_fail (item != NULL, NULL);
#line 481 "rygel-l16-transcoder.c"
	_inner_error_ = NULL;
#line 117 "rygel-l16-transcoder.vala"
	convert1 = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_AUDIO_CONVERT, NULL, &_inner_error_);
#line 485 "rygel-l16-transcoder.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
#line 119 "rygel-l16-transcoder.vala"
	resample = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_AUDIO_RESAMPLE, RYGEL_L16_TRANSCODER_AUDIO_RESAMPLE, &_inner_error_);
#line 492 "rygel-l16-transcoder.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_gst_object_unref0 (convert1);
		return NULL;
	}
#line 121 "rygel-l16-transcoder.vala"
	audiorate = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_AUDIO_RATE, NULL, &_inner_error_);
#line 500 "rygel-l16-transcoder.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_gst_object_unref0 (convert1);
		_gst_object_unref0 (resample);
		return NULL;
	}
#line 122 "rygel-l16-transcoder.vala"
	convert2 = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_AUDIO_CONVERT, NULL, &_inner_error_);
#line 509 "rygel-l16-transcoder.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_gst_object_unref0 (convert1);
		_gst_object_unref0 (resample);
		_gst_object_unref0 (audiorate);
		return NULL;
	}
#line 124 "rygel-l16-transcoder.vala"
	capsfilter = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_CAPS_FILTER, RYGEL_L16_TRANSCODER_CAPS_FILTER, &_inner_error_);
#line 519 "rygel-l16-transcoder.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_gst_object_unref0 (convert1);
		_gst_object_unref0 (resample);
		_gst_object_unref0 (audiorate);
		_gst_object_unref0 (convert2);
		return NULL;
	}
#line 127 "rygel-l16-transcoder.vala"
	bin = (GstBin*) gst_bin_new ("l16-encoder-bin");
#line 128 "rygel-l16-transcoder.vala"
	gst_bin_add_many (bin, _gst_object_ref0 (convert1), _gst_object_ref0 (resample), _gst_object_ref0 (audiorate), _gst_object_ref0 (convert2), _gst_object_ref0 (capsfilter), NULL);
#line 130 "rygel-l16-transcoder.vala"
	_dynamic_set_caps6 (capsfilter, _tmp0_ = gst_caps_new_simple ("audio/x-raw-int", "channels", G_TYPE_INT, RYGEL_L16_TRANSCODER_CHANNELS, "rate", G_TYPE_INT, RYGEL_L16_TRANSCODER_FREQUENCY, "width", G_TYPE_INT, RYGEL_L16_TRANSCODER_WIDTH, "depth", G_TYPE_INT, RYGEL_L16_TRANSCODER_DEPTH, "signed", G_TYPE_BOOLEAN, RYGEL_L16_TRANSCODER_SIGNED, "endianness", G_TYPE_INT, self->priv->endianness, NULL));
#line 534 "rygel-l16-transcoder.c"
	_gst_caps_unref0 (_tmp0_);
#line 140 "rygel-l16-transcoder.vala"
	gst_element_link_many (convert1, resample, audiorate, convert2, capsfilter, NULL);
#line 142 "rygel-l16-transcoder.vala"
	pad = gst_element_get_static_pad (convert1, "sink");
#line 143 "rygel-l16-transcoder.vala"
	ghost = (GstGhostPad*) gst_ghost_pad_new (sink_pad_name, pad);
#line 144 "rygel-l16-transcoder.vala"
	gst_element_add_pad ((GstElement*) bin, _gst_object_ref0 ((GstPad*) ghost));
#line 146 "rygel-l16-transcoder.vala"
	pad = (_tmp1_ = gst_element_get_static_pad (capsfilter, "src"), _gst_object_unref0 (pad), _tmp1_);
#line 147 "rygel-l16-transcoder.vala"
	ghost = (_tmp2_ = (GstGhostPad*) gst_ghost_pad_new (src_pad_name, pad), _gst_object_unref0 (ghost), _tmp2_);
#line 148 "rygel-l16-transcoder.vala"
	gst_element_add_pad ((GstElement*) bin, _gst_object_ref0 ((GstPad*) ghost));
#line 550 "rygel-l16-transcoder.c"
	result = (GstElement*) bin;
	_gst_object_unref0 (convert1);
	_gst_object_unref0 (resample);
	_gst_object_unref0 (audiorate);
	_gst_object_unref0 (convert2);
	_gst_object_unref0 (capsfilter);
	_gst_object_unref0 (pad);
	_gst_object_unref0 (ghost);
#line 150 "rygel-l16-transcoder.vala"
	return result;
#line 561 "rygel-l16-transcoder.c"
}