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 //! \file     decode_sub_pipeline_manager.h
24 //! \brief    Defines the common interface for decode sub pipeline manager
25 //! \details  Defines the common interface for decode sub pipeline manager
26 //!
27 #ifndef __DECODE_SUB_PIPELINE_MANAGER_H__
28 #define __DECODE_SUB_PIPELINE_MANAGER_H__
29 
30 #include "decode_scalability_defs.h"
31 #include "media_packet.h"
32 #include "media_task.h"
33 #include "media_context.h"
34 #include "decode_sub_pipeline.h"
35 
36 namespace decode {
37 
38 struct DecodePipelineParams;
39 
40 class DecodeSubPipelineManager
41 {
42 public:
43     //!
44     //! \brief  Decode sub pipeline manager constructor
45     //!
46     DecodeSubPipelineManager(DecodePipeline& decodePipeline);
47 
48     //!
49     //! \brief  Decode sub pipeline manager destructor
50     //!
51     virtual ~DecodeSubPipelineManager();
52 
53     //!
54     //! \brief  Registe pre-execute sub pipeline
55     //! \param  [in] subPipeline
56     //!         sub pipeline to be excuted
57     //! \return MOS_STATUS
58     //!         MOS_STATUS_SUCCESS if success, else fail reason
59     //!
60     MOS_STATUS Register(DecodeSubPipeline& subPipeline);
61 
62     //!
63     //! \brief  Init sub pipeline list
64     //! \param  [in] settings
65     //!         Codechal setting
66     //! \return MOS_STATUS
67     //!         MOS_STATUS_SUCCESS if success, else fail reason
68     //!
69     MOS_STATUS Init(CodechalSetting& settings);
70 
71     //!
72     //! \brief  Prepare sub pipeline
73     //! \param  [in] params
74     //!         Decode pipeline parameters
75     //! \return MOS_STATUS
76     //!         MOS_STATUS_SUCCESS if success, else fail reason
77     //!
78     MOS_STATUS Prepare(DecodePipelineParams& params);
79 
80     //!
81     //! \brief  Execute sub pipeline
82     //! \param  [in] subPipelineList
83     //!         Sub pipeline list
84     //! \return MOS_STATUS
85     //!         MOS_STATUS_SUCCESS if success, else fail reason
86     //!
87     MOS_STATUS Execute();
88 
89 protected:
90     //!
91     //! \brief  Execute sub pipeline
92     //! \param  [in] subPipeline
93     //!         sub pipeline to be excuted
94     //! \return MOS_STATUS
95     //!         MOS_STATUS_SUCCESS if success, else fail reason
96     //!
97     MOS_STATUS ExecuteSubPipeline(DecodeSubPipeline &subPipeline);
98 
99     //!
100     //! \brief  Destroy sub pipeline list
101     //! \param  [in] subPipelineList
102     //!         Sub pipeline list
103     //!
104     void Destroy(std::vector<DecodeSubPipeline *> &subPipelineList);
105 
106 protected:
107     DecodePipeline* m_decodePipeline = nullptr;
108     std::vector<DecodeSubPipeline *> m_subPipelineList; //!< sub pipeline list
109 
110 MEDIA_CLASS_DEFINE_END(DecodeSubPipelineManager)
111 };
112 
113 }//decode
114 
115 #endif // !__DECODE_SUB_PIPELINE_MANAGER_H__
116