1 /*
2  *  Copyright (C) 2005-2018 Team Kodi
3  *  This file is part of Kodi - https://kodi.tv
4  *
5  *  SPDX-License-Identifier: GPL-2.0-or-later
6  *  See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "ServiceBroker.h"
12 #include "utils/CPUInfo.h"
13 
14 extern "C" {
15 #include <libavcodec/avcodec.h>
16 #include <libavformat/avformat.h>
17 #include <libavutil/avutil.h>
18 #include <libavutil/log.h>
19 #include <libavutil/ffversion.h>
20 #include <libavfilter/avfilter.h>
21 #include <libpostproc/postprocess.h>
22 }
23 
PPCPUFlags()24 inline int PPCPUFlags()
25 {
26   unsigned int cpuFeatures = CServiceBroker::GetCPUInfo()->GetCPUFeatures();
27   int flags = 0;
28 
29   if (cpuFeatures & CPU_FEATURE_MMX)
30     flags |= PP_CPU_CAPS_MMX;
31   if (cpuFeatures & CPU_FEATURE_MMX2)
32     flags |= PP_CPU_CAPS_MMX2;
33   if (cpuFeatures & CPU_FEATURE_3DNOW)
34     flags |= PP_CPU_CAPS_3DNOW;
35   if (cpuFeatures & CPU_FEATURE_ALTIVEC)
36     flags |= PP_CPU_CAPS_ALTIVEC;
37 
38   return flags;
39 }
40 
41 // callback used for logging
42 void ff_avutil_log(void* ptr, int level, const char* format, va_list va);
43 void ff_flush_avutil_log_buffers(void);
44 
45 class CFFmpegLog
46 {
47 public:
48   static void SetLogLevel(int level);
49   static int GetLogLevel();
50   static void ClearLogLevel();
51   int level;
52 };
53 
54