[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / platform / freebsd / PlatformFreebsd.cpp
blob6ab3f46ed256458d2fcd6bc0e30f1be9383b98db
1 /*
2 * Copyright (C) 2016-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "PlatformFreebsd.h"
11 #include "ServiceBroker.h"
12 #include "application/AppParams.h"
13 #include "utils/StringUtils.h"
15 #include "platform/freebsd/OptionalsReg.h"
16 #include "platform/linux/powermanagement/LinuxPowerSyscall.h"
18 // clang-format off
19 #if defined(HAS_GLES)
20 #if defined(HAVE_WAYLAND)
21 #include "windowing/wayland/WinSystemWaylandEGLContextGLES.h"
22 #endif
23 #if defined(HAVE_X11)
24 #include "windowing/X11/WinSystemX11GLESContext.h"
25 #endif
26 #if defined(HAVE_GBM)
27 #include "windowing/gbm/WinSystemGbmGLESContext.h"
28 #endif
29 #endif
31 #if defined(HAS_GL)
32 #if defined(HAVE_WAYLAND)
33 #include "windowing/wayland/WinSystemWaylandEGLContextGL.h"
34 #endif
35 #if defined(HAVE_X11)
36 #include "windowing/X11/WinSystemX11GLContext.h"
37 #endif
38 #if defined(HAVE_GBM)
39 #include "windowing/gbm/WinSystemGbmGLContext.h"
40 #endif
41 #endif
42 // clang-format on
44 #include <cstdlib>
46 CPlatform* CPlatform::CreateInstance()
48 return new CPlatformFreebsd();
51 bool CPlatformFreebsd::InitStageOne()
53 if (!CPlatformPosix::InitStageOne())
54 return false;
56 setenv("OS", "Linux", true); // for python scripts that check the OS
58 #if defined(HAS_GLES)
59 #if defined(HAVE_WAYLAND)
60 KODI::WINDOWING::WAYLAND::CWinSystemWaylandEGLContextGLES::Register();
61 #endif
62 #if defined(HAVE_X11)
63 KODI::WINDOWING::X11::CWinSystemX11GLESContext::Register();
64 #endif
65 #if defined(HAVE_GBM)
66 KODI::WINDOWING::GBM::CWinSystemGbmGLESContext::Register();
67 #endif
68 #endif
70 #if defined(HAS_GL)
71 #if defined(HAVE_WAYLAND)
72 KODI::WINDOWING::WAYLAND::CWinSystemWaylandEGLContextGL::Register();
73 #endif
74 #if defined(HAVE_X11)
75 KODI::WINDOWING::X11::CWinSystemX11GLContext::Register();
76 #endif
77 #if defined(HAVE_GBM)
78 KODI::WINDOWING::GBM::CWinSystemGbmGLContext::Register();
79 #endif
80 #endif
82 CLinuxPowerSyscall::Register();
84 std::string_view sink = CServiceBroker::GetAppParams()->GetAudioBackend();
86 if (sink == "alsa")
88 OPTIONALS::ALSARegister();
90 else if (sink == "pulseaudio")
92 OPTIONALS::PulseAudioRegister(true);
94 else if (sink == "oss")
96 OPTIONALS::OSSRegister();
98 else if (sink == "sndio")
100 OPTIONALS::SndioRegister();
102 else if (sink == "alsa+pulseaudio")
104 OPTIONALS::ALSARegister();
105 OPTIONALS::PulseAudioRegister(true);
107 else
109 if (!OPTIONALS::PulseAudioRegister(false))
111 if (!OPTIONALS::ALSARegister())
113 if (!OPTIONALS::SndioRegister())
115 OPTIONALS::OSSRegister();
121 m_lirc.reset(OPTIONALS::LircRegister());
123 return true;