Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add device id
  • Loading branch information
achronop committed Jan 15, 2016
1 parent dd805ee commit d710886
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions include/cubeb/cubeb.h
Expand Up @@ -118,6 +118,8 @@ typedef enum {
} cubeb_stream_type;
#endif

typedef void * cubeb_devid;

/** Stream format initialization parameters. */
typedef struct {
cubeb_sample_format format; /**< Requested sample format. One of
Expand All @@ -127,6 +129,7 @@ typedef struct {
#if defined(__ANDROID__)
cubeb_stream_type stream_type; /**< Used to map Android audio stream types */
#endif
cubeb_devid devid;
} cubeb_stream_params;

/** Output device description */
Expand Down Expand Up @@ -172,8 +175,6 @@ typedef enum {

/** An opaque handle used to refer a particular input or output device
* accross calls. */
typedef void * cubeb_devid;

/**
* Architecture specific sample type.
*/
Expand Down
11 changes: 8 additions & 3 deletions src/cubeb_pulse.c
Expand Up @@ -306,8 +306,9 @@ stream_read_callback(pa_stream * s, size_t nbytes, void * u)
write_to_output(stm->output_stream, read_buffer, writable_size, stm);
// Trigger to play output stream.
WRAP(pa_stream_trigger)(stm->output_stream, NULL, NULL);
} else {
write_to_output(stm->output_stream, read_buffer, write_size, stm);
}
write_to_output(stm->output_stream, read_buffer, write_size, stm);
} else {
// printf("\n");
// input/capture only operation. Call callback directly
Expand Down Expand Up @@ -693,7 +694,9 @@ pulse_stream_init(cubeb * context,
}
WRAP(pa_stream_set_state_callback)(stm->output_stream, stream_state_callback, stm);
WRAP(pa_stream_set_write_callback)(stm->output_stream, stream_request_callback, stm);
WRAP(pa_stream_connect_playback)(stm->output_stream, NULL, &battr,
WRAP(pa_stream_connect_playback)(stm->output_stream,
output_stream_params->devid,
&battr,
PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_INTERPOLATE_TIMING |
PA_STREAM_START_CORKED,
NULL, NULL);
Expand All @@ -713,7 +716,9 @@ pulse_stream_init(cubeb * context,
}
WRAP(pa_stream_set_state_callback)(stm->input_stream, stream_state_callback, stm);
WRAP(pa_stream_set_read_callback)(stm->input_stream, stream_read_callback, stm);
WRAP(pa_stream_connect_record)(stm->input_stream, NULL, &battr,
WRAP(pa_stream_connect_record)(stm->input_stream,
input_stream_params->devid,
&battr,
PA_STREAM_START_CORKED);
}

Expand Down

0 comments on commit d710886

Please sign in to comment.