23 #include "libavutil/aes.h"
24 #include "libavutil/avstring.h"
25 #include "libavutil/opt.h"
29 #define MAX_BUFFER_BLOCKS 150
47 #define OFFSET(x) offsetof(CryptoContext, x)
48 #define D AV_OPT_FLAG_DECODING_PARAM
64 const char *nested_url;
111 memcpy(buf, c->
outptr, size);
168 .priv_data_class = &crypto_class,
static int crypto_close(URLContext *h)
int is_streamed
true if streamed (no seek possible), default = false
AVIOInterruptCB interrupt_callback
static int crypto_read(URLContext *h, uint8_t *buf, int size)
void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
Encrypt or decrypt a buffer using a previously initialized context.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static const AVOption options[]
uint8_t inbuffer[BLOCKSIZE *MAX_BUFFER_BLOCKS]
URLProtocol ff_crypto_protocol
uint8_t outbuffer[BLOCKSIZE *MAX_BUFFER_BLOCKS]
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
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 AVERROR_EOF
End of file.
#define MAX_BUFFER_BLOCKS
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define URL_PROTOCOL_FLAG_NESTED_SCHEME
static const AVClass crypto_class
offset must point to a pointer immediately followed by an int for the length
static int crypto_open(URLContext *h, const char *uri, int flags)
int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt)
Initialize an AVAES context.
Describe the class of an AVClass context structure.
int ffurl_close(URLContext *h)
Close the resource accessed by the URLContext h, and free the memory used by it.
struct AVAES * av_aes_alloc(void)
Allocate an AVAES context.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
int ffurl_open(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create an URLContext for accessing to the resource indicated by url, and open it. ...
unbuffered private I/O API
av_default_item_name
Return the context name.
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf...