1 /*
2  * Copyright (c) 2021-2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "UtCodecTest1.h"
17 
18 using namespace OHOS::Media::Plugin;
19 
PluginCreator(const std::string & name)20 static std::shared_ptr<CodecPlugin> PluginCreator(const std::string &name)
21 {
22     return std::make_shared<UtCodecTest1>(name);
23 }
24 
CodecRegister(const std::shared_ptr<Register> & reg)25 static Status CodecRegister(const std::shared_ptr<Register> &reg)
26 {
27     CodecPluginDef definition;
28     definition.pluginType = PluginType::AUDIO_DECODER;
29     definition.name = "UtCodecTest1";
30     definition.description = "unit test codec test1";
31     definition.rank = 100; // 100
32     definition.creator = PluginCreator;
33     return reg->AddPlugin(definition);
34 }
35 
__anond968bd3e0102null36 PLUGIN_DEFINITION(UtCodecTest1, LicenseType::APACHE_V2, CodecRegister, [] {});
37 
QueueInputBuffer(const std::shared_ptr<Buffer> & inputBuffer,int32_t timeoutMs)38 Status UtCodecTest1::QueueInputBuffer(const std::shared_ptr<Buffer> &inputBuffer, int32_t timeoutMs)
39 {
40     return Status::OK;
41 }
42 
QueueOutputBuffer(const std::shared_ptr<Buffer> & outputBuffers,int32_t timeoutMs)43 Status UtCodecTest1::QueueOutputBuffer(const std::shared_ptr<Buffer> &outputBuffers, int32_t timeoutMs)
44 {
45     return Status::OK;
46 }
47 
Flush()48 Status UtCodecTest1::Flush()
49 {
50     return Status::OK;
51 }
52 
SetDataCallback(DataCallback * dataCallback)53 Status UtCodecTest1::SetDataCallback(DataCallback* dataCallback)
54 {
55     return Status::OK;
56 }
57 
GetAllocator()58 std::shared_ptr<Allocator> UtCodecTest1::GetAllocator()
59 {
60     return std::shared_ptr<Allocator>();
61 }
62 
SetCallback(Callback * cb)63 Status UtCodecTest1::SetCallback(Callback* cb)
64 {
65     return Status::OK;
66 }
67