PCM: First cut at fast forward by subsampling

This commit is contained in:
Gregory Nutt
2014-07-27 18:33:17 -06:00
parent 0cc9b06eca
commit c9f15ffd3d
2 changed files with 827 additions and 32 deletions
+813 -27
View File
File diff suppressed because it is too large Load Diff
+14 -5
View File
@@ -649,18 +649,27 @@ static int null_resume(FAR struct audio_lowerhalf_s *dev)
static int null_enqueuebuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct ap_buffer_s *apb)
{
/* Take a reference */
FAR struct null_dev_s *priv = (FAR struct null_dev_s *)dev;
apb_reference(apb);
audvdbg("apb=%p curbyte=%d nbytes=%d\n", apb, apb->curbyte, apb->nbytes);
/* say that we consumed all of the data */
/* Say that we consumed all of the data */
apb->curbyte = apb->nbytes;
/* Release the reference and return success */
/* And return the buffer to the upper level */
apb_free(apb);
DEBUGASSERT(priv && apb && priv->dev.upper);
/* The buffer belongs to to an upper level. Just forward the event to
* the next level up.
*/
#ifdef CONFIG_AUDIO_MULTI_SESSION
priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK, NULL);
#else
priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK);
#endif
audvdbg("Return OK\n");
return OK;