1 | | Useful if application wants to manage the sound device by itself, so that it knows when to open and close it. |
| 1 | Implement a new callback to notify application that sound device is about to be opened or closed. This is useful if application wants to keep track whether the sound device is currently active or idle, and also will be very useful if application manages the sound device by itself since this callback notifies the application when the library needs to use the sound device and when it's safe to close it, taking into account the sound device idle timer. |
| 2 | |
| 3 | Prototype of the callback: |
| 4 | {{{ |
| 5 | /** |
| 6 | * Callback when the sound device is about to be opened or closed. |
| 7 | * This callback will be called even when null sound device or no |
| 8 | * sound device is configured by the application (i.e. the |
| 9 | * #pjsua_set_null_snd_dev() and #pjsua_set_no_snd_dev() APIs). |
| 10 | * This API is mostly useful when the application wants to manage |
| 11 | * the sound device by itself (i.e. with #pjsua_set_no_snd_dev()), |
| 12 | * to get notified when it should open or close the sound device. |
| 13 | * |
| 14 | * @param operation The value will be set to 0 to signal that sound |
| 15 | * device is about to be closed, and 1 to be opened. |
| 16 | * |
| 17 | * @return The callback must return PJ_SUCCESS at the moment. |
| 18 | */ |
| 19 | pj_status_t (*on_snd_dev_operation)(int operation); |
| 20 | }}} |