123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #ifndef VIDEOCLOCK_H
- #define VIDEOCLOCK_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "videoutil.h"
- #include <stdarg.h>
- /**
- * video clock engine handler
- */
- typedef struct videoclock* videoclock_t;
- typedef void (*get_frame_cb)(void *get_user_data, video_frame *frame);
- typedef void (*put_frame_cb)(void *put_user_data, video_frame *frame);
- typedef void (*clockdbg_cb)(void* user_data, const char* fmt, va_list arg);
- /**
- * create a clock engine
- * @param fps_num frame per second number, use with fps_den
- * @param fps_den the actual frame per second is fps_num/fps_den
- * @param video_width the width of the video
- * @param video_height the height of the video
- * @param frame_format the pixel format of the video
- * @param put callback funtion that video clock used to push video frame
- * @param put_user_data user specify data pass to put_frame_cb
- * @param get callback funtion that video clock used to get a video frame
- * @param get_usre_data user specify data pass to get_user_data
- * @param p_clock return the created clock engine
- */
- int videoclock_create(int fps_num,
- int fps_den,
- int video_width,
- int video_height,
- int frame_format,
- put_frame_cb put,
- void *put_user_data,
- get_frame_cb get,
- void *get_user_data,
- videoclock_t *p_clock,
- volatile int*nFps,
- clockdbg_cb dbgfunc);
- /**
- * destroy the clock
- */
- void videoclock_destroy(videoclock_t vc);
- /**
- * start work, create a inner thread
- */
- int videoclock_start(videoclock_t vc);
- /**
- * stop work, destroy the inner thread
- */
- int videoclock_stop(videoclock_t vc);
- #ifdef __cplusplus
- }//extern "C" {
- #endif
- #endif // VIDEOCLOCK_H
|