| #include <vector> |
| 6 | #include <map> |
| 7 | #include <stdint.h> |
| 8 |
| 9 | namespace tgcalls { |
| 10 |
| 11 | class AudioStreamingPartState; |
| 12 |
| 13 | class AudioStreamingPart { |
| 14 | public: |
| 15 | struct StreamingPartChannel { |
| 16 | uint32_t ssrc = 0; |
| 17 | std::vector<int16_t> pcmData; |
| 18 | }; |
| 19 |
| 20 | explicit AudioStreamingPart(std::vector<uint8_t> &&data); |
| 21 | ~AudioStreamingPart(); |
| 22 |
| 23 | AudioStreamingPart(const AudioStreamingPart&) = delete; |
| 24 | AudioStreamingPart(AudioStreamingPart&& other) { |
| 25 | _state = other._state; |
| 26 | other._state = nullptr; |
| 27 | } |
| 28 | AudioStreamingPart& operator=(const AudioStreamingPart&) = delete; |
| 29 | AudioStreamingPart& operator=(AudioStreamingPart&&) = delete; |
| 30 |
| 31 | std::map<std::string, int32_t> getEndpointMapping() const; |
| 32 | int getRemainingMilliseconds() const; |
| 33 | std::vector<StreamingPartChannel> get10msPerChannel(); |
| 34 |
| 35 | private: |
| 36 | AudioStreamingPartState *_state = nullptr; |
| 37 | }; |
| 38 |
| 39 | } |
| 40 |
| 41 | #endif |
| 42 |