This structure describes the bitrate properties of an encoded bitstream. It
roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD
parameters for H.264/HEVC.
Describe the class of an AVClass context structure. That is an
arbitrary struct of which the first field is a pointer to an
AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
main external API structure.
New fields can be added to the end with minor version bumps.
Removal, reordering and changes to existing fields require a major
version bump.
You can use AVOptions (av_opt* / av_set/get*()) to access these fields from user
applications.
The name string for AVOptions options matches the associated command line
parameter name and can be found in libavcodec/options_table.h
The AVOption/command line parameter names differ in some cases from the C
structure field names for historic reasons or brevity.
sizeof(AVCodecContext) must not be used outside libav*.
A link between two filters. This contains pointers to the source and
destination filters between which this link exists, and the indexes of
the pads involved. In addition, this link also contains the parameters
which have been negotiated and agreed upon between the filter, such as
image dimensions, format, etc.
Format I/O context.
New fields can be added to the end with minor version bumps.
Removal, reordering and changes to existing fields require a major
version bump.
sizeof(AVFormatContext) must not be used outside libav*, use
avformat_alloc_context() to create an AVFormatContext.
This struct aggregates all the (hardware/vendor-specific) “high-level” state,
i.e. state that is not tied to a concrete processing configuration.
E.g., in an API that supports hardware-accelerated encoding and decoding,
this struct will (if possible) wrap the state that is common to both encoding
and decoding and from which specific instances of encoders or decoders can be
derived.
This struct describes the constraints on hardware frames attached to
a given device with a hardware-specific configuration. This is returned
by av_hwdevice_get_hwframe_constraints() and must be freed by
av_hwframe_constraints_free() after use.
This struct describes a set or pool of “hardware” frames (i.e. those with
data not located in normal system memory). All the frames in the pool are
assumed to be allocated in the same way and interchangeable.
@example ffhash.c
This example is a simple command line application that takes one or more
arguments. It demonstrates a typical use of the hashing API with allocation,
initialization, updating, and finalizing.
Bytestream IO Context.
New public fields can be added with minor version bumps.
Removal, reordering and changes to existing public fields require
a major version bump.
sizeof(AVIOContext) must not be used outside libav*.
Callback for checking whether to abort blocking functions.
AVERROR_EXIT is returned in this case by the interrupted
function. During blocking operations, callback is called with
opaque as parameter. If the callback returns 1, the
blocking operation will be aborted.
Context structure for the Lagged Fibonacci PRNG.
The exact layout, types and content of this struct may change and should
not be accessed directly. Only its sizeof() is guaranteed to stay the same
to allow easy instanciation.
@defgroup avoptions AVOptions
@ingroup lavu_data
@{
AVOptions provide a generic system to declare options on arbitrary structs
(“objects”). An option can have a help text, a type and a range of possible
values. Options may then be enumerated, read and written to.
This structure stores compressed data. It is typically exported by demuxers
and then passed as input to decoders, or received as output from encoders and
then passed to muxers.
This structure stores auxiliary information for decoding, presenting, or
otherwise processing the coded stream. It is typically exported by demuxers
and encoders and can be fed to decoders and muxers either in a per packet
basis, or as global side data (applying to the entire coded stream).
Descriptor that unambiguously describes how the bits of a pixel are
stored in the up to 4 data planes of an image. It also stores the
subsampling factors and number of components.
This structure supplies correlation between a packet timestamp and a wall clock
production time. The definition follows the Producer Reference Time (‘prft’)
as defined in ISO/IEC 14496-12
New fields can be added to the end with minor version bumps.
Removal, reordering and changes to existing fields require a major
version bump.
sizeof(AVProgram) must not be used outside libav*.
ReplayGain information (see
http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
The size of this struct is a part of the public ABI.
Stream structure.
New fields can be added to the end with minor version bumps.
Removal, reordering and changes to existing fields require a major
version bump.
sizeof(AVStream) must not be used outside libav*.
Read data and append it to the current content of the AVPacket.
If pkt->size is 0 this is identical to av_get_packet.
Note that this uses av_grow_packet and thus involves a realloc
which is inefficient. Thus this function should only be used
when there is no reasonable way to know (an upper bound of)
the final size.
Append path component to the existing path.
Path separator ‘/’ is placed between when needed.
Resulting string have to be freed with av_free().
@param path base path
@param component component to be appended
@return new path or NULL on error.
Print arguments following specified format into a large enough auto
allocated buffer. It is similar to GNU asprintf().
@param fmt printf-compatible format string, specifying how the
following parameters are used.
@return the allocated string
@note You have to free the string yourself with av_free().
Thread safe basename.
@param path the string to parse, on DOS both \ and / are considered separators.
@return pointer to the basename substring.
If path does not contain a slash, the function returns a copy of path.
If path is a NULL pointer or points to an empty string, a pointer
to a string “.” is returned.
@return 1 if the caller may write to the data referred to by buf (which is
true if and only if buf is the only reference to the underlying AVBuffer).
Return 0 otherwise.
A positive answer is valid until av_buffer_ref() is called on buf.
Mark the pool as being available for freeing. It will actually be freed only
once all the allocated buffers associated with the pool are released. Thus it
is safe to call this function while some of the allocated buffers are still
in use.
Same as av_buffersink_get_frame(), but with the ability to specify the number
of samples read. This function is less efficient than
av_buffersink_get_frame(), because it copies the data around.
Initialize the buffersrc or abuffersrc filter with the provided parameters.
This function may be called multiple times, the later calls override the
previous ones. Some of the parameters may also be set through AVOptions, then
whatever method is used last takes precedence.
Get a human-readable string describing the channel layout properties.
The string will be in the same format that is accepted by
@ref av_channel_layout_from_string(), allowing to rebuild the same
channel layout, except for opaque pointers.
Get the index in a channel layout of a channel described by the given string.
In case multiple channels are found, only the first match will be returned.
Calculate the CRC of a block.
@param ctx initialized AVCRC array (see av_crc_init())
@param crc CRC of previous blocks if any or initial value for CRC
@param buffer buffer whose CRC to calculate
@param length length of the buffer
@return CRC updated with the data from the given block
Initialize a CRC table.
@param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
@param le If 1, the lowest bit represents the coefficient for the highest
exponent of the corresponding polynomial (both for poly and
actual CRC).
If 0, you must swap the CRC parameter and the result of av_crc
if you need the standard representation (can be simplified in
most cases to e.g. bswap16):
av_bswap32(crc << (32-bits))
@param bits number of bits for the CRC
@param poly generator polynomial without the x**bits coefficient, in the
representation as specified by le
@param ctx_size size of ctx in bytes
@return <0 on failure
Thread safe dirname.
@param path the string to parse, on DOS both \ and / are considered separators.
@return A pointer to a string that’s the parent directory of path.
If path is a NULL pointer or points to an empty string, a pointer
to a string “.” is returned.
@note the function may modify the contents of the path, so copies should be passed.
@param disposition a combination of AV_DISPOSITION_* values
@return The string description corresponding to the lowest set bit in
disposition. NULL when the lowest set bit does not correspond
to a known disposition or when disposition is 0.
Print detailed information about the input or output format, such as
duration, bitrate, streams, container, programs, metadata, side data,
codec and time base.
Do a complex FFT with the parameters defined in av_fft_init(). The
input data must be permuted before. No 1.0/sqrt(n) normalization is done.
@deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation
Set up a complex FFT.
@param nbits log2 of the length of the input array
@param inverse if 0 perform the forward transform, if 1 perform the inverse
@deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT
Initialize an AVFifoBuffer.
@param nmemb number of elements
@param size size of the single element
@return AVFifoBuffer or NULL in case of memory allocation failure
@deprecated use av_fifo_alloc2()
Feed data from an AVFifoBuffer to a user-supplied callback.
Similar as av_fifo_gereric_read but without discarding data.
@param f AVFifoBuffer to read from
@param buf_size number of bytes to read
@param func generic read function
@param dest data destination
Feed data at specific position from an AVFifoBuffer to a user-supplied callback.
Similar as av_fifo_gereric_read but without discarding data.
@param f AVFifoBuffer to read from
@param offset offset from current read position
@param buf_size number of bytes to read
@param func generic read function
@param dest data destination
Feed data from an AVFifoBuffer to a user-supplied callback.
@param f AVFifoBuffer to read from
@param buf_size number of bytes to read
@param func generic read function
@param dest data destination
Feed data from a user-supplied callback to an AVFifoBuffer.
@param f AVFifoBuffer to write to
@param src data source; non-const since it may be used as a
modifiable context by the function defined in func
@param size number of bytes to write
@param func generic write function; the first parameter is src,
the second is dest_buf, the third is dest_buf_size.
func must return the number of bytes written to dest_buf, or <= 0 to
indicate no more data available to write.
If func is NULL, src is interpreted as a simple byte array for source data.
@return the number of bytes written to the FIFO or a negative error code on failure
Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
@param f AVFifoBuffer to reset
@deprecated use av_fifo_reset2() with the new AVFifo-API
Return the amount of data in bytes in the AVFifoBuffer, that is the
amount of data you can read from it.
@param f AVFifoBuffer to read from
@return size
@deprecated use av_fifo_can_read() with the new AVFifo-API
Return the amount of space in bytes in the AVFifoBuffer, that is the
amount of data you can write into it.
@param f AVFifoBuffer to write into
@return size
@deprecated use av_fifo_can_write() with the new AVFifo-API
Read the file with name filename, and put its content in a newly
allocated buffer or map it with mmap() when available.
In case of success set *bufptr to the read or mmapped buffer, and
*size to the size in bytes of the buffer in *bufptr.
Unlike mmap this function succeeds with zero sized files, in this
case *bufptr will be set to NULL and *size will be set to 0.
The returned buffer must be released with av_file_unmap().
Compute what kind of losses will occur when converting from one specific
pixel format to another.
When converting from one pixel format to another, information loss may occur.
For example, when converting from RGB24 to GRAY, the color information will
be lost. Similarly, other losses occur when converting from some formats to
other formats. These losses can involve loss of chroma, but also loss of
resolution, loss of color depth, loss due to the color space conversion, loss
of the alpha bits or loss due to color quantization.
av_get_fix_fmt_loss() informs you about the various types of losses
which will occur when converting from one pixel format to another.
Find the “best” stream in the file.
The best stream is determined according to various heuristics as the most
likely to be what the user expects.
If the decoder parameter is non-NULL, av_find_best_stream will find the
default decoder for the stream’s codec; streams for which no decoder can
be found are ignored.
Open a file using a UTF-8 filename.
The API of this function matches POSIX fopen(), errors are returned through
errno.
@deprecated Avoid using it, as on Windows, the FILE* allocated by this
function may be allocated with a different CRT than the caller
who uses the FILE*. No replacement provided in public API.
Crop the given video AVFrame according to its crop_left/crop_top/crop_right/
crop_bottom fields. If cropping is successful, the function will adjust the
data pointers and the width/height fields, and set the crop fields to 0.
Ensure the destination frame refers to the same data described by the source
frame, either by creating a new reference for each AVBufferRef from src if
they differ from those in dst, by allocating new buffers and copying data if
src is not reference counted, or by unrefencing it if src is empty.
Return the planar<->packed alternative form of the given sample format, or
AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the
requested planar/packed format, the format returned is the same as the
input.
Return the flags which specify extensions supported by the CPU.
The returned value is affected by av_force_cpu_flags() if that was used
before. So av_get_cpu_flags() can easily be used in an application to
detect the enabled cpu flags.
Get timing information for the data currently output.
The exact meaning of “currently output” depends on the format.
It is mostly relevant for devices that have an internal buffer and/or
work in real time.
@param s media file handle
@param stream stream in the media file
@param[out] dts DTS of the last packet output for the stream, in stream
time_base units
@param[out] wall absolute time when that packet whas output,
in microsecond
@retval 0 Success
@retval AVERROR(ENOSYS) The format does not support it
Compute what kind of losses will occur when converting from one specific
pixel format to another.
When converting from one pixel format to another, information loss may occur.
For example, when converting from RGB24 to GRAY, the color information will
be lost. Similarly, other losses occur when converting from some formats to
other formats. These losses can involve loss of chroma, but also loss of
resolution, loss of color depth, loss due to the color space conversion, loss
of the alpha bits or loss due to color quantization.
av_get_fix_fmt_loss() informs you about the various types of losses
which will occur when converting from one pixel format to another.
Get a seed to use in conjunction with random functions.
This function tries to provide a good seed at a best effort bases.
Its possible to call this function multiple times if more bits are needed.
It can be quite slow, which is why it should only be used as seed for a faster
PRNG. The quality of the seed depends on the platform.
Get the current time in microseconds since some unspecified starting point.
On platforms that support it, the time comes from a monotonic clock
This property makes this time source ideal for measuring relative time.
The returned values may not be monotonic on platforms where a monotonic
clock is not available.
Hash an array of data with a key.
@param ctx The HMAC context
@param data The data to hash
@param len The length of the data, in bytes
@param key The authentication key
@param keylen The length of the key, in bytes
@param out The output buffer to write the digest into
@param outlen The length of the out buffer, in bytes
@return The number of bytes written to out, or a negative error code.
Finish hashing and output the HMAC digest.
@param ctx The HMAC context
@param out The output buffer to write the digest into
@param outlen The length of the out buffer, in bytes
@return The number of bytes written to out, or a negative error code.
Initialize an AVHMAC context with an authentication key.
@param ctx The HMAC context
@param key The authentication key
@param keylen The length of the key, in bytes
Finalize the device context before use. This function must be called after
the context is filled with all the required information and before it is
used in any way.
Get the constraints on HW frames given a device and the HW-specific
configuration to be used with that device. If no HW-specific
configuration is provided, returns the maximum possible capabilities
of the device.
Allocate a HW-specific configuration structure for a given HW device.
After use, the user must free all members as required by the specific
hardware structure being used, then free the structure itself with
av_free().
Finalize the context before use. This function must be called after the
context is filled with all the required information and before it is attached
to any frames.
Allocate an image with size w and h and pixel format pix_fmt, and
fill pointers and linesizes accordingly.
The allocated image buffer has to be freed by using
av_freep(&pointers[0]).
Check if the given dimension of an image is valid, meaning that all
bytes of a plane of an image with the specified pix_fmt can be addressed
with a signed int.
Copy image plane from src to dst.
That is, copy “height” number of lines of “bytewidth” bytes each.
The first byte of each successive line is separated by *_linesize
bytes.
Copy image data located in uncacheable (e.g. GPU mapped) memory. Where
available, this function will use special functionality for reading from such
memory, which may result in greatly improved performance compared to plain
av_image_copy_plane().
Copy image data located in uncacheable (e.g. GPU mapped) memory. Where
available, this function will use special functionality for reading from such
memory, which may result in greatly improved performance compared to plain
av_image_copy().
Overwrite the image data with black. This is suitable for filling a
sub-rectangle of an image, meaning the padding between the right most pixel
and the left most pixel on the next line will not be overwritten. For some
formats, the image size might be rounded up due to inherent alignment.
Send the specified message to the log if the level is less than or equal
to the current av_log_level. By default, all logging messages are sent to
stderr. This behavior can be altered by setting a different logging callback
function.
@see av_log_set_callback
Format a line of log the same way as the default callback.
@param line buffer to receive the formatted line
@param line_size size of the buffer
@param print_prefix used to store whether the prefix must be printed;
must point to a persistent integer initially set to 1
Format a line of log the same way as the default callback.
@param line buffer to receive the formatted line;
may be NULL if line_size is 0
@param line_size size of the buffer; at most line_size-1 characters will
be written to the buffer, plus one null terminator
@param print_prefix used to store whether the prefix must be printed;
must point to a persistent integer initially set to 1
@return Returns a negative value if an error occurred, otherwise returns
the number of characters that would have been written for a
sufficiently large buffer, not including the terminating null
character. If the return value is not less than line_size, it means
that the log message was truncated to fit the buffer.
Send the specified message to the log once with the initial_level and then with
the subsequent_level. By default, all logging messages are sent to
stderr. This behavior can be altered by setting a different logging callback
function.
@see av_log
@brief Decodes LZO 1x compressed data.
@param out output buffer
@param outlen size of output buffer, number of bytes left are returned here
@param in input buffer
@param inlen size of input buffer, number of bytes left are returned here
@return 0 on success, otherwise a combination of the error flags above
Allocate a memory block with alignment suitable for all memory accesses
(including vectors if available on the CPU) and zero all the bytes of the
block.
Match instances of a name in a comma-separated list of names.
List entries are checked from the start to the end of the names list,
the first match ends further processing. If an entry prefixed with ‘-’
matches, then 0 is returned. The “ALL” list entry is considered to
match all names.
@defgroup opt_eval_funcs Evaluating option strings
@{
This group of functions can be used to evaluate option strings
and get numbers out of them. They do the same thing as av_opt_set(),
except the result is written into the caller-supplied pointer.
@}
/
/**
Gets a pointer to the requested field in a struct.
This function allows accessing a struct even when its fields are moved or
renamed since the application making the access has been compiled,
Set the values of all AVOption fields to their default values. Only these
AVOption fields for which (opt->flags & mask) == flags will have their
default applied to s.
Convert valid timing fields (timestamps / durations) in a packet from one
timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be
ignored.
Probe a bytestream to determine the input format. Each time a probe returns
with a score that is too low, the probe buffer size is increased and another
attempt is made. When the maximum probe size is reached, the input format
with the highest score is returned.
Return the next frame of a stream.
This function returns what is stored in the file, and does not validate
that what is there are valid frames for the decoder. It will split what is
stored in the file into frames and return one for each call. It will not
omit invalid data between valid frames so as to give the decoder the maximum
information possible for decoding.
Allocate a samples buffer for nb_samples samples, and fill data pointers and
linesize accordingly.
The allocated samples buffer can be freed by using av_freep(&audio_data[0])
Allocated data will be initialized to silence.
Parse the key/value pairs list in opts. For each key/value pair
found, stores the value in the field in ctx that is named like the
key. ctx must be an AVClass context, storing is done using
AVOptions.
Put a description of the AVERROR code errnum in errbuf.
In case of failure the global variable errno is set to indicate the
error. Even in case of failure av_strerror() will print a generic
error message indicating the errnum provided to errbuf.
Locate the first case-independent occurrence in the string haystack
of the string needle. A zero-length string needle is considered to
match at the start of haystack.
Append output to a string, according to a format. Never write out of
the destination buffer, and always put a terminating 0 within
the buffer.
@param dst destination buffer (string to which the output is
appended)
@param size total size of the destination buffer
@param fmt printf-compatible format string, specifying how the
following parameters are used
@return the length of the string that would have been generated
if enough space had been available
Locate the first occurrence of the string needle in the string haystack
where not more than hay_length characters are searched. A zero-length
string needle is considered to match at the start of haystack.
Parse the string in numstr and return its value as a double. If
the string is empty, contains only whitespaces, or does not contain
an initial substring that has the expected syntax for a
floating-point number, no conversion is performed. In this case,
returns a value of zero and the value returned in tail is the value
of numstr.
Wrapper to work around the lack of mkstemp() on mingw.
Also, tries to create file in /tmp first, if possible.
*prefix can be a character constant; *filename will be allocated internally.
@return file descriptor of opened file (or negative value corresponding to an
AVERROR code on error)
and opened file name in **filename.
@note On very old libcs it is necessary to set a secure umask before
calling this, av_tempfile() can’t call umask itself as it is used in
libraries and could interfere with the calling application.
@deprecated as fd numbers cannot be passed saftely between libs on some platforms
Return an informative version string. This usually is the actual release
version number or a git commit description. This string has no fixed format
and can change any time. It should never be parsed by code.
Send the specified message to the log if the level is less than or equal
to the current av_log_level. By default, all logging messages are sent to
stderr. This behavior can be altered by setting a different logging callback
function.
@see av_log_set_callback
Modify width and height values so that they will result in a memory
buffer that is acceptable for the codec if you also ensure that all
line sizes are a multiple of the respective linesize_align[i].
Decode a subtitle message.
Return a negative value on error, otherwise return the number of bytes used.
If no subtitle could be decompressed, got_sub_ptr is zero.
Otherwise, the subtitle is stored in *sub.
Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for
simplicity, because the performance difference is expected to be negligible
and reusing a get_buffer written for video codecs would probably perform badly
due to a potentially very different allocation pattern.
The default callback for AVCodecContext.get_buffer2(). It is made public so
it can be called by custom get_buffer2() implementations for decoders without
AV_CODEC_CAP_DR1 set.
The default callback for AVCodecContext.get_encode_buffer(). It is made public so
it can be called by custom get_encode_buffer() implementations for encoders without
AV_CODEC_CAP_DR1 set.
Find the best pixel format to convert to given a certain source pixel
format. When converting from one pixel format to another, information loss
may occur. For example, when converting from RGB24 to GRAY, the color
information will be lost. Similarly, other losses occur when converting from
some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of
the given pixel formats should be used to suffer the least amount of loss.
The pixel formats from which it chooses one, are determined by the
pix_fmt_list parameter.
Create and return a AVHWFramesContext with values adequate for hardware
decoding. This is meant to get called from the get_format callback, and is
a helper for preparing a AVHWFramesContext for AVCodecContext.hw_frames_ctx.
This API is for decoding with certain hardware acceleration modes/APIs only.
Allocate a new AVCodecParameters and set its fields to default values
(unknown/invalid/0). The returned struct must be freed with
avcodec_parameters_free().
Copy the contents of src to dst. Any allocated fields in dst are freed and
replaced with newly allocated duplicates of the corresponding fields in src.
Fill the parameters struct based on the values from the supplied codec
context. Any allocated fields in par are freed and replaced with duplicates
of the corresponding fields in codec.
Fill the codec context based on the values from the supplied codec
parameters. Any allocated fields in codec that have a corresponding field in
par are freed and replaced with duplicates of the corresponding field in par.
Fields in codec that do not have a counterpart in par are not touched.
Create and add a filter instance into an existing graph.
The filter instance is created from the filter filt and inited
with the parameter args. opaque is currently ignored.
Allocate an AVFormatContext for an output format.
avformat_free_context() can be used to free the context and
everything allocated by the framework within it.
Read packets of a media file to get stream information. This
is useful for file formats with no headers such as MPEG. This
function also computes the real framerate in case of MPEG-2 repeat
frame mode.
The logical file position is not changed by this function;
examined packets may be buffered for later processing.
Discard all internally buffered data. This can be useful when dealing with
discontinuities in the byte stream. Generally works only with formats that
can resync. This includes headerless formats like MPEG-TS/TS but should also
work with NUT, Ogg and in a limited way AVI for example.
@defgroup riff_fourcc RIFF FourCCs
@{
Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are
meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the
following code:
@code
uint32_t tag = MKTAG(‘H’, ‘2’, ‘6’, ‘4’);
const struct AVCodecTag table[] = { avformat_get_riff_video_tags(), 0 };
enum AVCodecID id = av_codec_get_id(table, tag);
@endcode
/
/*
@return the table mapping RIFF FourCCs for video to libavcodec AVCodecID.
Allocate the stream private data and initialize the codec, but do not write the header.
May optionally be used before avformat_write_header() to initialize stream parameters
before actually writing the header.
If using this function, do not pass the same options to avformat_write_header().
Seek to timestamp ts.
Seeking will be done so that the point from which all active streams
can be presented successfully will be closest to ts and within min/max_ts.
Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
Accept and allocate a client context on a server context.
@param s the server context
@param c the client context, must be unallocated
@return >= 0 on success or a negative value corresponding
to an AVERROR on failure
Return AVIO_FLAG_* access flags corresponding to the access permissions
of the resource in url, or a negative value corresponding to an
AVERROR code in case of failure. The returned access flags are
masked by the value in flags.
Return the written size and a pointer to the buffer. The buffer
must be freed with av_free().
Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
Close the resource accessed by the AVIOContext *s, free it
and set the pointer pointing to it to NULL.
This function can only be used if s was opened by avio_open().
Return the written size and a pointer to the buffer.
The AVIOContext stream is left intact.
The buffer must NOT be freed.
No padding is added to the buffer.
Read a string from pb into buf. The reading will terminate when either
a NULL character was encountered, maxlen bytes have been read, or nothing
more can be read from pb. The result is guaranteed to be NULL-terminated, it
will be truncated if buf is too small.
Note that the string is not interpreted or validated in any way, it
might get truncated in the middle of a sequence for multi-byte encodings.
Read a UTF-16 string from pb and convert it to UTF-8.
The reading will terminate when either a null or invalid character was
encountered or maxlen bytes have been read.
@return number of bytes read (is always <= maxlen)
Perform one step of the protocol handshake to accept a new client.
This function must be called on a client returned by avio_accept() before
using it as a read/write context.
It is separate from avio_accept() because it may block.
A step of the handshake is defined by places where the application may
decide to change the proceedings.
For example, on a protocol with a request header and a reply header, each
one can constitute a step because the application may use the parameters
from the request to change parameters in the reply; or each individual
chunk of the request can constitute a step.
If the handshake is already finished, avio_handshake() does nothing and
returns 0 immediately.
Create and initialize a AVIOContext for accessing the
resource indicated by url.
@note When the resource indicated by url has been opened in
read+write mode, the AVIOContext can be used only for writing.
Create and initialize a AVIOContext for accessing the
resource indicated by url.
@note When the resource indicated by url has been opened in
read+write mode, the AVIOContext can be used only for writing.
Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed
to read fewer bytes than requested. The missing bytes can be read in the next
call. This always tries to read at least 1 byte.
Useful to reduce latency in certain cases.
@return number of bytes read or AVERROR
Find an upper bound on the number of samples that the next swr_convert
call will output, if called with in_samples of input samples. This
depends on the internal state, and anything changing the internal state
(like further swr_convert() calls) will may change the number of samples
swr_get_out_samples() returns for the same number of input samples.
Allocate an empty SwsContext. This must be filled and passed to
sws_init_context(). For filling see AVOptions, options.c and
sws_setColorspaceDetails().
Finish the scaling process for a pair of source/destination frames previously
submitted with sws_frame_start(). Must be called after all sws_send_slice()
and sws_receive_slice() calls are done, before any new sws_frame_start()
calls.
Initialize the scaling process for a given pair of source/destination frames.
Must be called before any calls to sws_send_slice() and sws_receive_slice().
Indicate that a horizontal slice of input data is available in the source
frame previously provided to sws_frame_start(). The slices may be provided in
any order, but may not overlap. For vertically subsampled pixel formats, the
slices must be aligned according to subsampling.
@param c the scaling context
@param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg)
@param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg)
@param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x]
@param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x]
@param brightness 16.16 fixed point brightness correction
@param contrast 16.16 fixed point contrast correction
@param saturation 16.16 fixed point saturation correction
Callback for writing or reading from a FIFO, passed to (and invoked from) the
av_fifo_cb() functions. It may be invoked multiple times from a single
av_fifo_cb() call and may process less data than the maximum size indicated
by nb_elems.