AudioDestion need to render even if there is active call.
authorKeonHo Kim <keonho07.kim@samsung.com>
Fri, 11 Oct 2013 02:40:47 +0000 (11:40 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Fri, 11 Oct 2013 05:11:00 +0000 (05:11 +0000)
[Title] AudioDestion need to render even if there is active call.
[Problem] N_SE-54515
[Cause] AudioSessionManger has been blocked render audiodestion.
[Solution] Make it always play, if there is user action.

Change-Id: Ie6c86cd5a17ce73cb15d6c75b4022b89db4fced6

Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp

index d50876e..5694bc9 100755 (executable)
@@ -254,6 +254,16 @@ gboolean AudioDestinationGStreamer::handleMessage(GstMessage* message)
         if (m_audioSessionManager)
             m_audioSessionManager->setSoundState(ASM_STATE_STOP);
         break;
+    case GST_MESSAGE_STATE_CHANGED:
+        GstState oldState, newState;
+        gst_message_parse_state_changed(message, &oldState, &newState, 0);
+
+        if (oldState == GST_STATE_PAUSED && newState == GST_STATE_PLAYING)
+            m_audioSessionManager->setSoundState(ASM_STATE_PLAYING);
+        else if (oldState == GST_STATE_PLAYING && newState == GST_STATE_PAUSED)
+            m_audioSessionManager->setSoundState(ASM_STATE_PAUSE);
+
+        break;
 #endif
     default:
         break;
@@ -266,10 +276,7 @@ void AudioDestinationGStreamer::start()
     ASSERT(m_wavParserAvailable);
     if (!m_wavParserAvailable)
         return;
-#if ENABLE(TIZEN_GSTREAMER_AUDIO)
-    if (m_audioSessionManager && !m_audioSessionManager->setSoundState(ASM_STATE_PLAYING))
-        return;
-#endif
+
     gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
     m_isPlaying = true;
 }
@@ -280,8 +287,6 @@ void AudioDestinationGStreamer::stop()
 #if ENABLE(TIZEN_GSTREAMER_AUDIO)
     if (!m_wavParserAvailable || !m_audioSinkAvailable)
        return;
-    if (m_audioSessionManager && !m_audioSessionManager->setSoundState(ASM_STATE_PAUSE))
-       return;
 #else
     if (!m_wavParserAvailable || m_audioSinkAvailable)
        return;