VLC  3.0.15
h2output.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * h2output.h: HTTP/2 send queue declarations
3  *****************************************************************************
4  * Copyright (C) 2015 RĂ©mi Denis-Courmont
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19  *****************************************************************************/
20 
21 /**
22  * \defgroup h2_output HTTP/2 output
23  * \ingroup h2
24  * @{
25  */
26 
27 struct vlc_h2_output;
28 struct vlc_h2_frame;
29 struct vlc_tls;
30 
31 int vlc_h2_output_send_prio(struct vlc_h2_output *, struct vlc_h2_frame *);
32 int vlc_h2_output_send(struct vlc_h2_output *, struct vlc_h2_frame *);
33 
34 struct vlc_h2_output *vlc_h2_output_create(struct vlc_tls *, bool client);
36 
37 /** @} */
count
size_t count
Definition: core.c:461
vlc_h2_output::prio
struct vlc_h2_queue prio
Definition: h2output.c:50
vlc_restorecancel
void vlc_restorecancel(int state)
Restores the cancellation state.
Definition: thread.c:323
vlc_cleanup_push
#define vlc_cleanup_push(routine, arg)
Registers a thread cancellation handler.
Definition: vlc_threads.h:975
vlc_h2_output::closing
bool closing
Definition: h2output.c:54
vlc_tls::writev
ssize_t(* writev)(struct vlc_tls *, const struct iovec *, unsigned)
Definition: vlc_tls.h:47
vlc_common.h
vlc_https_send
static ssize_t vlc_https_send(vlc_tls_t *tls, const void *buf, size_t len)
Sends bytes to a connection.
Definition: h2output.c:192
pollfd::fd
int fd
Definition: vlc_fixups.h:416
vlc_h2_output::lock
vlc_mutex_t lock
Definition: h2output.c:56
pollfd
Definition: vlc_fixups.h:414
h2output.h
vlc_tls
Transport layer socket.
Definition: vlc_tls.h:43
poll
int poll(struct pollfd *, unsigned, int)
vlc_clone
int vlc_clone(vlc_thread_t *th, void *(*entry)(void *), void *data, int priority)
Creates and starts a new thread.
Definition: thread.c:263
vlc_h2_output_create
struct vlc_h2_output * vlc_h2_output_create(struct vlc_tls *tls, bool client)
Definition: h2output.c:300
vlc_h2_queue::first
struct vlc_h2_frame * first
Definition: h2output.c:42
vlc_cond_signal
void vlc_cond_signal(vlc_cond_t *p_condvar)
Wakes up one thread waiting on a condition variable.
Definition: thread.c:256
vlc_cond_t
pthread_cond_t vlc_cond_t
Condition variable.
Definition: vlc_threads.h:279
vlc_h2_output_queue
static int vlc_h2_output_queue(struct vlc_h2_output *out, struct vlc_h2_queue *q, struct vlc_h2_frame *f)
Queues one outgoing HTTP/2.
Definition: h2output.c:62
vlc_h2_output::wait
vlc_cond_t wait
Definition: h2output.c:57
vlc_h2_output::queue
struct vlc_h2_queue queue
Definition: h2output.c:51
vlc_h2_output::tls
struct vlc_tls * tls
Definition: h2output.c:48
vlc_h2_output::size
size_t size
Definition: h2output.c:52
vlc_h2_client_output_thread
static void * vlc_h2_client_output_thread(void *data)
Definition: h2output.c:284
vlc_h2_output_flush_unlocked
static void vlc_h2_output_flush_unlocked(struct vlc_h2_output *out)
Definition: h2output.c:173
vlc_h2_frame::next
struct vlc_h2_frame * next
Definition: h2frame.h:31
POLLOUT
#define POLLOUT
Definition: vlc_fixups.h:412
vlc_h2_queue
Definition: h2output.c:40
vlc_tls_GetFD
static int vlc_tls_GetFD(vlc_tls_t *tls)
Definition: vlc_tls.h:187
pollfd::events
short events
Definition: vlc_fixups.h:417
vlc_h2_output_dequeue
static struct vlc_h2_frame * vlc_h2_output_dequeue(struct vlc_h2_output *out)
Dequeues one outgoing HTTP/2.
Definition: h2output.c:125
vlc_thread_t
Thread handle.
Definition: vlc_threads.h:252
vlc_mutex_init
void vlc_mutex_init(vlc_mutex_t *p_mutex)
Initializes a fast mutex.
Definition: thread.c:85
vlc_cleanup_pop
#define vlc_cleanup_pop()
Unregisters the last cancellation handler.
Definition: vlc_threads.h:983
VLC_H2_MAX_QUEUE
#define VLC_H2_MAX_QUEUE
Definition: h2output.c:38
vlc_savecancel
int vlc_savecancel(void)
Disables thread cancellation.
Definition: thread.c:313
VLC_THREAD_PRIORITY_INPUT
#define VLC_THREAD_PRIORITY_INPUT
Definition: vlc_threads.h:322
vlc_mutex_t
pthread_mutex_t vlc_mutex_t
Mutex.
Definition: vlc_threads.h:267
vlc_h2_frame_size
size_t vlc_h2_frame_size(const struct vlc_h2_frame *f)
Definition: h2frame.c:72
vlc_h2_frame
Definition: h2frame.h:29
vlc_cond_destroy
void vlc_cond_destroy(vlc_cond_t *p_condvar)
Deinitializes a condition variable.
Definition: thread.c:228
vlc_cond_init
void vlc_cond_init(vlc_cond_t *p_condvar)
Initializes a condition variable.
Definition: thread.c:216
vlc_cond_wait
void vlc_cond_wait(vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
Waits on a condition variable.
Definition: thread.c:267
vlc_mutex_destroy
void vlc_mutex_destroy(vlc_mutex_t *p_mutex)
Deinitializes a mutex.
Definition: thread.c:110
vlc_tls.h
vlc_mutex_unlock
void vlc_mutex_unlock(vlc_mutex_t *p_mutex)
Releases a mutex.
Definition: thread.c:138
unlikely
#define unlikely(p)
Definition: vlc_common.h:114
vlc_h2_frame_send
static int vlc_h2_frame_send(struct vlc_tls *tls, struct vlc_h2_frame *f)
Sends one HTTP/2 frame through TLS.
Definition: h2output.c:242
vlc_cancel
void vlc_cancel(vlc_thread_t thread_id)
Marks a thread as cancelled.
Definition: thread.c:297
vlc_h2_output
Definition: h2output.c:46
vlc_h2_queue::last
struct vlc_h2_frame ** last
Definition: h2output.c:43
vlc_h2_output::thread
vlc_thread_t thread
Definition: h2output.c:58
vlc_h2_output::failed
bool failed
Definition: h2output.c:53
vlc_h2_frame::data
uint8_t data[]
Definition: h2frame.h:32
vlc_mutex_lock
void vlc_mutex_lock(vlc_mutex_t *p_mutex)
Acquires a mutex.
Definition: thread.c:123
h2frame.h
vlc_h2_output_send
int vlc_h2_output_send(struct vlc_h2_output *out, struct vlc_h2_frame *f)
Definition: h2output.c:119
vlc_h2_output_send_prio
int vlc_h2_output_send_prio(struct vlc_h2_output *out, struct vlc_h2_frame *f)
Definition: h2output.c:114
vlc_h2_output_destroy
void vlc_h2_output_destroy(struct vlc_h2_output *out)
Definition: h2output.c:331
vlc_join
void vlc_join(vlc_thread_t handle, void **result)
Waits for a thread to complete (if needed), then destroys it.
Definition: thread.c:270
vlc_h2_output_thread
static void * vlc_h2_output_thread(void *data)
Output thread.
Definition: h2output.c:256