• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 #ifndef AUDIO_HDICODEC_INNER_UNIT_TEST_H
16 #define AUDIO_HDICODEC_INNER_UNIT_TEST_H
17 
18 #include "hdi_codec.h"
19 #include <gtest/gtest.h>
20 #include <atomic>
21 #include <fstream>
22 #include <thread>
23 #include <queue>
24 #include <string>
25 #include <condition_variable>
26 #include <mutex>
27 #include "buffer/avbuffer.h"
28 #include "v4_0/codec_ext_types.h"
29 #include "v4_0/icodec_component_manager.h"
30 #include "avcodec_info.h"
31 
32 namespace OHOS {
33 namespace Media {
34 namespace Plugins {
35 namespace Hdi {
36 using namespace OHOS::HDI::Codec::V4_0;
37 
38 class HdiCodecInner : public HdiCodec {
39 public:
40     HdiCodecInner() = default;
41     ~HdiCodecInner() = default;
42 
GetSharedPtr()43     std::shared_ptr<HdiCodecInner> GetSharedPtr()
44     {
45         return std::static_pointer_cast<HdiCodecInner>(shared_from_this());
46     }
47 
GetCompId()48     uint32_t& GetCompId()
49     {
50         return componentId_;
51     }
52 
GetCompName()53     std::string& GetCompName()
54     {
55         return componentName_;
56     }
57 
GetCompCb()58     sptr<ICodecCallback>& GetCompCb()
59     {
60         return compCb_;
61     }
62 
GetCompNode()63     sptr<ICodecComponent>& GetCompNode()
64     {
65         return compNode_;
66     }
67 
GetCompMgr()68     sptr<ICodecComponentManager>& GetCompMgr()
69     {
70         return compMgr_;
71     }
72 
GetCompEvent()73     CodecEventType& GetCompEvent()
74     {
75         return event_;
76     }
77 };
78 
79 
80 } // namespace Hdi
81 } // namespace Plugins
82 } // namespace Media
83 } // namespace OHOS
84 
85 
86 #endif // AUDIO_HDICODEC_INNER_UNIT_TEST_H