1 /*
2 * Copyright (c) 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     encode_vp9_hpu_super_frame_packet.h
24 //! \brief    Defines the interface for vp9 HPU super frame packet
25 //!
26 
27 #ifndef __ENCODE_VP9_HUC_SUPER_FRAME_PACKET_H__
28 #define __ENCODE_VP9_HUC_SUPER_FRAME_PACKET_H__
29 
30 #include "encode_vp9_hpu_packet.h"
31 
32 namespace encode
33 {
34 class Vp9HpuSuperFramePkt : public CmdPacket
35 {
36 public:
37     //!
38     //! \brief  Vp9HucSuperFramePkt constructor
39     //! \param  [in] task
40     //!         Pointer to media task
41     //! \param  [in] pkt
42     //!         Pointer Vp9HucProbPkt packet
43     //! \param  [in] hwInterface
44     //!         Pointer to HW interface
45     //!
Vp9HpuSuperFramePkt(MediaTask * task,Vp9HpuPkt * pkt)46     Vp9HpuSuperFramePkt(MediaTask *task, Vp9HpuPkt *pkt)
47         : CmdPacket(task),
48           m_vp9HucProbPkt(pkt)
49     {
50         ENCODE_CHK_NULL_NO_STATUS_RETURN(m_vp9HucProbPkt);
51     }
52 
53     //!
54     //! \brief  Vp9HucSuperFramePkt destructor
55     //!
~Vp9HpuSuperFramePkt()56     virtual ~Vp9HpuSuperFramePkt() {}
57 
58     //!
59     //! \brief  Add the command sequence into the commandBuffer and
60     //!         and return to the caller task
61     //! \param  [in] commandBuffer
62     //!         Pointer to the command buffer which is allocated by caller
63     //! \param  [in] packetPhase
64     //!         Indicate packet phase stage
65     //! \return MOS_STATUS
66     //!         MOS_STATUS_SUCCESS if success, else fail reason
67     //!
68     virtual MOS_STATUS Submit(
69         MOS_COMMAND_BUFFER *commandBuffer,
70         uint8_t             packetPhase = otherPacket) override;
71 
72     //!
73     //! \brief  Dump output resources or infomation after submit
74     //! \return MOS_STATUS
75     //!         MOS_STATUS_SUCCESS if success, else fail reason
76     //!
DumpOutput()77     virtual MOS_STATUS DumpOutput() override { return m_vp9HucProbPkt->DumpOutput(); }
78 
79     //!
80     //! \brief  Get Packet Name
81     //! \return std::string
82     //!
GetPacketName()83     virtual std::string GetPacketName() override { return m_vp9HucProbPkt->GetPacketName(); }
84 
85 protected:
86     Vp9HpuPkt *m_vp9HucProbPkt = nullptr;
87 
88 MEDIA_CLASS_DEFINE_END(encode__Vp9HpuSuperFramePkt)
89 };
90 
91 }  // namespace encode
92 
93 #endif  // __ENCODE_VP9_HUC_SUPER_FRAME_PACKET_H__