2015-05-15 20:24:00 +00:00
|
|
|
/*
|
|
|
|
* \brief Connection to Audio_in service
|
|
|
|
* \author Josef Soentgen
|
|
|
|
* \date 2015-05-08
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 12:23:52 +00:00
|
|
|
* Copyright (C) 2015-2017 Genode Labs GmbH
|
2015-05-15 20:24:00 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 12:23:52 +00:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2015-05-15 20:24:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__AUDIO_IN_SESSION__CONNECTION_H_
|
|
|
|
#define _INCLUDE__AUDIO_IN_SESSION__CONNECTION_H_
|
|
|
|
|
|
|
|
#include <audio_in_session/client.h>
|
|
|
|
#include <base/connection.h>
|
|
|
|
#include <base/allocator.h>
|
|
|
|
|
|
|
|
namespace Audio_in { struct Connection; }
|
|
|
|
|
|
|
|
|
|
|
|
struct Audio_in::Connection : Genode::Connection<Session>, Audio_in::Session_client
|
|
|
|
{
|
2016-05-20 09:00:53 +00:00
|
|
|
/**
|
|
|
|
* Issue session request
|
|
|
|
*
|
|
|
|
* \noapi
|
|
|
|
*/
|
2016-05-10 15:24:51 +00:00
|
|
|
Capability<Audio_in::Session> _session(Genode::Parent &parent, char const *channel)
|
|
|
|
{
|
2017-05-07 20:03:25 +00:00
|
|
|
return session(parent, "ram_quota=%ld, cap_quota=%ld, channel=\"%s\"",
|
|
|
|
10*1024 + sizeof(Stream), CAP_QUOTA, channel);
|
2016-05-10 15:24:51 +00:00
|
|
|
}
|
|
|
|
|
2015-05-15 20:24:00 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* \param progress_signal install progress signal, the client may then
|
|
|
|
* call 'wait_for_progress', which is sent when the
|
|
|
|
* server processed one or more packets
|
|
|
|
*/
|
2016-05-10 15:24:51 +00:00
|
|
|
Connection(Genode::Env &env, char const *channel, bool progress_signal = false)
|
|
|
|
:
|
|
|
|
Genode::Connection<Session>(env, _session(env.parent(), channel)),
|
2017-01-06 14:32:53 +00:00
|
|
|
Session_client(env.rm(), cap(), progress_signal)
|
2015-05-15 20:24:00 +00:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__AUDIO_IN_SESSION__CONNECTION_H_ */
|