Sayonara Player
ConvertPipeline.h
1 /* ConvertPipeline.h */
2 
3 /* Copyright (C) 2013 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 
22 
23 #ifndef ConvertPipeline_H
24 #define ConvertPipeline_H
25 
26 #include "Components/Engine/AbstractPipeline.h"
27 #include "Helper/globals.h"
28 
30 {
31  Q_OBJECT
32 public:
33  explicit ConvertPipeline(Engine* engine, QObject *parent=nullptr);
34  virtual ~ConvertPipeline();
35 
36  bool set_uri(gchar* uri) override;
37  bool init(GstState state=GST_STATE_NULL) override;
38  GstElement* get_source() const override;
39 
40  bool set_target_uri(gchar* uri);
41 
42 
43 public slots:
44  void play() override;
45  void pause() override;
46  void stop() override;
47 
48  guint get_bitrate();
49 
50  void set_quality(LameBitrate quality);
51 
52 private:
53  GstElement* _audio_src=nullptr;
54  GstElement* _lame=nullptr;
55  GstElement* _decoder=nullptr;
56  GstElement* _audio_convert=nullptr;
57  GstElement* _audio_sink=nullptr;
58  GstElement* _resampler=nullptr;
59  GstElement* _xingheader=nullptr;
60 
61 
62 protected:
63  bool create_elements() override;
64  bool add_and_link_elements() override;
65  bool configure_elements() override;
66 };
67 
68 #endif // ConvertPipeline_H
Definition: ConvertPipeline.h:29
Definition: AbstractEngine.h:40
Definition: AbstractPipeline.h:46