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