mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
parent
7b40ccea85
commit
7f8a94bb70
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
* Copyright (C) 2015-2022 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -162,6 +162,21 @@ class Audio_in::Stream
|
||||
*/
|
||||
unsigned tail() const { return _tail; }
|
||||
|
||||
/**
|
||||
* Number of packets between record and allocation position
|
||||
*
|
||||
* \return number
|
||||
*/
|
||||
unsigned queued() const
|
||||
{
|
||||
if (_tail > _pos)
|
||||
return _tail - _pos;
|
||||
else if (_pos > _tail)
|
||||
return QUEUE_SIZE - (_pos - _tail);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve next packet for given packet
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user