audio-drain/airtalgo/EndPointCallback.h

49 lines
1.6 KiB
C
Raw Normal View History

/** @file
* @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#ifndef __AIRT_ALGO_END_POINT_CALLBACK_H__
#define __AIRT_ALGO_END_POINT_CALLBACK_H__
#include <airtalgo/EndPoint.h>
#include <functional>
namespace airtalgo {
2015-01-27 21:26:03 +01:00
typedef std::function<void (const std::chrono::system_clock::time_point& _playTime,
size_t _nbChunk,
const std::vector<airtalgo::channel>& _map,
void* _data,
enum airtalgo::format _type)> needDataFunction;
typedef std::function<void (const std::chrono::system_clock::time_point& _readTime,
size_t _nbChunk,
const std::vector<airtalgo::channel>& _map,
const void* _data,
enum airtalgo::format _type)> haveNewDataFunction;
class EndPointCallback : public EndPoint {
private:
2015-01-27 21:26:03 +01:00
needDataFunction m_outputFunction;
haveNewDataFunction m_inputFunction;
public:
/**
* @brief Constructor
*/
2015-01-27 21:26:03 +01:00
EndPointCallback(needDataFunction _callback);
EndPointCallback(haveNewDataFunction _callback);
/**
* @brief Destructor
*/
2015-01-28 22:07:11 +01:00
virtual ~EndPointCallback();
virtual void configurationChange();
virtual bool process(std::chrono::system_clock::time_point& _time,
void* _input,
size_t _inputNbChunk,
void*& _output,
size_t& _outputNbChunk);
};
};
#endif