Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
isource.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Roc Streaming authors
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 
9 //! @file roc_sndio/isource.h
10 //! @brief Source interface.
11 
12 #ifndef ROC_SNDIO_ISOURCE_H_
13 #define ROC_SNDIO_ISOURCE_H_
14 
16 #include "roc_core/time.h"
17 #include "roc_sndio/idevice.h"
18 
19 namespace roc {
20 namespace sndio {
21 
22 //! Source interface.
23 class ISource : public IDevice, public audio::IFrameReader {
24 public:
25  virtual ~ISource();
26 
27  //! Adjust source clock to match consumer clock.
28  //! @remarks
29  //! Invoked regularly after reading every or a several frames.
30  //! @p timestamp defines the time in Unix domain when the last sample of the last
31  //! frame read from source is going to be actually processed by consumer.
33 };
34 
35 } // namespace sndio
36 } // namespace roc
37 
38 #endif // ROC_SNDIO_ISOURCE_H_
Frame reader interface.
Definition: iframe_reader.h:22
Base interface for sinks and sources.
Definition: idevice.h:25
Source interface.
Definition: isource.h:23
virtual void reclock(core::nanoseconds_t timestamp)=0
Adjust source clock to match consumer clock.
Device interface.
Frame reader interface.
nanoseconds_t timestamp(clock_t clock)
Get current timestamp in nanoseconds.
int64_t nanoseconds_t
Nanoseconds.
Definition: time.h:58
Root namespace.
Time definitions.