Esempio n. 1
0
static GObject * rygel_live_response_test_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	RygelLiveResponseTest * self;
	GError * _inner_error_;
	parent_class = G_OBJECT_CLASS (rygel_live_response_test_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = RYGEL_LIVE_RESPONSE_TEST (obj);
	_inner_error_ = NULL;
	{
		GstElement* _tmp0_;
		GstElement* _tmp1_;
#line 54 "rygel-live-response-test.vala"
		_tmp0_ = rygel_gst_utils_create_element ("audiotestsrc", NULL, &_inner_error_);
#line 431 "rygel-live-response-test.c"
		if (_inner_error_ != NULL) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
		}
#line 54 "rygel-live-response-test.vala"
		self->priv->src = (_tmp1_ = _tmp0_, _gst_object_unref0 (self->priv->src), _tmp1_);
#line 438 "rygel-live-response-test.c"
	}
	return obj;
}
Esempio n. 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;
}
RygelMP3TranscoderBin* rygel_mp3_transcoder_bin_construct (GType object_type, GstElement* src, RygelMP3Transcoder* transcoder, GError** error) {
	GError * _inner_error_;
	RygelMP3TranscoderBin * self;
	GstElement* decodebin;
	GstElement* _tmp0_;
	GstElement* _tmp1_;
	GstElement* _tmp4_;
	GstElement* _tmp3_;
	GstElement* _tmp2_;
	GstPad* src_pad;
	GstGhostPad* ghost;
	GstPad* _tmp5_;
	g_return_val_if_fail (src != NULL, NULL);
	g_return_val_if_fail (transcoder != NULL, NULL);
	_inner_error_ = NULL;
	self = g_object_newv (object_type, 0, NULL);
	decodebin = rygel_gst_utils_create_element (RYGEL_MP3_TRANSCODER_BIN_DECODEBIN, RYGEL_MP3_TRANSCODER_BIN_DECODEBIN, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	_tmp0_ = rygel_mp3_transcoder_create_encoder (transcoder, RYGEL_MP3_TRANSCODER_BIN_AUDIO_SRC_PAD, RYGEL_MP3_TRANSCODER_BIN_AUDIO_SINK_PAD, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(decodebin == NULL) ? NULL : (decodebin = (gst_object_unref (decodebin), NULL));
		return;
	}
	_tmp1_ = NULL;
	self->priv->audio_enc = (_tmp1_ = _tmp0_, (self->priv->audio_enc == NULL) ? NULL : (self->priv->audio_enc = (gst_object_unref (self->priv->audio_enc), NULL)), _tmp1_);
	_tmp4_ = NULL;
	_tmp3_ = NULL;
	_tmp2_ = NULL;
	gst_bin_add_many ((GstBin*) self, (_tmp2_ = src, (_tmp2_ == NULL) ? NULL : gst_object_ref (_tmp2_)), (_tmp3_ = decodebin, (_tmp3_ == NULL) ? NULL : gst_object_ref (_tmp3_)), (_tmp4_ = self->priv->audio_enc, (_tmp4_ == NULL) ? NULL : gst_object_ref (_tmp4_)), NULL);
	gst_element_link (src, decodebin);
	src_pad = gst_element_get_static_pad (self->priv->audio_enc, RYGEL_MP3_TRANSCODER_BIN_AUDIO_SRC_PAD);
	ghost = (GstGhostPad*) gst_ghost_pad_new (NULL, src_pad);
	_tmp5_ = NULL;
	gst_element_add_pad ((GstElement*) self, (_tmp5_ = (GstPad*) ghost, (_tmp5_ == NULL) ? NULL : gst_object_ref (_tmp5_)));
	g_signal_connect_object (decodebin, "pad-added", (GCallback) _rygel_mp3_transcoder_bin_decodebin_pad_added_gst_element_pad_added, self, 0);
	(decodebin == NULL) ? NULL : (decodebin = (gst_object_unref (decodebin), NULL));
	(src_pad == NULL) ? NULL : (src_pad = (gst_object_unref (src_pad), NULL));
	(ghost == NULL) ? NULL : (ghost = (gst_object_unref (ghost), NULL));
	return self;
}
Esempio n. 4
0
GstElement* rygel_l16_transcoder_create_encoder (RygelL16Transcoder* self, const char* src_pad_name, const char* sink_pad_name, GError** error) {
	GError * _inner_error_;
	GstElement* convert1;
	GstElement* resample;
	GstElement* audiorate;
	GstElement* convert2;
	GstElement* capsfilter;
	GstBin* bin;
	GstElement* _tmp4_;
	GstElement* _tmp3_;
	GstElement* _tmp2_;
	GstElement* _tmp1_;
	GstElement* _tmp0_;
	GstCaps* _tmp5_;
	GstPad* pad;
	GstGhostPad* ghost;
	GstPad* _tmp6_;
	GstPad* _tmp7_;
	GstGhostPad* _tmp8_;
	GstPad* _tmp9_;
	GstElement* _tmp10_;
	g_return_val_if_fail (self != NULL, NULL);
	_inner_error_ = NULL;
	convert1 = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_AUDIO_CONVERT, NULL, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	resample = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_AUDIO_RESAMPLE, RYGEL_L16_TRANSCODER_AUDIO_RESAMPLE, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(convert1 == NULL) ? NULL : (convert1 = (gst_object_unref (convert1), NULL));
		return NULL;
	}
	audiorate = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_AUDIO_RATE, NULL, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(convert1 == NULL) ? NULL : (convert1 = (gst_object_unref (convert1), NULL));
		(resample == NULL) ? NULL : (resample = (gst_object_unref (resample), NULL));
		return NULL;
	}
	convert2 = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_AUDIO_CONVERT, NULL, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(convert1 == NULL) ? NULL : (convert1 = (gst_object_unref (convert1), NULL));
		(resample == NULL) ? NULL : (resample = (gst_object_unref (resample), NULL));
		(audiorate == NULL) ? NULL : (audiorate = (gst_object_unref (audiorate), NULL));
		return NULL;
	}
	capsfilter = rygel_gst_utils_create_element (RYGEL_L16_TRANSCODER_CAPS_FILTER, RYGEL_L16_TRANSCODER_CAPS_FILTER, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(convert1 == NULL) ? NULL : (convert1 = (gst_object_unref (convert1), NULL));
		(resample == NULL) ? NULL : (resample = (gst_object_unref (resample), NULL));
		(audiorate == NULL) ? NULL : (audiorate = (gst_object_unref (audiorate), NULL));
		(convert2 == NULL) ? NULL : (convert2 = (gst_object_unref (convert2), NULL));
		return NULL;
	}
	bin = (GstBin*) gst_bin_new ("l16-encoder-bin");
	_tmp4_ = NULL;
	_tmp3_ = NULL;
	_tmp2_ = NULL;
	_tmp1_ = NULL;
	_tmp0_ = NULL;
	gst_bin_add_many (bin, (_tmp0_ = convert1, (_tmp0_ == NULL) ? NULL : gst_object_ref (_tmp0_)), (_tmp1_ = resample, (_tmp1_ == NULL) ? NULL : gst_object_ref (_tmp1_)), (_tmp2_ = audiorate, (_tmp2_ == NULL) ? NULL : gst_object_ref (_tmp2_)), (_tmp3_ = convert2, (_tmp3_ == NULL) ? NULL : gst_object_ref (_tmp3_)), (_tmp4_ = capsfilter, (_tmp4_ == NULL) ? NULL : gst_object_ref (_tmp4_)), NULL);
	_tmp5_ = NULL;
	_dynamic_set_caps4 (capsfilter, _tmp5_ = 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));
	(_tmp5_ == NULL) ? NULL : (_tmp5_ = (gst_caps_unref (_tmp5_), NULL));
	gst_element_link_many (convert1, resample, audiorate, convert2, capsfilter, NULL);
	pad = gst_element_get_static_pad (convert1, "sink");
	ghost = (GstGhostPad*) gst_ghost_pad_new (sink_pad_name, pad);
	_tmp6_ = NULL;
	gst_element_add_pad ((GstElement*) bin, (_tmp6_ = (GstPad*) ghost, (_tmp6_ == NULL) ? NULL : gst_object_ref (_tmp6_)));
	_tmp7_ = NULL;
	pad = (_tmp7_ = gst_element_get_static_pad (capsfilter, "src"), (pad == NULL) ? NULL : (pad = (gst_object_unref (pad), NULL)), _tmp7_);
	_tmp8_ = NULL;
	ghost = (_tmp8_ = (GstGhostPad*) gst_ghost_pad_new (src_pad_name, pad), (ghost == NULL) ? NULL : (ghost = (gst_object_unref (ghost), NULL)), _tmp8_);
	_tmp9_ = NULL;
	gst_element_add_pad ((GstElement*) bin, (_tmp9_ = (GstPad*) ghost, (_tmp9_ == NULL) ? NULL : gst_object_ref (_tmp9_)));
	_tmp10_ = NULL;
	return (_tmp10_ = (GstElement*) bin, (convert1 == NULL) ? NULL : (convert1 = (gst_object_unref (convert1), NULL)), (resample == NULL) ? NULL : (resample = (gst_object_unref (resample), NULL)), (audiorate == NULL) ? NULL : (audiorate = (gst_object_unref (audiorate), NULL)), (convert2 == NULL) ? NULL : (convert2 = (gst_object_unref (convert2), NULL)), (capsfilter == NULL) ? NULL : (capsfilter = (gst_object_unref (capsfilter), NULL)), (pad == NULL) ? NULL : (pad = (gst_object_unref (pad), NULL)), (ghost == NULL) ? NULL : (ghost = (gst_object_unref (ghost), NULL)), _tmp10_);
}
Esempio n. 5
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;
}
Esempio n. 6
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"
}
Esempio n. 7
0
GstElement* rygel_mp3_transcoder_create_encoder (RygelMP3Transcoder* self, const char* src_pad_name, const char* sink_pad_name, GError** error) {
	GError * _inner_error_;
	RygelL16Transcoder* l16_transcoder;
	GstElement* convert;
	GstElement* encoder;
	GstElement* parser;
	GstBin* bin;
	GstElement* _tmp2_;
	GstElement* _tmp1_;
	GstElement* _tmp0_;
	GstPad* pad;
	GstGhostPad* ghost;
	GstPad* _tmp3_;
	GstPad* _tmp4_;
	GstGhostPad* _tmp5_;
	GstPad* _tmp6_;
	GstElement* _tmp7_;
	g_return_val_if_fail (self != NULL, NULL);
	_inner_error_ = NULL;
	l16_transcoder = rygel_l16_transcoder_new (ENDIANNESS_LITTLE);
	convert = rygel_l16_transcoder_create_encoder (l16_transcoder, NULL, RYGEL_MP3_TRANSCODER_CONVERT_SINK_PAD, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(l16_transcoder == NULL) ? NULL : (l16_transcoder = (g_object_unref (l16_transcoder), NULL));
		return NULL;
	}
	encoder = rygel_gst_utils_create_element (RYGEL_MP3_TRANSCODER_AUDIO_ENCODER[self->priv->layer], RYGEL_MP3_TRANSCODER_AUDIO_ENCODER[self->priv->layer], &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(l16_transcoder == NULL) ? NULL : (l16_transcoder = (g_object_unref (l16_transcoder), NULL));
		(convert == NULL) ? NULL : (convert = (gst_object_unref (convert), NULL));
		return NULL;
	}
	parser = rygel_gst_utils_create_element (RYGEL_MP3_TRANSCODER_AUDIO_PARSER, RYGEL_MP3_TRANSCODER_AUDIO_PARSER, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(l16_transcoder == NULL) ? NULL : (l16_transcoder = (g_object_unref (l16_transcoder), NULL));
		(convert == NULL) ? NULL : (convert = (gst_object_unref (convert), NULL));
		(encoder == NULL) ? NULL : (encoder = (gst_object_unref (encoder), NULL));
		return NULL;
	}
	if (self->priv->layer == RYGEL_MP3_LAYER_THREE) {
		/* Best quality*/
		_dynamic_set_quality2 (encoder, 0);
	}
	_dynamic_set_bitrate3 (encoder, RYGEL_MP3_TRANSCODER_BITRATE);
	bin = (GstBin*) gst_bin_new ("mp3-encoder-bin");
	_tmp2_ = NULL;
	_tmp1_ = NULL;
	_tmp0_ = NULL;
	gst_bin_add_many (bin, (_tmp0_ = convert, (_tmp0_ == NULL) ? NULL : gst_object_ref (_tmp0_)), (_tmp1_ = encoder, (_tmp1_ == NULL) ? NULL : gst_object_ref (_tmp1_)), (_tmp2_ = parser, (_tmp2_ == NULL) ? NULL : gst_object_ref (_tmp2_)), NULL);
	gst_element_link_many (convert, encoder, parser, NULL);
	pad = gst_element_get_static_pad (convert, RYGEL_MP3_TRANSCODER_CONVERT_SINK_PAD);
	ghost = (GstGhostPad*) gst_ghost_pad_new (sink_pad_name, pad);
	_tmp3_ = NULL;
	gst_element_add_pad ((GstElement*) bin, (_tmp3_ = (GstPad*) ghost, (_tmp3_ == NULL) ? NULL : gst_object_ref (_tmp3_)));
	_tmp4_ = NULL;
	pad = (_tmp4_ = gst_element_get_static_pad (parser, "src"), (pad == NULL) ? NULL : (pad = (gst_object_unref (pad), NULL)), _tmp4_);
	_tmp5_ = NULL;
	ghost = (_tmp5_ = (GstGhostPad*) gst_ghost_pad_new (src_pad_name, pad), (ghost == NULL) ? NULL : (ghost = (gst_object_unref (ghost), NULL)), _tmp5_);
	_tmp6_ = NULL;
	gst_element_add_pad ((GstElement*) bin, (_tmp6_ = (GstPad*) ghost, (_tmp6_ == NULL) ? NULL : gst_object_ref (_tmp6_)));
	_tmp7_ = NULL;
	return (_tmp7_ = (GstElement*) bin, (l16_transcoder == NULL) ? NULL : (l16_transcoder = (g_object_unref (l16_transcoder), NULL)), (convert == NULL) ? NULL : (convert = (gst_object_unref (convert), NULL)), (encoder == NULL) ? NULL : (encoder = (gst_object_unref (encoder), NULL)), (parser == NULL) ? NULL : (parser = (gst_object_unref (parser), NULL)), (pad == NULL) ? NULL : (pad = (gst_object_unref (pad), NULL)), (ghost == NULL) ? NULL : (ghost = (gst_object_unref (ghost), NULL)), _tmp7_);
}
GstElement* rygel_mp2_ts_transcoder_create_encoder (RygelMP2TSTranscoder* self, const char* src_pad_name, const char* sink_pad_name, GError** error) {
	GError * _inner_error_;
	GstElement* videorate;
	GstElement* videoscale;
	GstElement* convert;
	GstElement* encoder;
	GstBin* bin;
	GstElement* _tmp3_;
	GstElement* _tmp2_;
	GstElement* _tmp1_;
	GstElement* _tmp0_;
	GstCaps* caps;
	GstPad* pad;
	GstGhostPad* ghost;
	GstPad* _tmp4_;
	GstPad* _tmp5_;
	GstGhostPad* _tmp6_;
	GstPad* _tmp7_;
	GstElement* _tmp8_;
	g_return_val_if_fail (self != NULL, NULL);
	_inner_error_ = NULL;
	videorate = rygel_gst_utils_create_element (RYGEL_MP2_TS_TRANSCODER_VIDEO_RATE, RYGEL_MP2_TS_TRANSCODER_VIDEO_RATE, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	videoscale = rygel_gst_utils_create_element (RYGEL_MP2_TS_TRANSCODER_VIDEO_SCALE, RYGEL_MP2_TS_TRANSCODER_VIDEO_SCALE, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(videorate == NULL) ? NULL : (videorate = (gst_object_unref (videorate), NULL));
		return NULL;
	}
	convert = rygel_gst_utils_create_element (RYGEL_MP2_TS_TRANSCODER_COLORSPACE_CONVERT, RYGEL_MP2_TS_TRANSCODER_COLORSPACE_CONVERT, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(videorate == NULL) ? NULL : (videorate = (gst_object_unref (videorate), NULL));
		(videoscale == NULL) ? NULL : (videoscale = (gst_object_unref (videoscale), NULL));
		return NULL;
	}
	encoder = rygel_gst_utils_create_element (RYGEL_MP2_TS_TRANSCODER_VIDEO_ENCODER, RYGEL_MP2_TS_TRANSCODER_VIDEO_ENCODER, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		(videorate == NULL) ? NULL : (videorate = (gst_object_unref (videorate), NULL));
		(videoscale == NULL) ? NULL : (videoscale = (gst_object_unref (videoscale), NULL));
		(convert == NULL) ? NULL : (convert = (gst_object_unref (convert), NULL));
		return NULL;
	}
	bin = (GstBin*) gst_bin_new ("video-encoder-bin");
	_tmp3_ = NULL;
	_tmp2_ = NULL;
	_tmp1_ = NULL;
	_tmp0_ = NULL;
	gst_bin_add_many (bin, (_tmp0_ = videorate, (_tmp0_ == NULL) ? NULL : gst_object_ref (_tmp0_)), (_tmp1_ = videoscale, (_tmp1_ == NULL) ? NULL : gst_object_ref (_tmp1_)), (_tmp2_ = convert, (_tmp2_ == NULL) ? NULL : gst_object_ref (_tmp2_)), (_tmp3_ = encoder, (_tmp3_ == NULL) ? NULL : gst_object_ref (_tmp3_)), NULL);
	gst_element_link_many (convert, videoscale, videorate, NULL);
	caps = gst_caps_new_simple ("video/x-raw-yuv", "width", G_TYPE_INT, RYGEL_MP2_TS_TRANSCODER_WIDTH[self->priv->profile], "height", G_TYPE_INT, RYGEL_MP2_TS_TRANSCODER_HEIGHT[self->priv->profile], "framerate", GST_TYPE_FRACTION, 30, 1, "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, NULL);
	gst_element_link_filtered (videorate, encoder, caps);
	pad = gst_element_get_static_pad (convert, "sink");
	ghost = (GstGhostPad*) gst_ghost_pad_new (sink_pad_name, pad);
	_tmp4_ = NULL;
	gst_element_add_pad ((GstElement*) bin, (_tmp4_ = (GstPad*) ghost, (_tmp4_ == NULL) ? NULL : gst_object_ref (_tmp4_)));
	_tmp5_ = NULL;
	pad = (_tmp5_ = gst_element_get_static_pad (encoder, "src"), (pad == NULL) ? NULL : (pad = (gst_object_unref (pad), NULL)), _tmp5_);
	_tmp6_ = NULL;
	ghost = (_tmp6_ = (GstGhostPad*) gst_ghost_pad_new (src_pad_name, pad), (ghost == NULL) ? NULL : (ghost = (gst_object_unref (ghost), NULL)), _tmp6_);
	_tmp7_ = NULL;
	gst_element_add_pad ((GstElement*) bin, (_tmp7_ = (GstPad*) ghost, (_tmp7_ == NULL) ? NULL : gst_object_ref (_tmp7_)));
	_tmp8_ = NULL;
	return (_tmp8_ = (GstElement*) bin, (videorate == NULL) ? NULL : (videorate = (gst_object_unref (videorate), NULL)), (videoscale == NULL) ? NULL : (videoscale = (gst_object_unref (videoscale), NULL)), (convert == NULL) ? NULL : (convert = (gst_object_unref (convert), NULL)), (encoder == NULL) ? NULL : (encoder = (gst_object_unref (encoder), NULL)), (caps == NULL) ? NULL : (caps = (gst_caps_unref (caps), NULL)), (pad == NULL) ? NULL : (pad = (gst_object_unref (pad), NULL)), (ghost == NULL) ? NULL : (ghost = (gst_object_unref (ghost), NULL)), _tmp8_);
}