1 /*
2 * Copyright (c) 2021, 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_jpeg_feature_manager.h
24 //! \brief    Defines the common interface for jpeg feature manager
25 //! \details  The encode feature manager is further sub-divided by codec type
26 //!           this file is for the base interface which is shared by all components.
27 //!
28 #ifndef __ENCODE_JPEG_FEATURE_MANAGER_H__
29 #define __ENCODE_JPEG_FEATURE_MANAGER_H__
30 
31 #include "encode_feature_manager.h"
32 #include "codec_hw_next.h"
33 #include "encode_recycle_resource.h"
34 #include "encode_tracked_buffer.h"
35 
36 namespace encode
37 {
38 
39 class EncodeJpegFeatureManager : public EncodeFeatureManager
40 {
41 public:
42     //!
43     //! \brief  EncodeJpegFeatureManager constructor
44     //! \param  [in] allocator
45     //!         Pointer to EncodeAllocator
46     //! \param  [in] hwInterface
47     //!         Pointer to CodechalHwInterface
48     //! \param  [in] trackedBuf
49     //!         Pointer to TrackedBuffer
50     //! \param  [in] recycleBuf
51     //!         Pointer to RecycleResource
52     //!
EncodeJpegFeatureManager(EncodeAllocator * allocator,CodechalHwInterfaceNext * hwInterface,TrackedBuffer * trackedBuf,RecycleResource * recycleBuf)53      EncodeJpegFeatureManager(EncodeAllocator *allocator,
54                                   CodechalHwInterfaceNext *hwInterface,
55                                   TrackedBuffer       *trackedBuf,
56                                   RecycleResource     *recycleBuf):
57                                   m_allocator(allocator),
58                                   m_hwInterface(hwInterface),
59                                   m_recycleResource(recycleBuf),
60                                   m_trackedBuf(trackedBuf) {}
61 
62     //!
63     //! \brief  EncodeJpegFeatureManager deconstructor
64     //!
~EncodeJpegFeatureManager()65     virtual ~EncodeJpegFeatureManager() {}
66 
67 protected:
68 
69     EncodeAllocator     *m_allocator = nullptr;
70     CodechalHwInterfaceNext *m_hwInterface = nullptr;
71     RecycleResource     *m_recycleResource = nullptr;
72     TrackedBuffer       *m_trackedBuf = nullptr;
73 
74     //!
75     //! \brief  Create feature const settings
76     //! \return MOS_STATUS
77     //!         MOS_STATUS_SUCCESS if success, else fail reason
78     //!
79     virtual MOS_STATUS CreateConstSettings();
80 
81     //!
82     //! \brief  Create features
83     //! \param  [in] constsettings
84     //!         feature const settings
85     //! \return MOS_STATUS
86     //!         MOS_STATUS_SUCCESS if success, else fail reason
87     //!
88     virtual MOS_STATUS CreateFeatures(void *constSettings);
89 
90 MEDIA_CLASS_DEFINE_END(encode__EncodeJpegFeatureManager)
91 };
92 
93 }
94 #endif // !__ENCODE_JPEG_FEATURE_MANAGER_H__
95