-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessing_block.go
More file actions
41 lines (30 loc) · 899 Bytes
/
processing_block.go
File metadata and controls
41 lines (30 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package facesdk
/*
#include <stdlib.h>
void TDVProcessingBlock_processContext(void* handle_, void* config, void** eh);
void TDVProcessingBlock_destroyBlock(void* handle_, void** eh);
*/
import "C"
import (
"errors"
"unsafe"
)
type ProcessingBlock struct {
implementation unsafe.Pointer
}
// Infer
func (block *ProcessingBlock) Process(context Context) error {
exception := createException()
C.TDVProcessingBlock_processContext(block.implementation, context.implementation, &exception)
return checkProcessingBlockException(exception)
}
// Destroy ProcessingBlock
func (block *ProcessingBlock) Close() error {
if block.implementation == nil {
return errors.New("ProcessingBlock already destroyed")
}
exception := createException()
C.TDVProcessingBlock_destroyBlock(block.implementation, &exception)
block.implementation = nil
return checkProcessingBlockException(exception)
}