[Spice-devel] [spice-server v2 8/9] reds: add support to ranks for video codecs

Francois Gouget fgouget at codeweavers.com
Tue Dec 13 19:06:50 UTC 2016


On Tue, 13 Dec 2016, Victor Toso wrote:
[...]
> > > To be able to select video-codecs based on both host and client
> > > preferences.
> >
> > I guess that by client you mean the Spice client (spice-gtk).
> 
> Any client.. but yeah, I'll implement things in spice-gtk.

Ok. I was just checking client did not mean user here.


> > Assuming that's desired, then what you need is a way for the Spice
> > client to express preferences. Currently it cannot because all it
> > sends to the server is the list of supported codecs as an unordered
> > capabilities set. So you'll need to add some sort of message to send a
> > preference list. That list can be in the same format as on the server,
> > that is an ordered semi-colon separated list of encoder:codec pairs.
> 
> Too complex. Client should not care about the encoders in host, only
> about the codecs it can decode and some sort of preference order.
>
> The version that I plan to send tomorrow is just an array with the order
> of video codecs that client prefer.

So your complexity objection is about the format in which to send the 
client's codec preferences to the server: you want to send it as an 
array rather than as a single string.

My objection is that the client should not send codec preferences to the 
server at all and that anything else is needlessly complex.


[...]
> Given the encoder:codecs we need to say, from host point of view:
> 1-) which one is enabled/disabled
> 2-) which one should I try to encode *first*

That's exactly what the current video_codecs string does.


> A rank is super simple for that. Set a encoder:codec to 0 to say it is
> disabled. If you say that default rank value is 1, any codec with higher
> value then 1 should be tried first.
> 
> Not sure what is the problem with rank.

It's needlessly complex and does not add anything useful.


[...]
> Yes, there were some discussion on IRC about preference for encoding.
> The Admin/host will have preference, always. The message about client's
> preference will sort without changing the rank in spice-server... an
> example is always much easier to follow:
> 
> 1-) gstreamer:mjpeg:0;gstreamer:h264:1;gstreamer:vp8:1;spice:mjpeg:1
> 
> -> gstreamer:mjpeg is disabled
> -> h264, vp8, spice:mjpeg has the same rank
> 
> 2-) client sends: vp8, mjpeg, h264
> 
> -> array order in spice: gstreamer:vp8, spice:mjpeg, gstreamer:h264
> -> gstreamer:mjpeg is still disabled

So your example is:

 1-) "gstreamer:h264;gstreamer:vp8;spice:mjpeg"

  -> gstreamer:mjpeg is disabled
  -> the server prefers h264, vp8, spice:mjpeg in that order

 2-) client advertises support for vp8, mjpeg, h264

  -> the server picks h264


So the only thing that ranks allow is to be able to not express a 
preference between several codecs. I just don't see the point of that.

-- 
Francois Gouget <fgouget at codeweavers.com>


More information about the Spice-devel mailing list