This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0d4fc3b9e73d5a8e9297957e582064d020799b58
Author: caozilong1 <[email protected]>
AuthorDate: Tue Aug 18 14:41:42 2026 +0800

    !audio: carry frame_samples and extradata in audio_codec_s
    
    A consumer that receives encoded data from another core or process
    cannot work out the samples per packet or the codec extradata from the
    stream itself.  Add frame_samples and a fixed-size extradata buffer to
    audio_codec_s, so that the encoder can report them with the format.
    AUDIO_CODEC_EXTRADATA_MAX is 64 bytes, which covers the current codecs
    and keeps audio_codec_s small.
    
    BREAKING CHANGE: struct audio_codec_s grows by 72 bytes, and so do the
    structures that embed it: struct audio_caps_s, struct audio_caps_desc_s,
    struct audio_info_s and struct ap_buffer_s.  In struct ap_buffer_s the
    members after the embedded audio_info_s, including samp, move.  Code
    built against the old header no longer matches the kernel.  Quick fix:
    rebuild the kernel and every application that includes
    nuttx/audio/audio.h.
    
    Signed-off-by: caozilong1 <[email protected]>
---
 include/nuttx/audio/audio.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/nuttx/audio/audio.h b/include/nuttx/audio/audio.h
index 7bcd690b1a4..fe92ec5629a 100644
--- a/include/nuttx/audio/audio.h
+++ b/include/nuttx/audio/audio.h
@@ -543,6 +543,10 @@
 #define AUDIO_STATE_DRAINING       4
 #define AUDIO_STATE_RUNNING        5
 
+/* Cross-Core Codec Parameters **********************************************/
+
+#define AUDIO_CODEC_EXTRADATA_MAX   64
+
 /****************************************************************************
  * Public Types
  ****************************************************************************/
@@ -700,6 +704,10 @@ struct audio_codec_s
   uint32_t format;
   uint32_t align;
   union audio_codec_options_u options;
+
+  uint32_t frame_samples;
+  uint32_t extradata_size;
+  uint8_t  extradata[AUDIO_CODEC_EXTRADATA_MAX];
 };
 
 struct audio_caps_s

Reply via email to