文件名称:
BufferStream.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
6.90 KB
下载地址:
文本预览:
# BufferStream
## **Overview**
**Related Modules:**
[Format](Format.md)
**Description:**
Defines the function for reading stream data.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Fields
## **Details**
## **Field Documentation**
## GetReadableSize
```
int32_t(* BufferStream::GetReadableSize) (const void *[handle](BufferStream.md#ae2019a77aba73fa96d5a716155c7fb7f))
```
**Description:**
Obtains the size of data that can be read.
Before reading data, you should call this function to check whether there is data to read.
**Parameters:**
**Returns:**
Returns the size of the read data.
## handle
```
void* BufferStream::handle
```
**Description:**
Context handle
## ReadData
```
int32_t(* BufferStream::ReadData) (void *[handle](BufferStream.md#ae2019a77aba73fa96d5a716155c7fb7f), uint8_t *data, int32_t size, int32_t timeOutMs, [DataFlags](Format.md#gacff079fdf8427c743f9197ea5be33a7f) *flags)
```
**Description:**
Reads data from streams, save the data to the buffer pointed by **data** with the specified **size**, and returns the size of the read data and type.
**Parameters:**
**Returns:**
Returns the size of the read data.
## **Overview**
**Related Modules:**
[Format](Format.md)
**Description:**
Defines the function for reading stream data.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Fields
ReadData )(void *handle, uint8_t *data, int32_t size, int32_t timeOutMs, DataFlags *flags) | Reads data from streams, save the data to the buffer pointed by data with the specified size, and returns the size of the read data and type. |
GetReadableSize )(const void *handle) | Obtains the size of data that can be read. |
## **Details**
## **Field Documentation**
## GetReadableSize
```
int32_t(* BufferStream::GetReadableSize) (const void *[handle](BufferStream.md#ae2019a77aba73fa96d5a716155c7fb7f))
```
**Description:**
Obtains the size of data that can be read.
Before reading data, you should call this function to check whether there is data to read.
**Parameters:**
handle | Indicates the pointer to the context handle. |
**Returns:**
Returns the size of the read data.
## handle
```
void* BufferStream::handle
```
**Description:**
Context handle
## ReadData
```
int32_t(* BufferStream::ReadData) (void *[handle](BufferStream.md#ae2019a77aba73fa96d5a716155c7fb7f), uint8_t *data, int32_t size, int32_t timeOutMs, [DataFlags](Format.md#gacff079fdf8427c743f9197ea5be33a7f) *flags)
```
**Description:**
Reads data from streams, save the data to the buffer pointed by **data** with the specified **size**, and returns the size of the read data and type.
**Parameters:**
handle | Indicates the pointer to the context handle. |
data | Indicates the pointer to the buffer to store the read data. The memory is allocated by the caller. |
size | Indicates the size of the available buffer memory. |
timeOutMs | Indicates read operation wait time. The value 0 means no wait time. |
flags | Indicates the pointer to the type of the read data, see DataFlags. |
**Returns:**
Returns the size of the read data.
点赞
回复
X