video_decoder.h 781 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef API_VIDEO_CODECS_VIDEO_DECODER_H_
  2. #define API_VIDEO_CODECS_VIDEO_DECODER_H_
  3. #include "../videoutil.h"
  4. #include "video_encoder_defines.h"
  5. typedef struct _DecoderConfig{
  6. int width;
  7. int height;
  8. int color_space; //VIDEO_FORMAT_I420 or VIDEO_FORMAT_RGB24
  9. int decode_id; //ffmpeg decoder enum
  10. }DecoderConfig;
  11. typedef struct _DecoderedFrame{
  12. video_frame *frame;
  13. int key_frame;
  14. }DecoderedFrame;
  15. typedef struct _VideoDecoder VideoDecoder;
  16. VideoDecoder *video_decoder_open(const DecoderConfig *config, VideoCodingLogCallBack *log_func);
  17. video_frame *video_decoder_process(VideoDecoder *obj, unsigned char *input_packet,
  18. int length, int *remain_length, int *key_frame);
  19. void video_decoder_close(VideoDecoder *obj);
  20. #endif // API_VIDEO_CODECS_VIDEO_ENCODER_H_