Coverage Report

Created: 2025-07-23 08:18

/src/openh264/codec/processing/src/common/WelsFrameWorkEx.cpp
Line
Count
Source (jump to first uncovered line)
1
/*!
2
 * \copy
3
 *     Copyright (c)  2013, Cisco Systems
4
 *     All rights reserved.
5
 *
6
 *     Redistribution and use in source and binary forms, with or without
7
 *     modification, are permitted provided that the following conditions
8
 *     are met:
9
 *
10
 *        * Redistributions of source code must retain the above copyright
11
 *          notice, this list of conditions and the following disclaimer.
12
 *
13
 *        * Redistributions in binary form must reproduce the above copyright
14
 *          notice, this list of conditions and the following disclaimer in
15
 *          the documentation and/or other materials provided with the
16
 *          distribution.
17
 *
18
 *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 *     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 *     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21
 *     FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
 *     COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23
 *     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24
 *     BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
 *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
 *     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27
 *     LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28
 *     ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
 *     POSSIBILITY OF SUCH DAMAGE.
30
 *
31
 */
32
33
#include "WelsFrameWork.h"
34
35
///////////////////////////////////////////////////////////////////////
36
37
WELSVP_NAMESPACE_BEGIN
38
39
0
EResult Init (void* pCtx, int32_t iType, void* pCfg) {
40
0
  return pCtx ? WelsStaticCast (IWelsVP*, pCtx)->Init (iType, pCfg) : RET_INVALIDPARAM;
41
0
}
42
0
EResult Uninit (void* pCtx, int32_t iType) {
43
0
  return pCtx ? WelsStaticCast (IWelsVP*, pCtx)->Uninit (iType) : RET_INVALIDPARAM;
44
0
}
45
0
EResult Flush (void* pCtx, int32_t iType) {
46
0
  return pCtx ? WelsStaticCast (IWelsVP*, pCtx)->Flush (iType) : RET_INVALIDPARAM;
47
0
}
48
0
EResult Process (void* pCtx, int32_t iType, SPixMap* pSrc, SPixMap* dst) {
49
0
  return pCtx ? WelsStaticCast (IWelsVP*, pCtx)->Process (iType, pSrc, dst) : RET_INVALIDPARAM;
50
0
}
51
0
EResult Get (void* pCtx, int32_t iType, void* pParam) {
52
0
  return pCtx ? WelsStaticCast (IWelsVP*, pCtx)->Get (iType, pParam) : RET_INVALIDPARAM;
53
0
}
54
0
EResult Set (void* pCtx, int32_t iType, void* pParam) {
55
0
  return pCtx ? WelsStaticCast (IWelsVP*, pCtx)->Set (iType, pParam) : RET_INVALIDPARAM;
56
0
}
57
0
EResult SpecialFeature (void* pCtx, int32_t iType, void* pIn, void* pOut) {
58
0
  return pCtx ? WelsStaticCast (IWelsVP*, pCtx)->SpecialFeature (iType, pIn, pOut) : RET_INVALIDPARAM;
59
0
}
60
61
///////////////////////////////////////////////////////////////////////////////
62
63
0
EResult CreateSpecificVpInterface (IWelsVPc** pCtx) {
64
0
  EResult  ret     = RET_FAILED;
65
0
  IWelsVP* pWelsVP = NULL;
66
67
0
  ret = CreateSpecificVpInterface (&pWelsVP);
68
0
  if (ret == RET_SUCCESS) {
69
0
    IWelsVPc* pVPc = new IWelsVPc;
70
0
    if (pVPc) {
71
0
      pVPc->Init    = Init;
72
0
      pVPc->Uninit  = Uninit;
73
0
      pVPc->Flush   = Flush;
74
0
      pVPc->Process = Process;
75
0
      pVPc->Get     = Get;
76
0
      pVPc->Set     = Set;
77
0
      pVPc->SpecialFeature = SpecialFeature;
78
0
      pVPc->pCtx       = WelsStaticCast (void*, pWelsVP);
79
0
      *pCtx            = pVPc;
80
0
    } else
81
0
      ret = RET_OUTOFMEMORY;
82
0
  }
83
84
0
  return ret;
85
0
}
86
87
0
EResult DestroySpecificVpInterface (IWelsVPc* pCtx) {
88
0
  if (pCtx) {
89
0
    DestroySpecificVpInterface (WelsStaticCast (IWelsVP*, pCtx->pCtx));
90
0
    delete pCtx;
91
0
  }
92
93
0
  return RET_SUCCESS;
94
0
}
95
96
WELSVP_NAMESPACE_END