Go to the documentation of this file.
21 #include <libsmbclient.h>
38 char *workgroup,
int workgroup_len,
39 char *username,
int username_len,
40 char *password,
int password_len)
50 libsmbc->
ctx = smbc_new_context();
56 if (!smbc_init_context(libsmbc->
ctx)) {
61 smbc_set_context(libsmbc->
ctx);
63 smbc_setOptionUserData(libsmbc->
ctx,
h);
67 smbc_setTimeout(libsmbc->
ctx, libsmbc->
timeout);
71 if (smbc_init(
NULL, 0) < 0) {
82 if (libsmbc->
fd >= 0) {
83 smbc_close(libsmbc->
fd);
87 smbc_free_context(libsmbc->
ctx, 1);
106 access = O_CREAT | O_RDWR;
110 access = O_CREAT | O_WRONLY;
117 if ((libsmbc->
fd = smbc_open(url, access, 0666)) < 0) {
123 if (smbc_fstat(libsmbc->
fd, &st) < 0)
147 if ((newpos = smbc_lseek(libsmbc->
fd,
pos, whence)) < 0) {
161 if ((bytes_read = smbc_read(libsmbc->
fd, buf,
size)) < 0) {
175 if ((bytes_written = smbc_write(libsmbc->
fd, buf,
size)) < 0) {
181 return bytes_written;
192 if ((libsmbc->
dh = smbc_opendir(
h->filename)) < 0) {
209 struct smbc_dirent *dirent =
NULL;
219 dirent = smbc_readdir(libsmbc->
dh);
224 switch (dirent->smbc_type) {
231 case SMBC_FILE_SHARE:
240 case SMBC_COMMS_SHARE:
242 case SMBC_PRINTER_SHARE:
250 }
while (skip_entry || !strcmp(dirent->name,
".") ||
251 !strcmp(dirent->name,
".."));
262 if (!smbc_stat(url, &st)) {
263 entry->group_id = st.st_gid;
264 entry->user_id = st.st_uid;
265 entry->size = st.st_size;
266 entry->filemode = st.st_mode & 0777;
267 entry->modification_timestamp = INT64_C(1000000) * st.st_mtime;
268 entry->access_timestamp = INT64_C(1000000) * st.st_atime;
269 entry->status_change_timestamp = INT64_C(1000000) * st.st_ctime;
280 if (libsmbc->
dh >= 0) {
281 smbc_closedir(libsmbc->
dh);
297 if ((libsmbc->
fd = smbc_open(
h->filename, O_WRONLY, 0666)) < 0) {
302 if (smbc_fstat(libsmbc->
fd, &st) < 0) {
307 smbc_close(libsmbc->
fd);
310 if (S_ISDIR(st.st_mode)) {
311 if (smbc_rmdir(
h->filename) < 0) {
316 if (smbc_unlink(
h->filename) < 0) {
349 #define OFFSET(x) offsetof(LIBSMBContext, x)
350 #define D AV_OPT_FLAG_DECODING_PARAM
351 #define E AV_OPT_FLAG_ENCODING_PARAM
353 {
"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...
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...
#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,...)
static int libsmbc_write(URLContext *h, const unsigned char *buf, int size)