fusion/mw/media/mw_video.c

68 lines
1.8 KiB
C
Raw Permalink Normal View History

2025-08-05 07:53:44 +00:00
/*************************************************
File name : mw_video.c
Module :
Author : amir
Version : 0.1
Created on : 2024-09-07
Description :
Modify History:
1. Date: Author: Modification:
*************************************************/
#include "mw_video.h"
/**
* Video_OpenStream
* uint32_t video_openstream(STREAM_CHANNEL Stream, int32_t Channel)
*
* STREAM_CHANNEL Stream,
VIDEO_FORMAT Format,
int32_t Channel,
*
* , uint32_t代码值
* 0
* 0 ,
*/
uint32_t video_openstream(HAL_SENSOR_IDX idx, hal_video_frame_callback cb, HAL_STREAM_CHANNEL stream_chn, const video_attr_st attr)
{
uint32_t ret = hal_video_init(idx);
return ret|hal_video_openstream(idx, cb, stream_chn, attr);
}
/**
* Video_CloseStream
* uint32_t video_close(STREAM_CHANNEL Stream, int32_t Channel)
*
* STREAM_CHANNEL Stream,
VIDEO_FORMAT Format,
int32_t Channel,
*
* , uint32_t代码值
* 0
* 0 ,
*/
uint32_t video_close(hal_video_frame_callback cb)
{
return hal_video_closestream(cb);
}
static uint32_t video_frame_cb(video_frame * frame){
hlogi("%s frame:%p", __func__, frame);
hv_msleep(2000);
return OK;
}
void mw_video_test(){
video_attr_st attr;
video_openstream(0, video_frame_cb, 0, attr);
hv_sleep(2);
video_close(video_frame_cb);
}