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 OHOS_DSCREEN_OUTPUT_CONTROLLER_H 17 #define OHOS_DSCREEN_OUTPUT_CONTROLLER_H 18 19 #include "output_controller.h" 20 #include "av_trans_utils.h" 21 #include "av_sync_utils.h" 22 23 namespace OHOS { 24 namespace DistributedHardware { 25 class DScreenOutputController : public OutputController { 26 public: 27 ~DScreenOutputController() override = default; 28 void PrepareSmooth() override; 29 void PrepareSync() override; 30 31 private: 32 constexpr static float ADJUST_SLEEP_FACTOR = 0.1; 33 constexpr static float WAIT_CLOCK_FACTOR = 0.1; 34 constexpr static float TRACK_CLOCK_FACTOR = 0.2; 35 constexpr static uint8_t DYNAMIC_BALANCE_THRE = 3; 36 constexpr static int32_t SMOOTH_BUFFER_TIME = 0 * NS_ONE_MS; 37 constexpr static uint32_t AVER_INTERVAL_DIFF_THRE = 2 * NS_ONE_MS; 38 constexpr static uint32_t PUSH_ONCE_DIFF_THRE = 10 * NS_ONE_MS; 39 constexpr static uint32_t TIMESTAMP_ONCE_DIFF_THRE = 3 * NS_ONE_MS; 40 constexpr static uint32_t WAIT_CLOCK_THRE = 125 * NS_ONE_MS; 41 constexpr static uint32_t TRACK_CLOCK_THRE = 45 * NS_ONE_MS; 42 constexpr static int64_t SLEEP_THRE = 1000 * NS_ONE_MS; 43 constexpr static int64_t AUDIO_BACK_TIME = 320 * NS_ONE_MS; 44 }; 45 } // namespace DistributedHardware 46 } // namespace OHOS 47 #endif // OHOS_DSCREEN_OUTPUT_CONTROLLER_H