• 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 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 OHOS_HDI_LPP_V1_0_LPPCOMPONENTSERVICE_H
17 #define OHOS_HDI_LPP_V1_0_LPPCOMPONENTSERVICE_H
18 
19 #include <mutex>
20 #include <stdint.h>
21 #include "lpp_component_vdi.h"
22 #include "v1_0/ilpp_sync_manager_adapter.h"
23 
24 namespace OHOS {
25 namespace HDI {
26 namespace LowPowerPlayer {
27 namespace V1_0 {
28 
29 class LppSyncManagerAdapter : public ILppSyncManagerAdapter {
30 public:
31     LppSyncManagerAdapter() = default;
32     ~LppSyncManagerAdapter();
33     int32_t Init();
34     int32_t SetVideoChannelId(uint32_t channelId);
SetAudioChannelId(uint32_t channelId)35     int32_t SetAudioChannelId(uint32_t channelId) { return 0; };
36     int32_t StartRender();
37     int32_t RenderNextFrame();
38     int32_t Pause();
39     int32_t Resume();
40     int32_t Flush();
41     int32_t Stop();
42     int32_t Reset();
43     int32_t Release();
44     int32_t SetTunnelId(uint64_t tunnelId);
45     int32_t SetTargetStartFrame(int64_t framePts, uint32_t timeoutMs);
46     int32_t SetPlaybackSpeed(float mode);
47     int32_t RegisterCallback(const sptr<ILppSyncManagerCallback>& syncCallback);
48     int32_t GetShareBuffer(int32_t& fd);
49     int32_t GetParameter(std::map<std::string, std::string>& parameter);
50     int32_t SetParameter(const std::map<std::string, std::string>& parameter);
51     int32_t UpdateTimeAnchor(int64_t anchorPts, uint64_t anchorClk);
52     int32_t BindOutputBuffers(const std::map<uint32_t, sptr<NativeBuffer>>& outputBuffers);
53     int32_t UnbindOutputBuffers();
54     int32_t GetLatestPts(int64_t& pts);
55 
56 private:
57     ILowPowerPlayerVdi* vdiImpl_;
58     static int32_t LoadVendorLib();
59 };
60 
61 }  // namespace V1_0
62 }  // namespace LowPowerPlayer
63 }  // namespace HDI
64 }  // namespace OHOS
65 
66 #endif //OHOS_HDI_LOW_POWER_PLAYER_V1_0_CODECCOMPONENTSERVICE_H