Debian Codegraph @

media_softlet/agnostic/common/cp/cp_copy_interface.h

raw
1 /*
2 * Copyright (c) 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 cp_copy_interface.h
24 //! \brief CP copy interface for content protection
25 //! \details Impelements the copy functionalities across all platforms for content protection
26 //!
27
28 #ifndef __CP_COPY_INTERFACE_H__
29 #define __CP_COPY_INTERFACE_H__
30
31 #include "mos_os.h"
32 #include "media_copy.h"
33
34 typedef struct _CPCPY_STATE_PARAMS
35 {
36 bool bForceMediaCopy = false; // If true will use MediaCopy directly.
37 MCPY_METHOD mediaCopyMethod = MCPY_METHOD_BALANCE; // Read it when bForceMediaCopy is true, otherwise ignore it.
38 } CPCPY_STATE_PARAMS;
39
40 class CpCopyInterface
41 {
42 public:
43 virtual ~CpCopyInterface(){};
44
45 virtual MOS_STATUS InitCpCopy(PMOS_CONTEXT pOsDriverContext) = 0;
46
47 virtual MOS_STATUS CopyResource(PMOS_SURFACE src, PMOS_SURFACE dst, CPCPY_STATE_PARAMS params) = 0;
48
49 virtual MOS_STATUS Fill2DSurfaceWithProtectedZero(PMOS_RESOURCE dst) = 0;
50
51 MEDIA_CLASS_DEFINE_END(CpCopyInterface)
52 };
53
54 #endif // __CP_COPY_INTERFACE_H__