Go to the documentation of this file.
21 #include <libsmbclient.h>
39 char *workgroup,
int workgroup_len,
40 char *username,
int username_len,
41 char *password,
int password_len)
51 libsmbc->
ctx = smbc_new_context();
57 if (!smbc_init_context(libsmbc->
ctx)) {
62 smbc_set_context(libsmbc->
ctx);
64 smbc_setOptionUserData(libsmbc->
ctx,
h);
68 smbc_setTimeout(libsmbc->
ctx, libsmbc->
timeout);
72 if (smbc_init(
NULL, 0) < 0) {
83 if (libsmbc->
fd >= 0) {
84 smbc_close(libsmbc->
fd);
88 smbc_free_context(libsmbc->
ctx, 1);
107 access = O_CREAT | O_RDWR;
111 access = O_CREAT | O_WRONLY;
118 if ((libsmbc->
fd = smbc_open(url, access, 0666)) < 0) {
124 if (smbc_fstat(libsmbc->
fd, &st) < 0)
148 if ((newpos = smbc_lseek(libsmbc->
fd,
pos, whence)) < 0) {
162 if ((bytes_read = smbc_read(libsmbc->
fd, buf,
size)) < 0) {
176 if ((bytes_written = smbc_write(libsmbc->
fd, buf,
size)) < 0) {
182 return bytes_written;
193 if ((libsmbc->
dh = smbc_opendir(
h->filename)) < 0) {
210 struct smbc_dirent *dirent =
NULL;
220 dirent = smbc_readdir(libsmbc->
dh);
225 switch (dirent->smbc_type) {
232 case SMBC_FILE_SHARE:
241 case SMBC_COMMS_SHARE:
243 case SMBC_PRINTER_SHARE:
251 }
while (skip_entry || !strcmp(dirent->name,
".") ||
252 !strcmp(dirent->name,
".."));
263 if (!smbc_stat(url, &st)) {
264 entry->group_id = st.st_gid;
265 entry->user_id = st.st_uid;
266 entry->size = st.st_size;
267 entry->filemode = st.st_mode & 0777;
268 entry->modification_timestamp = INT64_C(1000000) * st.st_mtime;
269 entry->access_timestamp = INT64_C(1000000) * st.st_atime;
270 entry->status_change_timestamp = INT64_C(1000000) * st.st_ctime;
281 if (libsmbc->
dh >= 0) {
282 smbc_closedir(libsmbc->
dh);
298 if ((libsmbc->
fd = smbc_open(
h->filename, O_WRONLY, 0666)) < 0) {
303 if (smbc_fstat(libsmbc->
fd, &st) < 0) {
308 smbc_close(libsmbc->
fd);
311 if (S_ISDIR(st.st_mode)) {
312 if (smbc_rmdir(
h->filename) < 0) {
317 if (smbc_unlink(
h->filename) < 0) {
350 #define OFFSET(x) offsetof(LIBSMBContext, x)
351 #define D AV_OPT_FLAG_DECODING_PARAM
352 #define E AV_OPT_FLAG_ENCODING_PARAM
354 {
"timeout",
"set timeout in ms of socket I/O operations",
OFFSET(timeout),
AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX,
D|
E },
#define AV_LOG_WARNING
Something somehow does not look correct.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int64_t libsmbc_seek(URLContext *h, int64_t pos, int whence)
char * filename
specified URL
#define URL_PROTOCOL_FLAG_NETWORK
#define AVERROR_EOF
End of file.
static const AVOption options[]
static av_cold void cleanup(FlashSV2Context *s)
#define AVSEEK_SIZE
ORing this as the "whence" parameter to a seek function causes it to return the filesize without seek...
FFmpeg hosted at Telepoint in bulgaria ns2 avcodec org Replica Name server(provided by an ffmpeg developer, hosted at Hetzner in germany) ns3.avcodec.org Replica Name server(provided by an ffmpeg developer
char * av_append_path_component(const char *path, const char *component)
Append path component to the existing path.
static int libsmbc_delete(URLContext *h)
static __device__ float trunc(float a)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int libsmbc_close(URLContext *h)
#define AVIO_FLAG_WRITE
write-only
static av_cold int libsmbc_open(URLContext *h, const char *url, int flags)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const URLProtocol ff_libsmbclient_protocol
const char * av_default_item_name(void *ptr)
Return the context name.
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)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Describes single entry of the directory.
static int libsmbc_open_dir(URLContext *h)
static int libsmbc_close_dir(URLContext *h)
static const AVClass libsmbclient_context_class
AVIODirEntry * ff_alloc_dir_entry(void)
Allocate directory entry with default values.
static int libsmbc_move(URLContext *h_src, URLContext *h_dst)
static int libsmbc_read_dir(URLContext *h, AVIODirEntry **next)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AVIO_FLAG_READ
read-only
char * av_strdup(const char *s)
Duplicate a string.
static av_cold int libsmbc_connect(URLContext *h)
static int libsmbc_read(URLContext *h, unsigned char *buf, int size)
#define flags(name, subs,...)
@ 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...
static int libsmbc_write(URLContext *h, const unsigned char *buf, int size)