01org/dleyna-renderer — pull request #50 by cguiraud (2013-04-04 08:56:05+00:00)
Title: [Device] Add X_DLNA_PS transport action support

v2 updated according review comments.

- fixed checkpatch warnings
- removed unused stdlib.h include
- use g_list_prepend instead of g_list_append
- in prv_get_av_service_states_values() use g_variant_ref_sink instead of g_variant_ref
- in prv_get_rate_value_from_double() get rid of hash table lookup, fix mem leak
- reset rates value in case of open URI successful async response. only send prop changed signal for RATE, MIN_RATE, and MAX_RATE if their value have effectively changed.

----

- Add the X_DLNA_PS transport action support to allow the
playspeeds provided by the renderer once we have provided it a
URI (SetAVTransportURI()) in addition to the renderer default
playspeeds retrieved via the introspection.
MINIMUM_RATE, MAXIMUM_RATE and TRANSPORT_PLAY_SPEEDS properties
will be upddated.

when SetAVTransportURI() action is called, MINIMUM_RATE,
MAXIMUM_RATE and TRANSPORT_PLAY_SPEEDS properties will be reset
with the renderer default playspeeds.

- The renderer default playspeeds are stored in the dlr_device_t_
structure to be re-used without having to be re-computed.

- When the application set the property RATE, the new rate value
is checked with either the renderer default allowed playspeeds or
the X_DLNA_PS allowed playspeeds depending on the availability of
the X_DLNA_PS.

- We now emit a property changed signal when application set the
DLR_INTERFACE_PROP_MINIMUM_RATE property with a value not equal
to the current one.

- For the parsing of the action string containing the X_DLNA_PS
content, thanks to regexp API, the sequence "\," are replaced
by "*" ("\," is used to separated the X_DLNA_PS speeds),
then the action string is splitted by "," to separate
each actions token. For getting the X_DLNA_PS playspeeds we then
just have to split the string with "*"

action string = Play,Stop,Seek,X_DLNA_PS=-8\,2\,4\,8

Signed-off-by: Christophe Guiraud