1 /*
2 * Copyright (c) 2019, 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 //!
24 //! \file     decode_sub_packet_manager.h
25 //! \brief    Defines the common interface for decode sub packet manager
26 //! \details  The decode sub packet manager interface is shared by decode pipelines.
27 //!
28 
29 #ifndef __DECODE_SUB_PACKET_MANAGER_H__
30 #define __DECODE_SUB_PACKET_MANAGER_H__
31 
32 #include "decode_sub_packet.h"
33 
34 namespace decode
35 {
36 
37 class DecodeSubPacketManager
38 {
39 public:
40     //!
41     //! \brief  Decode sub packet constructor
42     //!
DecodeSubPacketManager()43     DecodeSubPacketManager() {};
44 
45     //!
46     //! \brief  Decode sub packet destructor
47     //!
48     virtual ~DecodeSubPacketManager();
49 
50     //!
51     //! \brief  Register sub packet
52     //! \param  [in] subPacket
53     //!         Reference to the sub packet
54     //! \return MOS_STATUS
55     //!         MOS_STATUS_SUCCESS if success, else fail reason
56     //!
57     MOS_STATUS Register(uint32_t packetId, DecodeSubPacket& subPacket);
58 
59     //!
60     //! \brief  Get sub packet
61     //! \param  [in] packetId
62     //!         sub packet id to get the sub packet
63     //! \return DecodeSubPacket*
64     //!         Pointer of the decode sub packet
65     //!
66     DecodeSubPacket* GetSubPacket(uint32_t packetId);
67 
68     //!
69     //! \brief  Initialize the decode sub packet
70     //! \return MOS_STATUS
71     //!         MOS_STATUS_SUCCESS if success, else fail reason
72     //!
73     MOS_STATUS Init();
74 
75     //!
76     //! \brief  Update the parameters for decode sub packet
77     //! \return MOS_STATUS
78     //!         MOS_STATUS_SUCCESS if success, else fail reason
79     //!
80     MOS_STATUS Prepare();
81 
82 protected:
83     std::map<uint32_t, DecodeSubPacket *> m_subPacketList; //!< sub packet list
84 
85 MEDIA_CLASS_DEFINE_END(decode__DecodeSubPacketManager)
86 };
87 
88 }
89 #endif  // !__DECODE_SUB_PACKET_MANAGER_H__
90