[Spice-devel] [PATCH spice-gtk 1/4] channel: no need to reset local caps on reset
Marc-André Lureau
marcandre.lureau at gmail.com
Thu Jan 3 18:12:59 UTC 2019
On Thu, Jan 3, 2019 at 9:22 PM Frediano Ziglio <fziglio at redhat.com> wrote:
>
> >
> > From: Marc-André Lureau <marcandre.lureau at redhat.com>
> >
> > Local caps are set during construction, no need to reset to the same
> > caps on channel_reset().
> >
> > This also solves calling spice_channel_reset_capabilities() without an
> > associated session (after a channel disconnect).
> >
> > Also fix keeping CAP_AUTH_SASL on reset.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> > ---
> > src/channel-display.c | 7 +++----
> > src/channel-main.c | 5 ++---
> > src/channel-playback.c | 5 ++---
> > src/channel-record.c | 5 ++---
> > src/spice-channel.c | 16 ----------------
> > src/spice-channel.h | 2 +-
> > 6 files changed, 10 insertions(+), 30 deletions(-)
> >
> > diff --git a/src/channel-display.c b/src/channel-display.c
> > index 2a1d9d1..079b5f7 100644
> > --- a/src/channel-display.c
> > +++ b/src/channel-display.c
> > @@ -105,7 +105,7 @@ static void clear_surfaces(SpiceChannel *channel,
> > gboolean keep_primary);
> > static void clear_streams(SpiceChannel *channel);
> > static display_surface *find_surface(SpiceDisplayChannelPrivate *c, guint32
> > surface_id);
> > static void spice_display_channel_reset(SpiceChannel *channel, gboolean
> > migrating);
> > -static void spice_display_channel_reset_capabilities(SpiceChannel *channel);
> > +static void spice_display_channel_set_capabilities(SpiceChannel *channel);
> > static void destroy_canvas(display_surface *surface);
> > static void display_stream_destroy(gpointer st);
> > static void display_session_mm_time_reset_cb(SpiceSession *session, gpointer
> > data);
> > @@ -269,7 +269,6 @@ static void
> > spice_display_channel_class_init(SpiceDisplayChannelClass *klass)
> >
> > channel_class->channel_up = spice_display_channel_up;
> > channel_class->channel_reset = spice_display_channel_reset;
> > - channel_class->channel_reset_capabilities =
> > spice_display_channel_reset_capabilities;
> >
> > g_object_class_install_property
> > (gobject_class, PROP_HEIGHT,
> > @@ -843,7 +842,7 @@ static SpiceImageSurfacesOps image_surfaces_ops = {
> > .get = surfaces_get
> > };
> >
> > -static void spice_display_channel_reset_capabilities(SpiceChannel *channel)
> > +static void spice_display_channel_set_capabilities(SpiceChannel *channel)
> > {
> > guint i;
> >
> > @@ -900,7 +899,7 @@ static void
> > spice_display_channel_init(SpiceDisplayChannel *channel)
> > } else {
> > c->enable_adaptive_streaming = TRUE;
> > }
> > - spice_display_channel_reset_capabilities(SPICE_CHANNEL(channel));
> > + spice_display_channel_set_capabilities(SPICE_CHANNEL(channel));
> > }
> >
> > /* ------------------------------------------------------------------ */
> > diff --git a/src/channel-main.c b/src/channel-main.c
> > index d902f37..f8be9ff 100644
> > --- a/src/channel-main.c
> > +++ b/src/channel-main.c
> > @@ -238,7 +238,7 @@ static gboolean test_agent_cap(SpiceMainChannel *channel,
> > guint32 cap)
> > return VD_AGENT_HAS_CAPABILITY(c->agent_caps,
> > G_N_ELEMENTS(c->agent_caps), cap);
> > }
> >
> > -static void spice_main_channel_reset_capabilties(SpiceChannel *channel)
> > +static void spice_main_channel_set_capabilties(SpiceChannel *channel)
>
> I didn't look much at the patch, why not fixing also the typo?
Good catch, I didn't notice! :)
>
> Frediano
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
--
Marc-André Lureau
More information about the Spice-devel
mailing list