• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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(uint32_t fps);
38     uint32_t 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 private:
44     friend void to_json(json &j, const VideoParam &videoParam);
45     friend void from_json(const json &j, VideoParam &videoParam);
46 
47     uint32_t screenWidth_;
48     uint32_t screenHeight_;
49     uint32_t videoWidth_;
50     uint32_t videoHeight_;
51     uint32_t fps_ = DEFAULT_FPS;
52     uint8_t codecType_ = DEFAULT_CODECTYPE;
53     uint8_t videoFormat_ = DEFAULT_VIDEO_FORMAT;
54 };
55 void to_json(json &j, const VideoParam &videoParam);
56 void from_json(const json &j, VideoParam &videoParam);
57 } // namespace DistributedHardware
58 } // namespace OHOS
59 #endif