]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/source-output.h
core: add assert macros for verifying calling context
[pulseaudio] / src / pulsecore / source-output.h
index 018ec8861b56f87aff3961556881a47845f60e16..7b32c86646cae9cc3712ac19bcc109a21fcb0ae8 100644 (file)
@@ -116,13 +116,19 @@ struct pa_source_output {
      * disconnected from its source. Called from IO thread context */
     void (*detach) (pa_source_output *o);           /* may be NULL */
 
-    /* If non-NULL called whenever the the source this output is attached
+    /* If non-NULL called whenever the source this output is attached
      * to suspends or resumes. Called from main context */
     void (*suspend) (pa_source_output *o, pa_bool_t b);   /* may be NULL */
 
-    /* If non-NULL called whenever the the source this output is attached
-     * to changes. Called from main context */
-    void (*moved) (pa_source_output *o);   /* may be NULL */
+    /* If non-NULL called whenever the source this output is attached
+     * to suspends or resumes. Called from IO context */
+    void (*suspend_within_thread) (pa_source_output *o, pa_bool_t b);   /* may be NULL */
+
+    /* If non-NULL called whenever the source output is moved to a new
+     * source. Called from main context after the stream was detached
+     * from the old source and before it is attached to the new
+     * source. */
+    void (*moving) (pa_source_output *o, pa_source *dest);   /* may be NULL */
 
     /* Supposed to unlink and destroy this stream. Called from main
      * context. */
@@ -271,4 +277,7 @@ int pa_source_output_process_msg(pa_msgobject *mo, int code, void *userdata, int
 
 pa_usec_t pa_source_output_set_requested_latency_within_thread(pa_source_output *o, pa_usec_t usec);
 
+#define pa_source_output_assert_io_context(s) \
+    pa_assert(pa_thread_mq_get() || !PA_SOURCE_OUTPUT_IS_LINKED((s)->state))
+
 #endif