1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct snd_compr_ops</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The ALSA Driver API"><link rel="up" href="ch06.html#idp1095078220" title="Compress Offload API"><link rel="prev" href="API-struct-snd-compr-stream.html" title="struct snd_compr_stream"><link rel="next" href="API-struct-snd-compr.html" title="struct snd_compr"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct snd_compr_ops</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-snd-compr-stream.html">Prev</a>&#160;</td><th width="60%" align="center">Compress Offload API</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-struct-snd-compr.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-snd-compr-ops"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct snd_compr_ops &#8212; 
2   </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
3struct snd_compr_ops {
4  int (* open) (struct snd_compr_stream *stream);
5  int (* free) (struct snd_compr_stream *stream);
6  int (* set_params) (struct snd_compr_stream *stream,struct snd_compr_params *params);
7  int (* get_params) (struct snd_compr_stream *stream,struct snd_codec *params);
8  int (* set_metadata) (struct snd_compr_stream *stream,struct snd_compr_metadata *metadata);
9  int (* get_metadata) (struct snd_compr_stream *stream,struct snd_compr_metadata *metadata);
10  int (* trigger) (struct snd_compr_stream *stream, int cmd);
11  int (* pointer) (struct snd_compr_stream *stream,struct snd_compr_tstamp *tstamp);
12  int (* copy) (struct snd_compr_stream *stream, char __user *buf,size_t count);
13  int (* mmap) (struct snd_compr_stream *stream,struct vm_area_struct *vma);
14  int (* ack) (struct snd_compr_stream *stream, size_t bytes);
15  int (* get_caps) (struct snd_compr_stream *stream,struct snd_compr_caps *caps);
16  int (* get_codec_caps) (struct snd_compr_stream *stream,struct snd_compr_codec_caps *codec);
17};  </pre></div><div class="refsect1"><a name="idp1095206316"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">open</span></dt><dd><p>
18   Open the compressed stream
19   This callback is mandatory and shall keep dsp ready to receive the stream
20   parameter
21      </p></dd><dt><span class="term">free</span></dt><dd><p>
22   Close the compressed stream, mandatory
23      </p></dd><dt><span class="term">set_params</span></dt><dd><p>
24   Sets the compressed stream parameters, mandatory
25   This can be called in during stream creation only to set codec params
26   and the stream properties
27      </p></dd><dt><span class="term">get_params</span></dt><dd><p>
28   retrieve the codec parameters, mandatory
29      </p></dd><dt><span class="term">set_metadata</span></dt><dd><p>
30   Set the metadata values for a stream
31      </p></dd><dt><span class="term">get_metadata</span></dt><dd><p>
32   retrieves the requested metadata values from stream
33      </p></dd><dt><span class="term">trigger</span></dt><dd><p>
34   Trigger operations like start, pause, resume, drain, stop.
35   This callback is mandatory
36      </p></dd><dt><span class="term">pointer</span></dt><dd><p>
37   Retrieve current h/w pointer information. Mandatory
38      </p></dd><dt><span class="term">copy</span></dt><dd><p>
39   Copy the compressed data to/from userspace, Optional
40   Can't be implemented if DSP supports mmap
41      </p></dd><dt><span class="term">mmap</span></dt><dd><p>
42   DSP mmap method to mmap DSP memory
43      </p></dd><dt><span class="term">ack</span></dt><dd><p>
44   Ack for DSP when data is written to audio buffer, Optional
45   Not valid if copy is implemented
46      </p></dd><dt><span class="term">get_caps</span></dt><dd><p>
47   Retrieve DSP capabilities, mandatory
48      </p></dd><dt><span class="term">get_codec_caps</span></dt><dd><p>
49   Retrieve capabilities for a specific codec, mandatory
50      </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-snd-compr-stream.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch06.html#idp1095078220">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-struct-snd-compr.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct snd_compr_stream</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">struct snd_compr</span></td></tr></table></div></body></html>
51