Video Source is the image source of IMP system, it can set some functions such as setting the image resolution, cropping, scaling and other properties as well as the back-end noise reduction function.
More...
|
int | IMP_FrameSource_CreateChn (int chnNum, IMPFSChnAttr *chn_attr) |
| Create a frame channel. More...
|
|
int | IMP_FrameSource_DestroyChn (int chnNum) |
| Destroy the selected frame channel. More...
|
|
int | IMP_FrameSource_EnableChn (int chnNum) |
| Enable the selected frame channel. More...
|
|
int | IMP_FrameSource_DisableChn (int chnNum) |
| Disable the selected frame channel. More...
|
|
int | IMP_FrameSource_GetChnAttr (int chnNum, IMPFSChnAttr *chnAttr) |
| Obtains the frame channel attribute. More...
|
|
int | IMP_FrameSource_SetChnAttr (int chnNum, const IMPFSChnAttr *chnAttr) |
| Sets the frame channel attribute. More...
|
|
int | IMP_FrameSource_SetFrameDepth (int chnNum, int depth) |
| Sets the maximum space(depth) for the images. More...
|
|
int | IMP_FrameSource_GetFrameDepth (int chnNum, int *depth) |
| Obtains the depth of Frame FIFO. More...
|
|
int | IMP_FrameSource_GetFrame (int chnNum, IMPFrameInfo **frame) |
| Obtained image. More...
|
|
int | IMP_FrameSource_GetTimedFrame (int chnNum, IMPFrameTimestamp *framets, int block, void *framedata, IMPFrameInfo *frame) |
| Obtained image with specified time. More...
|
|
int | IMP_FrameSource_ReleaseFrame (int chnNum, IMPFrameInfo *frame) |
| Release the frame. More...
|
|
int | IMP_FrameSource_SnapFrame (int chnNum, IMPPixelFormat fmt, int width, int height, void *framedata, IMPFrameInfo *frame) |
| Get frames. More...
|
|
int | IMP_FrameSource_SetMaxDelay (int chnNum, int maxcnt) |
| Set max frame delay. More...
|
|
int | IMP_FrameSource_GetMaxDelay (int chnNum, int *maxcnt) |
| Get max frame delay. More...
|
|
int | IMP_FrameSource_SetDelay (int chnNum, int cnt) |
| Set frame delay. More...
|
|
int | IMP_FrameSource_GetDelay (int chnNum, int *cnt) |
| Get frame delay. More...
|
|
int | IMP_FrameSource_SetChnFifoAttr (int chnNum, IMPFSChnFifoAttr *attr) |
| set channel's largest cache FIFO attribute More...
|
|
int | IMP_FrameSource_GetChnFifoAttr (int chnNum, IMPFSChnFifoAttr *attr) |
| Get channel maximum caches FIFO attribute. More...
|
|
Video Source is the image source of IMP system, it can set some functions such as setting the image resolution, cropping, scaling and other properties as well as the back-end noise reduction function.
FrameSource is a data flow related to the concept, you can set the image resolution, format, etc., and provide the original image to the back-end.
The scheme of FrameSource is as follow:
According to this image above, FrameSource has 3 outputs, all of them can be used for encoding *Channel 0 : High clear video stream *Channel 1 : Standard clear video stream, or IVS can only do the algorithm of data source *Channel 2 : Expands the channel, is is used in special applications, it is not recommended to use it. Note: The video that frame channel-1 output maybe used to encode and analyse.
The example of FrameSource's operating instruction is below(example: two channels as output)
if (ret < 0) {
printf("FrameSource_CreateChn(0) error\n");
goto createchn_err;
}
if (ret < 0) {
printf("EnableChn(0) error\n";
return enablechn_err;
}
if (ret < 0) {
printf("FrameSource_DisableChn(0) error\n");
return disablechn_err;
}
if (ret < 0) {
printf("FrameSource_DestroyChn error\n");
return destorychn_err;
}
There are more examples in the content of Samples.
Channel FIFO Type.
Enumerator |
---|
FIFO_CACHE_PRIORITY |
FIFO caches first,then output data.
|
FIFO_DATA_PRIORITY |
FIFO output data first, then caches.
|
Enumerator |
---|
FS_PHY_CHANNEL |
physics frame channel
|
FS_EXT_CHANNEL |
virtual frame channel
|
int IMP_FrameSource_CreateChn |
( |
int |
chnNum, |
|
|
IMPFSChnAttr * |
chnAttr |
|
) |
| |
Create a frame channel.
- Parameters
-
[in] | chnNum | Id of frame channel |
[in] | chnAttr | the pointer of the frame channel's attribute |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- none.
IMP_FrameSource_DestroyChn |
( |
int |
chnNum | ) |
|
Destroy the selected frame channel.
- Parameters
-
[in] | chnNum | Id of frame channel |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- If the channel has been enabled (IMP_FrameSource_EnableChn), please disable it (IMP_FrameSource_DisableChn) before calling the current function.
int IMP_FrameSource_DisableChn |
( |
int |
chnNum | ) |
|
Disable the selected frame channel.
- Parameters
-
[in] | chnNum | Id of frame channel |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- none
int IMP_FrameSource_EnableChn |
( |
int |
chnNum | ) |
|
Enable the selected frame channel.
- Parameters
-
[in] | chnNum | Id of frame channel |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- Before calling the function, the frame channel has to been created.
int IMP_FrameSource_GetChnAttr |
( |
int |
chnNum, |
|
|
IMPFSChnAttr * |
chnAttr |
|
) |
| |
Obtains the frame channel attribute.
- Parameters
-
[in] | chnNum | Id of frame channel |
[out] | chnAttr | Pointer of the channel's attribute. |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- none
Get channel maximum caches FIFO attribute.
- Parameters
-
[in] | chnNum | Channel ID |
[out] | attr | FIFO attribute. |
- Return values
-
0 | means success |
other | values means failure,its value is an error code |
- Attention
- Use it after calling IMP_FrameSource_CreateChn.
IMP_FrameSource_GetDelay |
( |
int |
chnNum, |
|
|
int * |
cnt |
|
) |
| |
Get frame delay.
- Parameters
-
[in] | chnNum | ID of frame channel |
[out] | cnt | frame delay |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- Before calling the function, the frame channel has to been created.
IMP_FrameSource_GetFrame |
( |
int |
chnNum, |
|
|
IMPFrameInfo ** |
frame |
|
) |
| |
Obtained image.
- Parameters
-
[in] | chnNum | Id of frame channel |
[out] | frame | Pointer of the frame information. |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
1.This interface can obtain the video image information of the specified channel. The image information mainly includes: the width of the image, the height, the pixel format and the image data starting address.
2.This interface will be valid only after the channel has been enabled.
3.It supports multiple access after release, but it is recommended to access and release the right interface for use.
4.The default timeout for this interface is 2S, that means after 2S without receiving any images the will be a timeout.
- Attention
- none.
IMP_FrameSource_GetFrameDepth |
( |
int |
chnNum, |
|
|
int * |
depth |
|
) |
| |
Obtains the depth of Frame FIFO.
- Parameters
-
[in] | chnNum | Id of frame channel |
[out] | depth | Pointer of the depth value. |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- none.
IMP_FrameSource_GetMaxDelay |
( |
int |
chnNum, |
|
|
int * |
maxcnt |
|
) |
| |
Get max frame delay.
- Parameters
-
[in] | chnNum | ID of frame channel |
[out] | maxcnt | max frame delay |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- Before calling the function, the frame channel has to been created.
Obtained image with specified time.
- Parameters
-
[in] | chnNum | Id of frame channel |
[in] | framets | Time info |
[in] | block | block info |
[in] | framedata | Mem porinter used to store image |
[in] | frame | Image info |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
1.This interface can obtain the video image with certain time information of the specified channel. The image information mainly includes: the width of the image, the height, the pixel format and the image data starting address.
2.This interface will be valid only after the channel has been enabled.
3.Before this interface, IMP_FrameSource_SetMaxDelay and IMP_FrameSource_SetDelay should be used。
- Attention
- 无.
IMP_FrameSource_ReleaseFrame |
( |
int |
chnNum, |
|
|
IMPFrameInfo * |
frame |
|
) |
| |
Release the frame.
- Parameters
-
[in] | chnNum | ID of frame channel |
[in] | frame | Pointer of frame information. |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- none.
int IMP_FrameSource_SetChnAttr |
( |
int |
chnNum, |
|
|
const IMPFSChnAttr * |
chnAttr |
|
) |
| |
Sets the frame channel attribute.
- Parameters
-
[in] | chnNum | Id of frame channel |
[out] | chnAttr | Pointer of the channel's attribute. |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- none
set channel's largest cache FIFO attribute
- Parameters
-
[in] | chnNum | ID of the frame channel |
[in] | attr | FIFO attribute,includes FIFO maximum depth,unit(frame);FIFO type. |
- Return values
-
0 | means success |
other | values means failure,its value is an error code |
- Attention
- use it in between of these two interfaces IMP_FrameSource_CreateChn, IMP_FrameSource_EnableChn.
IMP_FrameSource_SetDelay |
( |
int |
chnNum, |
|
|
int |
cnt |
|
) |
| |
Set frame delay.
- Parameters
-
[in] | chnNum | ID of frame channel |
[in] | cnt | frame delay |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- If need, this function should be called after IMP_FrameSource_SetMaxDelay.
IMP_FrameSource_SetFrameDepth |
( |
int |
chnNum, |
|
|
int |
depth |
|
) |
| |
Sets the maximum space(depth) for the images.
- Parameters
-
[in] | chnNum | Id of frame channel |
[out] | depth | the maximum space(depth) for the images of the Frame channel. |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
1.This interface is used to set the video frames of a channel cache. When the user sets caches for multi frame video image, he can access a certain number of consecutive image datas.
2.If the specified depth is 0, that does not require the system to cache the image of the channel, so users can not get the channel image data. The system default is not the channel cache image, so, depth is 0.
3.System will automatically update the most old image data, to ensure that once the user begins to get new image data, you can get the latest image.
4.If the system can not get the image then it automatically stops the cache of the new image, so the user can not get a new image. Therefore it is recommended that the user makes sure to access and release the interface for use.
5.System will automatically update the user that it has not yet acquired the old image data, to ensure that the cache image queue is for the most recent image. If the user can not guarantee acquisition speed, the whole process might end up receiving non-consecutive images.
6 this function can call the location, there is no requirement, but it can be done only once.
- Attention
- none.
IMP_FrameSource_SetMaxDelay |
( |
int |
chnNum, |
|
|
int |
maxcnt |
|
) |
| |
Set max frame delay.
- Parameters
-
[in] | chnNum | ID of frame channel |
[in] | maxcnt | max frame delay |
- Return values
-
0 | means success. |
Other | values means failure, its value is an error code. |
- Attention
- If need, this function should be called between IMP_FrameSource_CreateChn and IMP_FrameSource_EnableChn.
Get frames.
- Parameters
-
[in] | chnNum | ID of frame channel |
[in] | fmt | format of image |
[in] | width | width of image |
[in] | height | height of image |
[in] | framedata | memory of image, provided by user |
[in] | frame | pointer of frame information. |
- Return values
-
0 | means success |
others | means failure, its value is an error code |
1.This interface can snap a video image, format now only support NV12 and YUYV422, resolution support the same size of framesource resolution.
2.This interface does not need to be used with IMP_FrameSource_SetFrameDepth.
3.This interface will be valid only after the channel has been enabled.
- Attention
- none.