Commit 57058800 authored by Stepan Salenikovich's avatar Stepan Salenikovich
Browse files

gnome: improve video widget

aspect ratio should now get properly reset when changing video source

Refs #66538

Change-Id: I679089f8908f114011a615d9518aaf1b979d7327
parent 39ee49a3
......@@ -370,7 +370,8 @@ current_call_view_set_call_info(CurrentCallView *view, const QModelIndex& idx) {
);
/* local renderer */
push_new_renderer(view, Video::PreviewManager::instance()->previewRenderer(), VIDEO_RENDERER_LOCAL);
if (Video::PreviewManager::instance()->isPreviewing())
push_new_renderer(view, Video::PreviewManager::instance()->previewRenderer(), VIDEO_RENDERER_LOCAL);
/* callback for local renderer */
priv->local_renderer_connection = QObject::connect(
......
......@@ -469,8 +469,10 @@ renderer_start(VideoWidgetRenderer *renderer)
renderer->renderer,
&Video::Renderer::frameUpdated,
[=]() {
if (!renderer->renderer->isRendering())
g_warning("got frame but not rendering!");
if (!renderer->renderer->isRendering()) {
g_debug("got frame but not rendering");
return;
}
/* this callback comes from another thread;
* rendering must be done in the main loop;
......@@ -488,12 +490,16 @@ video_widget_set_renderer(VideoWidgetRenderer *renderer)
{
if (renderer == NULL) return;
/* reset the content gravity so that the aspect ratio gets properly set if it chagnes */
clutter_actor_set_content_gravity(renderer->actor, CLUTTER_CONTENT_GRAVITY_RESIZE_FILL);
/* update the renderer */
QObject::disconnect(renderer->frame_update);
QObject::disconnect(renderer->render_stop);
QObject::disconnect(renderer->render_start);
renderer_start(renderer);
if (renderer->renderer->isRendering())
renderer_start(renderer);
renderer->render_stop = QObject::connect(
renderer->renderer,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment