mirror of
https://github.com/openharmony/drivers_peripheral.git
synced 2026-08-24 18:15:56 -04:00
feat: Add multi instance of CodecComponentType
Signed-off-by: zhangguorong <zhangguorong@kaihongdigi.com>
This commit is contained in:
@@ -30,14 +30,14 @@ namespace Codec {
|
||||
struct CodecComponentType *component = nullptr;
|
||||
int32_t appData = testingAppData;
|
||||
CodecCallbackType* callback = CodecCallbackTypeStubGetInstance();
|
||||
|
||||
uint32_t compoentId = 0;
|
||||
manager = GetCodecComponentManager();
|
||||
if (manager == nullptr) {
|
||||
HDF_LOGE("%{public}s: GetCodecComponentManager failed\n", __func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t ret = manager->CreateComponent(&component, (char*)"compName", &appData, sizeof(appData), callback);
|
||||
int32_t ret = manager->CreateComponent(&component, &compoentId, (char*)"compName", appData, callback);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
HDF_LOGE("%{public}s: CreateComponent failed\n", __func__);
|
||||
return false;
|
||||
@@ -50,11 +50,12 @@ namespace Codec {
|
||||
result = true;
|
||||
}
|
||||
|
||||
ret = manager->DestoryComponent(component);
|
||||
ret = manager->DestoryComponent(compoentId);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
HDF_LOGE("%{public}s: DestoryComponent failed\n", __func__);
|
||||
return false;
|
||||
}
|
||||
CodecComponentTypeRelease(component);
|
||||
CodecComponentManagerRelease();
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user