Debian Codegraph @

xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2010-2021 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 "cores/AudioEngine/Interfaces/AESink.h"
12 #include "cores/AudioEngine/Utils/AEDeviceInfo.h"
13
14 #include <chrono>
15
16 namespace KODI
17 {
18 namespace PIPEWIRE
19 {
20 class CPipewireStream;
21 }
22 } // namespace KODI
23
24 namespace AE
25 {
26 namespace SINK
27 {
28
29 class CAESinkPipewire : public IAESink
30 {
31 public:
32 CAESinkPipewire() = default;
33 ~CAESinkPipewire() override = default;
34
35 static bool Register();
36 static std::unique_ptr<IAESink> Create(std::string& device, AEAudioFormat& desiredFormat);
37 static void EnumerateDevicesEx(AEDeviceInfoList& list, bool force = false);
38 static void Destroy();
39
40 // overrides via IAESink
41 const char* GetName() override { return "PIPEWIRE"; }
42
43 bool Initialize(AEAudioFormat& format, std::string& device) override;
44 void Deinitialize() override;
45
46 double GetCacheTotal() override;
47 void GetDelay(AEDelayStatus& status) override;
48
49 unsigned int AddPackets(uint8_t** data, unsigned int frames, unsigned int offset) override;
50 void Drain() override;
51
52 private:
53 AEAudioFormat m_format;
54 std::chrono::duration<double, std::ratio<1>> m_latency;
55
56 std::unique_ptr<KODI::PIPEWIRE::CPipewireStream> m_stream;
57 };
58
59 } // namespace SINK
60 } // namespace AE