VLC  3.0.15
clock.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * clock.h: clocks synchronisation
3  *****************************************************************************
4  * Copyright (C) 2008 VLC authors and VideoLAN
5  * Copyright (C) 2008 Laurent Aimar
6  * $Id: dc4c8bd9352ed669930fe4b36dcd601783d6026c $
7  *
8  * Authors: Laurent Aimar < fenrir _AT_ videolan _DOT_ org >
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation; either version 2.1 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24 
25 #ifndef LIBVLC_INPUT_CLOCK_H
26 #define LIBVLC_INPUT_CLOCK_H 1
27 
28 #include <vlc_common.h>
29 #include <vlc_input.h> /* FIXME Needed for input_clock_t */
30 
31 /** @struct input_clock_t
32  * This structure is used to manage clock drift and reception jitters
33  *
34  * XXX input_clock_GetTS can be called from any threads. All others functions
35  * MUST be called from one and only one thread.
36  */
37 typedef struct input_clock_t input_clock_t;
38 
39 /**
40  * This function creates a new input_clock_t.
41  * You must use input_clock_Delete to delete it once unused.
42  */
44 
45 /**
46  * This function destroys a input_clock_t created by input_clock_New.
47  */
49 
50 /**
51  * This function will update a input_clock_t with a new clock reference point.
52  * It will also tell if the clock point is late regarding our buffering.
53  *
54  * \param b_buffering_allowed tells if we are allowed to bufferize more data in
55  * advanced (if possible).
56  */
58  bool *pb_late,
59  bool b_can_pace_control, bool b_buffering_allowed,
60  mtime_t i_clock, mtime_t i_system );
61 /**
62  * This function will reset the drift of a input_clock_t.
63  *
64  * The actual jitter estimation will not be reseted by it.
65  */
67 
68 /**
69  * This functions will return a deadline used to control the reading speed.
70  */
72 
73 /**
74  * This functions allows changing the actual reading speed.
75  */
77 
78 /**
79  * This function allows changing the pause status.
80  */
82 
83 /**
84  * This function returns the original system value date and the delay for the current
85  * reference point (a valid reference point must have been set).
86  */
87 void input_clock_GetSystemOrigin( input_clock_t *, mtime_t *pi_system, mtime_t *pi_delay );
88 
89 /**
90  * This function allows rebasing the original system value date (a valid
91  * reference point must have been set).
92  * When using the absolute mode, it will create a discontinuity unless
93  * called imediatly after a input_clock_Update.
94  */
95 void input_clock_ChangeSystemOrigin( input_clock_t *, bool b_absolute, mtime_t i_system );
96 
97 /**
98  * This function converts a pair of timestamp from stream clock to system clock.
99  *
100  * If pi_rate is provided it will be filled with the rate value used for
101  * the conversion.
102  * p_ts0 is a pointer to a timestamp to be converted (in place) and must be non NULL.
103  * p_ts1 is a pointer to a timestamp to be converted (in place) and can be NULL.
104  *
105  * It will return VLC_EGENERIC if i_ts_bound is not INT64_MAX and if the value *p_ts0
106  * after conversion is not before the deadline mdate() + i_pts_delay + i_ts_bound.
107  * It will also return VLC_EGENERIC if the conversion cannot be done successfully. In
108  * this case, *p_ts0 and *p_ts1 will hold an invalid timestamp.
109  * Otherwise it will return VLC_SUCCESS.
110  */
111 int input_clock_ConvertTS( vlc_object_t *, input_clock_t *, int *pi_rate,
112  mtime_t *pi_ts0, mtime_t *pi_ts1, mtime_t i_ts_bound );
113 
114 /**
115  * This function returns the current rate.
116  */
118 
119 /**
120  * This function returns current clock state or VLC_EGENERIC if there is not a
121  * reference point.
122  */
124  mtime_t *pi_stream_start, mtime_t *pi_system_start,
125  mtime_t *pi_stream_duration, mtime_t *pi_system_duration );
126 
127 /**
128  * This function allows the set the minimal configuration for the jitter estimation algo.
129  */
131  mtime_t i_pts_delay, int i_cr_average );
132 
133 /**
134  * This function returns an estimation of the pts_delay needed to avoid rebufferization.
135  * XXX in the current implementation, the pts_delay will never be decreased.
136  */
138 
139 #endif
vlc_credential::psz_password
const char * psz_password
valid only if vlc_credential_get() returned true
Definition: vlc_keystore.h:175
STREAM_CAN_PAUSE
arg1= bool * res=cannot fail
Definition: vlc_stream.h:142
vlc_module_begin
#define vlc_module_begin()
Definition: vlc_plugin.h:253
VLC_HOME_DIR
Definition: vlc_configuration.h:121
input_clock_GetWakeup
mtime_t input_clock_GetWakeup(input_clock_t *cl)
This functions will return a deadline used to control the reading speed.
Definition: clock.c:380
input_clock_New
input_clock_t * input_clock_New(int i_rate)
This function creates a new input_clock_t.
Definition: clock.c:188
STREAM_IS_DIRECTORY
res=can fail
Definition: vlc_stream.h:146
input_clock_Delete
void input_clock_Delete(input_clock_t *)
This function destroys a input_clock_t created by input_clock_New.
Definition: clock.c:222
INPUT_RATE_DEFAULT
#define INPUT_RATE_DEFAULT
Input rate.
Definition: vlc_input.h:306
vlc_credential_init
void vlc_credential_init(vlc_credential *p_credential, const vlc_url_t *p_url)
Init a credential struct.
Definition: keystore.c:344
vlc_stream_ReadPartial
ssize_t vlc_stream_ReadPartial(stream_t *s, void *buf, size_t len)
Reads partial data from a byte stream.
Definition: stream.c:431
i_value
uint32_t i_value
Definition: vlc_text_style.h:215
vlc_access_NewMRL
stream_t * vlc_access_NewMRL(vlc_object_t *parent, const char *mrl)
Opens a new read-only byte stream.
Definition: access.c:145
vlc_stream_vaControl
int vlc_stream_vaControl(stream_t *s, int cmd, va_list args)
Use to control the "stream_t *".
Definition: stream.c:655
Close
static void Close(vlc_object_t *obj)
Definition: access.c:277
access_sys_t::resource
struct vlc_http_resource * resource
Definition: access.c:61
VLC_VIDEOS_DIR
Definition: vlc_configuration.h:133
config_GetAppDir
static char * config_GetAppDir(void)
Definition: dirs.c:224
access_New
static stream_t * access_New(vlc_object_t *parent, input_thread_t *input, bool preparsing, const char *mrl)
Definition: access.c:68
average_t
This structure holds long term average.
Definition: clock.c:107
stream_CommonDelete
void stream_CommonDelete(stream_t *s)
Definition: stream.c:101
vlc_http_file_can_seek
bool vlc_http_file_can_seek(struct vlc_http_resource *res)
Checks seeking support.
Definition: file.c:195
VLC_ACCESS_REDIRECT
#define VLC_ACCESS_REDIRECT
Special redirection error code.
Definition: vlc_access.h:45
live.h
ClockStreamToSystem
static mtime_t ClockStreamToSystem(input_clock_t *, mtime_t i_stream)
Definition: clock.c:592
AvgRescale
static void AvgRescale(average_t *, int i_divider)
Definition: clock.c:654
vlc_http_live_read
block_t * vlc_http_live_read(struct vlc_http_resource *res)
Definition: live.c:74
vlc_common.h
FromLocaleDup
#define FromLocaleDup
Definition: vlc_charset.h:252
ClockSystemToStream
static mtime_t ClockSystemToStream(input_clock_t *, mtime_t i_system)
Definition: clock.c:605
input_clock_t
Definition: clock.c:140
vlc_http_res_get_redirect
char * vlc_http_res_get_redirect(struct vlc_http_resource *restrict res)
Definition: resource.c:247
stream_t::b_preparsing
bool b_preparsing
True if this access is used to preparse.
Definition: vlc_stream.h:57
average_t::i_divider
int i_divider
Definition: clock.c:114
stream_t::pf_block
block_t *(* pf_block)(stream_t *, bool *eof)
Read data block.
Definition: vlc_stream.h:95
VLC_PUBLICSHARE_DIR
Definition: vlc_configuration.h:129
vlc_keystore.h
NoSeek
static int NoSeek(stream_t *access, uint64_t pos)
Definition: access.c:123
block_t::i_buffer
size_t i_buffer
Payload length.
Definition: vlc_block.h:116
access_vaDirectoryControlHelper
int access_vaDirectoryControlHelper(stream_t *p_access, int i_query, va_list args)
Default pf_control callback for directory accesses.
Definition: access.c:152
vlc_interrupt.h
vlc_http_live_get_type
#define vlc_http_live_get_type
Definition: live.h:37
var_InheritInteger
#define var_InheritInteger(o, n)
Definition: vlc_variables.h:612
vlc_pipe
int vlc_pipe(int fds[2])
Creates a pipe (see "man pipe" for further reference).
Definition: filesystem.c:263
stats_Update
void stats_Update(counter_t *p_counter, uint64_t val, uint64_t *new_val)
Update a counter element with new values.
Definition: stats.c:157
set_callbacks
#define set_callbacks(activate, deactivate)
Definition: vlc_plugin.h:304
vlc_access.h
vlc_stream_Eof
bool vlc_stream_Eof(const stream_t *s)
Checks for end of stream.
Definition: stream.c:586
vlc_uri2path
char * vlc_uri2path(const char *url)
Converts a URI to a local path.
Definition: url.c:240
CR_MAX_GAP
#define CR_MAX_GAP
Definition: clock.c:82
input_clock_t::i_pause_date
mtime_t i_pause_date
Definition: clock.c:178
input_clock_GetJitter
mtime_t input_clock_GetJitter(input_clock_t *cl)
This function returns an estimation of the pts_delay needed to avoid rebufferization.
Definition: clock.c:568
input_clock_t::i_next_drift_update
mtime_t i_next_drift_update
Definition: clock.c:156
vlc_network.h
var_InheritBool
#define var_InheritBool(o, n)
Definition: vlc_variables.h:601
vlc_http_mgr
Definition: connmgr.c:95
vlc_http_mgr_create
struct vlc_http_mgr * vlc_http_mgr_create(vlc_object_t *obj, struct vlc_http_cookie_jar_t *jar)
Creates an HTTP connection manager.
Definition: connmgr.c:266
vlc_charset.h
vlc_getProxyUrl
char * vlc_getProxyUrl(const char *url)
Determines the network proxy server to use (if any).
Definition: netconf.c:44
clock_point_t
Definition: clock.c:124
get_path
char * get_path(const char *location)
Definition: access.c:42
stream_FilterChainNew
stream_t * stream_FilterChainNew(stream_t *source, const char *list)
Builds an explicit chain of stream filters.
Definition: stream_filter.c:86
vlc_UrlClean
void vlc_UrlClean(vlc_url_t *restrict url)
Definition: url.c:594
vlc_http_res_destroy
void vlc_http_res_destroy(struct vlc_http_resource *res)
Destroys an HTTP resource.
Definition: resource.c:161
input_clock_GetJitter
mtime_t input_clock_GetJitter(input_clock_t *)
This function returns an estimation of the pts_delay needed to avoid rebufferization.
Definition: clock.c:568
VLC_MUSIC_DIR
Definition: vlc_configuration.h:131
vlc_UrlParse
int vlc_UrlParse(vlc_url_t *url, const char *str)
Parses an URI or IRI.
Definition: url.c:554
msg_Dbg
#define msg_Dbg(p_this,...)
Definition: vlc_messages.h:86
set_shortname
#define set_shortname(shortname)
Definition: vlc_plugin.h:287
vlc_access_Destroy
static void vlc_access_Destroy(stream_t *access)
Definition: access.c:57
vlc_http_file_get_size
uintmax_t vlc_http_file_get_size(struct vlc_http_resource *res)
Gets file size.
Definition: file.c:177
input_clock_GetSystemOrigin
void input_clock_GetSystemOrigin(input_clock_t *, mtime_t *pi_system, mtime_t *pi_delay)
This function returns the original system value date and the delay for the current reference point (a...
Definition: clock.c:515
_
#define _(str)
Definition: vlc_fixups.h:371
vlc_url_t::psz_password
char * psz_password
Definition: vlc_url.h:149
input_clock_Reset
void input_clock_Reset(input_clock_t *)
This function will reset the drift of a input_clock_t.
Definition: clock.c:326
FileSeek
static int FileSeek(stream_t *access, uint64_t pos)
Definition: access.c:57
input_thread_private_t::counters_lock
vlc_mutex_t counters_lock
Definition: input_internal.h:166
clock_point_t::i_system
mtime_t i_system
Definition: clock.c:127
input_clock_t::i_pts_delay
mtime_t i_pts_delay
Definition: clock.c:177
VLC_EGENERIC
#define VLC_EGENERIC
Unspecified error.
Definition: vlc_common.h:350
STREAM_SET_PAUSE_STATE
arg1= bool res=can fail
Definition: vlc_stream.h:158
getenv
static char * getenv(const char *name)
Definition: vlc_fixups.h:293
VLC_DESKTOP_DIR
Definition: vlc_configuration.h:126
vlc_input.h
FileRead
static block_t * FileRead(stream_t *access, bool *restrict eof)
Definition: access.c:47
vlc_http_res_set_login
int vlc_http_res_set_login(struct vlc_http_resource *res, const char *username, const char *password)
Definition: resource.c:330
input_clock_GetState
int input_clock_GetState(input_clock_t *cl, mtime_t *pi_stream_start, mtime_t *pi_system_start, mtime_t *pi_stream_duration, mtime_t *pi_system_duration)
This function returns current clock state or VLC_EGENERIC if there is not a reference point.
Definition: clock.c:466
config_GetPsz
#define config_GetPsz(a, b)
Definition: vlc_configuration.h:146
resource.h
var_InheritString
#define var_InheritString(o, n)
Definition: vlc_variables.h:639
set_category
#define set_category(i_id)
Definition: vlc_plugin.h:355
change_safe
#define change_safe()
Definition: vlc_plugin.h:502
asprintf
int asprintf(char **, const char *,...)
AStreamNoReadDir
static int AStreamNoReadDir(stream_t *s, input_item_node_t *p_node)
Definition: access.c:175
access_sys_t::manager
struct vlc_http_mgr * manager
Definition: access.c:60
input_clock_ConvertTS
int input_clock_ConvertTS(vlc_object_t *, input_clock_t *, int *pi_rate, mtime_t *pi_ts0, mtime_t *pi_ts1, mtime_t i_ts_bound)
This function converts a pair of timestamp from stream clock to system clock.
Definition: clock.c:397
VLC_DOWNLOAD_DIR
Definition: vlc_configuration.h:127
set_description
#define set_description(desc)
Definition: vlc_plugin.h:291
stream_t::psz_location
const char * psz_location
Location (URL with the scheme stripped)
Definition: vlc_stream.h:55
strndup
char * strndup(const char *, size_t)
AStreamReadStream
static ssize_t AStreamReadStream(stream_t *s, void *buf, size_t len)
Definition: access.c:214
STREAM_CAN_SEEK
arg1= bool * res=cannot fail
Definition: vlc_stream.h:140
vlc_stream_ReadBlock
block_t * vlc_stream_ReadBlock(stream_t *s)
Reads a data block from a byte stream.
Definition: stream.c:529
clock.h
vlc_module_end
#define vlc_module_end()
Definition: vlc_plugin.h:266
stream_t::pf_readdir
int(* pf_readdir)(stream_t *, input_item_node_t *)
Read directory.
Definition: vlc_stream.h:105
config_GetLibDir
char * config_GetLibDir(void)
Definition: dirs.c:38
input_clock_t::b_has_external_clock
bool b_has_external_clock
Definition: clock.c:172
input_clock_ChangeRate
void input_clock_ChangeRate(input_clock_t *, int i_rate)
This functions allows changing the actual reading speed.
Definition: clock.c:340
input_clock_t::i_index
unsigned i_index
Definition: clock.c:163
vlc_killed
bool vlc_killed(void)
Checks if the interruption context was "killed".
Definition: interrupt.c:186
stream_t::psz_name
char * psz_name
Definition: vlc_stream.h:53
input_clock_ChangeSystemOrigin
void input_clock_ChangeSystemOrigin(input_clock_t *cl, bool b_absolute, mtime_t i_system)
This function allows rebasing the original system value date (a valid reference point must have been ...
Definition: clock.c:489
CLOCK_FREQ
#define CLOCK_FREQ
Definition: vlc_config.h:45
clock_point_Create
static clock_point_t clock_point_Create(mtime_t i_stream, mtime_t i_system)
Definition: clock.c:130
MAX_REDIR
#define MAX_REDIR
Definition: access.c:64
getAppDependentDir
static char * getAppDependentDir(vlc_userdir_t type)
Definition: dirs.c:120
VLC_CONFIG_DIR
Definition: vlc_configuration.h:122
lock
static vlc_mutex_t lock
Definition: interface.c:62
input_clock_t::b_paused
bool b_paused
Definition: clock.c:175
msg_Warn
#define msg_Warn(p_this,...)
Definition: vlc_messages.h:84
access_sys_t
Definition: access.c:41
stream_t::p_module
module_t * p_module
Definition: vlc_stream.h:51
vlc_close
int vlc_close(int fd)
Closes a file descriptor.
Definition: filesystem.c:88
input_clock_t::i_external_clock
mtime_t i_external_clock
Definition: clock.c:171
vlc_userdir_t
enum vlc_userdir vlc_userdir_t
config_GetShellDir
static char * config_GetShellDir(int csidl)
Definition: dirs.c:214
input_clock_t::i_ts_max
mtime_t i_ts_max
Definition: clock.c:150
vlc_stream_CommonNew
stream_t * vlc_stream_CommonNew(vlc_object_t *parent, void(*destroy)(stream_t *))
Allocates a VLC stream object.
Definition: stream.c:67
input_clock_GetSystemOrigin
void input_clock_GetSystemOrigin(input_clock_t *cl, mtime_t *pi_system, mtime_t *pi_delay)
This function returns the original system value date and the delay for the current reference point (a...
Definition: clock.c:515
input_clock_t::late
struct input_clock_t::@11 late
VLC_TS_INVALID
#define VLC_TS_INVALID
Definition: vlc_config.h:42
input_clock_ChangePause
void input_clock_ChangePause(input_clock_t *, bool b_paused, mtime_t i_date)
This function allows changing the pause status.
Definition: clock.c:357
input_clock_GetState
int input_clock_GetState(input_clock_t *, mtime_t *pi_stream_start, mtime_t *pi_system_start, mtime_t *pi_stream_duration, mtime_t *pi_system_duration)
This function returns current clock state or VLC_EGENERIC if there is not a reference point.
Definition: clock.c:466
input_clock_t::b_has_reference
bool b_has_reference
Definition: clock.c:168
vlc_http_file_read
block_t * vlc_http_file_read(struct vlc_http_resource *res)
Reads data.
Definition: file.c:231
stream_t::pf_seek
int(* pf_seek)(stream_t *, uint64_t)
Seek.
Definition: vlc_stream.h:114
stream_t::psz_url
char * psz_url
Full URL or MRL (can be NULL)
Definition: vlc_stream.h:54
input_clock_GetRate
int input_clock_GetRate(input_clock_t *cl)
This function returns the current rate.
Definition: clock.c:455
stream_FilterAutoNew
stream_t * stream_FilterAutoNew(stream_t *source)
Probes stream filters automatically.
Definition: stream_filter.c:70
config_GetHomeDir
static char * config_GetHomeDir(void)
Definition: dirs.c:60
average_t::i_value
mtime_t i_value
Definition: clock.c:110
config_GetUserDir
char * config_GetUserDir(vlc_userdir_t type)
Definition: dirs.c:170
vlc_plugin.h
system_Init
void system_Init(void)
Definition: specific.c:166
stream.h
vlc_http_resource
Definition: resource.h:42
stream_t::p_input
input_thread_t * p_input
Definition: vlc_stream.h:131
vlc_http_mgr_destroy
void vlc_http_mgr_destroy(struct vlc_http_mgr *mgr)
Destroys an HTTP connection manager.
Definition: connmgr.c:280
input_thread_private_t::p_read_bytes
counter_t * p_read_bytes
Definition: input_internal.h:150
CR_BUFFERING_TARGET
#define CR_BUFFERING_TARGET
Definition: clock.c:99
vlc_mutex_init
void vlc_mutex_init(vlc_mutex_t *p_mutex)
Initializes a fast mutex.
Definition: thread.c:85
stream_t
stream_t definition
Definition: vlc_stream.h:46
VLC_DATA_DIR
Definition: vlc_configuration.h:123
input_clock_GetRate
int input_clock_GetRate(input_clock_t *)
This function returns the current rate.
Definition: clock.c:455
change_private
#define change_private()
Definition: vlc_plugin.h:494
AStreamControl
static int AStreamControl(stream_t *s, int cmd, va_list args)
Definition: access.c:256
AStreamReadBlock
static block_t * AStreamReadBlock(stream_t *s, bool *restrict eof)
Definition: access.c:182
input_clock_ChangePause
void input_clock_ChangePause(input_clock_t *cl, bool b_paused, mtime_t i_date)
This function allows changing the pause status.
Definition: clock.c:357
vlc_http_file_create
struct vlc_http_resource * vlc_http_file_create(struct vlc_http_mgr *mgr, const char *uri, const char *ua, const char *ref)
Creates an HTTP file.
Definition: file.c:112
vlc_configuration.h
vlc_uri_compose
char * vlc_uri_compose(const vlc_url_t *uri)
Composes an URI.
Definition: url.c:706
vlc_stream_Seek
int vlc_stream_Seek(stream_t *s, uint64_t offset)
Sets the current stream position.
Definition: stream.c:593
VLC_DOCUMENTS_DIR
Definition: vlc_configuration.h:130
input_clock_t::lock
vlc_mutex_t lock
Definition: clock.c:143
vlc_fs.h
config_GetTypeDir
static char * config_GetTypeDir(const char *xdg_name)
Definition: dirs.c:106
STREAM_GET_PTS_DELAY
arg1= int64_t* res=cannot fail
Definition: vlc_stream.h:149
AStreamDestroy
static void AStreamDestroy(stream_t *s)
Definition: access.c:263
stream_t::pf_control
int(* pf_control)(stream_t *, int i_query, va_list)
Stream control.
Definition: vlc_stream.h:123
vlc_url.h
CR_BUFFERING_RATE
#define CR_BUFFERING_RATE
Definition: clock.c:91
likely
#define likely(p)
Definition: vlc_common.h:113
input_clock_SetJitter
void input_clock_SetJitter(input_clock_t *, mtime_t i_pts_delay, int i_cr_average)
This function allows the set the minimal configuration for the jitter estimation algo.
Definition: clock.c:529
vlc_url_t
Definition: vlc_url.h:145
vlc_http_res_get_status
int vlc_http_res_get_status(struct vlc_http_resource *res)
Definition: resource.c:130
vlc_object_t
The main vlc_object_t structure.
Definition: vlc_objects.h:39
change_volatile
#define change_volatile()
Definition: vlc_plugin.h:498
average_t::i_residue
int i_residue
Definition: clock.c:111
SUBCAT_INPUT_ACCESS
#define SUBCAT_INPUT_ACCESS
Definition: vlc_plugin.h:162
VLC_ENOMEM
#define VLC_ENOMEM
Not enough memory.
Definition: vlc_common.h:351
set_capability
#define set_capability(cap, score)
Definition: vlc_plugin.h:299
var_InheritAddress
#define var_InheritAddress(o, n)
Definition: vlc_variables.h:650
VLC_UNUSED
#define VLC_UNUSED(x)
Definition: vlc_common.h:912
input_clock_t::i_buffering_duration
mtime_t i_buffering_duration
Definition: clock.c:153
LiveRead
static block_t * LiveRead(stream_t *access, bool *restrict eof)
Definition: access.c:113
vlc_mutex_t
pthread_mutex_t vlc_mutex_t
Mutex.
Definition: vlc_threads.h:267
VLC_SUCCESS
#define VLC_SUCCESS
No error.
Definition: vlc_common.h:349
input_clock_ConvertTS
int input_clock_ConvertTS(vlc_object_t *p_object, input_clock_t *cl, int *pi_rate, mtime_t *pi_ts0, mtime_t *pi_ts1, mtime_t i_ts_bound)
This function converts a pair of timestamp from stream clock to system clock.
Definition: clock.c:397
connmgr.h
strdup
char * strdup(const char *)
input_thread_private_t::p_read_packets
counter_t * p_read_packets
Definition: input_internal.h:149
vlc_http_file_get_type
#define vlc_http_file_get_type
Definition: file.h:83
vlc_credential::psz_authtype
const char * psz_authtype
http authtype to search, can be overridden after a call to vlc_credential_get()
Definition: vlc_keystore.h:171
Open
static int Open(vlc_object_t *obj)
Definition: access.c:158
VLC_TEMPLATES_DIR
Definition: vlc_configuration.h:128
stream_AccessNew
stream_t * stream_AccessNew(vlc_object_t *parent, input_thread_t *input, bool preparsing, const char *url)
This function creates a raw stream_t from an URL.
Definition: access.c:270
input_clock_Delete
void input_clock_Delete(input_clock_t *cl)
This function destroys a input_clock_t created by input_clock_New.
Definition: clock.c:222
config_GetHomeDir
static char * config_GetHomeDir(void)
Definition: dirs.c:66
VLC_PICTURES_DIR
Definition: vlc_configuration.h:132
VLC_CACHE_DIR
Definition: vlc_configuration.h:124
vlc_credential_store
#define vlc_credential_store(a, b)
Definition: vlc_keystore.h:258
ClockGetTsOffset
static mtime_t ClockGetTsOffset(input_clock_t *)
It returns timestamp display offset due to ref/last modfied on rate changes It ensures that currently...
Definition: clock.c:616
input_clock_Update
void input_clock_Update(input_clock_t *cl, vlc_object_t *p_log, bool *pb_late, bool b_can_pace_control, bool b_buffering_allowed, mtime_t i_ck_stream, mtime_t i_ck_system)
This function will update a input_clock_t with a new clock reference point.
Definition: clock.c:234
input_priv
static input_thread_private_t * input_priv(input_thread_t *input)
Definition: input_internal.h:179
name
const char name[16]
Definition: httpd.c:1249
vlc_http_live_create
struct vlc_http_resource * vlc_http_live_create(struct vlc_http_mgr *mgr, const char *uri, const char *ua, const char *ref)
Definition: live.c:57
stream_t::pf_read
ssize_t(* pf_read)(stream_t *, void *buf, size_t len)
Read data.
Definition: vlc_stream.h:77
AvgGet
static mtime_t AvgGet(average_t *)
Definition: clock.c:650
STREAM_GET_CONTENT_TYPE
arg1= char ** res=can fail
Definition: vlc_stream.h:154
N_
#define N_(str)
Definition: vlc_fixups.h:372
add_bool
#define add_bool(name, v, text, longtext, advc)
Definition: vlc_plugin.h:442
vlc_mutex_destroy
void vlc_mutex_destroy(vlc_mutex_t *p_mutex)
Deinitializes a mutex.
Definition: thread.c:110
FileControl
static int FileControl(stream_t *access, int query, va_list args)
Definition: access.c:66
CR_MEAN_PTS_GAP
#define CR_MEAN_PTS_GAP
Definition: clock.c:86
input_clock_t::last
clock_point_t last
Definition: clock.c:147
vlc_credential
Definition: vlc_keystore.h:162
configuration.h
average_t::i_count
int i_count
Definition: clock.c:113
AvgReset
static void AvgReset(average_t *)
Definition: clock.c:632
vlc_http_res_get_basic_realm
char * vlc_http_res_get_basic_realm(struct vlc_http_resource *res)
Definition: resource.c:364
vlc_mutex_unlock
void vlc_mutex_unlock(vlc_mutex_t *p_mutex)
Releases a mutex.
Definition: thread.c:138
input_clock_New
input_clock_t * input_clock_New(int i_rate)
This function creates a new input_clock_t.
Definition: clock.c:188
unlikely
#define unlikely(p)
Definition: vlc_common.h:114
environ
char ** environ
STREAM_CAN_CONTROL_PACE
arg1= bool * res=cannot fail
Definition: vlc_stream.h:143
vlc_credential_clean
void vlc_credential_clean(vlc_credential *p_credential)
Clean a credential struct.
Definition: keystore.c:354
add_string
#define add_string(name, value, text, longtext, advc)
Definition: vlc_plugin.h:372
libvlc.h
vlc_credential_get
#define vlc_credential_get(a, b, c, d, e, f,...)
Definition: vlc_keystore.h:243
config_GetHomeDir
static char * config_GetHomeDir(void)
Definition: dirs.c:110
input_clock_Reset
void input_clock_Reset(input_clock_t *cl)
This function will reset the drift of a input_clock_t.
Definition: clock.c:326
set_subcategory
#define set_subcategory(i_id)
Definition: vlc_plugin.h:359
vlc_assert_unreachable
#define vlc_assert_unreachable()
Definition: vlc_common.h:118
LiveControl
static int LiveControl(stream_t *access, int query, va_list args)
Definition: access.c:130
mtime_t
int64_t mtime_t
High precision date or time interval.
Definition: vlc_common.h:150
file.h
vlc_credential::psz_username
const char * psz_username
valid only if vlc_credential_get() returned true
Definition: vlc_keystore.h:173
AStreamSeek
static int AStreamSeek(stream_t *s, uint64_t offset)
Definition: access.c:249
AvgInit
static void AvgInit(average_t *, int i_divider)
Definition: clock.c:623
input_clock_Update
void input_clock_Update(input_clock_t *, vlc_object_t *p_log, bool *pb_late, bool b_can_pace_control, bool b_buffering_allowed, mtime_t i_clock, mtime_t i_system)
This function will update a input_clock_t with a new clock reference point.
Definition: clock.c:234
stream_t::psz_filepath
char * psz_filepath
Local file path (if applicable)
Definition: vlc_stream.h:56
input_clock_SetJitter
void input_clock_SetJitter(input_clock_t *cl, mtime_t i_pts_delay, int i_cr_average)
This function allows the set the minimal configuration for the jitter estimation algo.
Definition: clock.c:529
input_clock_ChangeSystemOrigin
void input_clock_ChangeSystemOrigin(input_clock_t *, bool b_absolute, mtime_t i_system)
This function allows rebasing the original system value date (a valid reference point must have been ...
Definition: clock.c:489
CAT_INPUT
#define CAT_INPUT
Definition: vlc_plugin.h:160
STREAM_GET_SIZE
arg1= uint64_t * res=can fail
Definition: vlc_stream.h:145
input_thread_private_t::p_input_bitrate
counter_t * p_input_bitrate
Definition: input_internal.h:151
input_thread_t
Main structure representing an input thread.
Definition: vlc_input.h:221
VLC_OBJECT
#define VLC_OBJECT(x)
Type-safe vlc_object_t cast.
Definition: vlc_common.h:464
input_clock_t::i_rate
int i_rate
Definition: clock.c:176
input_item_node_t
Definition: vlc_input_item.h:180
config_GetAppDir
static char * config_GetAppDir(const char *xdg_name, const char *xdg_default)
Definition: dirs.c:82
AvgClean
static void AvgClean(average_t *)
Definition: clock.c:628
mdate
mtime_t mdate(void)
Precision monotonic clock.
Definition: thread.c:406
INPUT_CLOCK_LATE_COUNT
#define INPUT_CLOCK_LATE_COUNT
Definition: clock.c:137
AvgUpdate
static void AvgUpdate(average_t *, mtime_t i_value)
Definition: clock.c:638
module_unneed
#define module_unneed(a, b)
Definition: vlc_modules.h:49
VLC_STATIC_MUTEX
#define VLC_STATIC_MUTEX
Static initializer for (static) mutex.
Definition: vlc_threads.h:272
input_internal.h
vlc_credential::psz_realm
const char * psz_realm
http realm or smb domain to search, can be overridden after a call to vlc_credential_get()
Definition: vlc_keystore.h:168
STREAM_CAN_FASTSEEK
arg1= bool * res=cannot fail
Definition: vlc_stream.h:141
stream_t::p_sys
void * p_sys
Private data pointer.
Definition: vlc_stream.h:128
vlc_mutex_lock
void vlc_mutex_lock(vlc_mutex_t *p_mutex)
Acquires a mutex.
Definition: thread.c:123
block_t
Definition: vlc_block.h:111
input_clock_t::pi_value
mtime_t pi_value[(3)]
Definition: clock.c:162
vlc_http_file_seek
int vlc_http_file_seek(struct vlc_http_resource *res, uintmax_t offset)
Sets the read offset.
Definition: file.c:203
input_clock_t::ref
clock_point_t ref
Definition: clock.c:167
msg_Err
#define msg_Err(p_this,...)
Definition: vlc_messages.h:82
input_clock_ChangeRate
void input_clock_ChangeRate(input_clock_t *cl, int i_rate)
This functions allows changing the actual reading speed.
Definition: clock.c:340
AStreamReadDir
static int AStreamReadDir(stream_t *s, input_item_node_t *p_node)
Definition: access.c:241
input_clock_GetWakeup
mtime_t input_clock_GetWakeup(input_clock_t *)
This functions will return a deadline used to control the reading speed.
Definition: clock.c:380
module_need
#define module_need(a, b, c, d)
Definition: vlc_modules.h:47
getline
ssize_t getline(char **, size_t *, FILE *)
p
#define p(t)
vlc_modules.h
input_clock_t::drift
average_t drift
Definition: clock.c:157
clock_point_t::i_stream
mtime_t i_stream
Definition: clock.c:126
vlc_stream_Delete
void vlc_stream_Delete(stream_t *s)
Destroy a stream.
Definition: stream.c:120
add_shortcut
#define add_shortcut(...)
Definition: vlc_plugin.h:279
config_GetDataDir
char * config_GetDataDir(void)
Definition: dirs.c:94