• Home
  • Raw
  • Download

Lines Matching refs:xfer

38 int xfer_context_init(struct xfer_context *xfer, enum xfer_type type,  in xfer_context_init()  argument
53 assert(xfer); in xfer_context_init()
65 xfer->direction = direction; in xfer_context_init()
66 xfer->type = type; in xfer_context_init()
67 xfer->ops = &entry->data->ops; in xfer_context_init()
69 xfer->private_data = malloc(entry->data->private_size); in xfer_context_init()
70 if (xfer->private_data == NULL) in xfer_context_init()
72 memset(xfer->private_data, 0, entry->data->private_size); in xfer_context_init()
74 err = xfer->ops->init(xfer, direction); in xfer_context_init()
78 err = xfer_options_parse_args(xfer, entry->data, argc, argv); in xfer_context_init()
82 return xfer->ops->validate_opts(xfer); in xfer_context_init()
85 void xfer_context_destroy(struct xfer_context *xfer) in xfer_context_destroy() argument
89 assert(xfer); in xfer_context_destroy()
91 if (!xfer->ops) in xfer_context_destroy()
94 if (xfer->ops->destroy) in xfer_context_destroy()
95 xfer->ops->destroy(xfer); in xfer_context_destroy()
96 if (xfer->private_data) in xfer_context_destroy()
97 free(xfer->private_data); in xfer_context_destroy()
99 if (xfer->paths) { in xfer_context_destroy()
100 for (i = 0; i < xfer->path_count; ++i) in xfer_context_destroy()
101 free(xfer->paths[i]); in xfer_context_destroy()
102 free(xfer->paths); in xfer_context_destroy()
105 xfer->paths = NULL; in xfer_context_destroy()
107 free(xfer->sample_format_literal); in xfer_context_destroy()
108 xfer->sample_format_literal = NULL; in xfer_context_destroy()
110 free(xfer->cntr_format_literal); in xfer_context_destroy()
111 xfer->cntr_format_literal = NULL; in xfer_context_destroy()
114 int xfer_context_pre_process(struct xfer_context *xfer, in xfer_context_pre_process() argument
123 assert(xfer); in xfer_context_pre_process()
130 if (!xfer->ops) in xfer_context_pre_process()
133 if (xfer->direction == SND_PCM_STREAM_CAPTURE) { in xfer_context_pre_process()
135 if (xfer->sample_format != SND_PCM_FORMAT_UNKNOWN) in xfer_context_pre_process()
136 *format = xfer->sample_format; in xfer_context_pre_process()
137 if (xfer->samples_per_frame > 0) in xfer_context_pre_process()
138 *samples_per_frame = xfer->samples_per_frame; in xfer_context_pre_process()
139 if (xfer->frames_per_second > 0) in xfer_context_pre_process()
140 *frames_per_second = xfer->frames_per_second; in xfer_context_pre_process()
141 } else if (xfer->direction == SND_PCM_STREAM_PLAYBACK) { in xfer_context_pre_process()
144 if (*format != xfer->sample_format) { in xfer_context_pre_process()
146 if (xfer->sample_format != SND_PCM_FORMAT_UNKNOWN) { in xfer_context_pre_process()
150 snd_pcm_format_name(xfer->sample_format), in xfer_context_pre_process()
156 if (*samples_per_frame != xfer->samples_per_frame) { in xfer_context_pre_process()
158 if (xfer->samples_per_frame > 0) { in xfer_context_pre_process()
162 xfer->samples_per_frame, in xfer_context_pre_process()
168 if (*frames_per_second != xfer->frames_per_second) { in xfer_context_pre_process()
170 if (xfer->frames_per_second != 8000) { in xfer_context_pre_process()
174 xfer->frames_per_second, in xfer_context_pre_process()
181 err = xfer->ops->pre_process(xfer, format, samples_per_frame, in xfer_context_pre_process()
195 xfer->sample_format = *format; in xfer_context_pre_process()
196 xfer->samples_per_frame = *samples_per_frame; in xfer_context_pre_process()
197 xfer->frames_per_second = *frames_per_second; in xfer_context_pre_process()
199 if (xfer->direction == SND_PCM_STREAM_CAPTURE) { in xfer_context_pre_process()
200 err = xfer_options_fixup_paths(xfer); in xfer_context_pre_process()
205 if (xfer->verbose > 1) { in xfer_context_pre_process()
207 xfer_type_labels[xfer->type]); in xfer_context_pre_process()
225 int xfer_context_process_frames(struct xfer_context *xfer, in xfer_context_process_frames() argument
230 assert(xfer); in xfer_context_process_frames()
235 if (!xfer->ops) in xfer_context_process_frames()
238 return xfer->ops->process_frames(xfer, frame_count, mapper, cntrs); in xfer_context_process_frames()
241 void xfer_context_pause(struct xfer_context *xfer, bool enable) in xfer_context_pause() argument
243 assert(xfer); in xfer_context_pause()
245 if (!xfer->ops) in xfer_context_pause()
248 xfer->ops->pause(xfer, enable); in xfer_context_pause()
251 void xfer_context_post_process(struct xfer_context *xfer) in xfer_context_post_process() argument
253 assert(xfer); in xfer_context_post_process()
255 if (!xfer->ops) in xfer_context_post_process()
258 xfer->ops->post_process(xfer); in xfer_context_post_process()