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 16 #ifndef DASH_ADAPTATION_SET_NODE_H 17 #define DASH_ADAPTATION_SET_NODE_H 18 19 #include "i_dash_mpd_node.h" 20 #include "dash_com_attrs_elements.h" 21 22 namespace OHOS { 23 namespace Media { 24 namespace Plugins { 25 namespace HttpPlugin { 26 class DashAdptSetNode : public IDashMpdNode { 27 public: 28 DashAdptSetNode(); 29 ~DashAdptSetNode() override; 30 31 void ParseNode(std::shared_ptr<XmlParser> xmlParser, std::shared_ptr<XmlElement> rootElement) override; 32 void GetAttr(const std::string &attrName, std::string &sAttrVal) override; 33 void GetAttr(const std::string &attrName, uint32_t &uiAttrVal) override; 34 void GetAttr(const std::string &attrName, int32_t &iAttrVal) override; 35 void GetAttr(const std::string &attrName, uint64_t &ullAttrVal) override; 36 void GetAttr(const std::string &attrName, double &dAttrVal) override; 37 38 private: 39 static constexpr int32_t DASH_ADAPTATION_SET_ATTR_NUM = 19; 40 static constexpr const char *adptSetAttrs_[DASH_ADAPTATION_SET_ATTR_NUM] = {"id", 41 "group", 42 "lang", 43 "contentType", 44 "par", 45 "minBandwidth", 46 "maxBandwidth", 47 "minWidth", 48 "maxWidth", 49 "minHeight", 50 "maxHeight", 51 "minFrameRate", 52 "maxFrameRate", 53 "segmentAlignment", 54 "bitstreamSwitching", 55 "subsegmentAlignment", 56 "subsegmentStartsWithSAP", 57 "cameraIndex", 58 "videoType"}; 59 NodeAttr adptSetAttr_[DASH_ADAPTATION_SET_ATTR_NUM]; 60 DashComAttrsElements comAttrsElements_; 61 }; 62 } // namespace HttpPluginLite 63 } // namespace Plugin 64 } // namespace Media 65 } // namespace OHOS 66 #endif // DASH_ADAPTATION_SET_NODE_H 67