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 HEVC_PARSER_H 17 #define HEVC_PARSER_H 18 19 #include <cstdint> 20 21 namespace OHOS { 22 namespace Media { 23 namespace Plugins { 24 class HevcParser { 25 public: 26 explicit HevcParser() = default; 27 virtual ~HevcParser() = default; 28 virtual void ParseExtraData(const uint8_t *sample, int32_t size, 29 uint8_t **extraDataBuf, int32_t *extraDataSize) = 0; 30 virtual void ConvertExtraDataToAnnexb(uint8_t *extraData, int32_t extraDataSize) = 0; 31 virtual void ConvertPacketToAnnexb(uint8_t **hvccPacket, int32_t &hvccPacketSize) = 0; 32 virtual void ParseAnnexbExtraData(const uint8_t *sample, int32_t size) = 0; 33 virtual void ResetXPSSendStatus(); 34 virtual bool IsHdrVivid() = 0; 35 virtual bool GetColorRange() = 0; 36 virtual uint8_t GetColorPrimaries() = 0; 37 virtual uint8_t GetColorTransfer() = 0; 38 virtual uint8_t GetColorMatrixCoeff() = 0; 39 virtual uint8_t GetProfileIdc() = 0; 40 virtual uint8_t GetLevelIdc() = 0; 41 virtual uint32_t GetChromaLocation() = 0; 42 virtual uint32_t GetPicWidInLumaSamples() = 0; 43 virtual uint32_t GetPicHetInLumaSamples() = 0; 44 }; 45 } // Plugins 46 } // Media 47 } // OHOS 48 #endif // HEVC_PARSER_H