From: Seungbae Shin Date: Wed, 11 Sep 2019 04:06:43 +0000 (+0900) Subject: Add deprecated symbol related to Unity for compatibility X-Git-Tag: accepted/tizen/unified/20190917.034033^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fapi%2Faudio-io.git;a=commitdiff_plain;h=b00489dc7b14ee239ac474efb8b230961c94d479 Add deprecated symbol related to Unity for compatibility - audio_out_create() - audio_out_set_interrupted_cb() [Version] 0.5.21 [Issue Type] Compatibility Change-Id: I76a7619afe6e88e8cdcb3926e8a2b4fbff497039 --- diff --git a/packaging/capi-media-audio-io.spec b/packaging/capi-media-audio-io.spec index 257600a..8933b38 100644 --- a/packaging/capi-media-audio-io.spec +++ b/packaging/capi-media-audio-io.spec @@ -1,6 +1,6 @@ Name: capi-media-audio-io Summary: An Audio Input & Audio Output library in Tizen Native API -Version: 0.5.20 +Version: 0.5.21 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/audio_io_deprecated.c b/src/audio_io_deprecated.c new file mode 100644 index 0000000..6c8c1cc --- /dev/null +++ b/src/audio_io_deprecated.c @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + + +#include +#include + +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "TIZEN_N_AUDIO_IO" + +typedef enum { + AUDIO_IO_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed */ + AUDIO_IO_INTERRUPTED_BY_MEDIA, /**< Interrupted by a media application */ + AUDIO_IO_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call */ + AUDIO_IO_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones */ + AUDIO_IO_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */ + AUDIO_IO_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm */ + AUDIO_IO_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency */ + AUDIO_IO_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification */ +} audio_io_interrupted_code_e; + +typedef void (*audio_io_interrupted_cb)(audio_io_interrupted_code_e code, void *user_data); + +#define DEPRECATED_WARN() do { \ + LOGW("DEPRECATION WARNING: %s() is deprecated", __func__); \ +} while (0) + +#define DEPRECATED_WARN_INSTEAD(msg) do { \ + LOGW("DEPRECATION WARNING: %s() is deprecated. Use %s() instead.", __func__, msg); \ +} while (0) + +int audio_out_create(int sample_rate, audio_channel_e channel, audio_sample_type_e type, sound_type_e sound_type, audio_out_h* output) +{ + DEPRECATED_WARN_INSTEAD("audio_out_create_new"); + + /* ignore sound_type, treat this stream as media type */ + return cpp_audio_out_create_new(sample_rate, channel, type, output); +} + +int audio_out_set_interrupted_cb(audio_out_h output, audio_io_interrupted_cb callback, void *user_data) +{ + DEPRECATED_WARN_INSTEAD("sound_manager_create_stream_information"); + + /* dummy, do nothing */ + return AUDIO_IO_ERROR_NONE; +} + +