SOUND_STREAM_TYPE_VOICE_RECOGNITION, /**< Sound stream type for voice recognition */
SOUND_STREAM_TYPE_RINGTONE_VOIP, /**< Sound stream type for ringtone for VoIP */
SOUND_STREAM_TYPE_VOIP, /**< Sound stream type for VoIP */
+ SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY,/**< Sound stream type for media only for external devices */
} sound_stream_type_e;
/**
* @since_tizen 3.0
*/
typedef enum {
- SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA, /**< Changed by the stream type for media */
- SOUND_STREAM_FOCUS_CHANGED_BY_SYSTEM, /**< Changed by the stream type for system */
- SOUND_STREAM_FOCUS_CHANGED_BY_ALARM, /**< Changed by the stream type for alarm */
- SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION, /**< Changed by the stream type for notification */
- SOUND_STREAM_FOCUS_CHANGED_BY_EMERGENCY, /**< Changed by the stream type for emergency */
- SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION, /**< Changed by the stream type for voice information */
- SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION, /**< Changed by the stream type for voice recognition */
- SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE, /**< Changed by the stream type for ringtone */
- SOUND_STREAM_FOCUS_CHANGED_BY_VOIP, /**< Changed by the stream type for VoIP */
- SOUND_STREAM_FOCUS_CHANGED_BY_CALL, /**< Changed by the stream type for voice-call or video-call */
+ SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA, /**< Changed by the stream type for media */
+ SOUND_STREAM_FOCUS_CHANGED_BY_SYSTEM, /**< Changed by the stream type for system */
+ SOUND_STREAM_FOCUS_CHANGED_BY_ALARM, /**< Changed by the stream type for alarm */
+ SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION, /**< Changed by the stream type for notification */
+ SOUND_STREAM_FOCUS_CHANGED_BY_EMERGENCY, /**< Changed by the stream type for emergency */
+ SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION, /**< Changed by the stream type for voice information */
+ SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION, /**< Changed by the stream type for voice recognition */
+ SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE, /**< Changed by the stream type for ringtone */
+ SOUND_STREAM_FOCUS_CHANGED_BY_VOIP, /**< Changed by the stream type for VoIP */
+ SOUND_STREAM_FOCUS_CHANGED_BY_CALL, /**< Changed by the stream type for voice-call or video-call */
+ SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA_EXTERNAL_ONLY,/**< Changed by the stream type for media only for external devices */
} sound_stream_focus_change_reason_e;
/**
/* it should be synchronized with pulseaudio's */
typedef enum stream_route_type {
- STREAM_ROUTE_TYPE_AUTO, /* the policy of decision device(s) is automatic and it's routing path is particular to one device */
- STREAM_ROUTE_TYPE_AUTO_ALL, /* the policy of decision device(s) is automatic and it's routing path can be several devices */
- STREAM_ROUTE_TYPE_MANUAL, /* the policy of decision device(s) is manual */
+ STREAM_ROUTE_TYPE_AUTO, /* the policy of decision device(s) is automatic and it's routing path is particular to one device */
+ STREAM_ROUTE_TYPE_AUTO_ALL, /* the policy of decision device(s) is automatic and it's routing path can be several devices */
+ STREAM_ROUTE_TYPE_MANUAL, /* the policy of decision device(s) is manual */
+ STREAM_ROUTE_TYPE_MANUAL_EXT, /* the policy of decision device(s) is manual and it's routing path is only for external devices */
} stream_route_type;
#define AVAIL_DEVICES_MAX 16
#define AVAIL_FRAMEWORKS_MAX 16
case SOUND_STREAM_TYPE_VOIP:
*stream_type = "voip";
break;
+ case SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY:
+ *stream_type = "ext-media";
+ break;
default:
LOGE("could not find the stream_type[%d] in this switch case statement", stream_type_enum);
ret = MM_ERROR_SOUND_INTERNAL;
} else if (!strncmp(stream_type, "call-voice", SOUND_STREAM_TYPE_LEN) ||
!strncmp(stream_type, "call-video", SOUND_STREAM_TYPE_LEN)) {
*change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_CALL;
+
+ } else if (!strncmp(stream_type, "ext-media", SOUND_STREAM_TYPE_LEN)) {
+ *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA_EXTERNAL_ONLY;
+
} else {
ret = MM_ERROR_INVALID_ARGUMENT;
LOGE("not supported stream_type(%s), err(0x%08x)", stream_type, ret);
!strncmp(stream_type, "system", SOUND_STREAM_TYPE_LEN) ||
!strncmp(stream_type, "voice-information", SOUND_STREAM_TYPE_LEN) ||
!strncmp(stream_type, "voice-recognition", SOUND_STREAM_TYPE_LEN) ||
- !strncmp(stream_type, "loopback", SOUND_STREAM_TYPE_LEN)) {
+ !strncmp(stream_type, "loopback", SOUND_STREAM_TYPE_LEN) ||
+ !strncmp(stream_type, "ext-media", SOUND_STREAM_TYPE_LEN)) {
*change_reason = SOUND_SESSION_INTERRUPTED_BY_MEDIA;
} else if (!strncmp(stream_type, "alarm", SOUND_STREAM_TYPE_LEN)) {
int i = 0;
int j = 0;
bool added_successfully = false;
+#if 0
+ /* not ready yet. after preparing in libmm-sound, it'll be enabled */
+ bool use_internal_codec = false;
+#endif
char *device_type_str = NULL;
int device_id = 0;
mm_sound_device_type_e device_type;
SM_INSTANCE_CHECK_FOR_PRIV(stream_info);
SM_NULL_ARG_CHECK_FOR_PRIV(device);
- if (stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL) {
+ if (stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL ||
+ stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL_EXT) {
+#if 0
+ /* not ready yet. after preparing in libmm-sound, it'll be enabled */
+ if (stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL_EXT) {
+ ret = mm_sound_get_device_use_internal_codec(device, &use_internal_codec);
+ if (ret) {
+ return _convert_sound_manager_error_code(__func__, ret);
+ }
+ if (use_internal_codec)
+ return _convert_sound_manager_error_code(__func__, MM_ERROR_POLICY_INTERNAL);
+ }
+#endif
ret = mm_sound_get_device_id(device, &device_id);
if (ret) {
return _convert_sound_manager_error_code(__func__, ret);
SM_INSTANCE_CHECK_FOR_PRIV(stream_info);
SM_NULL_ARG_CHECK_FOR_PRIV(device);
- if (stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL) {
+ if (stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL ||
+ stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL_EXT) {
ret = mm_sound_get_device_id(device, &device_id);
if (ret) {
return _convert_sound_manager_error_code(__func__, ret);
SM_INSTANCE_CHECK_FOR_PRIV(stream_info);
- if (stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL) {
+ if (stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL ||
+ stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL_EXT) {
for (i = 0; i < AVAIL_DEVICES_MAX; i++) {
if (stream_info->manual_route_info.route_in_devices[i]) {
need_to_apply = true;
SM_INSTANCE_CHECK_FOR_PRIV(virtual_stream);
SM_STATE_CHECK_FOR_PRIV(virtual_stream, _VSTREAM_STATE_READY);
- if (virtual_stream->stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL) {
+ if (virtual_stream->stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL ||
+ virtual_stream->stream_info->stream_conf_info.route_type == STREAM_ROUTE_TYPE_MANUAL_EXT) {
/* check if the manual route info. is set when it comes to the manual route type */
if (virtual_stream->stream_info->manual_route_info.is_set == false) {
ret = MM_ERROR_SOUND_INVALID_STATE;