initial commit

This commit is contained in:
2025-08-05 15:53:44 +08:00
commit 09dc02ae52
553 changed files with 137665 additions and 0 deletions

67
mw/media/mw_video.c Executable file
View File

@@ -0,0 +1,67 @@
/*************************************************
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);
}