qiaohaijiao commented on code in PR #1523:
URL: https://github.com/apache/nuttx-apps/pull/1523#discussion_r1093972616


##########
system/nxrecorder/nxrecorder.c:
##########
@@ -101,7 +162,79 @@ static int nxrecorder_opendevice(FAR struct nxrecorder_s 
*precorder)
           return -ENOENT;
         }
 
-      return OK;
+      cap.ac_len = sizeof(cap);
+      cap.ac_type    = AUDIO_TYPE_QUERY;
+      cap.ac_subtype = AUDIO_TYPE_QUERY;
+
+      if (ioctl(precorder->dev_fd, AUDIOIOC_GETCAPS,
+               (unsigned long)&cap) == cap.ac_len)
+        {
+          if (((cap.ac_format.hw & (1 << (format - 1))) != 0) &&
+              (cap.ac_controls.b[0] & AUDIO_TYPE_INPUT))
+            {
+              /* Test if subformat needed and detected */
+
+              if (subfmt != AUDIO_FMT_UNDEF)
+                {
+                  /* Prepare to get sub-formats for
+                   * this main format
+                   */
+
+                  cap.ac_subtype = format;
+                  cap.ac_format.b[0] = 0;
+
+                  while (ioctl(precorder->dev_fd, AUDIOIOC_GETCAPS,
+                              (unsigned long)&cap) == cap.ac_len)

Review Comment:
   resolved



##########
system/nxrecorder/nxrecorder_main.c:
##########
@@ -68,6 +68,8 @@ static int nxrecorder_cmd_quit(FAR struct nxrecorder_s 
*precorder,
                                FAR char *parg);
 static int nxrecorder_cmd_recordraw(FAR struct nxrecorder_s *precorder,
                                     FAR char *parg);
+static int nxrecorder_cmd_record(FAR struct nxrecorder_s *precorder,
+                                    FAR char *parg);

Review Comment:
   resolved



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to