mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-13 22:23:45 +00:00
capture session: add viewport as buffer attribute
This patch adds the viewport area to the interface. It is not evaluated by the nitpicker GUI server yet. Issue #5518
This commit is contained in:
parent
5d8a8257d6
commit
a2058a8d21
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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 */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 };
|
||||
|
@ -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 = { } } };
|
||||
|
||||
|
||||
/*
|
||||
|
@ -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 };
|
||||
|
@ -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();
|
||||
|
@ -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()
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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() };
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user