Ginga  0.13.6.1771-df200
The iTV middleware.
PlayerVideo.h
Go to the documentation of this file.
1 /* Copyright (C) 2006-2017 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 <http://www.gnu.org/licenses/>. */
17 
18 #ifndef PLAYER_VIDEO_H
19 #define PLAYER_VIDEO_H
20 
21 #include "Player.h"
22 
24 
25 class PlayerVideo: public Player
26 {
27 public:
28  PlayerVideo (Formatter *, const string &, const string &);
29  ~PlayerVideo ();
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 (PlayerProperty, const string &,
38  const string &) override;
39 
40 private:
41  GstElement *_playbin; // pipeline
42  struct { // audio pipeline
43  GstElement *bin; // audio bin
44  GstElement *volume; // volume filter
45  GstElement *pan; // balance filter
46  GstElement *equalizer; // equalizer filter
47  GstElement *convert; // convert audio format
48  GstElement *sink; // audio sink
49  } _audio;
50  struct { // video pipeline
51  GstElement *bin; // video bin
52  GstElement *caps; // caps filter
53  GstElement *sink; // app sink
54  } _video;
55  int _sample_flag; // true if new sample is available
56  GstAppSinkCallbacks _callbacks; // video app-sink callback data
57 
58  struct
59  {
60  bool mute; // true if mute is on
61  double balance; // balance sound level
62  double volume; // sound level
63  double treble; // treble level (Default: 0; Range: -24 and +12)
64  double bass; // bass level (Default: 0; Range: -24 and +12)
65  bool freeze; // true if player should freeze
66  } _prop;
67 
68  bool getFreeze ();
69 
70  // GStreamer callbacks.
71  static gboolean cb_Bus (GstBus *, GstMessage *, PlayerVideo *);
72  static GstFlowReturn cb_NewSample (GstAppSink *, gpointer);
73 };
74 
76 
77 #endif // PLAYER_VIDEO_H
bool freeze
Definition: PlayerVideo.h:65
GstAppSinkCallbacks _callbacks
Definition: PlayerVideo.h:56
Definition: PlayerVideo.h:25
GstElement * sink
Definition: PlayerVideo.h:48
GstElement * volume
Definition: PlayerVideo.h:44
double treble
Definition: PlayerVideo.h:63
static GstFlowReturn cb_NewSample(GstAppSink *, gpointer)
Definition: PlayerVideo.cpp:442
int _sample_flag
Definition: PlayerVideo.h:55
GstElement * pan
Definition: PlayerVideo.h:45
#define GINGA_NAMESPACE_END
Definition: aux-ginga.h:62
~PlayerVideo()
Definition: PlayerVideo.cpp:177
void redraw(cairo_t *) override
Definition: PlayerVideo.cpp:259
GstElement * caps
Definition: PlayerVideo.h:52
Definition: Formatter.h:35
void stop() override
Definition: PlayerVideo.cpp:228
double bass
Definition: PlayerVideo.h:64
GstElement * equalizer
Definition: PlayerVideo.h:46
bool mute
Definition: PlayerVideo.h:60
struct PlayerVideo::@4 _prop
void start() override
Definition: PlayerVideo.cpp:182
GstElement * convert
Definition: PlayerVideo.h:47
void resume() override
Definition: PlayerVideo.cpp:249
#define GINGA_NAMESPACE_BEGIN
Definition: aux-ginga.h:61
PlayerVideo(Formatter *, const string &, const string &)
Definition: PlayerVideo.cpp:46
bool doSetProperty(PlayerProperty, const string &, const string &) override
Definition: PlayerVideo.cpp:332
double balance
Definition: PlayerVideo.h:61
struct PlayerVideo::@3 _video
struct PlayerVideo::@2 _audio
void pause() override
Definition: PlayerVideo.cpp:239
bool getFreeze()
Definition: PlayerVideo.cpp:387
GstElement * _playbin
Definition: PlayerVideo.h:41
static gboolean cb_Bus(GstBus *, GstMessage *, PlayerVideo *)
Definition: PlayerVideo.cpp:396
Definition: Player.h:27
PlayerProperty
Definition: Player.h:37
double volume
Definition: PlayerVideo.h:62
GstElement * bin
Definition: PlayerVideo.h:43