| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifndef PLAYER_WINDOW_H_ |
| 20 |
#define PLAYER_WINDOW_H_ |
| 21 |
|
| 22 |
#include <gtkmm.h> |
| 23 |
#include <gstreamermm.h> |
| 24 |
|
| 25 |
class PlayerWindow : public Gtk::Window |
| 26 |
{ |
| 27 |
public: |
| 28 |
#ifndef GSTREAMERMM_DISABLE_DEPRECATED |
| 29 |
using PlayBinT = Gst::PlayBin; |
| 30 |
#else |
| 31 |
using PlayBinT = Gst::Element; |
| 32 |
#endif |
| 33 |
PlayerWindow(const Glib::RefPtr<PlayBinT>& playbin); |
| 34 |
virtual ~PlayerWindow(); |
| 35 |
|
| 36 |
protected: |
| 37 |
|
| 38 |
|
| 39 |
void on_video_area_realize(); |
| 40 |
void on_bus_message_sync(const Glib::RefPtr<Gst::Message>& message); |
| 41 |
bool on_bus_message(const Glib::RefPtr<Gst::Bus>& bus, const Glib::RefPtr<Gst::Message>& message); |
| 42 |
void on_video_changed(); |
| 43 |
Gst::PadProbeReturn on_video_pad_got_buffer(const Glib::RefPtr<Gst::Pad>& pad, const Gst::PadProbeInfo& data); |
| 44 |
|
| 45 |
void on_button_play(); |
| 46 |
void on_button_pause(); |
| 47 |
void on_button_stop(); |
| 48 |
void on_button_rewind(); |
| 49 |
void on_button_forward(); |
| 50 |
void on_button_open(); |
| 51 |
bool on_scale_value_changed(Gtk::ScrollType type, double value); |
| 52 |
bool on_timeout(); |
| 53 |
|
| 54 |
void display_label_progress(gint64 pos, gint64 len); |
| 55 |
|
| 56 |
protected: |
| 57 |
Gtk::VBox m_vbox; |
| 58 |
Gtk::HButtonBox m_button_box; |
| 59 |
Gtk::DrawingArea m_video_area; |
| 60 |
Gtk::Label m_progress_label; |
| 61 |
Gtk::HScale m_progress_scale; |
| 62 |
Gtk::Button m_play_button; |
| 63 |
Gtk::Button m_pause_button; |
| 64 |
Gtk::Button m_stop_button; |
| 65 |
Gtk::Button m_rewind_button; |
| 66 |
Gtk::Button m_forward_button; |
| 67 |
Gtk::Button m_open_button; |
| 68 |
|
| 69 |
#ifndef GSTREAMERMM_DISABLE_DEPRECATED |
| 70 |
Glib::RefPtr<Gst::PlayBin> m_playbin; |
| 71 |
#else |
| 72 |
Glib::RefPtr<Gst::Element> m_playbin; |
| 73 |
#endif |
| 74 |
|
| 75 |
sigc::connection m_timeout_connection; |
| 76 |
guint m_watch_id; |
| 77 |
gint64 m_duration; |
| 78 |
gulong window_handler; |
| 79 |
gulong m_pad_probe_id; |
| 80 |
|
| 81 |
const gint64 rewind_skip_amount = Gst::SECOND * 2; |
| 82 |
const gint64 forward_skip_amount = Gst::SECOND * 3; |
| 83 |
}; |
| 84 |
|
| 85 |
#endif |