ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
PlayerSigGen.h
1/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia
2
3This file is part of Ginga (Ginga-NCL).
4
5Ginga is free software: you can redistribute it and/or modify it
6under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10Ginga is distributed in the hope that it will be useful, but WITHOUT
11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13License for more details.
14
15You should have received a copy of the GNU General Public License
16along 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
23namespace ginga {
24
25class PlayerSigGen : public Player
26{
27public:
30 void start () override;
31 void stop () override;
32 void pause () override;
33 void resume () override;
34 void redraw (cairo_t *) override;
35
36protected:
37 bool doSetProperty (Property, const string &, const string &) override;
38
39private:
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}
75
76#endif // PLAYER_SIGGEN_H
Interface between libginga and the external world.
Definition Formatter.h:39
Definition Media.h:27
Definition PlayerSigGen.h:26
Definition Player.h:29