![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <unistd.h>#include <stdlib.h>#include <string.h>#include <stdio.h>#include <array>#include <string>#include <memory>#include <sys/types.h>#include <sys/time.h>#include <sys/socket.h>#include <sys/un.h>#include <netinet/in.h>#include <cerrno>#include "ipc_frame_unix.h"
Go to the source code of this file.
Classes | |
| struct | Ipc_frame_reader |
| struct | Ipc_frame_writer |
Macros | |
| #define | CLOSESOCKET close |
| #define | INVALID_SOCKET -1 |
| #define | MSG_NOSIGNAL 0 |
| #define | UNLINK unlink |
Functions | |
| static size_t | blocking_read (fd_t fd, char *dst, size_t size) |
| static bool | do_frame_read (Ipc_frame_reader *reader, Ipc_frame *dst) |
| void | ipc_frame_reader_free (struct Ipc_frame_reader *reader) |
| bool | ipc_frame_reader_has_frame (struct Ipc_frame_reader *reader) |
| bool | ipc_frame_reader_is_connected (struct Ipc_frame_reader *reader) |
| Ipc_frame_reader * | ipc_frame_reader_new (const char *path) |
| bool | ipc_frame_reader_read (Ipc_frame_reader *reader, Ipc_frame *dst) |
| void | ipc_frame_reader_wait_connect (struct Ipc_frame_reader *reader) |
| void | ipc_frame_writer_free (struct Ipc_frame_writer *writer) |
| Ipc_frame_writer * | ipc_frame_writer_new (const char *path) |
| bool | ipc_frame_writer_write (struct Ipc_frame_writer *writer, const struct Ipc_frame *f) |
| static bool | socket_read_avail (fd_t fd) |
| static bool | try_accept (struct Ipc_frame_reader *reader) |
| #define CLOSESOCKET close |
Definition at line 15 of file ipc_frame_unix.cpp.
Referenced by ipc_frame_reader_free(), ipc_frame_reader_new(), ipc_frame_reader_read(), ipc_frame_writer_free(), and ipc_frame_writer_new().
| #define INVALID_SOCKET -1 |
Definition at line 16 of file ipc_frame_unix.cpp.
Referenced by ipc_frame_reader_free(), ipc_frame_reader_is_connected(), ipc_frame_reader_new(), ipc_frame_reader_read(), ipc_frame_reader_wait_connect(), ipc_frame_writer_free(), ipc_frame_writer_new(), and socket_read_avail().
| #define MSG_NOSIGNAL 0 |
Definition at line 31 of file ipc_frame_unix.cpp.
| #define UNLINK unlink |
Definition at line 17 of file ipc_frame_unix.cpp.
Referenced by ipc_frame_reader_free(), and ipc_frame_reader_new().
|
static |
Definition at line 103 of file ipc_frame_unix.cpp.
Referenced by do_frame_read().
|
static |
Definition at line 160 of file ipc_frame_unix.cpp.
References blocking_read(), Ipc_frame::data, Ipc_frame_reader::data_fd, Ipc_frame_header::data_len, Ipc_frame::header, IPC_FRAME_HEADER_LEN, ipc_frame_parse_header(), and ipc_frame_reserve().
Referenced by ipc_frame_reader_read().

| void ipc_frame_reader_free | ( | struct Ipc_frame_reader * | reader | ) |
Definition at line 92 of file ipc_frame_unix.cpp.
References CLOSESOCKET, Ipc_frame_reader::data_fd, INVALID_SOCKET, Ipc_frame_reader::listen_fd, Ipc_frame_reader::path, and UNLINK.
Referenced by Ipc_frame_reader_deleter::operator()().
| bool ipc_frame_reader_has_frame | ( | struct Ipc_frame_reader * | reader | ) |
Definition at line 142 of file ipc_frame_unix.cpp.
References Ipc_frame_reader::data_fd, ipc_frame_reader_is_connected(), and socket_read_avail().
Referenced by PreviewWidget::loadFrame().

| bool ipc_frame_reader_is_connected | ( | struct Ipc_frame_reader * | reader | ) |
Definition at line 149 of file ipc_frame_unix.cpp.
References Ipc_frame_reader::data_fd, INVALID_SOCKET, and try_accept().
Referenced by ipc_frame_reader_has_frame(), and PreviewWidget::loadFrame().

| Ipc_frame_reader * ipc_frame_reader_new | ( | const char * | path | ) |
Definition at line 59 of file ipc_frame_unix.cpp.
References CLOSESOCKET, INVALID_SOCKET, and UNLINK.
Referenced by main(), and PreviewWidget::setKey().
| bool ipc_frame_reader_read | ( | Ipc_frame_reader * | reader, |
| Ipc_frame * | dst ) |
Definition at line 177 of file ipc_frame_unix.cpp.
References CLOSESOCKET, Ipc_frame_reader::data_fd, do_frame_read(), and INVALID_SOCKET.
Referenced by PreviewWidget::loadFrame(), and main().

| void ipc_frame_reader_wait_connect | ( | struct Ipc_frame_reader * | reader | ) |
Definition at line 153 of file ipc_frame_unix.cpp.
References Ipc_frame_reader::data_fd, INVALID_SOCKET, and Ipc_frame_reader::listen_fd.
Referenced by main().
| void ipc_frame_writer_free | ( | struct Ipc_frame_writer * | writer | ) |
Definition at line 217 of file ipc_frame_unix.cpp.
References CLOSESOCKET, INVALID_SOCKET, and writer().
Referenced by Ipc_frame_writer_deleter::operator()().

| Ipc_frame_writer * ipc_frame_writer_new | ( | const char * | path | ) |
Definition at line 191 of file ipc_frame_unix.cpp.
References CLOSESOCKET, INVALID_SOCKET, and writer().
Referenced by display_unix_sock_init(), and worker().

| bool ipc_frame_writer_write | ( | struct Ipc_frame_writer * | writer, |
| const struct Ipc_frame * | f ) |
Definition at line 240 of file ipc_frame_unix.cpp.
References Ipc_frame::data, Ipc_frame_header::data_len, Ipc_frame::header, ipc_frame_write_header(), and writer().
Referenced by display_unix_sock_run(), and worker().

|
static |
Definition at line 117 of file ipc_frame_unix.cpp.
References INVALID_SOCKET.
Referenced by ipc_frame_reader_has_frame(), and try_accept().
|
static |
Definition at line 134 of file ipc_frame_unix.cpp.
References Ipc_frame_reader::data_fd, Ipc_frame_reader::listen_fd, and socket_read_avail().
Referenced by ipc_frame_reader_is_connected().
