xbmc
ActiveAEFilter.h
1 /*
2  * Copyright (C) 2010-2018 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 extern "C" {
12 #include <libavfilter/avfilter.h>
13 #include <libavutil/frame.h>
14 }
15 
16 struct SwrContext;
17 
18 namespace ActiveAE
19 {
20 
22 {
23 public:
25  virtual ~CActiveAEFilter();
26  void Init(AVSampleFormat fmt, int sampleRate, uint64_t channelLayout);
27  int ProcessFilter(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, int src_bufsize);
28  bool SetTempo(float tempo);
29  bool NeedData() const;
30  bool IsEof() const;
31  bool IsActive() const;
32  int GetBufferedSamples() const;
33 
34 protected:
35  bool CreateFilterGraph();
36  bool CreateAtempoFilter();
37  void CloseFilter();
38 
39  AVSampleFormat m_sampleFormat;
40  int m_sampleRate;
41  uint64_t m_channelLayout;
42  AVFilterGraph* m_pFilterGraph;
43  AVFilterContext* m_pFilterCtxIn;
44  AVFilterContext* m_pFilterCtxOut;
45  AVFilterContext* m_pFilterCtxAtempo;
46  AVFrame* m_pOutFrame;
47  SwrContext* m_pConvertCtx;
48  AVFrame* m_pConvertFrame;
49  bool m_needConvert;
50  float m_tempo;
51  bool m_filterEof;
52  bool m_started;
53  bool m_hasData;
54  bool m_needData;
55  bool m_ptsInitialized;
56  int m_sampleOffset;
57  int64_t m_SamplesIn;
58  int64_t m_SamplesOut;
59 };
60 
61 }
Definition: ActiveAEFilter.h:21
Definition: Application.h:69