FFmpeg
Loading...
Searching...
No Matches
libsmbclient.c File Reference
#include <libsmbclient.h>
#include <string.h>
#include "libavutil/avstring.h"
#include "libavutil/error.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "url.h"

Go to the source code of this file.

Data Structures

struct  LIBSMBContext
 

Macros

#define OFFSET(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)
Value:

Definition at line 352 of file libsmbclient.c.

◆ D

Definition at line 353 of file libsmbclient.c.

◆ E

Definition at line 354 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 40 of file libsmbclient.c.

Referenced by libsmbc_connect().

◆ libsmbc_connect()

static av_cold int libsmbc_connect ( URLContext * h)
static

Definition at line 49 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 96 of file libsmbclient.c.

◆ libsmbc_seek()

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

Definition at line 137 of file libsmbclient.c.

◆ libsmbc_read()

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

Definition at line 159 of file libsmbclient.c.

◆ libsmbc_write()

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

Definition at line 173 of file libsmbclient.c.

◆ libsmbc_open_dir()

static int libsmbc_open_dir ( URLContext * h)
static

Definition at line 187 of file libsmbclient.c.

◆ libsmbc_read_dir()

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

Definition at line 208 of file libsmbclient.c.

◆ libsmbc_close_dir()

static int libsmbc_close_dir ( URLContext * h)
static

Definition at line 280 of file libsmbclient.c.

◆ libsmbc_delete()

static int libsmbc_delete ( URLContext * h)
static

Definition at line 291 of file libsmbclient.c.

◆ libsmbc_move()

static int libsmbc_move ( URLContext * h_src,
URLContext * h_dst )
static

Definition at line 332 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}
}
#define E
Definition avdct.c:34
#define D
Definition avdct.c:35
#define NULL
Definition coverity.c:32
static __device__ float trunc(float a)
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275

Definition at line 355 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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 362 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,
}
#define flags(name, subs,...)
Definition cbs_h264.c:74
static int libsmbc_read(URLContext *h, unsigned char *buf, int size)
static int libsmbc_move(URLContext *h_src, URLContext *h_dst)
static av_cold int libsmbc_close(URLContext *h)
static av_cold int libsmbc_open(URLContext *h, const char *url, int flags)
static int libsmbc_delete(URLContext *h)
static int64_t libsmbc_seek(URLContext *h, int64_t pos, int whence)
static int libsmbc_open_dir(URLContext *h)
static int libsmbc_write(URLContext *h, const unsigned char *buf, int size)
static const AVClass libsmbclient_context_class
static int libsmbc_close_dir(URLContext *h)
static int libsmbc_read_dir(URLContext *h, AVIODirEntry **next)
#define URL_PROTOCOL_FLAG_NETWORK
Definition url.h:33

Definition at line 369 of file libsmbclient.c.