1 /* 2 * Copyright (c) 2024-2024 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 #ifndef HISTREAMER_NETWORK_TYPES_H 16 #define HISTREAMER_NETWORK_TYPES_H 17 18 #include <string> 19 #include <map> 20 #include "common/status.h" 21 #include "plugin/plugin_event.h" 22 23 namespace OHOS { 24 namespace Media { 25 namespace Plugins { 26 namespace HttpPlugin { 27 using RxBody = size_t(*)(void* buffer, size_t size, size_t nitems, void* userParam); 28 using RxHeader = size_t(*)(void* buffer, size_t size, size_t nitems, void* userParam); 29 using RequestCompletedFunc = std::function<void(const Status&)>; 30 using HandleResponseCbFunc = std::function<void( 31 const int32_t clientCode, const int32_t serverCode, const Status ret)>; 32 33 struct RequestInfo { 34 std::string url; 35 std::map<std::string, std::string> httpHeader; 36 int32_t timeoutMs{-1}; 37 }; 38 } // namespace HttpPlugin 39 } // namespace Plugins 40 } // namespace Media 41 } // namespace OHOS 42 #endif // HISTREAMER_NETWORK_TYPES_H 43