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_AVQUEUE_ITEM_H 17 #define OHOS_AVQUEUE_ITEM_H 18 19 #include <bitset> 20 #include <memory> 21 #include <string> 22 #include <map> 23 24 #include "parcel.h" 25 #include "avmedia_description.h" 26 27 namespace OHOS::AVSession { 28 class AVQueueItem : public Parcelable { 29 public: 30 enum { 31 QUEUE_ITEM_KEY_ITEM_ID = 0, 32 QUEUE_ITEM_KEY_DESCRIPTION = 1, 33 QUEUE_ITEM_KEY_MAX = 2 34 }; 35 36 AVQueueItem() = default; 37 ~AVQueueItem() = default; 38 39 static AVQueueItem* Unmarshalling(Parcel& data); 40 bool Marshalling(Parcel& parcel) const override; 41 42 void SetItemId(int32_t itemId); 43 int32_t GetItemId() const; 44 45 void SetDescription(const std::shared_ptr<AVMediaDescription>& description); 46 std::shared_ptr<AVMediaDescription> GetDescription() const; 47 48 bool IsValid() const; 49 50 void Reset(); 51 52 private: 53 int32_t itemId_ = 0; 54 std::shared_ptr<AVMediaDescription> description_ = nullptr; 55 }; 56 } // namespace OHOS::AVSession 57 #endif // OHOS_AVQUEUE_ITEM_H 58