/usr/include/mediastreamer2/msticker.h is in libmediastreamer-dev 3.3.2-4.1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | /*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef MS_TICKER_H
#define MS_TICKER_H
#include "msfilter.h"
#include "mscommon.h"
/**
* @file msticker.h
* @brief mediastreamer2 msticker.h include file
*
* This file provide the API needed to create, start
* and stop a graph.
*
*/
/**
* @defgroup mediastreamer2_ticker Ticker API - manage mediastreamer2 graphs.
* @ingroup mediastreamer2_api
* @{
*/
/**
* Structure for method getting time in miliseconds from an external source.
* @var MSTickerTimeFunc
*/
typedef uint64_t (*MSTickerTimeFunc)(void *);
struct _MSTicker
{
ms_mutex_t lock;
ms_cond_t cond;
MSList *execution_list; /* the list of source filters to be executed.*/
ms_thread_t thread; /* the thread ressource*/
int interval; /* in miliseconds*/
int exec_id;
uint32_t ticks;
uint64_t time; /* a time since the start of the ticker expressed in milisec*/
uint64_t orig; /* a relative time to take in account difference between time base given by consecutive get_cur_time_ptr() functions.*/
MSTickerTimeFunc get_cur_time_ptr;
void *get_cur_time_data;
char *name;
bool_t run; /* flag to indicate whether the ticker must be run or not */
#ifdef WIN32_TIMERS
HANDLE TimeEvent;
#endif
};
/**
* Structure for ticker object.
* @var MSTicker
*/
typedef struct _MSTicker MSTicker;
#ifdef __cplusplus
extern "C"{
#endif
/**
* Create a ticker that will be used to start
* and stop a graph.
*
* Returns: MSTicker * if successfull, NULL otherwise.
*/
MSTicker *ms_ticker_new(void);
/**
* Set a name to the ticker (used for logging)
**/
void ms_ticker_set_name(MSTicker *ticker, const char *name);
/**
* Attach a chain of filters to a ticker.
* The processing chain will be executed until ms_ticker_detach
* will be called.
*
* @param ticker A #MSTicker object.
* @param f A #MSFilter object.
*
* Returns: 0 if successfull, -1 otherwise.
*/
int ms_ticker_attach(MSTicker *ticker,MSFilter *f);
/**
* Dettach a chain of filters to a ticker.
* The processing chain will no more be executed.
*
* @param ticker A #MSTicker object.
* @param f A #MSFilter object.
*
*
* Returns: 0 if successfull, -1 otherwise.
*/
int ms_ticker_detach(MSTicker *ticker,MSFilter *f);
/**
* Destroy a ticker.
*
* @param ticker A #MSTicker object.
*
*/
void ms_ticker_destroy(MSTicker *ticker);
/**
* Override MSTicker's time function.
* This can be used to control the ticker from an external time provider, for example the
* clock of a sound card.
*
* @param ticker A #MSTicker object.
* @param func A replacement method for calculating "current time"
* @param user_data Any pointer to user private data.
*/
void ms_ticker_set_time_func(MSTicker *ticker, MSTickerTimeFunc func, void *user_data);
/**
* Print on stdout all filters of a ticker. (INTERNAL: DO NOT USE)
*
* @param ticker A #MSTicker object.
*/
void ms_ticker_print_graphs(MSTicker *ticker);
/* private functions:*/
#ifdef __cplusplus
}
#endif
/** @} */
#endif
|