decoder.h 642 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __DECODER_H__
  2. #define __DECODER_H__
  3. #include <stdint.h>
  4. typedef struct Decoder Decoder;
  5. typedef struct {
  6. int fd;
  7. int width;
  8. int height;
  9. int hor_stride;
  10. int ver_stride;
  11. int idx;
  12. int64_t pts;
  13. } DecodedFrame;
  14. Decoder *decoder_create(const char *url, int timeout_sec);
  15. void decoder_destroy(Decoder *dec);
  16. int decoder_get_codec(Decoder *dec);
  17. int decoder_get_width(Decoder *dec);
  18. int decoder_get_height(Decoder *dec);
  19. int decoder_get_stride(Decoder *dec);
  20. int decoder_get_frame(Decoder *dec, DecodedFrame *frame);
  21. int decoder_release_frame(Decoder *dec, int idx);
  22. int decoder_flush(Decoder *dec);
  23. #endif