Skip to content

Commit

Permalink
Fix zh-en order not sync
Browse files Browse the repository at this point in the history
  • Loading branch information
taoboyang authored and sfeiwong committed Jan 4, 2024
1 parent d354d0e commit 8d4f1b7
Show file tree
Hide file tree
Showing 49 changed files with 1,350 additions and 829 deletions.
Binary file modified content/.DS_Store
Binary file not shown.
Binary file modified content/en/.DS_Store
Binary file not shown.
Binary file added content/en/docs/.DS_Store
Binary file not shown.
Binary file added content/en/docs/bmf/.DS_Store
Binary file not shown.
Binary file added content/en/docs/bmf/api/.DS_Store
Binary file not shown.
143 changes: 143 additions & 0 deletions content/en/docs/bmf/api/api_in_cpp/api_in_go/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
title: 'API In Go'
linkTitle: 'API In Go'
weight: 3
---
## Normal mode (refer to normalMode)
### func NewBMFGraph(mode BMFGraphMode, option interface{}) *BMFGraph

Para:
- mode: Enumeration type, the operation mode of BMF, with the following options:
- Normal mode (most commonly used)
- Server pre-built mode
- Generator generator mode
- SubGraph subgraph mode
- Update Dynamic addition and deletion of streaming scenarios
- option: interface{} type, global Parameter of BMF, usually can be filled with null value nil

Return:
- *BMFGraph: structure pointer type, global Graph pointer

### func (g *BMFGraph) Decode(decodePara interface{}, controlStream *BMFStream) *BMFNode

Para:
- decodePara: interface{} type, decoding module Parameters, can be represented by map[string]interface{} data structure
- controlStream: structure pointer type, usually empty nil

Return:
- *BMFNode: structure pointer type, pointer to decoding node

### func (n *BMFNode) Stream(id interface{}) *BMFStream
Para:

- id: integer, representing the stream number of the node (the stream number usually starts from 0)

Return:
- *BMFStream: structure pointer type, pointer to stream structure

### func (g *BMFGraph) Encode(videoStream *BMFStream, audioStream *BMFStream, encoderPara interface{}) *BMFNode

Para:
- videoStream: structure pointer type, the structure pointer of the video stream
- audioStream: structure pointer type, structure pointer of audio stream
- encoderPara: interface{} type, encoding module Parameters, can be represented by map[string]interface{} data structure

Return:
- *BMFNode: structure pointer type, coded node pointer

### func (g *BMFGraph) Module(inputs []*BMFStream, moduleName string, moduleType BMFModuleType, modulePath string, moduleEntry string, option interface{}, preModule *BMFModuleInstance) *BMFNode

Para:
- inputs: The slice structure of the BMFStream structure pointer, representing all input streams of the module
- moduleName: string type, module name
- moduleType: enumerated type, with the following options:
-Python
-Cpp
- Go
- modulePath: string type, the path where the module file is located
- moduleEntry: string type, module entry
- option: interface{} type, module Parameter
- preModule: structure pointer of BMFModuleInstance, preload module, nil if no

Return:
- *BMFNode: structure pointer type, the pointer of the corresponding node of the module

### func (g *BMFGraph) Run(needMerge bool) *CBMFGraph

Para:
- needMerge: Boolean type, whether to merge the ffmpeg filter nodes in the graph, usually true

Return:
- *CBMFGraph: structure pointer type, which is a pointer to the encapsulation structure of the C language graph object

### func (bgp *CBMFGraph) Close() error

Return:
- error: error type, when the C graph structure is empty, an error will be reported

## preload mode (refer to premoduleMode)
### func NewCBMFModule(moduleName string, option interface{}, moduleType BMFModuleType, modulePath, moduleEntry string) (*CBMFModule, error)

Para:
- moduleName: string type, module name
- option: interface{} type, module Parameter
- moduleType: enumerated type, with the following options:
-Python
-Cpp
- Go
- modulePath: string type, the path where the module file is located
- moduleEntry: string type, module entry

Return:
- *BMFModuleInstance: structure pointer type, which is a pointer to the encapsulation structure of the C language module object
- error: error type, when the C graph structure is empty, an error will be reported

### func (s *BMFStream) Module(inputs []*BMFStream, moduleName string, moduleType BMFModuleType, modulePath string, moduleEntry string, option interface{}, preModule *CBMFModule) *BMFNode

Note: The difference between this interface and the Module interface in normal mode is that the caller is BMFStream instead of BMFGraph.
When the caller is BMFStream, the stream corresponding to the caller will be merged with other streams in inputs, and they will be used as the input stream of the module together.

## Sync mode (see syncMode & syncModeSerial)
### func NewModulefunctor(name, tp, path, entry string, option interface{}, ninputs, nooutputs int32) (*Modulefunctor, error)

Para:
- name: string type, Module name
- tp: string type, Module type (python, c++, go)
- Path: string type, corresponding to the path of the module implementation file
- entry: string type, module entry
- ninputs: int32 type, specifies the number of input streams
- nooutputs: int32 type, specifies the number of output streams

