FFmpeg
Data Structures | Macros | Functions | Variables
libsmbclient.c File Reference
#include <libsmbclient.h>
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
#include "url.h"

Go to the source code of this file.

Data Structures

struct  LIBSMBContext
 

Macros

#define OFFSET(x)   offsetof(LIBSMBContext, x)
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static void libsmbc_get_auth_data (SMBCCTX *c, const char *server, const char *share, char *workgroup, int workgroup_len, char *username, int username_len, char *password, int password_len)
 
static av_cold int libsmbc_connect (URLContext *h)
 
static av_cold int libsmbc_close (URLContext *h)
 
static av_cold int libsmbc_open (URLContext *h, const char *url, int flags)
 
static int64_t libsmbc_seek (URLContext *h, int64_t pos, int whence)
 
static int libsmbc_read (URLContext *h, unsigned char *buf, int size)
 
static int libsmbc_write (URLContext *h, const unsigned char *buf, int size)
 
static int libsmbc_open_dir (URLContext *h)
 
static int libsmbc_read_dir (URLContext *h, AVIODirEntry **next)
 
static int libsmbc_close_dir (URLContext *h)
 
static int libsmbc_delete (URLContext *h)
 
static int libsmbc_move (URLContext *h_src, URLContext *h_dst)
 

Variables

static const AVOption options []
 
static const AVClass libsmbclient_context_class
 
const URLProtocol ff_libsmbclient_protocol
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(LIBSMBContext, x)

Definition at line 351 of file libsmbclient.c.

◆ D

Definition at line 352 of file libsmbclient.c.

◆ E

Definition at line 353 of file libsmbclient.c.

Function Documentation

◆ libsmbc_get_auth_data()

static void libsmbc_get_auth_data ( SMBCCTX *  c,
const char *  server,
const char *  share,
char *  workgroup,
int  workgroup_len,
char *  username,
int  username_len,
char *  password,
int  password_len 
)
static

Definition at line 39 of file libsmbclient.c.

Referenced by libsmbc_connect().

◆ libsmbc_connect()

static av_cold int libsmbc_connect ( URLContext h)
static

Definition at line 48 of file libsmbclient.c.

Referenced by libsmbc_delete(), libsmbc_move(), libsmbc_open(), and libsmbc_open_dir().

◆ libsmbc_close()

static av_cold int libsmbc_close ( URLContext h)
static

◆ libsmbc_open()

static av_cold int libsmbc_open ( URLContext h,
const char *  url,
int  flags 
)
static

Definition at line 95 of file libsmbclient.c.

◆ libsmbc_seek()

static int64_t libsmbc_seek ( URLContext h,
int64_t  pos,
int  whence 
)
static

Definition at line 136 of file libsmbclient.c.

◆ libsmbc_read()

static int libsmbc_read ( URLContext h,
unsigned char *  buf,
int  size 
)
static

Definition at line 158 of file libsmbclient.c.

◆ libsmbc_write()

static int libsmbc_write ( URLContext h,
const unsigned char *  buf,
int  size 
)
static

Definition at line 172 of file libsmbclient.c.

◆ libsmbc_open_dir()

static int libsmbc_open_dir ( URLContext h)
static

Definition at line 186 of file libsmbclient.c.

◆ libsmbc_read_dir()

static int libsmbc_read_dir ( URLContext h,
AVIODirEntry **  next 
)
static

Definition at line 207 of file libsmbclient.c.

◆ libsmbc_close_dir()

static int libsmbc_close_dir ( URLContext h)
static

Definition at line 279 of file libsmbclient.c.

◆ libsmbc_delete()

static int libsmbc_delete ( URLContext h)
static

Definition at line 290 of file libsmbclient.c.

◆ libsmbc_move()

static int libsmbc_move ( URLContext h_src,
URLContext h_dst 
)
static

Definition at line 331 of file libsmbclient.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{"timeout", "set timeout in ms of socket I/O operations", OFFSET(timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
{"truncate", "truncate existing files on write", OFFSET(trunc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E },
{"workgroup", "set the workgroup used for making connections", OFFSET(workgroup), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
{NULL}
}

Definition at line 354 of file libsmbclient.c.

◆ libsmbclient_context_class

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

Definition at line 361 of file libsmbclient.c.

◆ ff_libsmbclient_protocol

const URLProtocol ff_libsmbclient_protocol
Initial value:
= {
.name = "smb",
.url_open = libsmbc_open,
.url_read = libsmbc_read,
.url_write = libsmbc_write,
.url_seek = libsmbc_seek,
.url_close = libsmbc_close,
.url_delete = libsmbc_delete,
.url_move = libsmbc_move,
.url_open_dir = libsmbc_open_dir,
.url_read_dir = libsmbc_read_dir,
.url_close_dir = libsmbc_close_dir,
.priv_data_size = sizeof(LIBSMBContext),
.priv_data_class = &libsmbclient_context_class,
}

Definition at line 368 of file libsmbclient.c.

libsmbc_seek
static int64_t libsmbc_seek(URLContext *h, int64_t pos, int whence)
Definition: libsmbclient.c:136
URL_PROTOCOL_FLAG_NETWORK
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34
options
static const AVOption options[]
Definition: libsmbclient.c:354
libsmbc_delete
static int libsmbc_delete(URLContext *h)
Definition: libsmbclient.c:290
trunc
static __device__ float trunc(float a)
Definition: cuda_runtime.h:179
libsmbc_close
static av_cold int libsmbc_close(URLContext *h)
Definition: libsmbclient.c:81
D
#define D
Definition: libsmbclient.c:352
libsmbc_open
static av_cold int libsmbc_open(URLContext *h, const char *url, int flags)
Definition: libsmbclient.c:95
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:235
libsmbc_open_dir
static int libsmbc_open_dir(URLContext *h)
Definition: libsmbclient.c:186
libsmbc_close_dir
static int libsmbc_close_dir(URLContext *h)
Definition: libsmbclient.c:279
libsmbclient_context_class
static const AVClass libsmbclient_context_class
Definition: libsmbclient.c:361
OFFSET
#define OFFSET(x)
Definition: libsmbclient.c:351
libsmbc_move
static int libsmbc_move(URLContext *h_src, URLContext *h_dst)
Definition: libsmbclient.c:331
libsmbc_read_dir
static int libsmbc_read_dir(URLContext *h, AVIODirEntry **next)
Definition: libsmbclient.c:207
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
E
#define E
Definition: libsmbclient.c:353
libsmbc_read
static int libsmbc_read(URLContext *h, unsigned char *buf, int size)
Definition: libsmbclient.c:158
LIBSMBContext
Definition: libsmbclient.c:28
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228
libsmbc_write
static int libsmbc_write(URLContext *h, const unsigned char *buf, int size)
Definition: libsmbclient.c:172