http://blog.sina.com.cn/s/blog_7a77356b0100u1sf.html
给 vlc sdk 添加录像接口
先用 libvlc_video_take_snapshot 搜索 vlc1.0.0,在几处相同的地方增加类似的新接口 libvlc_video_bool_record,接口实现就应该在 src/control/video.c 中,具体内容如下:
void libvlc_video_bool_record (libvlc_media_player_t *p_mi, const char *psz_filepath, unsigned int i_width, unsigned int i_height, libvlc_exception_t *p_e) { input_thread_t *p_vin; vout_thread_t *p_vout; bool b_recording; char *psz_path; if (!psz_filepath) { libvlc_exception_raise (p_e, "filepath is null"); return; } if (!p_mi->p_input_thread) { libvlc_exception_raise (p_e, "Input does not exist"); return; } p_vout = GetVout (p_mi, p_e); p_vin = libvlc_get_input_thread (p_mi, p_e); psz_path = var_CreateGetString (p_vin, "input-record-path"); var_SetString (p_vin, "input-record-path", "d:\\"); b_recording = var_GetBool (p_vin, "record"); var_SetBool (p_vin, "record", !b_recording); vlc_object_release (p_vin); vlc_object_release (p_vout); } |