From 0ae96294e822d87ffbd275edf62f0bf9b37659a9 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 2 May 2025 23:19:55 +0200 Subject: [PATCH] XV-Display: start a research project to port the existing code (see #1403) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - initial assessment shows that the Design of the **Displayer** framework is adequate - for context: this code originates from the »Kino« video editor 20 years ago - notably the `XvDisplayer` contains almost no GTK(2)-code - so it seems feasible to attempt a port to GTK-3 This is a limited research project, and the setup shall be based mostly on existing code. In the early stage of the Lumiera application, we did some architecture studies regarding ongoing video generation and display, resulting in a `DemoVideoPlayer`. This code was broken by the GTK-3 transition, but kept in-tree for later referral. For this research project, we can mostly short-circuit all of the layer separation and service communication stuff and build a minimal invocation directly hooked-up behind the GUI widget. In preparation for such a setup, the existing demo player code is partially forked by this changeset, pushing aside the (defunct) !DummyPlayer pseudo-subsystem. --- src/stage/ctrl/demo-controller.cpp | 113 ++++++ src/stage/ctrl/demo-controller.hpp | 83 ++++ ...k-controller.cpp => player-controller.cpp} | 22 +- ...k-controller.hpp => player-controller.hpp} | 19 +- src/stage/output/displayer.cpp | 2 +- src/stage/output/null-displayer.cpp | 92 +++++ src/stage/output/null-displayer.hpp | 87 +++++ ...{gdkdisplayer.cpp => pixbuf-displayer.cpp} | 7 +- ...{gdkdisplayer.hpp => pixbuf-displayer.hpp} | 12 +- .../{xvdisplayer.cpp => xv-displayer.cpp} | 8 +- .../{xvdisplayer.hpp => xv-displayer.hpp} | 16 +- src/stage/panel/viewer-panel.cpp | 4 +- src/stage/panel/viewer-panel.hpp | 4 +- src/stage/ui-bus.cpp | 2 +- src/stage/ui-bus.hpp | 6 +- src/stage/widget/video-display-widget.cpp | 8 +- wiki/thinkPad.ichthyo.mm | 364 +++++++++++++++++- 17 files changed, 778 insertions(+), 71 deletions(-) create mode 100644 src/stage/ctrl/demo-controller.cpp create mode 100644 src/stage/ctrl/demo-controller.hpp rename src/stage/ctrl/{playback-controller.cpp => player-controller.cpp} (76%) rename src/stage/ctrl/{playback-controller.hpp => player-controller.hpp} (71%) create mode 100644 src/stage/output/null-displayer.cpp create mode 100644 src/stage/output/null-displayer.hpp rename src/stage/output/{gdkdisplayer.cpp => pixbuf-displayer.cpp} (92%) rename src/stage/output/{gdkdisplayer.hpp => pixbuf-displayer.hpp} (81%) rename src/stage/output/{xvdisplayer.cpp => xv-displayer.cpp} (96%) rename src/stage/output/{xvdisplayer.hpp => xv-displayer.hpp} (87%) diff --git a/src/stage/ctrl/demo-controller.cpp b/src/stage/ctrl/demo-controller.cpp new file mode 100644 index 000000000..e95d56423 --- /dev/null +++ b/src/stage/ctrl/demo-controller.cpp @@ -0,0 +1,113 @@ +/* + DemoController - playback controller object + + Copyright (C) + 2008, Joel Holdsworth + 2025, Hermann Vosseler + +  **Lumiera** is free software; you can redistribute it and/or modify it +  under the terms of the GNU General Public License as published by the +  Free Software Foundation; either version 2 of the License, or (at your +  option) any later version. See the file COPYING for further details. + +* *****************************************************************/ + + +/** @file demo-controller.cpp + ** Implementation parts of PlaybackController. + ** @todo 5/2025 now used for a research project for XV video display ////////////////////////////////////TICKET #1403 : attempt to upgrade the XV displayer + */ + + +#include "stage/ctrl/demo-controller.hpp" +#include "stage/display-service.hpp" +#include "lib/error.hpp" +#include "include/logging.h" + + +namespace stage { +namespace ctrl { + + namespace error = lumiera::error; + + + + DemoController::DemoController() + : playing_(false) + , viewerHandle_(0) + { + instance = this; ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + } + + DemoController::~DemoController() + { + instance = nullptr; ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + } + + + DemoController* DemoController::instance; ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + + DemoController& + DemoController::get() ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + { + if (not instance) + throw error::Logic ("GTK UI is not in running state" + , LERR_(LIFECYCLE)); + + return *instance; + } + + void + DemoController::play() + { + if (playHandle_) + { + playHandle_.play(true); + playing_ = true; + } + else if (viewerHandle_) + try + { + playHandle_ = lumiera::DummyPlayer::facade().start (viewerHandle_); + playing_ = true; + } + catch (lumiera::error::State& err) + { + WARN (stage, "failed to start playback: %s" ,err.what()); + lumiera_error(); + playing_ = false; + } + } + + void + DemoController::pause() + { + if (playHandle_) + playHandle_.play(false); + playing_ = false; + } + + void + DemoController::stop() + { + playHandle_.close(); + playing_ = false; + } + + bool + DemoController::is_playing() + { + return playing_; + } + + + + void + DemoController::useDisplay (LumieraDisplaySlot display) + { + viewerHandle_ = display; + } + + +}} // namespace stage::ctrl + diff --git a/src/stage/ctrl/demo-controller.hpp b/src/stage/ctrl/demo-controller.hpp new file mode 100644 index 000000000..ecf4cf586 --- /dev/null +++ b/src/stage/ctrl/demo-controller.hpp @@ -0,0 +1,83 @@ +/* + DEMO-CONTROLLER.hpp - playback controller object + + Copyright (C) + 2009, Joel Holdsworth + 2025, Hermann Vosseler + +  **Lumiera** is free software; you can redistribute it and/or modify it +  under the terms of the GNU General Public License as published by the +  Free Software Foundation; either version 2 of the License, or (at your +  option) any later version. See the file COPYING for further details. + +*/ + + +/** @file demo-controller.hpp + ** This file contains the definition of the playback controller object. + ** + ** @deprecated this represents an early design of playback and will be reworked + ** @remarks what we actually need is a PlaybackController as a shell or proxy + ** to maintain a flexible link to ongoing processes in the core. But note, + ** this is also related to the Displayer service, which needs to be offered + ** by the UI, so we create a mutual dependency here, and there is not much + ** that can be done about this. + ** @todo as a temporary solution, 1/2017 the playback controller was moved + ** into the viewer panel. Of course it can not work that way.... + ** @todo 5/2025 now used for a research project for XV video display ////////////////////////////////////TICKET #1403 : attempt to upgrade the XV displayer + */ + + +#ifndef DEMO_CONTROLLER_H +#define DEMO_CONTROLLER_H + +#include "stage/gtk-base.hpp" +#include "include/dummy-player-facade.h" +#include "include/display-facade.h" +#include "lib/nocopy.hpp" + + + +namespace stage { +namespace ctrl { + + + + /** @deprecated we need a durable design for the playback process */ + class DemoController + : util::NonCopyable + { + + volatile bool playing_; + + lumiera::DummyPlayer::Process playHandle_; + + LumieraDisplaySlot viewerHandle_; + + static DemoController* instance; /////////////////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + + public: + + DemoController(); + ~DemoController(); + + static DemoController& get(); /////////////////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + + void play(); + void pause(); + void stop(); + + bool is_playing(); + + void useDisplay (LumieraDisplaySlot display); + + private: + + void on_frame(); + + }; + + +}} // namespace stage::ctrl +#endif /*DEMO_CONTROLLER_H*/ + diff --git a/src/stage/ctrl/playback-controller.cpp b/src/stage/ctrl/player-controller.cpp similarity index 76% rename from src/stage/ctrl/playback-controller.cpp rename to src/stage/ctrl/player-controller.cpp index e89723f12..9eb976468 100644 --- a/src/stage/ctrl/playback-controller.cpp +++ b/src/stage/ctrl/player-controller.cpp @@ -20,7 +20,7 @@ */ -#include "stage/ctrl/playback-controller.hpp" +#include "stage/ctrl/player-controller.hpp" #include "stage/display-service.hpp" #include "lib/error.hpp" #include "include/logging.h" @@ -33,23 +33,23 @@ namespace ctrl { - PlaybackController::PlaybackController() + PlayerController::PlayerController() : playing_(false) , viewerHandle_(0) { instance = this; ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level } - PlaybackController::~PlaybackController() + PlayerController::~PlayerController() { instance = nullptr; ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level } - PlaybackController* PlaybackController::instance; ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + PlayerController* PlayerController::instance; ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level - PlaybackController& - PlaybackController::get() ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + PlayerController& + PlayerController::get() ////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level { if (not instance) throw error::Logic ("GTK UI is not in running state" @@ -59,7 +59,7 @@ namespace ctrl { } void - PlaybackController::play() + PlayerController::play() { if (playHandle_) { @@ -81,7 +81,7 @@ namespace ctrl { } void - PlaybackController::pause() + PlayerController::pause() { if (playHandle_) playHandle_.play(false); @@ -89,14 +89,14 @@ namespace ctrl { } void - PlaybackController::stop() + PlayerController::stop() { playHandle_.close(); playing_ = false; } bool - PlaybackController::is_playing() + PlayerController::is_playing() { return playing_; } @@ -104,7 +104,7 @@ namespace ctrl { void - PlaybackController::useDisplay (LumieraDisplaySlot display) + PlayerController::useDisplay (LumieraDisplaySlot display) { viewerHandle_ = display; } diff --git a/src/stage/ctrl/playback-controller.hpp b/src/stage/ctrl/player-controller.hpp similarity index 71% rename from src/stage/ctrl/playback-controller.hpp rename to src/stage/ctrl/player-controller.hpp index 7d682925b..fc42e5a50 100644 --- a/src/stage/ctrl/playback-controller.hpp +++ b/src/stage/ctrl/player-controller.hpp @@ -21,14 +21,15 @@ ** this is also related to the Displayer service, which needs to be offered ** by the UI, so we create a mutual dependency here, and there is not much ** that can be done about this. - ** @warning as a temporary solution, 1/2017 the playback controller was moved + ** @todo as a temporary solution, 1/2017 the playback controller was moved ** into the viewer panel. Of course it can not work that way.... + ** @todo 5/2025 now pushed aside in preparation for the »Playback Vertical Slice« //////////////////////TICKET #1273 : develop a Viewer-Connection concept ** @todo create a durable PlaybacController design //////////////////////////////////////////////////////TICKET #1072 */ -#ifndef PLAYBACK_CONTROLLER_HPP -#define PLAYBACK_CONTROLLER_HPP +#ifndef PLAYER_CONTROLLER_H +#define PLAYER_CONTROLLER_H #include "stage/gtk-base.hpp" #include "include/dummy-player-facade.h" @@ -43,7 +44,7 @@ namespace ctrl { /** @deprecated we need a durable design for the playback process */ - class PlaybackController + class PlayerController : util::NonCopyable { @@ -53,14 +54,14 @@ namespace ctrl { LumieraDisplaySlot viewerHandle_; - static PlaybackController* instance; ///////////////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + static PlayerController* instance; ///////////////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level public: - PlaybackController(); - ~PlaybackController(); + PlayerController(); + ~PlayerController(); - static PlaybackController& get(); ///////////////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level + static PlayerController& get(); ///////////////////////////////////////////////////////////////////TICKET #1067 shitty workaround to allow disentangling of top-level void play(); void pause(); @@ -78,5 +79,5 @@ namespace ctrl { }} // namespace stage::ctrl -#endif // PLAYBACK_CONTROLLER_HPP +#endif /*PLAYER_CONTROLLER_H*/ diff --git a/src/stage/output/displayer.cpp b/src/stage/output/displayer.cpp index 67f399124..50f69ba47 100644 --- a/src/stage/output/displayer.cpp +++ b/src/stage/output/displayer.cpp @@ -28,7 +28,7 @@ #include "stage/gtk-base.hpp" #include "stage/output/displayer.hpp" -#include "stage/output/xvdisplayer.hpp" +#include "stage/output/xv-displayer.hpp" #include "stage/output/gdkdisplayer.hpp" namespace stage { diff --git a/src/stage/output/null-displayer.cpp b/src/stage/output/null-displayer.cpp new file mode 100644 index 000000000..c1225eab0 --- /dev/null +++ b/src/stage/output/null-displayer.cpp @@ -0,0 +1,92 @@ +/* + NullDisplayer.hpp - fallback video displayer to not display video at all + + Copyright (C) + 2025, Hermann Vosseler + +  **Lumiera** is free software; you can redistribute it and/or modify it +  under the terms of the GNU General Public License as published by the +  Free Software Foundation; either version 2 of the License, or (at your +  option) any later version. See the file COPYING for further details. + +* *****************************************************************/ + + +/** @file null-displayer.hpp + ** Passive deactivated video displayer. + ** @deprecated obsolete since GTK-3 + ** @todo WIP as of 5/2025 attempt to accommodate to GTK-3 ////////////////////////////////////////////////TICKET #1403 + */ + + +#include "stage/gtk-base.hpp" +#include "stage/output/null-displayer.hpp" + +#if false ///////////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display +#include +#endif ///////////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display +#include + +using std::cerr; +using std::endl; + + +namespace stage { +namespace output { + + NullDisplayer::NullDisplayer (Gtk::Widget* drawing_area, + int width, int height) + : drawingArea( drawing_area ) + { + REQUIRE (drawing_area != NULL); + REQUIRE (width > 0); + REQUIRE (height > 0); + + imageWidth = width, + imageHeight = height; + } + + bool + NullDisplayer::usable() + { + return false; /////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display + } + + void + NullDisplayer::put (void* const image) + { + int video_x = 0, + video_y = 0, + video_width = 0, + video_height = 0; + + calculateVideoLayout( + drawingArea->get_width(), + drawingArea->get_height(), + preferredWidth(), preferredHeight(), + video_x, video_y, video_width, video_height); + + GdkWindow *window = drawingArea->get_window()->gobj(); + REQUIRE (window != NULL); + + #if false ///////////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display + GdkGC *gc = gdk_gc_new( window ); + REQUIRE(gc != NULL); + + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data( (const guchar*)image, GDK_COLORSPACE_RGB, FALSE, 8, + preferredWidth(), preferredHeight(), preferredWidth() * 3, NULL, NULL ); + REQUIRE(pixbuf != NULL); + + GdkPixbuf *scaled_image = gdk_pixbuf_scale_simple( pixbuf, video_width, video_height, GDK_INTERP_NEAREST ); + REQUIRE(scaled_image != NULL); + + gdk_draw_pixbuf( window, gc, scaled_image, 0, 0, video_x, video_y, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 ); + + g_object_unref( scaled_image ); + g_object_unref( pixbuf ); + g_object_unref( gc ); + #endif ///////////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display + } + + +}} // namespace stage::output diff --git a/src/stage/output/null-displayer.hpp b/src/stage/output/null-displayer.hpp new file mode 100644 index 000000000..da6cf3918 --- /dev/null +++ b/src/stage/output/null-displayer.hpp @@ -0,0 +1,87 @@ +/* + NULL-DISPLAYER.hpp - fallback video displayer to not display video at all + + Copyright (C) + 2025, Hermann Vosseler + +  **Lumiera** is free software; you can redistribute it and/or modify it +  under the terms of the GNU General Public License as published by the +  Free Software Foundation; either version 2 of the License, or (at your +  option) any later version. See the file COPYING for further details. + +*/ + + +/** @file null-displayer.hpp + ** Passive deactivated video displayer. + ** + ** @deprecated obsolete since GTK-3 + ** @todo WIP as of 5/2025 attempt to accommodate to GTK-3 ////////////////////////////////////////////////TICKET #1403 + ** @see displayer.hpp + */ + +#ifndef STAGE_OUTPUT_NULL_DISPLAYER_H +#define STAGE_OUTPUT_NULL_DISPLAYER_H + +#include "stage/gtk-base.hpp" +#include "stage/output/displayer.hpp" + +namespace Gtk { + class Widget; +} + +namespace stage { +namespace output { + +/** + * NullDisplayer implements the Displayer interface without any actual display. + * + * @todo the GdkDisplayer class is not supported anymore in Gtk3. + * This is due to Gtk3 only supporting drawing with Cairo + * ////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display + * @todo WIP as of 5/2025 attempt to accommodate to GTK-3 /////////////////////////////////////////////////TICKET #1403 + */ +class NullDisplayer + : public Displayer + { + public: + + /** + * Constructor + * @param[in] drawing_area The widget into which the video image will + * be drawn. This value must not be NULL. + * @param[in] width The width of the video image in pixels. This value + * must be greater than zero. + * @param[in] height The height of the video image in pixels. This + * value must be greater than zero. + */ + NullDisplayer (Gtk::Widget* drawing_area, int width, int height ); + + /** + * Put an image of a given width and height with the expected input + * format (as indicated by the format method). + * @param[in] image The video image array to draw. + */ + void put (void* const image); + + protected: + + /** + * Indicates if this object can be used to render images on the + * running system. + */ + bool usable(); + + private: + + /** + * The widget that video will be drawn into. + * @remarks This value must be a valid pointer. + */ + Gtk::Widget* drawingArea; + }; + + + +}} // namespace stage::output +#endif /*STAGE_OUTPUT_NULL_DISPLAYER_H*/ diff --git a/src/stage/output/gdkdisplayer.cpp b/src/stage/output/pixbuf-displayer.cpp similarity index 92% rename from src/stage/output/gdkdisplayer.cpp rename to src/stage/output/pixbuf-displayer.cpp index 96e8593e2..85197a6d2 100644 --- a/src/stage/output/gdkdisplayer.cpp +++ b/src/stage/output/pixbuf-displayer.cpp @@ -1,5 +1,5 @@ /* - GgdkDisplayer - displaying video via GDK + GdkDisplayer - displaying video via GDK Copyright (C) 2000, Arne Schirmacher @@ -14,15 +14,16 @@ * *****************************************************************/ -/** @file gdkdisplayer.cpp +/** @file pixbuf-displayer.cpp ** Dysfunctional implementation code, formerly used to ** create a video display based on GDK ** @deprecated obsolete since GTK-3 + ** @todo WIP as of 5/2025 attempt to accommodate to GTK-3 ////////////////////////////////////////////////TICKET #1403 */ #include "stage/gtk-base.hpp" -#include "stage/output/gdkdisplayer.hpp" +#include "stage/output/pixbuf-displayer.hpp" #if false ///////////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display #include diff --git a/src/stage/output/gdkdisplayer.hpp b/src/stage/output/pixbuf-displayer.hpp similarity index 81% rename from src/stage/output/gdkdisplayer.hpp rename to src/stage/output/pixbuf-displayer.hpp index 0728c2309..27fe89b9c 100644 --- a/src/stage/output/gdkdisplayer.hpp +++ b/src/stage/output/pixbuf-displayer.hpp @@ -14,15 +14,16 @@ */ -/** @file gdkdisplayer.hpp +/** @file pixbuf-displayer.hpp ** Display video via GDK ** ** @deprecated obsolete since GTK-3 + ** @todo WIP as of 5/2025 attempt to accommodate to GTK-3 ////////////////////////////////////////////////TICKET #1403 ** @see displayer.hpp */ -#ifndef STAGE_OUTPUT_GDKDISPLAYER_H -#define STAGE_OUTPUT_GDKDISPLAYER_H +#ifndef STAGE_OUTPUT_PIXBUF_DISPLAYER_H +#define STAGE_OUTPUT_PIXBUF_DISPLAYER_H #include "stage/gtk-base.hpp" #include "stage/output/displayer.hpp" @@ -40,7 +41,8 @@ namespace output { * * @todo the GdkDisplayer class is not supported anymore in Gtk3. * This is due to Gtk3 only supporting drawing with Cairo - * /////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display + * ////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #950 : new solution for video display + * @todo WIP as of 5/2025 attempt to accommodate to GTK-3 /////////////////////////////////////////////////TICKET #1403 */ class GdkDisplayer : public Displayer @@ -85,4 +87,4 @@ class GdkDisplayer }} // namespace stage::output -#endif /*STAGE_OUTPUT_GDKDISPLAYER_H*/ +#endif /*STAGE_OUTPUT_PIXBUF_DISPLAYER_H*/ diff --git a/src/stage/output/xvdisplayer.cpp b/src/stage/output/xv-displayer.cpp similarity index 96% rename from src/stage/output/xvdisplayer.cpp rename to src/stage/output/xv-displayer.cpp index b79f96b39..e568dfadc 100644 --- a/src/stage/output/xvdisplayer.cpp +++ b/src/stage/output/xv-displayer.cpp @@ -16,16 +16,12 @@ /** @file xvdisplayer.cpp ** Implementation of video output via XVideo - ** @warning as of 2016 it is not clear, if this code will be - ** evolved into the actual display facility, or be - ** replaced and rewritten, when we're about to - ** create a functional video display connected - ** to the render engine. + ** @todo WIP as of 5/2025 -- attempt to port this component to GTK-3 ///////////////////////////////////////TICKET #1403 */ #include "stage/gtk-base.hpp" -#include "stage/output/xvdisplayer.hpp" +#include "stage/output/xv-displayer.hpp" #include "include/logging.h" #include diff --git a/src/stage/output/xvdisplayer.hpp b/src/stage/output/xv-displayer.hpp similarity index 87% rename from src/stage/output/xvdisplayer.hpp rename to src/stage/output/xv-displayer.hpp index 07856ca29..86330eb82 100644 --- a/src/stage/output/xvdisplayer.hpp +++ b/src/stage/output/xv-displayer.hpp @@ -1,5 +1,5 @@ /* - XVDISPLAYER.hpp - XVideo display + XV-DISPLAYER.hpp - XVideo display Copyright (C) 2000, Arne Schirmacher @@ -14,19 +14,15 @@ */ -/** @file xvdisplayer.hpp +/** @file xv-displayer.hpp ** Implementation of video output via XVideo - ** @warning as of 2016 it is not clear, if this code will be - ** evolved into the actual display facility, or be - ** replaced and rewritten, when we're about to - ** create a functional video display connected - ** to the render engine. + ** @todo WIP as of 5/2025 -- attempt to port this component to GTK-3 ///////////////////////////////////////TICKET #1403 ** @see displayer.hpp */ -#ifndef STAGE_OUTPUT_XVDISPLAYER_H -#define STAGE_OUTPUT_XVDISPLAYER_H +#ifndef STAGE_OUTPUT_XV_DISPLAYER_H +#define STAGE_OUTPUT_XV_DISPLAYER_H #include "stage/output/displayer.hpp" @@ -127,4 +123,4 @@ namespace output { }} // namespace stage::output -#endif // XVDISPLAYER_HPP +#endif /*STAGE_OUTPUT_XV_DISPLAYER_H*/ diff --git a/src/stage/panel/viewer-panel.cpp b/src/stage/panel/viewer-panel.cpp index dfd4f25b9..1c7c02f09 100644 --- a/src/stage/panel/viewer-panel.cpp +++ b/src/stage/panel/viewer-panel.cpp @@ -34,13 +34,13 @@ namespace panel { ViewerPanel::ViewerPanel (workspace::PanelManager& panelManager ,Gdl::DockItem& dockItem) : Panel(panelManager, dockItem, getTitle(), getStockID()) - , playbackController_{} + , demoPlayback_{} { //----- Pack in the Widgets -----// pack_start(display_, PACK_EXPAND_WIDGET); FrameDestination outputDestination (sigc::mem_fun(this, &ViewerPanel::on_frame)); - playbackController_.useDisplay (DisplayService::setUp (outputDestination)); + demoPlayback_.useDisplay (DisplayService::setUp (outputDestination)); } const char* diff --git a/src/stage/panel/viewer-panel.hpp b/src/stage/panel/viewer-panel.hpp index 2dd2b36e2..55243c90e 100644 --- a/src/stage/panel/viewer-panel.hpp +++ b/src/stage/panel/viewer-panel.hpp @@ -22,7 +22,7 @@ #include "stage/panel/panel.hpp" #include "stage/widget/video-display-widget.hpp" -#include "stage/ctrl/playback-controller.hpp" +#include "stage/ctrl/demo-controller.hpp" namespace stage { namespace panel { @@ -33,7 +33,7 @@ namespace panel { class ViewerPanel : public Panel { - ctrl::PlaybackController playbackController_; + ctrl::DemoController demoPlayback_; public: ViewerPanel (workspace::PanelManager&, Gdl::DockItem&); diff --git a/src/stage/ui-bus.cpp b/src/stage/ui-bus.cpp index 6c1a87de7..e8a0e2b25 100644 --- a/src/stage/ui-bus.cpp +++ b/src/stage/ui-bus.cpp @@ -42,7 +42,7 @@ namespace controller { - ctrl::PlaybackController& Controller::get_playback_controller() + ctrl::PlayerController& Controller::get_playback_controller() { return playback_; } diff --git a/src/stage/ui-bus.hpp b/src/stage/ui-bus.hpp index a9b9dbbcd..12ac0b96d 100644 --- a/src/stage/ui-bus.hpp +++ b/src/stage/ui-bus.hpp @@ -95,7 +95,7 @@ #include "stage/gtk-base.hpp" //////////////////////////////////////////////////////TODO remove any GTK dependency if possible -#include "stage/ctrl/playback-controller.hpp" +#include "stage/ctrl/player-controller.hpp" #include "lib/nocopy.hpp" #include @@ -119,12 +119,12 @@ namespace stage { class Controller { model::Project& project_; - ctrl::PlaybackController playback_; + ctrl::PlayerController playback_; public: Controller (model::Project&); - ctrl::PlaybackController& get_playback_controller(); + ctrl::PlayerController& get_playback_controller(); }; }// namespace stage::controller diff --git a/src/stage/widget/video-display-widget.cpp b/src/stage/widget/video-display-widget.cpp index 0ce7ebaaa..9b39dd84b 100644 --- a/src/stage/widget/video-display-widget.cpp +++ b/src/stage/widget/video-display-widget.cpp @@ -19,10 +19,12 @@ #include "stage/gtk-base.hpp" -#include "stage/output/xvdisplayer.hpp" -#include "stage/output/gdkdisplayer.hpp" +#include "stage/output/xv-displayer.hpp" +#include "stage/output/pixbuf-displayer.hpp" +#include "stage/output/null-displayer.hpp" +#include "stage/widget/video-display-widget.hpp" +#include "stage/style-scheme.hpp" -#include "video-display-widget.hpp" namespace stage { namespace widget { diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 17c39c354..26327788d 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -129646,6 +129646,136 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) + + + + + + + + + + + + + + + +

+ bedeutet: im Grunde kann man wild jede Funktion aufrufen +

+ + +
+ + + +

+ ...auch bezüglich Lifecycle: weil GUI depends-on Core +

+ +
+
+ + + + + + +
+ + + + + + + +

+ Das zeigt, daß ich damals das Prototyping durchaus richtig gemacht haben muß (finde keine Aufzeichnungen dazu mehr). Habe das erst mal irgendwie in funktionierenden Code gewürgt, und mir dann angeschaut, was paßt und was nicht paßt. Beibehalten habe ich die Idee eines »Play-Prozesses«. Aber Display-Connections sollen nicht mehr direkt vom Play-Prozess gemacht werden, sondern über einen OutputManager abstrahiert sein. Und als Schnittstelle hinter dem Prozeß-Handle bekommt man nun ein Controller-Interface (State Machine). +

+

+ +

+

+ Klingt alles sehr plausibel — sollte diesem Design folgen +

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -161444,16 +161574,13 @@ Since then others have made contributions, see the log for the history. - - - +

...das war vermutlich mein erster Versuch, eine Iterator-Klasse in C++ zu bauen — hatte mich dabei offensichtlich an Java orientiert

- -
+ @@ -161471,10 +161598,6 @@ Since then others have made contributions, see the log for the history. - - - - @@ -161493,14 +161616,218 @@ Since then others have made contributions, see the log for the history. - + + + + + + +

+ nix auskommentiert oder deaktiviert — und das heißt, die aktuellen Dependencies sind hierfür ausreichend +

+ +
- + + + + + + + + + + + + + + + + + +

+ jeder Displayer versucht eine minimale Initialisierung im Konstruktor und signalisiert damit, daß er im Prinzip Video ausgeben könnte +

+ + +
+
+ + + + +

+ zeigt an, in welchem Format die Daten angeliefert werden müssen +

+ +
+ + + + + + + + + + + +

+ der Displayer macht eine Vorgabe, kann aber durchaus (wohl in gewissen Grenzen) noch skalieren +

+ +
+
+ + + + + +

+ virtual void put (void* const) +

+ +
+ + + + + + + +
+ + + + + +

+ window = GDK_WINDOW_XID (area_window->gobj()); +

+

+ display = GDK_WINDOW_XDISPLAY (area_window->gobj()); +

+ +
+
+ + + + + + + + + + + + + + + +

+ Implementierung war extrem einfach +

+ + +
+ + + +

+ Nichts weiter als etwas Bit-Blitting. +

+

+ Das heißt, ein Pixmap wurde via GDK zur Anzeige gebracht +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+ die Anzeige erscheint nur marginal gebrochen +

+ + +
+
+ + + + + + + + + + + + + + + + + +

+ Mit dem DummyPlayer wollte ich damals demonstrieren, wie eine Zusammenarbeit über Facade-Interfaces funktionieren kann; das hat die ganzen Schwachstellen an Christian's Interface-Konzept schonungslos offengelegt — und war ein ziemliches Gewürge. Außerdem ist der Code alt, und verwendet einige Dinge wie den ScopedPtrVect, die ich gerne mal begraben würde. +

+ +
+
+
+ + + + +

+ man könnte den DummyImageGenerator +

+

+  + TickService wieder ins GUI ziehen +

+ +
+ + + + + + + + + + + + + + + - - - - + + + @@ -161531,6 +161858,13 @@ Since then others have made contributions, see the log for the history. + + + + + + +