diff --git a/repos/libports/src/driver/framebuffer/vesa/main.cc b/repos/libports/src/driver/framebuffer/vesa/main.cc index 6f165555b9..ca469d66ec 100644 --- a/repos/libports/src/driver/framebuffer/vesa/main.cc +++ b/repos/libports/src/driver/framebuffer/vesa/main.cc @@ -153,10 +153,11 @@ void Vesa_driver::Main::_handle_config() using Attr = Capture::Connection::Screen::Attr; _captured_screen.construct(_capture, _env.rm(), Attr { - .px = _size, - .mm = { }, - .rotate = { }, - .flip = { } }); + .px = _size, + .mm = { }, + .viewport = _size, + .rotate = { }, + .flip = { } }); unsigned long const period_ms = config.attribute_value("period_ms", 20U); _timer.trigger_periodic(period_ms*1000); diff --git a/repos/libports/src/lib/qemu-usb/webcam.cc b/repos/libports/src/lib/qemu-usb/webcam.cc index d8ba55d5ce..fe32313183 100644 --- a/repos/libports/src/lib/qemu-usb/webcam.cc +++ b/repos/libports/src/lib/qemu-usb/webcam.cc @@ -130,7 +130,7 @@ struct Capture_webcam /* construct/destruct capture connection and dataspace */ if (on) { _capture.construct(_env, "webcam"); - _capture->buffer({ .px = _area, .mm = { } }); + _capture->buffer({ .px = _area, .mm = { }, .viewport = { } }); _ds.construct(_env.rm(), _capture->dataspace()); } else { _ds.destruct(); diff --git a/repos/os/include/capture_session/capture_session.h b/repos/os/include/capture_session/capture_session.h index 4313c88b9a..2729274e59 100644 --- a/repos/os/include/capture_session/capture_session.h +++ b/repos/os/include/capture_session/capture_session.h @@ -79,8 +79,9 @@ struct Capture::Session : Genode::Session struct Buffer_attr { - Area px; /* buffer area in pixels */ - Area mm; /* physical size in millimeters */ + Area px; /* buffer area in pixels */ + Area mm; /* physical size in millimeters */ + Area viewport; /* part of the buffer watched by the client */ }; /** diff --git a/repos/os/include/capture_session/connection.h b/repos/os/include/capture_session/connection.h index 7c9afab3d9..aa3a3f1b86 100644 --- a/repos/os/include/capture_session/connection.h +++ b/repos/os/include/capture_session/connection.h @@ -109,8 +109,9 @@ class Capture::Connection::Screen struct Attr { - Area px; /* buffer area in pixels */ - Area mm; /* physical size in millimeters */ + Area px; /* buffer area in pixels */ + Area mm; /* physical size in millimeters */ + Area viewport; /* watched part of the buffer */ Rotate rotate; Flip flip; }; @@ -122,7 +123,9 @@ class Capture::Connection::Screen Capture::Connection &_connection; bool const _buffer_initialized = ( - _connection.buffer({ .px = attr.px, .mm = attr.mm }), true ); + _connection.buffer({ .px = attr.px, + .mm = attr.mm, + .viewport = attr.viewport }), true ); Attached_dataspace _ds; diff --git a/repos/os/src/driver/framebuffer/boot/main.cc b/repos/os/src/driver/framebuffer/boot/main.cc index 20d83972b8..2aa1c9c0ff 100644 --- a/repos/os/src/driver/framebuffer/boot/main.cc +++ b/repos/os/src/driver/framebuffer/boot/main.cc @@ -96,10 +96,11 @@ struct Framebuffer::Main Capture::Connection _capture { _env }; Capture::Connection::Screen _captured_screen { _capture, _env.rm(), { - .px = _info.phys_area(), - .mm = { }, - .rotate = { }, - .flip = { } } }; + .px = _info.phys_area(), + .mm = { }, + .viewport = _info.phys_area(), + .rotate = { }, + .flip = { } } }; Timer::Connection _timer { _env }; Signal_handler<Main> _timer_handler { _env.ep(), *this, &Main::_handle_timer }; diff --git a/repos/os/src/driver/framebuffer/pl11x/main.cc b/repos/os/src/driver/framebuffer/pl11x/main.cc index 555549463d..71f258be2a 100644 --- a/repos/os/src/driver/framebuffer/pl11x/main.cc +++ b/repos/os/src/driver/framebuffer/pl11x/main.cc @@ -60,10 +60,11 @@ struct Pl11x_driver::Main Capture::Connection _capture { _env }; Capture::Connection::Screen _captured_screen { _capture, _env.rm(), { - .px = _size, - .mm = { }, - .rotate = { }, - .flip = { } } }; + .px = _size, + .mm = { }, + .viewport = _size, + .rotate = { }, + .flip = { } } }; /* diff --git a/repos/os/src/driver/framebuffer/ram/main.cc b/repos/os/src/driver/framebuffer/ram/main.cc index 3a6fe88d45..7bb0855da7 100644 --- a/repos/os/src/driver/framebuffer/ram/main.cc +++ b/repos/os/src/driver/framebuffer/ram/main.cc @@ -66,10 +66,11 @@ class Main Capture::Area const _size { SCR_WIDTH, SCR_HEIGHT }; Capture::Connection _capture { _env }; Capture::Connection::Screen _captured_screen { _capture, _env.rm(), { - .px = _size, - .mm = { }, - .rotate = { }, - .flip = { } } }; + .px = _size, + .mm = { }, + .viewport = _size, + .rotate = { }, + .flip = { } } }; Timer::Connection _timer { _env }; Signal_handler<Main> _timer_handler { _env.ep(), *this, &Main::_handle_timer }; diff --git a/repos/os/src/driver/framebuffer/sdl/main.cc b/repos/os/src/driver/framebuffer/sdl/main.cc index 97c9a9c933..205849163d 100644 --- a/repos/os/src/driver/framebuffer/sdl/main.cc +++ b/repos/os/src/driver/framebuffer/sdl/main.cc @@ -282,10 +282,11 @@ struct Fb_sdl::Sdl : Noncopyable using Attr = Capture::Connection::Screen::Attr; _captured_screen.construct(_capture, _rm, Attr { - .px = Blit::transformed(size, _attr.rotate), - .mm = { }, - .rotate = _attr.rotate, - .flip = _attr.flip }); + .px = Blit::transformed(size, _attr.rotate), + .mm = { }, + .viewport = Blit::transformed(size, _attr.rotate), + .rotate = _attr.rotate, + .flip = _attr.flip }); _update_screen_from_capture(); _schedule_next_frame(); diff --git a/repos/os/src/driver/framebuffer/virtio/component.h b/repos/os/src/driver/framebuffer/virtio/component.h index ed0ee54581..4c86f934a8 100644 --- a/repos/os/src/driver/framebuffer/virtio/component.h +++ b/repos/os/src/driver/framebuffer/virtio/component.h @@ -359,10 +359,11 @@ class Virtio_fb::Driver using Attr = Capture::Connection::Screen::Attr; _captured_screen.construct(_capture, _env.rm(), Attr { - .px = _display_area, - .mm = { }, - .rotate = { }, - .flip = { } }); + .px = _display_area, + .mm = { }, + .viewport = _display_area, + .rotate = { }, + .flip = { } }); } void _shutdown_display() diff --git a/repos/os/src/lib/vfs/capture/plugin.cc b/repos/os/src/lib/vfs/capture/plugin.cc index dbd0798591..1856aa867f 100644 --- a/repos/os/src/lib/vfs/capture/plugin.cc +++ b/repos/os/src/lib/vfs/capture/plugin.cc @@ -121,7 +121,9 @@ class Vfs_capture::Data_file_system : public Single_file_system } catch (Genode::Service_denied) { return OPEN_ERR_UNACCESSIBLE; } - _capture->buffer({ .px = _capture_area, .mm = { } }); + _capture->buffer({ .px = _capture_area, + .mm = { }, + .viewport = _capture_area }); _capture_ds.construct(_env.rm(), _capture->dataspace()); } diff --git a/repos/os/src/test/black_hole/main.cc b/repos/os/src/test/black_hole/main.cc index 4681d1db41..54eaaabaa0 100644 --- a/repos/os/src/test/black_hole/main.cc +++ b/repos/os/src/test/black_hole/main.cc @@ -262,10 +262,11 @@ class Black_hole_test::Capture_test Capture::Pixel _pixels[1]; Surface<Capture::Pixel> _surface { _pixels, _screen_size }; Capture::Connection::Screen _screen { _connection, _env.rm(), - { .px = _screen_size, - .mm = { }, - .rotate = { }, - .flip = { } } }; + { .px = _screen_size, + .mm = { }, + .viewport = _screen_size, + .rotate = { }, + .flip = { } } }; bool _finished { false }; public: diff --git a/repos/os/src/test/capture/main.cc b/repos/os/src/test/capture/main.cc index 546314a1a7..bf99f81d16 100644 --- a/repos/os/src/test/capture/main.cc +++ b/repos/os/src/test/capture/main.cc @@ -113,7 +113,10 @@ struct Test::Main Capture::Connection _capture { _env, "" }; - bool _capture_buffer_init = ( _capture.buffer({ .px = _area, .mm = { }}), true ); + bool _capture_buffer_init = ( + _capture.buffer({ .px = _area, + .mm = { }, + .viewport = _area }), true ); Attached_dataspace _capture_ds { _env.rm(), _capture.dataspace() }; diff --git a/repos/pc/src/driver/framebuffer/intel/pc/main.cc b/repos/pc/src/driver/framebuffer/intel/pc/main.cc index f583840501..cbf2cf75c8 100644 --- a/repos/pc/src/driver/framebuffer/intel/pc/main.cc +++ b/repos/pc/src/driver/framebuffer/intel/pc/main.cc @@ -224,10 +224,11 @@ struct Framebuffer::Driver if (!conn.size.valid()) return same; - Capture::Connection::Screen::Attr attr = { .px = conn.size, - .mm = conn.size_mm, - .rotate = { }, - .flip = { } }; + Capture::Connection::Screen::Attr attr = { .px = conn.size, + .mm = conn.size_mm, + .viewport = conn.size, + .rotate = { }, + .flip = { } }; conn.capture.construct(env, label); conn.screen .construct(*conn.capture, env.rm(), attr);