Ginga  0.13.6.2086-83aa
The iTV middleware.
PlayerSigGen.h
1 /* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia
2 
3 This file is part of Ginga (Ginga-NCL).
4 
5 Ginga is free software: you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 
10 Ginga is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13 License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with Ginga. If not, see <https://www.gnu.org/licenses/>. */
17 
18 #ifndef PLAYER_SIGGEN_H
19 #define PLAYER_SIGGEN_H
20 
21 #include "Player.h"
22 
23 GINGA_NAMESPACE_BEGIN
24 
25 class PlayerSigGen : public Player
26 {
27 public:
29  ~PlayerSigGen ();
30  void start () override;
31  void stop () override;
32  void pause () override;
33  void resume () override;
34  void redraw (cairo_t *) override;
35 
36 protected:
37  bool doSetProperty (Property, const string &, const string &) override;
38 
39 private:
40  GstElement *_pipeline; // pipeline
41  struct
42  { // audio pipeline
43  GstElement *src; // Audio Test Src format
44  GstElement *convert; // convert audio format
45  GstElement *tee; // splits pipeline
46  GstElement *audioQueue; // links audio pipeline side
47  GstElement *audioSink; // audio sink
48  GstElement *videoQueue; // links video pipeline side
49  GstElement *videoScope; // video draw style
50  GstElement *videoConvert; // convert video format
51  GstElement *videoSink; // video sink
52 
53  GstPad *teeAudioPad; // tee audio pad (output)
54  GstPad *queueAudioPad; // queue audio pad (input)
55  GstPad *teeVideoPad; // tee video pad (output)
56  GstPad *queueVideoPad; // queue video pad (input)
57  } _audio;
58 
59  int _sample_flag; // true if new sample is available
60  GstAppSinkCallbacks _callbacks; // video app-sink callback data
61 
62  struct
63  {
64  double freq; // frequency
65  int wave; // wave
66  double volume; // sound level
67  } _prop;
68 
69  // GStreamer callbacks.
70  static gboolean cb_Bus (GstBus *, GstMessage *, PlayerSigGen *);
71  static GstFlowReturn cb_NewSample (GstAppSink *, gpointer);
72 };
73 
74 GINGA_NAMESPACE_END
75 
76 #endif // PLAYER_SIGGEN_H
Interface between libginga and the external world.
Definition: Formatter.h:37
Definition: Media.h:26
Definition: PlayerSigGen.h:25
Definition: Player.h:28