vp_engine.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef H_VP_ENGINE
  2. #define H_VP_ENGINE
  3. #include <stream.h>
  4. #include <jpeg_hal.h>
  5. typedef struct
  6. {
  7. char video[8];
  8. unsigned int frame_rate;
  9. unsigned int width;
  10. unsigned int height;
  11. unsigned int video_bitrate;
  12. unsigned int vtotal_time;
  13. }ve_video_info_t;
  14. typedef struct
  15. {
  16. char audio[8];
  17. unsigned int sample_rate;
  18. unsigned int audio_bitrate;
  19. unsigned int channels;
  20. unsigned int atotal_time;
  21. }ve_audio_info_t;
  22. typedef struct
  23. {
  24. ve_video_info_t video_info;
  25. ve_audio_info_t audio_info;
  26. int index_flag;
  27. }ve_media_info_t;
  28. typedef enum{
  29. GET_CONT_INFO,
  30. FAST_FORWORD,
  31. FAST_BACK,
  32. SEEK_TIME,
  33. }seek_cmd_t;
  34. typedef struct
  35. {
  36. seek_cmd_t seek_cmd;
  37. unsigned int curpos;
  38. unsigned int curframes;
  39. unsigned int curtime;
  40. unsigned char *searchbuf;
  41. }seek_info_t;
  42. typedef struct{
  43. int w;
  44. int h;
  45. }image_para_t;
  46. typedef enum{
  47. VIDEO_ES = 0,
  48. AUDIO_ES,
  49. UNKOWN_ES,
  50. }packet_type_t;
  51. typedef struct
  52. {
  53. unsigned char *data;
  54. unsigned int data_len;
  55. io_stream_t file_stream;
  56. image_para_t src_para;
  57. image_para_t out_para;
  58. short *outbuf;
  59. }av_buf_t;
  60. typedef struct
  61. {
  62. packet_type_t packet_type;
  63. unsigned int pts;
  64. unsigned char *data;
  65. unsigned int data_len;
  66. }demuxer_packet_t;
  67. typedef enum{
  68. FRAME_NORMAL,
  69. FRAME_END,
  70. FRAME_ERROR,
  71. }frame_status_t;
  72. typedef struct
  73. {
  74. av_buf_t av_dec_buf;
  75. frame_status_t status;
  76. packet_type_t packet_type;
  77. unsigned int pts;
  78. }frame_info_t;
  79. typedef struct
  80. {
  81. char file_extension[8];
  82. void *(*open)(io_stream_t stream, ve_media_info_t *file_info);
  83. int (*seek)(void *vp_handle, seek_info_t *seek_info);
  84. int (*getframe)(void *vp_handle, demuxer_packet_t *packet_buf);
  85. int (*dispose)(void *vp_handle);
  86. }demuxer_plugin_t;
  87. typedef struct
  88. {
  89. char file_extension[8];
  90. void *(*open)(void *arg);
  91. int (*decode)(void *vp_handle, av_buf_t *av_buf);
  92. int (*dispose)(void *vp_handle);
  93. }dec_plugin_t;
  94. demuxer_plugin_t * avi_api(void);
  95. dec_plugin_t * mjpeg_api(void);
  96. dec_plugin_t *adpcm_api(void);
  97. #endif