OSDN Git Service

Use audio_format_t consistently
authorGlenn Kasten <gkasten@google.com>
Thu, 12 Jan 2012 22:55:57 +0000 (14:55 -0800)
committerGlenn Kasten <gkasten@google.com>
Thu, 12 Jan 2012 22:55:57 +0000 (14:55 -0800)
Was sometimes int or uint32_t

Change-Id: Ib3d82f5aefeda371c0439e43e72737a54882f519

include/hardware/audio.h
include/hardware/audio_policy.h
modules/audio/audio_hw.c
modules/audio/audio_policy.c

index ed97728..ae82c3b 100644 (file)
@@ -102,12 +102,12 @@ struct audio_stream {
     /**
      * audio format - eg. AUDIO_FORMAT_PCM_16_BIT
      */
-    int (*get_format)(const struct audio_stream *stream);
+    audio_format_t (*get_format)(const struct audio_stream *stream);
 
     /* currently unused - use set_parameters with key
      *     AUDIO_PARAMETER_STREAM_FORMAT
      */
-    int (*set_format)(struct audio_stream *stream, int format);
+    int (*set_format)(struct audio_stream *stream, audio_format_t format);
 
     /**
      * Put the audio hardware input/output into standby mode.
@@ -297,12 +297,12 @@ struct audio_hw_device {
      * 0 if one of the parameters is not supported
      */
     size_t (*get_input_buffer_size)(const struct audio_hw_device *dev,
-                                    uint32_t sample_rate, int format,
+                                    uint32_t sample_rate, audio_format_t format,
                                     int channel_count);
 
     /** This method creates and opens the audio hardware output stream */
     int (*open_output_stream)(struct audio_hw_device *dev, uint32_t devices,
-                              int *format, uint32_t *channels,
+                              audio_format_t *format, uint32_t *channels,
                               uint32_t *sample_rate,
                               struct audio_stream_out **out);
 
@@ -311,7 +311,7 @@ struct audio_hw_device {
 
     /** This method creates and opens the audio hardware input stream */
     int (*open_input_stream)(struct audio_hw_device *dev, uint32_t devices,
-                             int *format, uint32_t *channels,
+                             audio_format_t *format, uint32_t *channels,
                              uint32_t *sample_rate,
                              audio_in_acoustics_t acoustics,
                              struct audio_stream_in **stream_in);
index fc56e5e..59ff865 100644 (file)
@@ -131,7 +131,7 @@ struct audio_policy {
     audio_io_handle_t (*get_output)(struct audio_policy *pol,
                                     audio_stream_type_t stream,
                                     uint32_t samplingRate,
-                                    uint32_t format,
+                                    audio_format_t format,
                                     uint32_t channels,
                                     audio_policy_output_flags_t flags);
 
@@ -156,7 +156,7 @@ struct audio_policy {
      * supplied parameters. */
     audio_io_handle_t (*get_input)(struct audio_policy *pol, int inputSource,
                                    uint32_t samplingRate,
-                                   uint32_t format,
+                                   audio_format_t format,
                                    uint32_t channels,
                                    audio_in_acoustics_t acoustics);
 
@@ -242,7 +242,7 @@ struct audio_policy_service_ops {
     audio_io_handle_t (*open_output)(void *service,
                                      uint32_t *pDevices,
                                      uint32_t *pSamplingRate,
-                                     uint32_t *pFormat,
+                                     audio_format_t *pFormat,
                                      uint32_t *pChannels,
                                      uint32_t *pLatencyMs,
                                      audio_policy_output_flags_t flags);
@@ -277,7 +277,7 @@ struct audio_policy_service_ops {
     audio_io_handle_t (*open_input)(void *service,
                                     uint32_t *pDevices,
                                     uint32_t *pSamplingRate,
-                                    uint32_t *pFormat,
+                                    audio_format_t *pFormat,
                                     uint32_t *pChannels,
                                     uint32_t acoustics);
 
index a482604..c5b4651 100644 (file)
@@ -60,12 +60,12 @@ static uint32_t out_get_channels(const struct audio_stream *stream)
     return AUDIO_CHANNEL_OUT_STEREO;
 }
 
-static int out_get_format(const struct audio_stream *stream)
+static audio_format_t out_get_format(const struct audio_stream *stream)
 {
     return AUDIO_FORMAT_PCM_16_BIT;
 }
 
-static int out_set_format(struct audio_stream *stream, int format)
+static int out_set_format(struct audio_stream *stream, audio_format_t format)
 {
     return 0;
 }
@@ -147,12 +147,12 @@ static uint32_t in_get_channels(const struct audio_stream *stream)
     return AUDIO_CHANNEL_IN_MONO;
 }
 
-static int in_get_format(const struct audio_stream *stream)
+static audio_format_t in_get_format(const struct audio_stream *stream)
 {
     return AUDIO_FORMAT_PCM_16_BIT;
 }
 
-static int in_set_format(struct audio_stream *stream, int format)
+static int in_set_format(struct audio_stream *stream, audio_format_t format)
 {
     return 0;
 }
@@ -208,7 +208,7 @@ static int in_remove_audio_effect(const struct audio_stream *stream, effect_hand
 }
 
 static int adev_open_output_stream(struct audio_hw_device *dev,
-                                   uint32_t devices, int *format,
+                                   uint32_t devices, audio_format_t *format,
                                    uint32_t *channels, uint32_t *sample_rate,
                                    struct audio_stream_out **stream_out)
 {
@@ -294,14 +294,14 @@ static int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state)
 }
 
 static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev,
-                                         uint32_t sample_rate, int format,
+                                         uint32_t sample_rate, audio_format_t format,
                                          int channel_count)
 {
     return 320;
 }
 
 static int adev_open_input_stream(struct audio_hw_device *dev, uint32_t devices,
-                                  int *format, uint32_t *channels,
+                                  audio_format_t *format, uint32_t *channels,
                                   uint32_t *sample_rate,
                                   audio_in_acoustics_t acoustics,
                                   struct audio_stream_in **stream_in)
index 409f0a1..e7d986a 100644 (file)
@@ -96,7 +96,7 @@ static int ap_init_check(const struct audio_policy *pol)
 static audio_io_handle_t ap_get_output(struct audio_policy *pol,
                                        audio_stream_type_t stream,
                                        uint32_t sampling_rate,
-                                       uint32_t format,
+                                       audio_format_t format,
                                        uint32_t channels,
                                        audio_policy_output_flags_t flags)
 {
@@ -122,7 +122,7 @@ static void ap_release_output(struct audio_policy *pol,
 
 static audio_io_handle_t ap_get_input(struct audio_policy *pol, int inputSource,
                                       uint32_t sampling_rate,
-                                      uint32_t format,
+                                      audio_format_t format,
                                       uint32_t channels,
                                       audio_in_acoustics_t acoustics)
 {