|
HVD
HVD Hardware Video Decoder library
|
Data Structures | |
| struct | hvd_config |
| Decoder configuration. More... | |
| struct | hvd_packet |
| Encoded data packet. More... | |
| struct | hvd |
| Internal library data passed around by the user. More... | |
Enumerations | |
| enum | hvd_retval_enum { HVD_AGAIN =AVERROR(EAGAIN), HVD_ERROR =-1, HVD_OK =0 } |
| Constants returned by most of library functions. More... | |
Functions | |
| struct hvd * | hvd_init (const struct hvd_config *config) |
| Initialize internal library data. More... | |
| void | hvd_close (struct hvd *h) |
| Free library resources. More... | |
| int | hvd_send_packet (struct hvd *h, struct hvd_packet *packet) |
| Send packet to hardware for decoding. More... | |
| AVFrame * | hvd_receive_frame (struct hvd *h, int *error) |
| Retrieve decoded frame data from hardware. More... | |
| enum hvd_retval_enum |
| void hvd_close | ( | struct hvd * | h | ) |
Free library resources.
Cleans and frees library memory.
| h | pointer to internal library data |
| struct hvd* hvd_init | ( | const struct hvd_config * | config | ) |
Initialize internal library data.
| config | decoder configuration |
| AVFrame* hvd_receive_frame | ( | struct hvd * | h, |
| int * | error | ||
| ) |
Retrieve decoded frame data from hardware.
Keep calling this functions after hvd_send_packet until NULL is returned. The ownership of returned FFmpeg AVFrame remains with the library:
| h | pointer to internal library data |
| error | pointer to error code |
Example (in decoding loop):
| int hvd_send_packet | ( | struct hvd * | h, |
| struct hvd_packet * | packet | ||
| ) |
Send packet to hardware for decoding.
Pass data in hvd_packet for decoding. Follow with hvd_receive_frame to get decoded data from hardware.
If you have simple loop like:
HVD_AGAIN return value will never happen. If you are sending lots of data and not reading you may get HVD_AGAIN when buffers are full.
When you are done with decoding call with:
After flushing and reading last frames you can follow with decoding new stream.
Perfomance hints:
| h | pointer to internal library data |
| packet | data to decode |
Example flushing: