Self camera should be lauched during a call.
authorkeonho07.kim <keonho07.kim@samsung.com>
Wed, 29 May 2013 04:53:39 +0000 (13:53 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 29 May 2013 11:46:42 +0000 (20:46 +0900)
[Title] Self camera should be lauched during a call.
[Issue#] N_SE-38583
[Problem] Self camera should be lauched during a call.
[Cause] Audio session manager is blocked lauching a camera.
[Solution] Make a exception for getusermedia

Change-Id: I34977645ee4db331c33102ffd66623b1cae4f7f5

Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

index a5e098c..15e0b78 100755 (executable)
@@ -250,8 +250,6 @@ static ASM_cb_result_t MediaPlayerAudioSessionEventSourcePause(ASM_event_sources
     case ASM_EVENT_SOURCE_EMERGENCY_START:
     case ASM_EVENT_SOURCE_OTHER_PLAYER_APP:
     case ASM_EVENT_SOURCE_RESOURCE_CONFLICT:
-        player->pause();
-        return ASM_CB_RES_PAUSE;
     case ASM_EVENT_SOURCE_EARJACK_UNPLUG:
         if (!player->url().string().contains("camera://")) {
             player->pause();
@@ -265,15 +263,13 @@ static ASM_cb_result_t MediaPlayerAudioSessionEventSourcePause(ASM_event_sources
 static ASM_cb_result_t MediaPlayerAudioSessionEventSourcePlay(ASM_event_sources_t eventSource, void* callbackData)
 {
     MediaPlayer* player = static_cast<MediaPlayer*>(callbackData);
+    HTMLMediaElement* element = static_cast<HTMLMediaElement*>(player->mediaPlayerClient());
     if (!player)
         return ASM_CB_RES_IGNORE;
 
     switch (eventSource) {
     case ASM_EVENT_SOURCE_ALARM_END:
-        if (!player->hasVideo()) {
-            player->play();
-            return ASM_CB_RES_PLAYING;
-        } else if (player->url().string().contains("camera://")) {
+        if (!element->isVideo() && !player->url().string().contains("camera://")) {
             player->play();
             return ASM_CB_RES_PLAYING;
         }
@@ -586,7 +582,7 @@ void MediaPlayerPrivateGStreamer::prepareToPlay()
 void MediaPlayerPrivateGStreamer::play()
 {
 #if ENABLE(TIZEN_GSTREAMER_AUDIO)
-    if (m_audioSessionManager && !m_audioSessionManager->setSoundState(ASM_STATE_PLAYING))
+    if (!m_audioSessionManager->setSoundState(ASM_STATE_PLAYING) && !isLocalMediaStream())
         return;
 #endif
     if (changePipelineState(GST_STATE_PLAYING)) {
@@ -598,7 +594,7 @@ void MediaPlayerPrivateGStreamer::play()
 void MediaPlayerPrivateGStreamer::pause()
 {
 #if ENABLE(TIZEN_GSTREAMER_AUDIO)
-    if (m_audioSessionManager && !m_audioSessionManager->setSoundState(ASM_STATE_PAUSE))
+    if (!m_audioSessionManager->setSoundState(ASM_STATE_PAUSE) && !isLocalMediaStream())
         return;
 #endif
     if (m_isEndReached)