示例#1
0
static void rygel_http_seek_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	RygelHTTPSeek * self;
	self = RYGEL_HTTP_SEEK (object);
	switch (property_id) {
		case RYGEL_HTTP_SEEK_MSG:
		g_value_set_object (value, rygel_http_seek_get_msg (self));
		break;
		case RYGEL_HTTP_SEEK_START:
		g_value_set_int64 (value, rygel_http_seek_get_start (self));
		break;
		case RYGEL_HTTP_SEEK_STOP:
		g_value_set_int64 (value, rygel_http_seek_get_stop (self));
		break;
		case RYGEL_HTTP_SEEK_LENGTH:
		g_value_set_int64 (value, rygel_http_seek_get_length (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
示例#2
0
static gboolean rygel_seekable_response_perform_seek_co (RygelSeekableResponsePerformSeekData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 15:
		goto _state_15;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		{
#line 75 "rygel-seekable-response.vala"
			G_FILE_INPUT_STREAM_GET_CLASS (data->self->priv->input_stream)->seek (data->self->priv->input_stream, rygel_http_seek_get_start (data->self->priv->seek), G_SEEK_SET, rygel_state_machine_get_cancellable ((RygelStateMachine*) data->self), &data->_inner_error_);
#line 450 "rygel-seekable-response.c"
			if (data->_inner_error_ != NULL) {
				goto __catch36_g_error;
			}
		}
		goto __finally36;
		__catch36_g_error:
		{
			data->err = data->_inner_error_;
			data->_inner_error_ = NULL;
			{
#line 81 "rygel-seekable-response.vala"
				g_warning (_ ("Failed to seek to %s-%s on URI %s: %s"), data->_tmp0_ = g_strdup_printf ("%lli", rygel_http_seek_get_start (data->self->priv->seek)), data->_tmp1_ = g_strdup_printf ("%lli", rygel_http_seek_get_stop (data->self->priv->seek)), data->_tmp2_ = g_file_get_uri (data->self->priv->file), data->err->message);
#line 463 "rygel-seekable-response.c"
				_g_free0 (data->_tmp2_);
				_g_free0 (data->_tmp1_);
				_g_free0 (data->_tmp0_);
#line 86 "rygel-seekable-response.vala"
				rygel_http_response_end ((RygelHTTPResponse*) data->self, FALSE, (guint) SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE);
#line 469 "rygel-seekable-response.c"
				_g_error_free0 (data->err);
				{
					if (data->_state_ == 0) {
						g_simple_async_result_complete_in_idle (data->_async_result);
					} else {
						g_simple_async_result_complete (data->_async_result);
					}
					g_object_unref (data->_async_result);
					return FALSE;
				}
				_g_error_free0 (data->err);
			}
		}
		__finally36:
		if (data->_inner_error_ != NULL) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code);
			g_clear_error (&data->_inner_error_);
			return FALSE;
		}
		data->_state_ = 15;
		rygel_seekable_response_start_reading (data->self, rygel_seekable_response_perform_seek_ready, data);
		return FALSE;
		_state_15:
#line 91 "rygel-seekable-response.vala"
		rygel_seekable_response_start_reading_finish (data->self, data->_res_);
#line 495 "rygel-seekable-response.c"
	}
	{
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
}