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 * miscservices under the License is miscservices 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 #ifndef DISTRIBUTED_STREAM_TEST_H 16 #define DISTRIBUTED_STREAM_TEST_H 17 18 #include <string> 19 #include <unordered_map> 20 #include <ctime> 21 #include <iostream> 22 23 #define BYTES_SIZE (16) 24 #define STREAM_SIZE (150 * 1024) 25 #define I_FRAME_SIZE (150 * 1024) 26 #define P_FRAME_SIZE (30 * 1024) 27 #define MS_PER_SECOND (1000) 28 #define US_PER_MS (1000) 29 #define NS_PER_MS (1000 * 1000) 30 31 const std::string TEST_PKG_NAME = "dms"; 32 const std::string STREAM_SESSION_NAME = "ohos.distributedschedule.dms.JtSendStream_10"; 33 const std::string CONTRL_SESSION_NAME = "ohos.distributedschedule.dms.TestContrl"; 34 35 namespace OHOS { GetCurrent(void)36inline time_t GetCurrent(void) 37 { 38 struct timespec time; 39 int ret = clock_gettime(CLOCK_MONOTONIC, &time); 40 if (ret != 0) { 41 std::cout <<"get time failed!" << std::endl; 42 } 43 return time.tv_sec * MS_PER_SECOND + time.tv_nsec / NS_PER_MS; 44 } 45 } 46 47 #endif