struct snd_compr_ops —
struct snd_compr_ops { int (* open) (struct snd_compr_stream *stream); int (* free) (struct snd_compr_stream *stream); int (* set_params) (struct snd_compr_stream *stream,struct snd_compr_params *params); int (* get_params) (struct snd_compr_stream *stream,struct snd_codec *params); int (* set_metadata) (struct snd_compr_stream *stream,struct snd_compr_metadata *metadata); int (* get_metadata) (struct snd_compr_stream *stream,struct snd_compr_metadata *metadata); int (* trigger) (struct snd_compr_stream *stream, int cmd); int (* pointer) (struct snd_compr_stream *stream,struct snd_compr_tstamp *tstamp); int (* copy) (struct snd_compr_stream *stream, char __user *buf,size_t count); int (* mmap) (struct snd_compr_stream *stream,struct vm_area_struct *vma); int (* ack) (struct snd_compr_stream *stream, size_t bytes); int (* get_caps) (struct snd_compr_stream *stream,struct snd_compr_caps *caps); int (* get_codec_caps) (struct snd_compr_stream *stream,struct snd_compr_codec_caps *codec); };
Open the compressed stream This callback is mandatory and shall keep dsp ready to receive the stream parameter
Close the compressed stream, mandatory
Sets the compressed stream parameters, mandatory This can be called in during stream creation only to set codec params and the stream properties
retrieve the codec parameters, mandatory
Set the metadata values for a stream
retrieves the requested metadata values from stream
Trigger operations like start, pause, resume, drain, stop. This callback is mandatory
Retrieve current h/w pointer information. Mandatory
Copy the compressed data to/from userspace, Optional Can't be implemented if DSP supports mmap
DSP mmap method to mmap DSP memory
Ack for DSP when data is written to audio buffer, Optional Not valid if copy is implemented
Retrieve DSP capabilities, mandatory
Retrieve capabilities for a specific codec, mandatory