Add print_usage to test program 65/294865/2
authorJaechul Lee <jcsing.lee@samsung.com>
Wed, 28 Jun 2023 02:18:43 +0000 (11:18 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Wed, 28 Jun 2023 03:57:33 +0000 (12:57 +0900)
[Version] 0.5.57
[Issue Type] Update

Change-Id: I5c86c86023f23b304d7bd8c73fee37648ed30205
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/capi-media-audio-io.spec
test/audio_io_process_test.c

index 98554a2..f809753 100644 (file)
@@ -1,6 +1,6 @@
 Name:           capi-media-audio-io
 Summary:        An Audio Input & Audio Output library in Tizen Native API
-Version:        0.5.56
+Version:        0.5.57
 Release:        0
 Group:          Multimedia/API
 License:        Apache-2.0
index d0e1bfb..5cf4c6b 100644 (file)
@@ -194,6 +194,12 @@ out:
        return;
 }
 
+static void print_usage()
+{
+       printf("audio_io_process_test -r [samplerate] -c [channels] -d [reference_device_id] -a [AEC type] -n [NS type] -o [output filename]\n");
+       printf("e.g) audio_io_process_test -r 16000 -d 1 -a 0 -n 0 -o filename\n");
+}
+
 int main(int argc, char **argv)
 {
        setbuf(stdout, NULL);
@@ -203,6 +209,11 @@ int main(int argc, char **argv)
        arg_channels = AUDIO_CHANNEL_MONO;
        arg_format = AUDIO_SAMPLE_TYPE_S16_LE;
 
+       if (argc == 1) {
+               print_usage();
+               return 0;
+       }
+
        printf("===== Arguments information =====\n");
        while (-1 != (option = getopt(argc, argv, optstring))) {
                switch (option) {
@@ -239,8 +250,7 @@ int main(int argc, char **argv)
                                break;
                        case 'h':
                        default:
-                               printf("audio_io_process_test -r [sample] [-d:reference_device_id] [-a:AEC type] [-n:NS type] -o [output filename]\n");
-                               printf("audio_io_process_test -r 16000 -d 1 -a 0 -n 0 -o filename\n");
+                               print_usage();
                                return 0;
                }
        }