ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
PlayerVideo.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_VIDEO_H
19#define PLAYER_VIDEO_H
20
21#include "Player.h"
22#include <gst/gstelement.h>
23
24namespace ginga {
25class Media;
26class PlayerVideo : public Player
27{
28public:
30 ~PlayerVideo ();
31 void start () override;
32 void stop () override;
33 void pause () override;
34 void resume () override;
35 void redraw (cairo_t *) override;
36 // GStreamer callback.
37 static gboolean cb_Bus (GstBus *, GstMessage *, PlayerVideo *);
38
39protected:
40 bool doSetProperty (Property, const string &, const string &) override;
41 void setURI (const string &uri);
42
43 void seek (gint64);
44 void speed (double);
45 gint64 getPipelineTime ();
46 gint64 getStreamMediaTime ();
47 gint64 getStreamMediaDuration ();
48
49private:
50 GstElement *_playbin; // pipeline
51 struct
52 { // audio pipeline
53 GstElement *bin; // audio bin
54 GstElement *volume; // volume filter
55 GstElement *pan; // balance filter
56 GstElement *equalizer; // equalizer filter
57 GstElement *convert; // convert audio format
58 GstElement *sink; // audio sink
59 } _audio;
60 struct
61 { // video pipeline
62 GstElement *bin; // video bin
63 GstElement *caps; // caps filter
64 GstElement *sink; // app sink
65 } _video;
66 int _sample_flag; // true if new sample is available
67 GstAppSinkCallbacks _callbacks; // video app-sink callback data
68 struct
69 {
70 bool mute; // true if mute is on
71 double balance; // balance sound level
72 double volume; // sound level
73 double treble; // treble level (Default: 0; Range: -24 and +12)
74 double bass; // bass level (Default: 0; Range: -24 and +12)
75 bool freeze; // true if player should freeze
76 double speed; // playback speed (Default: 1)
77 } _prop;
78 typedef struct
79 {
80 Property code;
81 string name;
82 string value;
84 list<PlayerVideoAction> _stack_actions;
85 void initProperties (set<string> *); // Init default values to properties
86 // without go to doSetProperty function
87 void stackAction (Property, const string &, const string &);
88 void doStackedActions ();
89 bool getFreeze ();
90 string getPipelineState ();
91};
92
93}
94
95#endif // PLAYER_VIDEO_H
Interface between libginga and the external world.
Definition Formatter.h:39
Definition Media.h:27
Definition PlayerVideo.h:27
Definition Player.h:29
Definition PlayerVideo.h:79