xine-lib: xine-lib-1.2.13/src/xine-engine/broadcaster.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Functions
broadcaster.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <unistd.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <fcntl.h>`
`#include <stdarg.h>`
`#include <string.h>`
`#include <signal.h>`
`#include <errno.h>`
`#include <sys/time.h>`
`#include <dlfcn.h>`
`#include <pthread.h>`
`#include <xine/xine_internal.h>`
`#include <xine/buffer.h>`
`#include <xine/xineutils.h>`
`#include "xine_private.h"`

## Data Structures
struct | broadcaster_s

## Macros
#define | QLEN 5 /* maximum connection queue length */
#define | _BUFSIZ 512

## Functions
static int | sock_check_opened (int socket)
static int | sock_data_write (xine_t *xine, int socket, const void *buf_gen, int len)
static int | XINE_FORMAT_PRINTF (3, 4)
static void | broadcaster_data_write (broadcaster_t *this, const void *buf, int len)
static void | XINE_FORMAT_PRINTF (2, 3)
static void * | manager_loop (void *this_gen)
static void | send_buf (broadcaster_t *this, const char *from, buf_element_t *buf)
static void | video_put_cb (fifo_buffer_t *fifo, buf_element_t *buf, void *this_gen)
static void | audio_put_cb (fifo_buffer_t *fifo, buf_element_t *buf, void *this_gen)
broadcaster_t * | _x_init_broadcaster (xine_stream_t *stream, int port)
void | _x_close_broadcaster (broadcaster_t *this_gen)
int | _x_get_broadcaster_port (broadcaster_t *this_gen)

## Macro Definition Documentation

## ◆ _BUFSIZ

#define _BUFSIZ 512

Referenced by XINE_FORMAT_PRINTF(), and XINE_FORMAT_PRINTF().

## ◆ QLEN

#define QLEN 5 /* maximum connection queue length */

Referenced by _x_init_broadcaster().

## Function Documentation

## ◆ _x_close_broadcaster()

void _x_close_broadcaster | ( | broadcaster_t * | this_gen | ) |

References xine_stream_s::audio_fifo, audio_put_cb(), broadcaster_s::connections, broadcaster_s::lock, broadcaster_s::manager_thread, broadcaster_s::msock, NULL, broadcaster_s::running, broadcaster_s::stream, fifo_buffer_s::unregister_put_cb, xine_stream_s::video_fifo, video_put_cb(), xine_stream_s::xine, xine_list_delete(), xine_list_next_value(), XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by _x_init_broadcaster(), xine_dispose(), and xine_set_param().

## ◆ _x_get_broadcaster_port()

int _x_get_broadcaster_port | ( | broadcaster_t * | this_gen | ) |

References broadcaster_s::port.

Referenced by xine_get_param().

## ◆ _x_init_broadcaster()

broadcaster_t * _x_init_broadcaster | ( | xine_stream_t * | stream,
|  | int | port )

References _x_close_broadcaster(), xine_stream_s::audio_fifo, audio_put_cb(), manager_loop(), NULL, QLEN, fifo_buffer_s::register_put_cb, xine_stream_s::video_fifo, video_put_cb(), xine_stream_s::xine, xine_list_new(), xine_socket_cloexec(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_NONE, and xprintf.

Referenced by xine_set_param().

## ◆ audio_put_cb()

static void audio_put_cb | ( | fifo_buffer_t * | fifo,
|  | buf_element_t * | buf,
|  | void * | this_gen )
| static

References send_buf().

Referenced by _x_close_broadcaster(), and _x_init_broadcaster().

## ◆ broadcaster_data_write()

static void broadcaster_data_write | ( | broadcaster_t * | this,
|  | const void * | buf,
|  | int | len )
| static

References NULL, sock_data_write(), xine_list_next_value(), xine_list_remove(), XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by send_buf(), and XINE_FORMAT_PRINTF().

## ◆ manager_loop()

static void * manager_loop | ( | void * | this_gen | ) |
| static

References _x_set_socket_close_on_exec(), NULL, xine_list_push_back(), XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by _x_init_broadcaster().

## ◆ send_buf()

static void send_buf | ( | broadcaster_t * | this,
|  | const char * | from,
|  | buf_element_t * | buf )
| static

References broadcaster_data_write(), BUF_CONTROL_END, BUF_CONTROL_RESET_DECODER, BUF_NUM_DEC_INFO, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, buf_element_s::decoder_info_ptr, buf_element_s::disc_off, buf_element_s::pts, buf_element_s::size, and buf_element_s::type.

Referenced by audio_put_cb(), and video_put_cb().

## ◆ sock_check_opened()

static int sock_check_opened | ( | int | socket | ) |
| static

Referenced by sock_data_write().

## ◆ sock_data_write()

static int sock_data_write | ( | xine_t * | xine,
|  | int | socket,
|  | const void * | buf_gen,
|  | int | len )
| static

References NULL, sock_check_opened(), XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by broadcaster_data_write(), and XINE_FORMAT_PRINTF().

## ◆ video_put_cb()

static void video_put_cb | ( | fifo_buffer_t * | fifo,
|  | buf_element_t * | buf,
|  | void * | this_gen )
| static

References send_buf().

Referenced by _x_close_broadcaster(), and _x_init_broadcaster().

## ◆ XINE_FORMAT_PRINTF() [1/2]

static void XINE_FORMAT_PRINTF | ( | 2 | ,
|  | 3 | )
| static

References _BUFSIZ, and broadcaster_data_write().

## ◆ XINE_FORMAT_PRINTF() [2/2]

static int XINE_FORMAT_PRINTF | ( | 3 | ,
|  | 4 | )
| static

References _BUFSIZ, and sock_data_write().