| 5 |
| #include <vector> |
| 6 | #include <string> |
| 7 | #include <map> |
| 8 | #include <stdint.h> |
| 9 |
| 10 | // Fix build on Windows - this should appear before FFmpeg timestamp include. |
| 11 | #define _USE_MATH_DEFINES |
| 12 | #include <math.h> |
| 13 |
| 14 | extern "C" { |
| 15 | #include <libavutil/timestamp.h> |
| 16 | #include <libavformat/avformat.h> |
| 17 | #include <libavcodec/avcodec.h> |
| 18 | } |
| 19 |
| 20 | namespace tgcalls { |
| 21 |
| 22 | class AudioStreamingPartPersistentDecoderState; |
| 23 |
| 24 | class WrappedCodecParameters { |
| 25 | public: |
| 26 | WrappedCodecParameters(AVCodecParameters const *codecParameters); |
| 27 | ~WrappedCodecParameters(); |
| 28 |
| 29 | bool isEqual(AVCodecParameters const *other); |
| 30 |
| 31 | private: |
| 32 | AVCodecParameters *_value = nullptr; |
| 33 | }; |
| 34 |
| 35 | class AudioStreamingPartPersistentDecoder { |
| 36 | public: |
| 37 | AudioStreamingPartPersistentDecoder(); |
| 38 | ~AudioStreamingPartPersistentDecoder(); |
| 39 |
| 40 | int decode(AVCodecParameters const *codecParameters, AVRational timeBase, AVPacket &packet, AVFrame *frame); |
| 41 |
| 42 | private: |
| 43 | void maybeReset(AVCodecParameters const *codecParameters, AVRational timeBase); |
| 44 |
| 45 | private: |
| 46 | AudioStreamingPartPersistentDecoderState *_state = nullptr; |
| 47 | }; |
| 48 |
| 49 | } |
| 50 |
| 51 | #endif |
| 52 |