1 /*
2  * Copyright (c) 2022-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 OHOS_DSCREEN_VIDEO_PARAM_H
17 #define OHOS_DSCREEN_VIDEO_PARAM_H
18 
19 #include "nlohmann/json.hpp"
20 
21 #include "dscreen_constants.h"
22 
23 using json = nlohmann::json;
24 
25 namespace OHOS {
26 namespace DistributedHardware {
27 class VideoParam {
28 public:
29     void SetScreenWidth(uint32_t screenWidth);
30     uint32_t GetScreenWidth() const;
31     void SetScreenHeight(uint32_t screenHeight);
32     uint32_t GetScreenHeight() const;
33     void SetVideoWidth(uint32_t videoWidth);
34     uint32_t GetVideoWidth() const;
35     void SetVideoHeight(uint32_t videoHeight);
36     uint32_t GetVideoHeight() const;
37     void SetFps(double fps);
38     double GetFps() const;
39     void SetCodecType(uint8_t codecType);
40     uint8_t GetCodecType() const;
41     void SetVideoFormat(uint8_t videoFormat);
42     uint8_t GetVideoFormat() const;
43     void SetPartialRefreshFlag(bool flag);
44     bool GetPartialRefreshFlag() const;
45 private:
46     friend void to_json(json &j, const VideoParam &videoParam);
47     friend void from_json(const json &j, VideoParam &videoParam);
48 
49     uint32_t screenWidth_;
50     uint32_t screenHeight_;
51     uint32_t videoWidth_;
52     uint32_t videoHeight_;
53     double fps_ = DEFAULT_FPS;
54     uint8_t codecType_ = DEFAULT_CODECTYPE;
55     uint8_t videoFormat_ = DEFAULT_VIDEO_FORMAT;
56     bool isPartialRefresh_ = false;
57 };
58 void to_json(json &j, const VideoParam &videoParam);
59 void from_json(const json &j, VideoParam &videoParam);
60 } // namespace DistributedHardware
61 } // namespace OHOS
62 #endif