1 /* 2 * Copyright (c) 2018-2020, Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 * OTHER DEALINGS IN THE SOFTWARE. 21 */ 22 //! 23 //! \file decode_avc_pipeline_m12.h 24 //! \brief Defines the interface for avc decode pipeline 25 //! 26 #ifndef __DECODE_AVC_PIPELINE_M12_H__ 27 #define __DECODE_AVC_PIPELINE_M12_H__ 28 #include "decode_avc_pipeline.h" 29 #include "decode_avc_packet_m12.h" 30 #include "decode_huc_packet_creator_g12.h" 31 32 namespace decode { 33 34 class AvcPipelineM12 : public AvcPipeline, public HucPacketCreatorG12 35 { 36 public: 37 //! 38 //! \brief DecodePipeline constructor 39 //! \param [in] hwInterface 40 //! Pointer to CodechalHwInterface 41 //! \param [in] debugInterface 42 //! Pointer to CodechalDebugInterface 43 //! 44 AvcPipelineM12( 45 CodechalHwInterface * hwInterface, 46 CodechalDebugInterface *debugInterface); 47 ~AvcPipelineM12()48 virtual ~AvcPipelineM12() {}; 49 50 virtual MOS_STATUS Init(void *settings) override; 51 52 //! 53 //! \brief Prepare interal parameters, should be invoked for each frame 54 //! \param [in] params 55 //! Pointer to the input parameters 56 //! \return MOS_STATUS 57 //! MOS_STATUS_SUCCESS if success, else fail reason 58 //! 59 virtual MOS_STATUS Prepare(void *params) final; 60 61 //! 62 //! \brief Finish the execution for each frame 63 //! \return MOS_STATUS 64 //! MOS_STATUS_SUCCESS if success, else fail reason 65 //! 66 virtual MOS_STATUS Execute() final; 67 68 virtual MOS_STATUS GetStatusReport(void *status, uint16_t numStatus) override; 69 70 uint32_t GetCompletedReport(); 71 72 virtual MOS_STATUS Destroy() override; 73 74 virtual MOS_STATUS CreateFeatureManager() override; 75 76 protected: 77 virtual MOS_STATUS Initialize(void *settings) override; 78 virtual MOS_STATUS Uninitialize() override; 79 80 //! 81 //! \brief User Feature Key Report 82 //! \return MOS_STATUS 83 //! MOS_STATUS_SUCCESS if success, else fail reason 84 //! 85 virtual MOS_STATUS UserFeatureReport() override; 86 87 //! 88 //! \brief Create sub packets 89 //! \param [in] codecSettings 90 //! Point to codechal settings 91 //! \return MOS_STATUS 92 //! MOS_STATUS_SUCCESS if success, else fail reason 93 //! 94 virtual MOS_STATUS CreateSubPackets(DecodeSubPacketManager& subPacketManager, CodechalSetting &codecSettings) override; 95 96 //! 97 //! \brief Initialize MMC state 98 //! 99 //! \return MOS_STATUS 100 //! MOS_STATUS_SUCCESS if success 101 //! 102 virtual MOS_STATUS InitMmcState(); 103 104 //! 105 //! \brief Initialize media context for decode pipeline 106 //! \return MOS_STATUS 107 //! MOS_STATUS_SUCCESS if success, else fail reason 108 //! 109 MOS_STATUS InitContext(); 110 111 //! 112 //! \brief Create post sub packets 113 //! \param [in] subPipelineManager 114 //! \return MOS_STATUS 115 //! MOS_STATUS_SUCCESS if success, else fail reason 116 //! 117 virtual MOS_STATUS CreatePostSubPipeLines(DecodeSubPipelineManager &subPipelineManager) override; 118 119 //! 120 //! \brief Create pre sub packets 121 //! \param [in] subPipelineManager 122 //! \return MOS_STATUS 123 //! MOS_STATUS_SUCCESS if success, else fail reason 124 //! 125 virtual MOS_STATUS CreatePreSubPipeLines(DecodeSubPipelineManager &subPipelineManager) override; 126 127 #if USE_CODECHAL_DEBUG_TOOL 128 //! 129 //! \brief Dump the parameters 130 //! \param [in] basicFeature 131 //! Reference to AvcBasicFeature 132 //! \return MOS_STATUS 133 //! MOS_STATUS_SUCCESS if success, else fail reason 134 //! 135 MOS_STATUS DumpParams(AvcBasicFeature &basicFeature); 136 #endif 137 138 private: 139 AvcDecodePktM12 *m_avcDecodePkt = nullptr; 140 CodechalHwInterface* m_hwInterface = nullptr; 141 MEDIA_CLASS_DEFINE_END(decode__AvcPipelineM12) 142 }; 143 144 } 145 #endif // !__DECODE_AVC_PIPELINE_M12_H__ 146