Return:
- *Modulefunctor: the instantiated Modulefunctor
- error: error message, default is nil
### func (self *Modulefunctor) Execute(inputs []*Packet, cleanup bool) (bool, error)

Para:
- inputs: *Packet is a slice structure of element type, which contains the input Packet to be processed
- cleanup : bool type, controls whether to clear all un-fetch results

Return:
- bool: Whether the operation is successful, 1 is success, 0 is failed
- error: error message, default is nil
### func (self *Modulefunctor) Fetch(index int) ([]*Packet, error)

Para:
- inputs: *Packet is a slice structure of element type, which contains the input Packet to be processed
- cleanup : bool type, controls whether to clear all un-fetch results

Return:
- []*Packet: packet list processed by Sync mode module
- error: error message, default is nil
### func (self *Modulefunctor) Call(inputs []*Packet) ([]*Packet, error)

Para:
- inputs: *Packet is a slice structure of element type, which contains the input Packet to be processed

Return:
- []*Packet: packet list processed by Sync mode module
- error: error message, default is nil
### func deleteModulefunctor(o *Modulefunctor)

Para:
- o: *Modulefunctor, pointing to the Modulefunctor instance that will be free
15 changes: 7 additions & 8 deletions content/en/docs/bmf/api/api_in_cpp/audio_frame/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ weight: 1
[//]: <> (REF_MD: classbmf__sdk_1_1AudioFrame.html)


[公共成员函数](#public-member-functions) | [静态公共成员函数](#static-public-member-functions) # bmf_sdk::AudioFrame Class Reference
[Public Member Functions](#public-member-functions) | [Static Public Member Functions](#static-public-member-functions) # bmf_sdk::AudioFrame Class Reference

audio_frame.h

## 公有成员函数
## Public Member Functions


[AudioFrame](#audioframe-15) ()=default
Expand Down Expand Up @@ -106,7 +106,7 @@ bool [operator<=](https://babitmf.github.io/docs/bmf/api/api_in_cpp/sequenceda



## 静态共有成员函数
## Static Public Member Functions


static [AudioFrame](https://babitmf.github.io/docs/bmf/api/api_in_cpp/audio_frame/) [make](#make-13) (int samples, uint64_t [layout](#layout) , bool [planer](#planer) =true)
Expand All @@ -117,7 +117,7 @@ static [AudioFrame](https://babitmf.github.io/docs/bmf/api/api_in_cpp/audio_fra
static [AudioFrame](https://babitmf.github.io/docs/bmf/api/api_in_cpp/audio_frame/) [make](#make-33) (const TensorList &data, uint64_t [layout](#layout) , bool [planer](#planer) =true)


## 其它继承成员
## Additional Inherited Members


![img](/img/docs/closed.png)
Expand All @@ -129,7 +129,7 @@ virtual void [set_private_data](https://babitmf.github.io/docs/bmf/api/api_in_
virtual const OpaqueData & [private_data](https://babitmf.github.io/docs/bmf/api/api_in_cpp/opaquedataset/#private_data) (int key) const


## 构造函数和析构函数文档
## Constructor & Destructor Documentation


###  AudioFrame() [1/5]
Expand Down Expand Up @@ -186,7 +186,7 @@ bmf_sdk::AudioFrame::AudioFrame ( const TensorList & data,
bool planer = true
)
```
## 成员函数文档
## Member Function Documentation


###  clone()
Expand All @@ -200,8 +200,7 @@ bmf_sdk::AudioFrame::AudioFrame ( const TensorList & data,
```
AudioFrame & bmf_sdk::AudioFrame::copy_props( const AudioFrame &from )
```
复制来自 `from` 的所有额外 prop(由成员 func set_xxx 设置,(如需要可深度复制)。
**Parameters**
copy all extra props(set by member func set_xxx) from `from` (deepcopy if needed), **Parameters**
- **from**


Expand Down
46 changes: 24 additions & 22 deletions content/en/docs/bmf/api/api_in_cpp/bmfavpacket/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ weight: 2
[//]: <> (REF_MD: classbmf__sdk_1_1BMFAVPacket.html)


[公有成员函数](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/#public-member-functions) | [静态公有成员函数](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/#static-public-member-functions) | [Public Attributes](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/#public-attributes) # bmf_sdk::BMFAVPacket Class Reference
[Public Member Functions](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/#public-member-functions) | [Static Public Member Functions](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/#static-public-member-functions) | [Public Attributes](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/#public-attributes) # bmf_sdk::BMFAVPacket Class Reference

bmf_av_packet.h!

!

## 公有成员函数
## Public Member Functions


[BMFAVPacket](#bmfavpacket-15) ()=default
Expand Down Expand Up @@ -111,22 +111,22 @@ bool [operator<=](https://babitmf.github.io/docs/bmf/api/api_in_cpp/sequenceda



## 静态公有成员函数
## Static Public Member Functions



static [BMFAVPacket](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/) [make](#make) (int size, Options &&...opts)


## 公共属性
## Public Attributes


int64_t [offset_](#offset_)

int [whence_](#whence_)


## 其它继承成员
## Additional Inherited Members


![img](/img/docs/closed.png)
Expand All @@ -138,7 +138,7 @@ virtual void [set_private_data](https://babitmf.github.io/docs/bmf/api/api_in_
virtual const OpaqueData & [private_data](https://babitmf.github.io/docs/bmf/api/api_in_cpp/opaquedataset/#private_data) (int key) const


## 构造函数和析构函数文档
## Constructor & Destructor Documentation


###  BMFAVPacket() [1/5]
Expand Down Expand Up @@ -182,9 +182,10 @@ bmf_sdk::BMFAVPacket::BMFAVPacket ( BMFAVPacket && )
```
bmf_sdk::BMFAVPacket::BMFAVPacket ( const Tensor & data )
```
构建一个新的 [BMFAVPacket](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/) 对象。
Construct a new [BMFAVPacket](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/) object.

**Parameters**
- **data**:连续张量数据,仅限 cpu
- **data** contiguous tensor data, cpu only



Expand All @@ -196,23 +197,23 @@ bmf_sdk::BMFAVPacket::BMFAVPacket ( int size,
const TensorOptions & options = kUInt8
)
```
构建一个新的 [BMFAVPacket](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/) 对象。
Construct a new [BMFAVPacket](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/) object.

**Parameters**
- **size**
- **options**:参考 [VideoFrame](https://babitmf.github.io/docs/bmf/api/api_in_cpp/video_frame/)
- **options** ref [VideoFrame](https://babitmf.github.io/docs/bmf/api/api_in_cpp/video_frame/)



## 成员函数文档
## Member Function Documentation


###  copy_props()

```
BMFAVPacket & bmf_sdk::BMFAVPacket::copy_props( const BMFAVPacket &from )
```
`from`复制所有额外的 props(由成员函数 set_xxx 设置)(如果需要则进行深复制)
**Parameters**
copy all extra props(set by member func set_xxx) from `from` (deepcopy if needed), **Parameters**
- **from**


Expand Down Expand Up @@ -244,7 +245,7 @@ const Tensor& bmf_sdk::BMFAVPacket::data ( ) const
```
void* bmf_sdk::BMFAVPacket::data_ptr ( )
```
返回底层数据的原始指针
return raw pointer of underlying data

**Returns**

Expand All @@ -264,7 +265,7 @@ const void* bmf_sdk::BMFAVPacket::data_ptr ( ) const
```
int64_t bmf_sdk::BMFAVPacket::get_offset ( ) const
```
获取当前数据偏移量,即文件的 write pointer 偏移量
get the current data offset which is file write pointer offset

**Returns**

Expand All @@ -275,7 +276,8 @@ int64_t bmf_sdk::BMFAVPacket::get_offset ( ) const
```
int bmf_sdk::BMFAVPacket::get_whence ( ) const
```
获取来自 mode 的数据。whence == SEEK_SET, from begin; whence == SEEK_CUR, current
get the data whence which is mode. whence == SEEK_SET, from begin; whence == SEEK_CUR, current

**Returns**


Expand All @@ -302,7 +304,7 @@ static

**Parameters**
- **size**
- **opts**:参考 [VideoFrame](https://babitmf.github.io/docs/bmf/api/api_in_cpp/video_frame/)
- **opts** ref [VideoFrame](https://babitmf.github.io/docs/bmf/api/api_in_cpp/video_frame/)



Expand All @@ -323,7 +325,7 @@ static
```
int bmf_sdk::BMFAVPacket::nbytes ( ) const
```
底层数据的字节数
number of bytes of underlying data

**Returns**

Expand All @@ -334,7 +336,7 @@ int bmf_sdk::BMFAVPacket::nbytes ( ) const
```
bmf_sdk::BMFAVPacket::operator bool ( ) const
```
检查 [BMFAVPacket](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/) 是否已定义。
check if [BMFAVPacket](https://babitmf.github.io/docs/bmf/api/api_in_cpp/bmfavpacket/) if defined

**Returns**

Expand All @@ -358,7 +360,7 @@ bmf_sdk::BMFAVPacket::operator bool ( ) const
```
void bmf_sdk::BMFAVPacket::set_offset ( int64_t offset )
```
设置当前数据偏移量,即文件的 write pointer 偏移量
set the current data offset which is file write pointer offset

**Returns**

Expand All @@ -369,12 +371,12 @@ void bmf_sdk::BMFAVPacket::set_offset ( int64_t offset )
```
void bmf_sdk::BMFAVPacket::set_whence ( int whence )
```
设置数据来源,即 modewhence == SEEK_SET, from begin; whence == SEEK_CUR, current
set the data whence which is mode. whence == SEEK_SET, from begin; whence == SEEK_CUR, current

**Returns**


## 成员函数文档
## Member Data Documentation


###  offset_
Expand Down
Loading

0 comments on commit 8d4f1b7

Please sign in to comment.