Change exception message during Prepare failure
authorsrinivasa.mr <srinivasa.mr@samsung.com>
Thu, 20 Jun 2013 09:25:56 +0000 (18:25 +0900)
committersrinivasa.mr <srinivasa.mr@samsung.com>
Thu, 20 Jun 2013 10:53:08 +0000 (19:53 +0900)
Change-Id: Iabf143ada561042f437bcd5b77fd253ac8461f55
Signed-off-by: srinivasa.mr <srinivasa.mr@samsung.com>
inc/FMediaAudioOut.h
inc/FMediaTonePlayer.h
src/FMedia_AudioOutImpl.cpp
src/FMedia_TonePlayerImpl.cpp

index 37b5536..15eecf7 100644 (file)
@@ -207,6 +207,7 @@ public:
        * @exception    E_INVALID_ARG                                                   A specified input parameter is invalid.
        * @exception    E_UNSUPPORTED_FORMAT            The specified audio sample type is not supported.
        * @see                  Unprepare()
+       * @remarks              This method returns E_IVALID_STATE when there is no memory left in the device
        */
        result Prepare(AudioSampleType audioSampleType, AudioChannelType audioChannelType, int audioSampleRate);
 
@@ -226,6 +227,7 @@ public:
        * @exception    E_INVALID_ARG                                           A specified input parameter is invalid.
        * @exception    E_UNSUPPORTED_FORMAT            The specified audio sample type is not supported.
        * @see                  Unprepare()
+       * @remarks              This method returns E_IVALID_STATE when there is no memory left in the device
        */
        result Prepare(AudioStreamType audioStreamType, AudioSampleType audioSampleType, AudioChannelType audioChannelType, int audioSampleRate);
 
index 4a1a4cd..4044b88 100755 (executable)
@@ -202,6 +202,7 @@ public:
        * @exception    E_SYSTEM                                                        A system error has occurred.
        * @remarks              The item(s) of the specified @c toneList must be an instance(s) of Tone.
        * @see                  Close()
+       * @remarks              This method returns E_IVALID_STATE when there is no memory left in the device
        */
        result Open(const Tizen::Base::Collection::IList& toneList, int repeatCount = 1);
 
@@ -220,6 +221,7 @@ public:
        * @exception    E_OUT_OF_RANGE                  The count is out of range.
        * @exception    E_SYSTEM                                                        A system error has occurred.
        * @see                  Close()
+       * @remarks              This method returns E_IVALID_STATE when there is no memory left in the device
        */
        result Open(const Tizen::Media::Tone& tone, int repeatCount = 1);
 
index 9adab57..35e8be6 100644 (file)
@@ -275,6 +275,7 @@ _AudioOutImpl::Prepare(AudioSampleType audioSampleType, AudioChannelType audioCh
 
        ret = audio_out_create(audioSampleRate, _AudioManagerConvert::ConvertChannelType(audioChannelType), _AudioManagerConvert::ConvertSampleType(audioSampleType), SOUND_TYPE_MEDIA, &__audioOutHandle);
        r = MapExceptionToResult(ret);
+       SysTryCatch(NID_MEDIA, r != E_INVALID_STATE, , r, "[%s] The device has moved to invalid state as it is out of memory : 0x%x", GetErrorMessage(r), ret);
        SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Failed to perform audio_out_create operation with error code : 0x%x", GetErrorMessage(r), ret);
 
        ret = audio_out_set_interrupted_cb(__audioOutHandle, AudioIoInterrupted, this);
index 714c38a..beb070d 100644 (file)
@@ -258,6 +258,7 @@ _TonePlayerImpl::Open(const Tizen::Base::Collection::IList& toneList, int repeat
        //Initilaize audio_out Device for raw audio out playback
        ret = audio_out_create(SAMPLING_RATE, AUDIO_CHANNEL_MONO, AUDIO_SAMPLE_TYPE_S16_LE, _AudioManagerConvert::ConvertAudioStreamType2SoundType(__audioStreamtype), &__audioOutHandle);
        r = MapExceptionToResult(ret);
+       SysTryCatch(NID_MEDIA, r != E_INVALID_STATE, , r, "[%s] The device has moved to invalid state as it is out of memory : 0x%x", GetErrorMessage(r), ret);
        SysTryCatch(NID_MEDIA, r == E_SUCCESS , , r, "[%s] Failed to perform audio_out_create operation with 0x%x", GetErrorMessage(r), ret);
 
        ret = audio_out_set_interrupted_cb(__audioOutHandle, AudioIoInterrupted, this);
@@ -336,6 +337,7 @@ _TonePlayerImpl::Open(const Tizen::Media::Tone& tone, int repeatCount)
        __repeatCount = repeatCount;
        //Initlaize audio-out Device for raw audio out playback
        ret = audio_out_create(SAMPLING_RATE, AUDIO_CHANNEL_MONO, AUDIO_SAMPLE_TYPE_S16_LE, _AudioManagerConvert::ConvertAudioStreamType2SoundType(__audioStreamtype), &__audioOutHandle);
+       SysTryCatch(NID_MEDIA, r != E_INVALID_STATE, , r, "[%s] The device has moved to invalid state as it is out of memory : 0x%x", GetErrorMessage(r), ret);
        r = MapExceptionToResult(ret);
        SysTryCatch(NID_MEDIA, r == E_SUCCESS , , r, "[%s] Failed to perform audio_out_create operation with 0x%x", GetErrorMessage(r), ret);