FFmpeg
Data Structures | Macros | Functions | Variables
tls_gnutls.c File Reference
#include <errno.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include "avformat.h"
#include "network.h"
#include "os_support.h"
#include "url.h"
#include "tls.h"
#include "libavutil/opt.h"
#include "libavutil/thread.h"

Go to the source code of this file.

Data Structures

struct  TLSContext
 

Macros

#define GNUTLS_VERSION_NUMBER   LIBGNUTLS_VERSION_NUMBER
 

Functions

void ff_gnutls_init (void)
 
void ff_gnutls_deinit (void)
 
static int print_tls_error (URLContext *h, int ret)
 
static int tls_close (URLContext *h)
 
static ssize_t gnutls_url_pull (gnutls_transport_ptr_t transport, void *buf, size_t len)
 
static ssize_t gnutls_url_push (gnutls_transport_ptr_t transport, const void *buf, size_t len)
 
static int tls_open (URLContext *h, const char *uri, int flags, AVDictionary **options)
 
static int tls_read (URLContext *h, uint8_t *buf, int size)
 
static int tls_write (URLContext *h, const uint8_t *buf, int size)
 
static int tls_get_file_handle (URLContext *h)
 
static int tls_get_short_seek (URLContext *h)
 

Variables

static AVMutex gnutls_mutex = AV_MUTEX_INITIALIZER
 
static const AVOption options []
 
static const AVClass tls_class
 
const URLProtocol ff_tls_protocol
 

Macro Definition Documentation

◆ GNUTLS_VERSION_NUMBER

#define GNUTLS_VERSION_NUMBER   LIBGNUTLS_VERSION_NUMBER

Definition at line 36 of file tls_gnutls.c.

Function Documentation

◆ ff_gnutls_init()

void ff_gnutls_init ( void  )

Definition at line 55 of file tls_gnutls.c.

Referenced by ff_tls_init(), and tls_open().

◆ ff_gnutls_deinit()

void ff_gnutls_deinit ( void  )

Definition at line 66 of file tls_gnutls.c.

Referenced by ff_tls_deinit(), and tls_close().

◆ print_tls_error()

static int print_tls_error ( URLContext h,
int  ret 
)
static

Definition at line 73 of file tls_gnutls.c.

Referenced by tls_open(), tls_read(), and tls_write().

◆ tls_close()

static int tls_close ( URLContext h)
static

Definition at line 100 of file tls_gnutls.c.

Referenced by ff_tls_close(), and tls_open().

◆ gnutls_url_pull()

static ssize_t gnutls_url_pull ( gnutls_transport_ptr_t  transport,
void *  buf,
size_t  len 
)
static

Definition at line 114 of file tls_gnutls.c.

Referenced by tls_open().

◆ gnutls_url_push()

static ssize_t gnutls_url_push ( gnutls_transport_ptr_t  transport,
const void *  buf,
size_t  len 
)
static

Definition at line 132 of file tls_gnutls.c.

Referenced by tls_open().

◆ tls_open()

static int tls_open ( URLContext h,
const char *  uri,
int  flags,
AVDictionary **  options 
)
static

Definition at line 150 of file tls_gnutls.c.

◆ tls_read()

static int tls_read ( URLContext h,
uint8_t *  buf,
int  size 
)
static

Definition at line 246 of file tls_gnutls.c.

Referenced by ff_tls_read().

◆ tls_write()

static int tls_write ( URLContext h,
const uint8_t *  buf,
int  size 
)
static

Definition at line 261 of file tls_gnutls.c.

Referenced by ff_tls_write().

◆ tls_get_file_handle()

static int tls_get_file_handle ( URLContext h)
static

Definition at line 276 of file tls_gnutls.c.

◆ tls_get_short_seek()

static int tls_get_short_seek ( URLContext h)
static

Definition at line 282 of file tls_gnutls.c.

Variable Documentation

◆ gnutls_mutex

AVMutex gnutls_mutex = AV_MUTEX_INITIALIZER
static

Definition at line 53 of file tls_gnutls.c.

Referenced by ff_gnutls_deinit(), and ff_gnutls_init().

◆ options

const AVOption options[]
static
Initial value:
= {
{ NULL }
}

Definition at line 288 of file tls_gnutls.c.

◆ tls_class

const AVClass tls_class
static
Initial value:
= {
.class_name = "tls",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 293 of file tls_gnutls.c.

◆ ff_tls_protocol

const URLProtocol ff_tls_protocol
Initial value:
= {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
.url_write = tls_write,
.url_close = tls_close,
.url_get_file_handle = tls_get_file_handle,
.url_get_short_seek = tls_get_short_seek,
.priv_data_size = sizeof(TLSContext),
.priv_data_class = &tls_class,
}

Definition at line 300 of file tls_gnutls.c.

TLSContext
Definition: tls_gnutls.c:44
URL_PROTOCOL_FLAG_NETWORK
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:33
tls_class
static const AVClass tls_class
Definition: tls_gnutls.c:293
tls_write
static int tls_write(URLContext *h, const uint8_t *buf, int size)
Definition: tls_gnutls.c:261
TLS_COMMON_OPTIONS
#define TLS_COMMON_OPTIONS(pstruct, options_field)
Definition: tls.h:46
tls_open
static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
Definition: tls_gnutls.c:150
tls_close
static int tls_close(URLContext *h)
Definition: tls_gnutls.c:100
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
tls_get_file_handle
static int tls_get_file_handle(URLContext *h)
Definition: tls_gnutls.c:276
tls_get_short_seek
static int tls_get_short_seek(URLContext *h)
Definition: tls_gnutls.c:282
options
static const AVOption options[]
Definition: tls_gnutls.c:288
tls_read
static int tls_read(URLContext *h, uint8_t *buf, int size)
Definition: tls_gnutls.c:246
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482