1 // Copyright (c) 2017 Intel Corporation
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in all
11 // copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 // SOFTWARE.
20 
21 #ifndef __MFX_TIMING_H__
22 #define __MFX_TIMING_H__
23 
24 //uncomment this define for timing instrumentation
25 //#define MFX_TIMING
26 
27 #define MFX_TIMING_CHECK_REGISTRY   0x10000000
28 #define MFX_TIMING_PROXY_LIBSW      0x20000000
29 #define MFX_TIMING_PROXY_LIBHW      0x40000000
30 
31 #define MFX_INVALID_STATUS_CODE     (int)0xffff
32 
33 // for SetInput/SetOutput
34 enum
35 {
36     MFX_COMP_DECODE  = 1,
37     MFX_COMP_VPP     = 2,
38     MFX_COMP_ENCODE  = 3,
39 };
40 
41 #ifndef NULL
42 #ifdef __cplusplus
43 #define NULL    0
44 #else
45 #define NULL    ((void *)0)
46 #endif
47 #endif
48 
49 namespace MFX
50 {
51 
52 
53 // empty declaration for normal build
54 class AutoTimer
55 {
56 public:
Init(const void *,int)57     static int Init(const void * /*filename*/, int /*level = -1*/) { return 0; }
CreateUniqTaskId()58     static unsigned int CreateUniqTaskId() {return 0;}
59 
AutoTimer(const char *)60     AutoTimer(const char * /*name*/){}
AutoTimer(const char *,const char *,int)61     AutoTimer(const char * /*name*/, const char * /*param*/, int /*parami = 0*/)    {}
AutoTimer(const char *,bool,unsigned int,unsigned int)62     AutoTimer(const char * /*name*/, bool /*bCreateId*/, unsigned int /*child_of*/, unsigned int /*parent_of*/)  {}
~AutoTimer()63     ~AutoTimer() {};
AutoTimer()64     AutoTimer() {};
65 
SetInput(void *,int)66     void SetInput(void * /*handle*/, int /*component_index = -1*/) {};
SetOutput(void *,int)67     void SetOutput(void * /*handle*/, int /*component_index = -1*/) {};
AddParam(const char *,const char *)68     void AddParam(const char * /*param_name*/, const char * /*param_value*/) {};
AddParam(const char *,int)69     void AddParam(const char * /*param_name*/, int /*param_value*/) {};
Start(const char *)70     void Start(const char * /*name*/) {};
Stop(int)71     void Stop(int /*return_code = MFX_INVALID_STATUS_CODE*/) {};
72 };
73 
74 
75 } // namespace UMC
76 
77 #endif // __MFX_TIMING_H__
78