Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
video-display-widget.cpp
Go to the documentation of this file.
1/*
2 VideoDisplayWidget - Implementation of the video viewer widget
3
4 Copyright (C)
5 2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
25#include "stage/gtk-base.hpp"
31
32
33namespace stage {
34namespace widget {
35
36 namespace {
37 const uint VIDEO_WIDTH = 320;
38 const uint VIDEO_HEIGHT = 240;
39 }
40
41
42 using std::make_unique;
46
48 {
49 get_style_context()->add_class (CLASS_background); // Style to ensure an opaque backdrop
50 get_style_context()->add_class (CLASS_videodisplay);
51 this->show_all();
52 }
53
54
55 void
56 VideoDisplayWidget::pushFrame (void* const buffer)
57 {
58 REQUIRE(displayer_);
59 displayer_->put(buffer);
60 }
61
62
63 void
65 {
66 // invoke base implementation
67 Gtk::Widget::on_realize ();
68 setupDisplayer (VIDEO_WIDTH, VIDEO_HEIGHT);
69 signal_activate (displayer_->format());
70 }
71
72
73 void
75 {
76 REQUIRE (videoWidth > 0);
77 REQUIRE (videoHeight > 0);
78 displayer_ = make_unique<XvDisplayer> (*this, videoWidth, videoHeight);
79 if (displayer_->usable())
80 return;
81 displayer_ = make_unique<PixbufDisplayer> (*this, videoWidth, videoHeight);
82 if (displayer_->usable())
83 return;
84
85 displayer_ = make_unique<NullDisplayer> (*this, videoWidth, videoHeight);
86 ENSURE (displayer_->usable());
87 }
88
89
90}}// stage::widget
NullDisplayer implements the Displayer interface without any actual display.
PixbufDisplayer is a class which is responsible for rendering a video image via GDK.
XvDisplayer is a class which is responsible for rendering a video image via XVideo.
sigc::signal< void(DisplayerInput)> signal_activate
signal to configure the image generation format
void pushFrame(void *const)
signal slot to display the next frame
std::unique_ptr< Displayer > displayer_
void setupDisplayer(uint videoWidth, uint videoHeight)
A set of basic GTK includes for the UI.
unsigned int uint
Definition integral.hpp:29
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
cuString CLASS_background
opaque backdrop
cuString CLASS_videodisplay
Passive deactivated video displayer.
Display video as bitmap image with the UI toolkit.
Definition of access keys for uniform UI styling.
Widget to create a video display embedded into the UI.
Implementation of video output via XVideo.