static void rygel_l16_transcoder_class_init (RygelL16TranscoderClass * klass) {
	rygel_l16_transcoder_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (RygelL16TranscoderPrivate));
	RYGEL_TRANSCODER_CLASS (klass)->create_source = rygel_l16_transcoder_real_create_source;
	RYGEL_TRANSCODER_CLASS (klass)->create_resource = rygel_l16_transcoder_real_create_resource;
	G_OBJECT_CLASS (klass)->finalize = rygel_l16_transcoder_finalize;
}
static GUPnPDIDLLiteResource rygel_mp3_transcoder_real_create_resource (RygelTranscoder* base, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
	RygelMP3Transcoder * self;
	GError * _inner_error_;
	GUPnPDIDLLiteResource res;
	self = (RygelMP3Transcoder*) base;
	_inner_error_ = NULL;
	res = RYGEL_TRANSCODER_CLASS (rygel_mp3_transcoder_parent_class)->create_resource (RYGEL_TRANSCODER (self), item, manager, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	res.bitrate = RYGEL_MP3_TRANSCODER_BITRATE;
	return res;
}
static GUPnPDIDLLiteResource rygel_mp2_ts_transcoder_real_create_resource (RygelTranscoder* base, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
	RygelMP2TSTranscoder * self;
	GError * _inner_error_;
	GUPnPDIDLLiteResource res;
	self = (RygelMP2TSTranscoder*) base;
	_inner_error_ = NULL;
	res = RYGEL_TRANSCODER_CLASS (rygel_mp2_ts_transcoder_parent_class)->create_resource (RYGEL_TRANSCODER (self), item, manager, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	res.width = RYGEL_MP2_TS_TRANSCODER_WIDTH[self->priv->profile];
	res.height = RYGEL_MP2_TS_TRANSCODER_HEIGHT[self->priv->profile];
	return res;
}
static GUPnPDIDLLiteResource rygel_l16_transcoder_real_create_resource (RygelTranscoder* base, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
	RygelL16Transcoder * self;
	GError * _inner_error_;
	GUPnPDIDLLiteResource res;
	self = (RygelL16Transcoder*) base;
	_inner_error_ = NULL;
	res = RYGEL_TRANSCODER_CLASS (rygel_l16_transcoder_parent_class)->create_resource (RYGEL_TRANSCODER (self), item, manager, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	res.sample_freq = RYGEL_L16_TRANSCODER_FREQUENCY;
	res.n_audio_channels = RYGEL_L16_TRANSCODER_CHANNELS;
	res.bits_per_sample = RYGEL_L16_TRANSCODER_WIDTH;
	return res;
}
Example #5
0
static GUPnPDIDLLiteResource* rygel_l16_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
#line 354 "rygel-l16-transcoder.c"
	RygelL16Transcoder * self;
	GUPnPDIDLLiteResource* result = NULL;
	GError * _inner_error_;
	GUPnPDIDLLiteResource* resource;
	self = (RygelL16Transcoder*) base;
#line 66 "rygel-l16-transcoder.vala"
	g_return_val_if_fail (didl_item != NULL, NULL);
#line 66 "rygel-l16-transcoder.vala"
	g_return_val_if_fail (item != NULL, NULL);
#line 66 "rygel-l16-transcoder.vala"
	g_return_val_if_fail (manager != NULL, NULL);
#line 366 "rygel-l16-transcoder.c"
	_inner_error_ = NULL;
#line 70 "rygel-l16-transcoder.vala"
	resource = RYGEL_TRANSCODER_CLASS (rygel_l16_transcoder_parent_class)->add_resource (RYGEL_TRANSCODER (self), didl_item, item, manager, &_inner_error_);
#line 370 "rygel-l16-transcoder.c"
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
#line 71 "rygel-l16-transcoder.vala"
	if (resource == NULL) {
#line 377 "rygel-l16-transcoder.c"
		result = NULL;
		_g_object_unref0 (resource);
#line 72 "rygel-l16-transcoder.vala"
		return result;
#line 382 "rygel-l16-transcoder.c"
	}
#line 74 "rygel-l16-transcoder.vala"
	gupnp_didl_lite_resource_set_sample_freq (resource, RYGEL_L16_TRANSCODER_FREQUENCY);
#line 75 "rygel-l16-transcoder.vala"
	gupnp_didl_lite_resource_set_audio_channels (resource, RYGEL_L16_TRANSCODER_CHANNELS);
#line 76 "rygel-l16-transcoder.vala"
	gupnp_didl_lite_resource_set_bits_per_sample (resource, RYGEL_L16_TRANSCODER_WIDTH);
#line 78 "rygel-l16-transcoder.vala"
	gupnp_didl_lite_resource_set_bitrate (resource, ((RYGEL_L16_TRANSCODER_FREQUENCY * RYGEL_L16_TRANSCODER_CHANNELS) * RYGEL_L16_TRANSCODER_WIDTH) / 8);
#line 392 "rygel-l16-transcoder.c"
	result = resource;
#line 82 "rygel-l16-transcoder.vala"
	return result;
#line 396 "rygel-l16-transcoder.c"
}