Sayonara Player
ConvertPipeline.h
1 /* ConvertPipeline.h */
2 
3 /* Copyright 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef ConvertPipeline_H
22 #define ConvertPipeline_H
23 
24 #include "LameBitrate.h"
25 #include "Components/Engine/AbstractPipeline.h"
26 
27 namespace Pipeline
28 {
29  class Convert :
30  public Base
31  {
32  Q_OBJECT
33  public:
34  explicit Convert(Engine::Base* engine, QObject *parent=nullptr);
35  ~Convert();
36 
37  bool set_uri(gchar* uri) override;
38  bool init(GstState state=GST_STATE_NULL) override;
39  GstElement* get_source() const override;
40 
41  bool set_target_uri(gchar* uri);
42 
43 
44  public slots:
45  void play() override;
46  void stop() override;
47 
48  void set_quality(LameBitrate quality);
49 
50  private:
51  GstElement* _audio_src=nullptr;
52  GstElement* _lame=nullptr;
53  GstElement* _decoder=nullptr;
54  GstElement* _audio_convert=nullptr;
55  GstElement* _audio_sink=nullptr;
56  GstElement* _resampler=nullptr;
57  GstElement* _xingheader=nullptr;
58 
59 
60  protected:
61  bool create_elements() override;
62  bool add_and_link_elements() override;
63  bool configure_elements() override;
64  };
65 }
66 #endif // ConvertPipeline_H
Definition: ConvertPipeline.h:29
The AbstractPipeline class.
Definition: AbstractPipeline.h:61
The Engine class.
Definition: AbstractEngine.h:51
Definition: AbstractPipeline.h:39