[pulseaudio-discuss] [PATCH 4/5] introspect: Add functions to handle the latency offset.

Tanu Kaskinen tanuk at iki.fi
Thu Jun 28 03:02:55 PDT 2012


On Fri, 2012-06-22 at 20:55 +0200, poljar (Damir Jelic) wrote:
> @@ -787,8 +803,9 @@ static void card_info_free(pa_card_info* i)
>      }
>  }
>  
> -static int fill_card_port_info(pa_tagstruct* t, pa_card_info* i)
> +static int fill_card_port_info(void *userdata, pa_tagstruct* t, pa_card_info* i)

I think pa_context pointer would be a better choice than pa_operation as
a void pointer. The function is not particularly interested in the
operation, only in the context object of the operation. You could then
argue that the function is not actually interested in the context object
either, but only its version field, and I could agree (so either is fine
for me).

> diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h
> index 0072f5d..3973d7a 100644
> --- a/src/pulse/introspect.h
> +++ b/src/pulse/introspect.h
> @@ -203,6 +203,7 @@ typedef struct pa_sink_port_info {
>      const char *description;            /**< Description of this port */
>      uint32_t priority;                  /**< The higher this value is, the more useful this port is as a default. */
>      int available;                      /**< A flags (see #pa_port_available), indicating availability status of this port. \since 2.0 */
> +    pa_usec_t latency_offset;           /**< Latency offset of the port that gets added to the sink if the port is active. \since 3.0 */
>  } pa_sink_port_info;

There has been some talk about stopping further development of the sink
and source port stuff in the client API, and only develop the card
ports. Here's one (not very informative) discussion about it:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/12955/focus=12968

Unless there are objections, I suggest that you don't include the
latency offset in the sink and source info.

Somewhat related, there should be change notifications sent to the
clients when the port latency offset changes. Since there's no
subscription object for ports, the change needs to be sent as a card
change event. If the latency offset is included also in the sink and
source info, then also sink and source change events should be sent. The
need to send the same event multiple times is one of the main reasons
why it's better to include the port information only with cards when
communicating with clients.

>  
>  /** Stores information about sinks. Please note that this structure
> @@ -283,6 +284,7 @@ typedef struct pa_source_port_info {
>      const char *description;            /**< Description of this port */
>      uint32_t priority;                  /**< The higher this value is, the more useful this port is as a default. */
>      int available;                      /**< A flags (see #pa_port_available), indicating availability status of this port. \since 2.0 */
> +    pa_usec_t latency_offset;           /**< Latency offset of the port that gets added to the source if the port is active. \since 3.0 */
>  } pa_source_port_info;
>  
>  /** Stores information about sources. Please note that this structure
> @@ -466,6 +468,7 @@ typedef struct pa_card_port_info {
>      uint32_t n_profiles;                /**< Number of entries in profile array */
>      pa_card_profile_info** profiles;    /**< Array of pointers to available profiles, or NULL. Array is terminated by an entry set to NULL. */
>      pa_proplist *proplist;              /**< Property list */
> +    pa_usec_t latency_offset;           /**< Latency offset of the port that gets added to the sink/source if the port is active. \since 3.0 */

I'd replace "if" with "when" and add word "latency" after "sink/source".

-- 
Tanu



More information about the pulseaudio-discuss mailing list