xref: /aosp_15_r20/external/intel-media-driver/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2018-2022, 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     vp_pipeline.h
24 //! \brief    Defines the interfaces for vp pipeline
25 //!           this file is for the base interface which is shared by all features.
26 //!
27 
28 #ifndef __VP_PIPELINE_H__
29 #define __VP_PIPELINE_H__
30 
31 #include <map>
32 #include "media_pipeline.h"
33 #include "vp_filter.h"
34 #include "vp_pipeline_common.h"
35 #include "vp_utils.h"
36 #include "vp_allocator.h"
37 #include "vp_status_report.h"
38 #include "vp_dumper.h"
39 #include "vp_debug_interface.h"
40 #include "vp_feature_manager.h"
41 #include "vp_packet_shared_context.h"
42 #include "vp_kernelset.h"
43 #include "vp_packet_reuse_manager.h"
44 
45 namespace vp
46 {
47 
48 class PacketFactory;
49 class PacketPipeFactory;
50 class VpResourceManager;
51 class SwFilterFeatureHandler;
52 
53 enum PIPELINE_PARAM_TYPE
54 {
55     PIPELINE_PARAM_TYPE_LEGACY = 1,
56     PIPELINE_PARAM_TYPE_MEDIA_SFC_INTERFACE,
57 };
58 
59 struct VP_PARAMS
60 {
61     PIPELINE_PARAM_TYPE type;
62     union
63     {
64         PVP_PIPELINE_PARAMS renderParams;
65         VEBOX_SFC_PARAMS    *sfcParams;
66     };
67 };
68 
69 class VpPipelineParamFactory
70 {
71 public:
VpPipelineParamFactory()72     VpPipelineParamFactory(){};
~VpPipelineParamFactory()73     virtual ~VpPipelineParamFactory()
74     {
75         while (!m_Pool.empty())
76         {
77             PVP_PIPELINE_PARAMS param = m_Pool.back();
78             m_Pool.pop_back();
79             MOS_Delete(param);
80         }
81     }
82 
Clone(PVP_PIPELINE_PARAMS param)83     virtual PVP_PIPELINE_PARAMS Clone(PVP_PIPELINE_PARAMS param)
84     {
85         PVP_PIPELINE_PARAMS paramDst = nullptr;
86 
87         if (m_Pool.empty())
88         {
89             paramDst = MOS_New(VP_PIPELINE_PARAMS);
90             *paramDst = *param;
91         }
92         else
93         {
94             paramDst = m_Pool.back();
95             if (paramDst)
96             {
97                 m_Pool.pop_back();
98                 *paramDst = *param;
99             }
100         }
101         return paramDst;
102     }
103 
Destroy(PVP_PIPELINE_PARAMS & param)104     virtual MOS_STATUS Destroy(PVP_PIPELINE_PARAMS &param)
105     {
106         if (param == nullptr)
107         {
108             return MOS_STATUS_SUCCESS;
109         }
110         m_Pool.push_back(param);
111         param = nullptr;
112         return MOS_STATUS_SUCCESS;
113     }
114 
115     std::vector<PVP_PIPELINE_PARAMS> m_Pool;
116 
117 MEDIA_CLASS_DEFINE_END(vp__VpPipelineParamFactory)
118 };
119 
120 class VpPipeline : public MediaPipeline
121 {
122 public:
123     VpPipeline(PMOS_INTERFACE osInterface);
124 
125     virtual ~VpPipeline();
126 
127     //!
128     //! \brief  Initialize the vp pipeline
129     //! \param  [in] mhwInterface
130     //!         Pointer to VP_MHWINTERFACE
131     //! \return MOS_STATUS
132     //!         MOS_STATUS_SUCCESS if success, else fail reason
133     //!
134     virtual MOS_STATUS Init(void *mhwInterface) override;
135 
136     //!
137     //! \brief  Prepare interal parameters, should be invoked for each frame
138     //! \param  [in] params
139     //!         Pointer to the input parameters
140     //! \return MOS_STATUS
141     //!         MOS_STATUS_SUCCESS if success, else fail reason
142     //!
143     virtual MOS_STATUS Prepare(void *params) override;
144 
145     //!
146     //! \brief  Finish the execution for each frame
147     //! \return MOS_STATUS
148     //!         MOS_STATUS_SUCCESS if success, else fail reason
149     //!
150     virtual MOS_STATUS Execute() override;
151 
152     //!
153     //! \brief  Get media pipeline execution status
154     //! \param  [out] status
155     //!         The point to encode status
156     //! \param  [in] numStatus
157     //!         The requested number of status reports
158     //! \return MOS_STATUS
159     //!         MOS_STATUS_SUCCESS if success, else fail reason
160     //!
161     virtual MOS_STATUS GetStatusReport(void *status, uint16_t numStatus) override;
162 
163     //!
164     //! \brief  Destory the media pipeline and release internal resources
165     //! \return MOS_STATUS
166     //!         MOS_STATUS_SUCCESS if success, else fail reason
167     //!
168     virtual MOS_STATUS Destroy() override;
169 
170     //!
171     //! \brief  Destory the tempSurface and release internal resources
172     //! \return MOS_STATUS
173     //!         MOS_STATUS_SUCCESS if success, else fail reason
174     //!
175 #if (_DEBUG || _RELEASE_INTERNAL)
176     MOS_STATUS DestroySurface();
177 #endif
178 
179     //!
180     //! \brief  get Status Report Table
181     //! \return PVPHAL_STATUS_TABLE
182     //!         Pointers to status Table
183     //!
GetStatusReportTable()184     PVPHAL_STATUS_TABLE GetStatusReportTable()
185     {
186         return m_vpMhwInterface.m_statusTable;
187     }
188 
189     //!
190     //! \brief  User Feature Key Report
191     //! \return MOS_STATUS
192     //!         MOS_STATUS_SUCCESS if success, else fail reason
193     //!
194     virtual MOS_STATUS UserFeatureReport() override;
195 
GetFeatureReport()196     virtual VphalFeatureReport *GetFeatureReport()
197     {
198         return m_reporting;
199     }
200 
201     //!
202     //! \brief    Check whether VEBOX-SFC Format Supported
203     //! \details  Check whether VEBOX-SFC Format Supported.
204     //! \param    inputFormat
205     //!           [in] Format of Input Frame
206     //! \param    outputFormat
207     //!           [in] Format of Output Frame
208     //! \return   bool
209     //!           Return true if supported, otherwise failed
210     //!
211     bool IsVeboxSfcFormatSupported(MOS_FORMAT formatInput, MOS_FORMAT formatOutput);
212 
ProcessBypassHandler(PVP_PIPELINE_PARAMS renderParams,bool & isBypassNeeded)213     virtual MOS_STATUS ProcessBypassHandler(PVP_PIPELINE_PARAMS renderParams, bool &isBypassNeeded)
214     {
215         return MOS_STATUS_SUCCESS;
216     }
217 
218     virtual MOS_STATUS CreateVPDebugInterface();
219 
GetUserFeatureControl()220     VpUserFeatureControl *GetUserFeatureControl()
221     {
222         return m_userFeatureControl;
223     }
224 
GetAllocator()225     VpAllocator *GetAllocator()
226     {
227         return m_allocator;
228     }
229 
230     // for debug purpose
231 #if (_DEBUG || _RELEASE_INTERNAL)
232     //!
233     //! \brief  replace output surface from Tile-Y to Linear
234     //! \param  [in] params
235     //!         Pointer to VP pipeline params
236     //! \return MOS_STATUS
237     //!         MOS_STATUS_SUCCESS if success, else fail reason
238     //!
239     MOS_STATUS SurfaceReplace(PVP_PIPELINE_PARAMS params);
240     virtual VPHAL_SURFACE *AllocateTempTargetSurface(VPHAL_SURFACE *m_tempTargetSurface);
241 #endif
242 
243     static const uint32_t m_scalability_threshWidth  = 4096;
244     static const uint32_t m_scalability_threshHeight = 2880;
245 
246 protected:
247 
248     //!
249     //! \brief  prepare execution params for vp pipeline
250     //! \param  [in] params
251     //!         Pointer to VP pipeline params
252     //! \return MOS_STATUS
253     //!         MOS_STATUS_SUCCESS if success, else fail reason
254     //!
255     virtual MOS_STATUS PrepareVpPipelineParams(PVP_PIPELINE_PARAMS params);
256 
257     //!
258     //! \brief  prepare execution params for vp scalability pipeline
259     //! \param  [in] params
260     //!         Pointer to VP scalability pipeline params
261     //! \return MOS_STATUS
262     //!         MOS_STATUS_SUCCESS if success, else fail reason
263     //!
264     virtual MOS_STATUS PrepareVpPipelineScalabilityParams(VEBOX_SFC_PARAMS* params);
265 
266 
267     //!
268     //! \brief  prepare execution params for vp scalability pipeline
269     //! \param  [in] params
270     //!         Pointer to VP scalability pipeline params
271     //! \return MOS_STATUS
272     //!         MOS_STATUS_SUCCESS if success, else fail reason
273     //!
274     virtual MOS_STATUS PrepareVpPipelineScalabilityParams(PVP_PIPELINE_PARAMS params);
275 
276     //!
277     //! \brief  prepare execution params for vp scalability pipeline
278     //! \param  [in] params
279     //!         src and dst surface's width and height
280     //! \return MOS_STATUS
281     //!         MOS_STATUS_SUCCESS if success, else fail reason
282     //!
283     virtual MOS_STATUS PrepareVpPipelineScalabilityParams(uint32_t srcWidth, uint32_t srcHeight, uint32_t dstWidth, uint32_t dstHeight);
284 
285     //!
286     //! \brief  Execute Vp Pipeline, and generate VP Filters
287     //! \return MOS_STATUS
288     //!         MOS_STATUS_SUCCESS if success, else fail reason
289     //!
290     virtual MOS_STATUS ExecuteVpPipeline();
291 
292     //!
293     //! \brief  updated Execute Vp Pipeline status
294     //! \return MOS_STATUS
295     //!         MOS_STATUS_SUCCESS if success, else fail reason
296     //!
297     virtual MOS_STATUS UpdateExecuteStatus(uint32_t frameCn);
298 
299     //!
300     //! \brief  Create SwFilterPipe
301     //! \param  [in] params
302     //!         Pointer to the input parameters
303     //! \param  [out] swFilterPipe
304     //!         Pointer to swFilterPipe
305     //! \return MOS_STATUS
306     //!         MOS_STATUS_SUCCESS if success, else fail reason
307     //!
308     virtual MOS_STATUS CreateSwFilterPipe(VP_PARAMS &params, std::vector<SwFilterPipe*> &swFilterPipe);
309 
310     //!
311     //! \brief  Get System Vebox Number
312     //! \return MOS_STATUS
313     //!         MOS_STATUS_SUCCESS if success, else fail reason
314     //!
315     virtual MOS_STATUS GetSystemVeboxNumber();
316 
317     //!
318     //! \brief  create media feature manager
319     //! \return MOS_STATUS
320     //!         MOS_STATUS_SUCCESS if success, else fail reason
321     //!
322     virtual MOS_STATUS CreateFeatureManager(VpResourceManager * vpResourceManager);
323 
324     virtual MOS_STATUS CreateSinglePipeContext();
325 
326 //!
327 //! \brief  create media kernel sets
328 //! \return MOS_STATUS
329 //!         MOS_STATUS_SUCCESS if success, else fail reason
330 //!
331     virtual MOS_STATUS CreateVpKernelSets();
332 
333     virtual MOS_STATUS CheckFeatures(void *params, bool &bapgFuncSupported);
334 
335     //!
336     //! \brief  create packet shared context
337     //! \return MOS_STATUS
338     //!         MOS_STATUS_SUCCESS if success, else fail reason
339     //!
340     virtual MOS_STATUS CreatePacketSharedContext();
341 
342     //!
343     //! \brief  create feature report
344     //! \return MOS_STATUS
345     //!         MOS_STATUS_SUCCESS if success, else fail reason
346     //!
347     virtual MOS_STATUS CreateFeatureReport();
348 
CreateReport()349     virtual MOS_STATUS CreateReport()
350     {
351         m_reporting        = MOS_New(VphalFeatureReport);
352         VP_PUBLIC_CHK_NULL_RETURN(m_reporting);
353         m_reporting->owner = this;
354         return MOS_STATUS_SUCCESS;
355     }
356 
357     virtual MOS_STATUS CreateUserFeatureControl();
358 
359     //!
360     //! \brief  set Predication Params
361     //! \return MOS_STATUS
362     //!         MOS_STATUS_SUCCESS if success, else fail reason
363     //!
SetPredicationParams(PVP_PIPELINE_PARAMS params)364     virtual MOS_STATUS SetPredicationParams(PVP_PIPELINE_PARAMS params)
365     {
366         return MOS_STATUS_SUCCESS;
367     }
368 
369     virtual MOS_STATUS UpdateFrameTracker();
370 
371 #if (_DEBUG || _RELEASE_INTERNAL)
372     //!
373     //! \brief  Report INTER_FRAME_MEMORY_NINJA_START_COUNTER and INTER_FRAME_MEMORY_NINJA_END_COUNTER
374     //!         INTER_FRAME_MEMORY_NINJA_START_COUNTER will be reported in Prepare() function
375     //!         INTER_FRAME_MEMORY_NINJA_END_COUNTER will be reported in UserFeatureReport() function which runs in EXecute()
376     //! \param
377     //! \return MOS_STATUS
378     //!         MOS_STATUS_SUCCESS if success, else fail reason
379     //!
380     virtual MOS_STATUS ReportIFNCC(bool bStart);
381 #endif
382 
383     //!
384     //! \brief  set Video Processing Settings
385     //! \param  [in] params
386     //!         Pointer to the input parameters
387     //! \return MOS_STATUS
388     //!         MOS_STATUS_SUCCESS if success, else fail reason
389     //!
SetVideoProcessingSettings(void * settings)390     virtual MOS_STATUS SetVideoProcessingSettings(void* settings)
391     {
392         if (!settings)
393         {
394             VP_PUBLIC_NORMALMESSAGE("No VPP Settings needed, driver to handle features behavious by self");
395             return MOS_STATUS_SUCCESS;
396         }
397 
398         VP_SETTINGS* vpSettings = (VP_SETTINGS*)settings;
399 
400         if (m_vpSettings == nullptr)
401         {
402             m_vpSettings = (VP_SETTINGS*)MOS_AllocAndZeroMemory(sizeof(VP_SETTINGS));
403 
404             if (m_vpSettings == nullptr)
405             {
406                 VP_PUBLIC_ASSERTMESSAGE("No Space, VP Settings created failed");
407                 return MOS_STATUS_NO_SPACE;
408             }
409         }
410 
411         *m_vpSettings = *vpSettings;
412 
413         return MOS_STATUS_SUCCESS;
414     }
415 
416     //!
417     //! \brief  Judge if it is gt test environment
418     //! \return bool
419     //!         true if success, else false
420     //!
IsGtEnv()421     virtual bool IsGtEnv()
422     {
423         return false;
424     }
425 
426     //!
427     //! \brief  Judge if it is gt test environment
428     //! \return bool
429     //!         true if success, else false
430     //!
IsMultiple()431     virtual bool IsMultiple()
432     {
433         return (m_numVebox > 1) ? true : false;
434     }
435 
436     MOS_STATUS UpdateVeboxNumberforScalability();
437 
438     MOS_STATUS ExecuteSingleswFilterPipe(VpSinglePipeContext *singlePipeCtx, SwFilterPipe *&pipe, PacketPipe *pPacketPipe, VpFeatureManagerNext *featureManagerNext);
439     MOS_STATUS UpdateRectForNegtiveDstTopLeft(PVP_PIPELINE_PARAMS params);
440 
441 protected:
442     VP_PARAMS              m_pvpParams              = {};   //!< vp Pipeline params
443     VP_MHWINTERFACE        m_vpMhwInterface         = {};   //!< vp Pipeline Mhw Interface
444 
445     uint8_t                m_numVebox               = 0;
446     uint8_t                m_numVeboxOriginal       = 0;
447     uint32_t               m_forceMultiplePipe      = 0;
448     VpAllocator           *m_allocator              = nullptr;  //!< vp Pipeline allocator
449     VPMediaMemComp        *m_mmc                    = nullptr;  //!< vp Pipeline mmc
450 
451     // For user feature report
452     VphalFeatureReport    *m_reporting              = nullptr;  //!< vp Pipeline user feature report
453 
454     VPStatusReport        *m_statusReport           = nullptr;  //!< vp Pipeline status report
455 
456 #if (_DEBUG || _RELEASE_INTERNAL)
457     VpDebugInterface      *m_debugInterface         = nullptr;
458 #endif
459     bool                   m_currentFrameAPGEnabled = false;
460     PacketFactory         *m_pPacketFactory         = nullptr;
461     PacketPipeFactory     *m_pPacketPipeFactory     = nullptr;
462     VpKernelSet           *m_kernelSet              = nullptr;
463     VPFeatureManager      *m_paramChecker           = nullptr;
464     VP_PACKET_SHARED_CONTEXT *m_packetSharedContext = nullptr;
465     VpInterface           *m_vpInterface            = nullptr;
466 #if (_DEBUG || _RELEASE_INTERNAL)
467     VPHAL_SURFACE         *m_tempTargetSurface      = nullptr;
468 #endif
469     VP_SETTINGS           *m_vpSettings = nullptr;
470     VpUserFeatureControl  *m_userFeatureControl = nullptr;
471     std::vector<VpSinglePipeContext *> m_vpPipeContexts     = {};
472     VpPipelineParamFactory            *m_pipelineParamFactory = nullptr;
473 
474     MEDIA_CLASS_DEFINE_END(vp__VpPipeline)
475 };
476 
477 struct _VP_SFC_PACKET_PARAMS
478 {
479     PSFC_SCALING_PARAMS sfcScalingParams;  //!< Params for SFC Scaling
480 };
481 
482 using VP_SFC_PACKET_PARAMS = _VP_SFC_PACKET_PARAMS;
483 
484 class VpSinglePipeContext
485 {
486 public:
487     VpSinglePipeContext();
488     virtual ~VpSinglePipeContext();
489 
490     virtual MOS_STATUS Init(PMOS_INTERFACE osInterface, VpAllocator *allocator, VphalFeatureReport *reporting, vp::VpPlatformInterface *vpPlatformInterface, PacketPipeFactory *packetPipeFactory, VpUserFeatureControl *userFeatureControl, MediaCopyWrapper *mediaCopyWrapper);
491 
492     //!
493     //! \brief  create reource manager
494     //! \return MOS_STATUS
495     //!         MOS_STATUS_SUCCESS if success, else fail reason
496     //!
497     virtual MOS_STATUS CreateResourceManager(PMOS_INTERFACE osInterface, VpAllocator *allocator, VphalFeatureReport *reporting, vp::VpPlatformInterface *vpPlatformInterface, vp::VpUserFeatureControl *userFeatureControl, MediaCopyWrapper *mediaCopyWrapper);
498 
499     virtual MOS_STATUS CreatePacketReuseManager(PacketPipeFactory *pPacketPipeFactory, VpUserFeatureControl *userFeatureControl);
500 
NewVpPacketReuseManagerObj(PacketPipeFactory * packetPipeFactory,VpUserFeatureControl * userFeatureControl)501     virtual VpPacketReuseManager *NewVpPacketReuseManagerObj(PacketPipeFactory *packetPipeFactory, VpUserFeatureControl *userFeatureControl)
502     {
503         return packetPipeFactory && userFeatureControl ? MOS_New(VpPacketReuseManager, *packetPipeFactory, *userFeatureControl) : nullptr;
504     }
505 
GetPacketReUseManager()506     VpPacketReuseManager *GetPacketReUseManager()
507     {
508         return m_packetReuseMgr;
509     }
510 
GetVpResourceManager()511     VpResourceManager *GetVpResourceManager()
512     {
513         return m_resourceManager;
514     }
515 
IsPacketReUsed()516     bool IsPacketReUsed()
517     {
518         return m_packetReused;
519     }
520 
IsVeboxInUse()521     bool IsVeboxInUse()
522     {
523         return m_veboxFeatureInuse;
524     }
525 
GetFrameCounter()526     uint32_t GetFrameCounter()
527     {
528         return m_frameCounter;
529     }
530 
AddFrameCount()531     void AddFrameCount()
532     {
533         m_frameCounter++;
534     }
535 
InitializeOutputPipe()536     void InitializeOutputPipe()
537     {
538         m_vpOutputPipe      = VPHAL_OUTPUT_PIPE_MODE_INVALID;
539         m_veboxFeatureInuse = false;
540     }
541 
GetOutputPipe()542     VPHAL_OUTPUT_PIPE_MODE GetOutputPipe()
543     {
544         return m_vpOutputPipe;
545     }
546 
SetOutputPipeMode(VPHAL_OUTPUT_PIPE_MODE mode)547     void SetOutputPipeMode(VPHAL_OUTPUT_PIPE_MODE mode)
548     {
549         m_vpOutputPipe = mode;
550     }
551 
SetPacketReused(bool isReused)552     void SetPacketReused(bool isReused)
553     {
554         m_packetReused = isReused;
555     }
556 
SetIsVeboxFeatureInuse(bool isInuse)557     void SetIsVeboxFeatureInuse(bool isInuse)
558     {
559         m_veboxFeatureInuse = isInuse;
560     }
561 
562 protected:
563     VpPacketReuseManager *m_packetReuseMgr  = nullptr;
564     VpResourceManager    *m_resourceManager = nullptr;
565     // Surface dumper fields (counter and specification)
566     uint32_t               m_frameCounter      = 0;
567     bool                   m_packetReused      = false;  //!< true is packet reused.
568     VPHAL_OUTPUT_PIPE_MODE m_vpOutputPipe      = VPHAL_OUTPUT_PIPE_MODE_INVALID;
569     bool                   m_veboxFeatureInuse = false;
570     MEDIA_CLASS_DEFINE_END(vp__VpSinglePipeContext)
571 };
572 
573 class VpInterface
574 {
575 public:
VpInterface(PVP_MHWINTERFACE pHwInterface,VpAllocator & allocator,VpResourceManager * resourceManager)576     VpInterface(PVP_MHWINTERFACE pHwInterface, VpAllocator& allocator, VpResourceManager* resourceManager) :
577         m_swFilterPipeFactory(*this),
578         m_hwFilterPipeFactory(*this),
579         m_hwFilterFactory(*this),
580         m_hwInterface(pHwInterface),
581         m_allocator(allocator),
582         m_resourceManager(resourceManager),
583         m_swFilterHandler(nullptr) // setting when create feature manager
584     {
585     }
586 
~VpInterface()587     virtual ~VpInterface()
588     {
589     }
590 
GetSwFilterPipeFactory()591     SwFilterPipeFactory& GetSwFilterPipeFactory()
592     {
593         return m_swFilterPipeFactory;
594     }
595 
SetSwFilterHandlers(std::map<FeatureType,SwFilterFeatureHandler * > & swFilterHandler)596     void SetSwFilterHandlers(std::map<FeatureType, SwFilterFeatureHandler*>& swFilterHandler)
597     {
598         m_swFilterHandler = &swFilterHandler;
599     }
600 
GetSwFilterHandler(FeatureType type)601     SwFilterFeatureHandler* GetSwFilterHandler(FeatureType type)
602     {
603          if (!m_swFilterHandler)
604          {
605              return nullptr;
606          }
607 
608         type = (FeatureType)(type & FEATURE_TYPE_MASK);
609 
610         auto handler = m_swFilterHandler->find(type);
611 
612         if (handler != m_swFilterHandler->end())
613         {
614             return handler->second;
615         }
616         else
617         {
618             return nullptr;
619         }
620     }
621 
GetSwFilterHandlerMap()622     std::map<FeatureType, SwFilterFeatureHandler*>* GetSwFilterHandlerMap()
623     {
624         return m_swFilterHandler;
625     }
626 
GetHwFilterPipeFactory()627     HwFilterPipeFactory& GetHwFilterPipeFactory()
628     {
629         return m_hwFilterPipeFactory;
630     }
631 
GetHwFilterFactory()632     HwFilterFactory& GetHwFilterFactory()
633     {
634         return m_hwFilterFactory;
635     }
636 
GetAllocator()637     VpAllocator& GetAllocator()
638     {
639         return m_allocator;
640     }
641 
GetResourceManager()642     VpResourceManager* GetResourceManager()
643     {
644         return m_resourceManager;
645     }
646 
GetHwInterface()647     PVP_MHWINTERFACE GetHwInterface()
648     {
649         return m_hwInterface;
650     }
651 
SwitchResourceManager(VpResourceManager * resManager)652     MOS_STATUS SwitchResourceManager(VpResourceManager *resManager)
653     {
654         m_resourceManager = resManager;
655         return MOS_STATUS_SUCCESS;
656     }
657 
658 private:
659     SwFilterPipeFactory m_swFilterPipeFactory;
660     HwFilterPipeFactory m_hwFilterPipeFactory;
661     HwFilterFactory     m_hwFilterFactory;
662 
663     PVP_MHWINTERFACE    m_hwInterface;
664     VpAllocator& m_allocator;
665     VpResourceManager* m_resourceManager;
666     std::map<FeatureType, SwFilterFeatureHandler*>* m_swFilterHandler = nullptr;
667 
668 MEDIA_CLASS_DEFINE_END(vp__VpInterface)
669 };
670 }  // namespace vp
671 
672 #endif
673