[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / cores / AudioEngine / Encoders / AEEncoderFFmpeg.h
blob3274d3ac4bca2e962d52ed69b17cac7d0b1ce9c8
1 /*
2 * Copyright (C) 2010-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 #pragma once
11 #include "cores/AudioEngine/Interfaces/AEEncoder.h"
13 extern "C" {
14 #include <libswresample/swresample.h>
17 /* ffmpeg re-defines this, so undef it to squash the warning */
18 #undef restrict
20 class CAEEncoderFFmpeg: public IAEEncoder
22 public:
23 CAEEncoderFFmpeg();
24 ~CAEEncoderFFmpeg() override;
26 bool IsCompatible(const AEAudioFormat& format) override;
27 bool Initialize(AEAudioFormat &format, bool allow_planar_input = false) override;
28 void Reset() override;
30 unsigned int GetBitRate() override;
31 AVCodecID GetCodecID() override;
32 unsigned int GetFrames() override;
34 int Encode(uint8_t *in, int in_size, uint8_t *out, int out_size) override;
35 int GetData(uint8_t **data) override;
36 double GetDelay(unsigned int bufferSize) override;
37 private:
38 unsigned int BuildChannelLayout(const int64_t ffmap, CAEChannelInfo& layout);
40 std::string m_CodecName;
41 AVCodecID m_CodecID;
42 unsigned int m_BitRate = 0;
43 AEAudioFormat m_CurrentFormat;
44 AVCodecContext *m_CodecCtx;
45 SwrContext *m_SwrCtx;
46 CAEChannelInfo m_Layout;
47 uint8_t m_Buffer[8 + AV_INPUT_BUFFER_MIN_SIZE];
48 int m_BufferSize = 0;
49 int m_OutputSize = 0;
50 double m_OutputRatio = 0.0;
51 double m_SampleRateMul = 0.0;
52 unsigned int m_NeededFrames = 0;
53 bool m_NeedConversion = false;