修訂 | d9cfa852a34b299be1de178ef59257cf4bcc5e14 (tree) |
---|---|
時間 | 2020-04-28 14:53:41 |
作者 | Francescodario Cuzzocrea <bosconovic@gmai...> |
Commiter | Chih-Wei Huang |
libaudio: remove panel orientation code
@@ -107,7 +107,6 @@ struct audio_device { | ||
107 | 107 | bool standby; |
108 | 108 | bool mic_mute; |
109 | 109 | struct audio_route *ar; |
110 | - int orientation; | |
111 | 110 | bool screen_off; |
112 | 111 | |
113 | 112 | struct stream_out *active_out; |
@@ -152,13 +151,6 @@ struct stream_in { | ||
152 | 151 | struct audio_device *dev; |
153 | 152 | }; |
154 | 153 | |
155 | -enum { | |
156 | - ORIENTATION_LANDSCAPE, | |
157 | - ORIENTATION_PORTRAIT, | |
158 | - ORIENTATION_SQUARE, | |
159 | - ORIENTATION_UNDEFINED, | |
160 | -}; | |
161 | - | |
162 | 154 | static uint32_t out_get_sample_rate(const struct audio_stream *stream); |
163 | 155 | static size_t out_get_buffer_size(const struct audio_stream *stream); |
164 | 156 | static audio_format_t out_get_format(const struct audio_stream *stream); |
@@ -281,12 +273,8 @@ static void select_devices(struct audio_device *adev) | ||
281 | 273 | audio_route_apply_path(adev->ar, "headphone"); |
282 | 274 | if (docked) |
283 | 275 | audio_route_apply_path(adev->ar, "dock"); |
284 | - if (main_mic_on) { | |
285 | - if (adev->orientation == ORIENTATION_LANDSCAPE) | |
286 | - audio_route_apply_path(adev->ar, "main-mic-left"); | |
287 | - else | |
288 | - audio_route_apply_path(adev->ar, "main-mic-top"); | |
289 | - } | |
276 | + if (main_mic_on) | |
277 | + audio_route_apply_path(adev->ar, "main-mic"); | |
290 | 278 | |
291 | 279 | update_mixer_state(adev->ar); |
292 | 280 |
@@ -1138,33 +1126,6 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) | ||
1138 | 1126 | int ret; |
1139 | 1127 | |
1140 | 1128 | parms = str_parms_create_str(kvpairs); |
1141 | - ret = str_parms_get_str(parms, "orientation", value, sizeof(value)); | |
1142 | - if (ret >= 0) { | |
1143 | - int orientation; | |
1144 | - | |
1145 | - if (strcmp(value, "landscape") == 0) | |
1146 | - orientation = ORIENTATION_LANDSCAPE; | |
1147 | - else if (strcmp(value, "portrait") == 0) | |
1148 | - orientation = ORIENTATION_PORTRAIT; | |
1149 | - else if (strcmp(value, "square") == 0) | |
1150 | - orientation = ORIENTATION_SQUARE; | |
1151 | - else | |
1152 | - orientation = ORIENTATION_UNDEFINED; | |
1153 | - | |
1154 | - pthread_mutex_lock(&adev->lock); | |
1155 | - if (orientation != adev->orientation) { | |
1156 | - adev->orientation = orientation; | |
1157 | - /* | |
1158 | - * Orientation changes can occur with the input device | |
1159 | - * closed so we must call select_devices() here to set | |
1160 | - * up the mixer. This is because select_devices() will | |
1161 | - * not be called when the input device is opened if no | |
1162 | - * other input parameter is changed. | |
1163 | - */ | |
1164 | - select_devices(adev); | |
1165 | - } | |
1166 | - pthread_mutex_unlock(&adev->lock); | |
1167 | - } | |
1168 | 1129 | |
1169 | 1130 | ret = str_parms_get_str(parms, "screen_state", value, sizeof(value)); |
1170 | 1131 | if (ret >= 0) { |
@@ -1348,7 +1309,7 @@ static int adev_open(const hw_module_t* module, const char* name, | ||
1348 | 1309 | adev->hw_device.dump = adev_dump; |
1349 | 1310 | |
1350 | 1311 | adev->ar = audio_route_init(); |
1351 | - adev->orientation = ORIENTATION_UNDEFINED; | |
1312 | + | |
1352 | 1313 | adev->out_device = AUDIO_DEVICE_OUT_SPEAKER; |
1353 | 1314 | adev->in_device = AUDIO_DEVICE_IN_BUILTIN_MIC & ~AUDIO_DEVICE_BIT_IN; |
1354 | 1315 |