• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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 #ifndef CODECLIST_CLIENT_H
17 #define CODECLIST_CLIENT_H
18 
19 #include <mutex>
20 #include "i_codeclist_service.h"
21 #include "i_standard_codeclist_service.h"
22 
23 namespace OHOS {
24 namespace MediaAVCodec {
25 class CodecListClient : public ICodecListService {
26 public:
27     static std::shared_ptr<CodecListClient> Create(const sptr<IStandardCodecListService> &ipcProxy);
28     explicit CodecListClient(const sptr<IStandardCodecListService> &ipcProxy);
29     ~CodecListClient();
30     void MediaServerDied();
31     // ICodecListService override
32     std::string FindDecoder(const Media::Format &format) override;
33     std::string FindEncoder(const Media::Format &format) override;
34     int32_t GetCapability(CapabilityData &capabilityData, const std::string &mime, const bool isEncoder,
35                           const AVCodecCategory &category) override;
36     void AVCodecServerDied();
37     bool IsServiceDied() override;
38 
39 private:
40     sptr<IStandardCodecListService> codecListProxy_ = nullptr;
41     std::mutex mutex_;
42 };
43 } // namespace MediaAVCodec
44 } // namespace OHOS
45 #endif // CODECLIST_CLIENT_H
46