MediaProcessors
|
#include "comm.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "log.h"
#include "stat_codes.h"
#include "check_utils.h"
#include "llist.h"
#include "uri_parser.h"
Go to the source code of this file.
Classes | |
struct | comm_module_ctx_s |
Macros | |
#define | TAG_IS(TAG) (strcmp(tag, TAG)== 0) |
Typedefs | |
typedef struct comm_module_ctx_s | comm_module_ctx_t |
Functions | |
static int | register_comm_if (const comm_if_t *comm_if, log_ctx_t *log_ctx) |
static int | unregister_comm_if (const char *scheme, log_ctx_t *log_ctx) |
static const comm_if_t * | get_comm_if_by_scheme (const char *scheme, log_ctx_t *log_ctx) |
static comm_if_t * | comm_if_allocate () |
static comm_if_t * | comm_if_dup (const comm_if_t *comm_if_arg) |
static void | comm_if_release (comm_if_t **ref_comm_if) |
static int | comm_module_url_probe (const char *url) |
int | comm_module_open (log_ctx_t *log_ctx) |
void | comm_module_close () |
int | comm_module_opt (const char *tag,...) |
comm_ctx_t * | comm_open (const char *url, const char *local_url, comm_mode_t comm_mode, log_ctx_t *log_ctx,...) |
void | comm_close (comm_ctx_t **ref_comm_ctx) |
int | comm_send (comm_ctx_t *comm_ctx, const void *buf, size_t count, struct timeval *timeout) |
int | comm_recv (comm_ctx_t *comm_ctx, void **ref_buf, size_t *ref_count, char **ref_from, struct timeval *timeout) |
int | comm_unblock (comm_ctx_t *comm_ctx) |
int | comm_open_external (pthread_mutex_t *comm_ctx_mutex_external, const char *url, const char *local_url, comm_mode_t comm_mode, log_ctx_t *log_ctx, comm_ctx_t **ref_comm_ctx,...) |
void | comm_close_external (pthread_mutex_t *comm_ctx_mutex_external, comm_ctx_t **ref_comm_ctx, log_ctx_t *log_ctx) |
int | comm_reset_external (pthread_mutex_t *comm_ctx_mutex_external, const char *new_url, const char *local_url, comm_mode_t comm_mode, log_ctx_t *log_ctx, comm_ctx_t **ref_comm_ctx_curr,...) |
int | comm_recv_external (pthread_mutex_t *comm_ctx_mutex_external, comm_ctx_t **ref_comm_ctx, void **ref_buf, size_t *ref_count, char **ref_from, struct timeval *timeout, log_ctx_t *log_ctx) |
Variables | |
static comm_module_ctx_t * | comm_module_ctx = NULL |
Definition in file comm.c.
#define TAG_IS | ( | TAG | ) | (strcmp(tag, TAG)== 0) |
typedef struct comm_module_ctx_s comm_module_ctx_t |
Module's context structure. This structure is statically defined in the program.
void comm_module_close | ( | ) |
int comm_module_open | ( | log_ctx_t * | log_ctx | ) |
Open communication module. This is a global function and should be called only once at the very beginning and during the life of the application.
log_ctx | Pointer to a externally defined LOG module context structure. |
int comm_module_opt | ( | const char * | tag, |
... | |||
) |
Communication module options. This function represents the API of the communication module. This function is thread-safe and can be called concurrently.
tag | Option tag, namely, option identifier string. The following options are available:
|
... | Variable list of parameters according to selected option. Refer to Tags description below to see the different additional parameters corresponding to each option tag. |
comm_if | Pointer to the protocol interface structure (static and unambiguous interface implementation of the type 'comm_if_t'). Code example: |
scheme | Pointer to a character string with the unambiguous protocol scheme name (for example: "udp", "file", ...). Code example: |
|
static |