#include <errno.h>
#include <stdarg.h>
#include "common.h"
#include "picture.h"
#include "data.h"
#include "version.h"
Go to the source code of this file.
◆ DAV1D_MAX_FRAME_THREADS
#define DAV1D_MAX_FRAME_THREADS 256 |
◆ DAV1D_MAX_POSTFILTER_THREADS
#define DAV1D_MAX_POSTFILTER_THREADS 256 |
◆ DAV1D_MAX_TILE_THREADS
#define DAV1D_MAX_TILE_THREADS 64 |
◆ Dav1dContext
◆ Dav1dRef
◆ Dav1dEventFlags
Enumerator |
---|
DAV1D_EVENT_FLAG_NEW_SEQUENCE | The last returned picture contains a reference to a new Sequence Header, either because it's the start of a new coded sequence, or the decoder was flushed before it was generated.
|
DAV1D_EVENT_FLAG_NEW_OP_PARAMS_INFO | The last returned picture contains a reference to a Sequence Header with new operating parameters information for the current coded sequence.
|
◆ dav1d_close()
Close a decoder instance and free all associated memory.
- Parameters
-
c_out | The decoder instance to close. *c_out will be set to NULL. |
◆ dav1d_default_settings()
Initialize settings to default values.
- Parameters
-
◆ dav1d_flush()
Flush all delayed frames in decoder and clear internal decoder state, to be used when seeking.
- Parameters
-
- Note
- Decoding will start only after a valid sequence header OBU is delivered to dav1d_send_data().
◆ dav1d_get_event_flags()
Fetch a combination of DAV1D_EVENT_FLAG_* event flags generated by the decoding process.
- Parameters
-
c | Input decoder instance. |
flags | Where to write the flags. |
- Returns
- 0 on success, or < 0 (a negative DAV1D_ERR code) on error.
- Note
- Calling this function will clear all the event flags currently stored in the decoder.
◆ dav1d_get_picture()
Return a decoded picture.
- Parameters
-
c | Input decoder instance. |
out | Output frame. The caller assumes ownership of the returned reference. |
- Returns
- 0: Success, and a frame is returned. DAV1D_ERR(EAGAIN): Not enough data to output a frame. dav1d_send_data() should be called with new input. other negative DAV1D_ERR codes: Error during decoding or because of invalid passed-in arguments.
- Note
- To drain buffered frames from the decoder (i.e. on end of stream), call this function until it returns DAV1D_ERR(EAGAIN).
int res;
read_data(&data);
do {
packet. It eventually will after one or more frames have been
returned in this loop.
free_and_abort();
if (res < 0) {
free_and_abort();
} else
output_and_unref_picture(&p);
}
while (data.
sz || read_data(&data) == SUCCESS);
do {
if (res < 0) {
free_and_abort();
} else
output_and_unref_picture(&p);
} while (res == 0);
#define DAV1D_ERR(e)
Definition: common.h:54
DAV1D_API int dav1d_get_picture(Dav1dContext *c, Dav1dPicture *out)
DAV1D_API int dav1d_send_data(Dav1dContext *c, Dav1dData *in)
size_t sz
data size
Definition: data.h:38
◆ dav1d_open()
Allocate and open a decoder instance.
- Parameters
-
c_out | The decoder instance to open. *c_out will be set to the allocated context. |
s | Input settings context. |
- Note
- The context must be freed using dav1d_close() when decoding is finished.
- Returns
- 0 on success, or < 0 (a negative DAV1D_ERR code) on error.
◆ dav1d_parse_sequence_header()
Parse a Sequence Header OBU from bitstream data.
- Parameters
-
out | Output Sequence Header. |
buf | The data to be parser. |
sz | Size of the data. |
- Returns
- 0 on success, or < 0 (a negative DAV1D_ERR code) on error.
- Note
- It is safe to feed this function data containing other OBUs than a Sequence Header, as they will simply be ignored. If there is more than one Sequence Header OBU present, only the last will be returned.
◆ dav1d_send_data()
Feed bitstream data to the decoder.
- Parameters
-
c | Input decoder instance. |
in | Input bitstream data. On success, ownership of the reference is passed to the library. |
- Returns
- 0: Success, and the data was consumed. DAV1D_ERR(EAGAIN): The data can't be consumed. dav1d_get_picture() should be called to get one or more frames before the function can consume new data. other negative DAV1D_ERR codes: Error during decoding or because of invalid passed-in arguments.
◆ dav1d_version()