merge with master
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:15:53 +0000 (01:15 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:15:53 +0000 (01:15 +0900)
13 files changed:
AUTHORS
configure.ac
packaging/libmm-player.spec
src/include/mm_player_asm.h
src/include/mm_player_priv.h
src/include/mm_player_utils.h
src/mm_player.c
src/mm_player_asm.c
src/mm_player_attrs.c
src/mm_player_capture.c
src/mm_player_pd.c
src/mm_player_priv.c
src/mm_player_utils.c

diff --git a/AUTHORS b/AUTHORS
index 9c96f2e..2f6e739 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1 @@
-JongHyuk Choi <jhchoi.choi at samsung dot com>\r
-YeJin Cho <cho.yejin at samsung dot com>\r
-YoungHwan An <younghwan_.an at samsung dot com>\r
+JongHyuk Choi <jhchoi.choi@samsung.com>\r
index 4070017..06898cf 100755 (executable)
@@ -8,7 +8,9 @@ AC_CONFIG_HEADER([config.h])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 
 # Checks for programs.
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 AC_PROG_CC
+
 AC_PROG_LIBTOOL
 
 AC_FUNC_MMAP
index 2a41c77..6f11da3 100644 (file)
@@ -1,14 +1,11 @@
-
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.2.11
-Release:    1
+Version:    0.2.14
+Release:    0
 Group:      System/Libraries
-License:    Apache License, Version 2.0
+License:    Apache-2.0
 URL:        http://source.tizen.org
 Source0:    %{name}-%{version}.tar.gz
-Requires(post):  /sbin/ldconfig
-Requires(postun):  /sbin/ldconfig
 BuildRequires:  pkgconfig(mm-ta)
 BuildRequires:  pkgconfig(mm-common)
 BuildRequires:  pkgconfig(mm-sound)
@@ -23,9 +20,8 @@ BuildRequires:  pkgconfig(iniparser)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(icu-i18n)
 
-BuildRoot:  %{_tmppath}/%{name}-%{version}-build
-
 %description
+Multimedia Framework Player Library.
 
 %package devel
 Summary:    Multimedia Framework Player Library (DEV)
@@ -33,6 +29,7 @@ Group:      Development/Libraries
 Requires:   %{name} = %{version}-%{release}
 
 %description devel
+Multimedia Framework Player Library (DEV).
 
 %prep
 %setup -q
@@ -46,18 +43,11 @@ LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--hash-style=both -Wl,--as-needed"; exp
 
 CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS ./configure --prefix=%{_prefix} --disable-static
 
-# Call make instruction with smp support
 make -j1 
 
 %install
-rm -rf %{buildroot}
 %make_install
 
-%clean
-rm -rf %{buildroot}
-
-
-
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
index cd9197f..d4fc478 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <glib.h>
 #include <mm_types.h>
-#include <mm_error.h>
 
 #include <mm_session.h>
 #include <mm_session_private.h>
@@ -39,14 +38,15 @@ typedef struct {
        int pid;
        int by_asm_cb;
        int event_src;
+       int skip_session;
        ASM_sound_states_t state;
        ASM_sound_events_t event;
 } MMPlayerASM;
 
-/* returns allocated handle */
 gint _mmplayer_asm_register(MMPlayerASM* sm, ASM_sound_cb_t callback, void* param);
-gint _mmplayer_asm_deregister(MMPlayerASM* sm);
+gint _mmplayer_asm_unregister(MMPlayerASM* sm);
 gint _mmplayer_asm_set_state(MMHandleType player, ASM_sound_states_t state);
+gint _mmplayer_asm_ignore_session(MMHandleType player);
 
 #ifdef __cplusplus
 }
index 08f7ba2..1a36081 100644 (file)
@@ -661,6 +661,8 @@ gboolean    _mmplayer_update_content_attrs(mm_player_t* player);
 int _mmplayer_set_volume_tune(MMHandleType hplayer, MMPlayerVolumeType volume);
 int _mmplayer_update_video_param(mm_player_t* player);
 int _mmplayer_set_audiobuffer_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
+int _mmplayer_audio_effect_preset_apply(mm_player_t *player, MMAudioEffectPresetType effect_type);
+int _mmplayer_audio_effect_custom_apply(mm_player_t *player);
 
 #ifdef __cplusplus
        }
index 624df44..480e1b8 100644 (file)
@@ -53,7 +53,7 @@ do \
                g_mutex_lock(cmd_lock); \
        else \
        { \
-               debug_log("don't get command lock"); \
+               debug_log("no command lock"); \
                return MM_ERROR_PLAYER_NOT_INITIALIZED; \
        } \
 } while (0);
@@ -65,7 +65,6 @@ do \
 
 #define MMPLAYER_GET_ATTRS(x_player)           ((mm_player_t*)x_player)->attrs
 
-/* sbs : for bluetooth */
 #define MAX_SOUND_DEVICE_LEN   18      
 
 /* element linking */
index e50fefb..8075283 100644 (file)
@@ -43,7 +43,7 @@ int mm_player_create(MMHandleType *player)
        return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (!g_thread_supported ())
-       g_thread_init (NULL);
+               g_thread_init (NULL);
 
        MMTA_INIT();
 
@@ -148,7 +148,6 @@ int  mm_player_destroy(MMHandleType player)
        return result;
 }
 
-
 int mm_player_realize(MMHandleType player)
 {
        int result = MM_ERROR_NONE;
@@ -168,7 +167,6 @@ int mm_player_realize(MMHandleType player)
        return result;
 }
 
-
 int mm_player_unrealize(MMHandleType player)
 {
        int result = MM_ERROR_NONE;
@@ -188,7 +186,6 @@ int mm_player_unrealize(MMHandleType player)
        return result;
 }
 
-
 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param)
 {
        int result = MM_ERROR_NONE;
@@ -236,7 +233,6 @@ int mm_player_set_audio_stream_callback(MMHandleType player, mm_player_audio_str
        return result;
 }
 
-
 int mm_player_set_audio_buffer_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param)
 {
        int result = MM_ERROR_NONE;
@@ -264,7 +260,7 @@ int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_str
 
        MMPLAYER_CMD_LOCK( player );
 
-    result = _mmplayer_set_videostream_cb(player, callback, user_param);
+       result = _mmplayer_set_videostream_cb(player, callback, user_param);
 
        MMPLAYER_CMD_UNLOCK( player );
 
@@ -315,14 +311,13 @@ int mm_player_set_buffer_need_data_callback(MMHandleType player, mm_player_buffe
 
        MMPLAYER_CMD_LOCK( player );
 
-    result = _mmplayer_set_buffer_need_data_cb(player, callback, user_param);
+       result = _mmplayer_set_buffer_need_data_cb(player, callback, user_param);
 
        MMPLAYER_CMD_UNLOCK( player );
 
        return result;
 }
 
-
 int mm_player_set_buffer_enough_data_callback(MMHandleType player, mm_player_buffer_enough_data_callback callback, void * user_param)
 {
        int result = MM_ERROR_NONE;
@@ -333,7 +328,7 @@ int mm_player_set_buffer_enough_data_callback(MMHandleType player, mm_player_buf
 
        MMPLAYER_CMD_LOCK( player );
 
-    result = _mmplayer_set_buffer_enough_data_cb(player, callback, user_param);
+       result = _mmplayer_set_buffer_enough_data_cb(player, callback, user_param);
 
        MMPLAYER_CMD_UNLOCK( player );
 
@@ -351,14 +346,13 @@ int mm_player_set_buffer_seek_data_callback(MMHandleType player, mm_player_buffe
 
        MMPLAYER_CMD_LOCK( player );
 
-    result = _mmplayer_set_buffer_seek_data_cb(player, callback, user_param);
+       result = _mmplayer_set_buffer_seek_data_cb(player, callback, user_param);
 
        MMPLAYER_CMD_UNLOCK( player );
 
        return result;
 }
 
-
 int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume)
 {
        int result = MM_ERROR_NONE;
@@ -377,7 +371,6 @@ int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume)
        return result;
 }
 
-
 int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume)
 {
        int result = MM_ERROR_NONE;
@@ -396,7 +389,6 @@ int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume)
        return result;
 }
 
-
 int mm_player_set_mute(MMHandleType player, int mute)
 {
        int result = MM_ERROR_NONE;
@@ -414,7 +406,6 @@ int mm_player_set_mute(MMHandleType player, int mute)
        return result;
 }
 
-
 int mm_player_get_mute(MMHandleType player, int *mute)
 {
        int result = MM_ERROR_NONE;
@@ -433,7 +424,6 @@ int mm_player_get_mute(MMHandleType player, int *mute)
        return result;
 }
 
-
 int mm_player_get_state(MMHandleType player, MMPlayerStateType *state)
 {
        int result = MM_ERROR_NONE;
@@ -480,7 +470,6 @@ int mm_player_push_buffer(MMHandleType player, unsigned char *buf, int size)
        return result;
 }
 
-
 int mm_player_start(MMHandleType player)
 {
        int result = MM_ERROR_NONE;
@@ -499,7 +488,6 @@ int mm_player_start(MMHandleType player)
        return result;
 }
 
-
 int  mm_player_stop(MMHandleType player)
 {
        int result = MM_ERROR_NONE;
@@ -519,7 +507,6 @@ int  mm_player_stop(MMHandleType player)
        return result;
 }
 
-
 int mm_player_pause(MMHandleType player)
 {
        int result = MM_ERROR_NONE;
@@ -539,7 +526,6 @@ int mm_player_pause(MMHandleType player)
        return result;
 }
 
-
 int mm_player_resume(MMHandleType player)
 {
        int result = MM_ERROR_NONE;
@@ -559,7 +545,6 @@ int mm_player_resume(MMHandleType player)
        return result;
 }
 
-
 int mm_player_activate_section_repeat(MMHandleType player, int start_pos, int end_pos)
 {
        int result = MM_ERROR_NONE;
@@ -575,7 +560,6 @@ int mm_player_activate_section_repeat(MMHandleType player, int start_pos, int en
        return result;
 }
 
-
 int mm_player_deactivate_section_repeat(MMHandleType player)
 {
        int result = MM_ERROR_NONE;
@@ -591,7 +575,6 @@ int mm_player_deactivate_section_repeat(MMHandleType player)
        return result;
 }
 
-
 int mm_player_set_play_speed(MMHandleType player, float rate)
 {
        int result = MM_ERROR_NONE;
@@ -607,7 +590,6 @@ int mm_player_set_play_speed(MMHandleType player, float rate)
        return result;
 }
 
-
 int mm_player_set_position(MMHandleType player, MMPlayerPosFormatType format, int pos)
 {
        int result = MM_ERROR_NONE;
@@ -631,7 +613,6 @@ int mm_player_set_position(MMHandleType player, MMPlayerPosFormatType format, in
        return result;
 }
 
-
 int mm_player_get_position(MMHandleType player, MMPlayerPosFormatType format, int *pos)
 {
        int result = MM_ERROR_NONE;
@@ -697,7 +678,6 @@ int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatTyp
        return result;
 }
 
-
 int mm_player_set_subtitle_silent(MMHandleType player, int silent)
 {
        int result = MM_ERROR_NONE;
@@ -715,7 +695,6 @@ int mm_player_set_subtitle_silent(MMHandleType player, int silent)
        return result;
 }
 
-
 int mm_player_get_subtitle_silent(MMHandleType player, int* silent)
 {
        int result = MM_ERROR_NONE;
@@ -733,7 +712,6 @@ int mm_player_get_subtitle_silent(MMHandleType player, int* silent)
        return result;
 }
 
-
 int mm_player_set_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)
 {
        int result = MM_ERROR_NONE;
@@ -751,7 +729,6 @@ int mm_player_set_attribute(MMHandleType player,  char **err_attr_name, const ch
        return result;
 }
 
-
 int mm_player_get_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)
 {
        int result = MM_ERROR_NONE;
@@ -769,7 +746,6 @@ int mm_player_get_attribute(MMHandleType player,  char **err_attr_name, const ch
        return result;
 }
 
-
 int mm_player_get_attribute_info(MMHandleType player,  const char *attribute_name, MMPlayerAttrsInfo *info)
 {
        int result = MM_ERROR_NONE;
@@ -799,7 +775,7 @@ int mm_player_get_pd_status(MMHandleType player, guint64 *current_pos, guint64 *
        return result;
 }
 
-int mm_player_get_track_count(MMHandleType player,  MMPlayerTrackType track_type, int *count)
+int mm_player_get_track_count(MMHandleType player, MMPlayerTrackType track_type, int *count)
 {
        int result = MM_ERROR_NONE;
 
@@ -813,3 +789,16 @@ int mm_player_get_track_count(MMHandleType player,  MMPlayerTrackType track_type
        return result;
 
 }
+
+int mm_player_ignore_session(MMHandleType player)
+{
+       int result = MM_ERROR_NONE;
+
+       debug_log("\n");
+
+       return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+       result = _mmplayer_asm_ignore_session(player);
+
+       return result;
+}
index e607806..daf101f 100644 (file)
  *
  */
 
-#include <glib.h>
 #include <mm_debug.h>
+#include <mm_error.h>
 #include "mm_player_priv.h"
 #include "mm_player_asm.h"
 
+#define MMPLAYER_CHECK_SESSION_SKIP(x_player_asm) \
+do \
+{ \
+       if (x_player_asm->skip_session == TRUE) \
+       { \
+               debug_log("skip session"); \
+               return MM_ERROR_NONE; \
+       } \
+}while(0);
+
+#define MMPLAYER_CHECK_SESSION_INSTANCE(x_player_asm) \
+do \
+{ \
+       if (!x_player_asm) \
+       { \
+               debug_log("no session instance");\
+               return MM_ERROR_SOUND_NOT_INITIALIZED; \
+       } \
+}while(0);
+
 static ASM_sound_events_t __mmplayer_asm_get_event_type(gint type);
 
 gint
@@ -37,12 +57,8 @@ _mmplayer_asm_register(MMPlayerASM* sm, ASM_sound_cb_t callback, void* param)
        gint pid = -1;
 
        debug_log("\n");
-
-       if ( ! sm )
-       {
-               debug_error("invalid session handle\n");
-               return MM_ERROR_PLAYER_NOT_INITIALIZED;
-       }
+       MMPLAYER_CHECK_SESSION_INSTANCE(sm);
+       MMPLAYER_CHECK_SESSION_SKIP(sm);
 
        /* check if it's running on the media_server */
        if ( sm->pid > 0 )
@@ -66,8 +82,8 @@ _mmplayer_asm_register(MMPlayerASM* sm, ASM_sound_cb_t callback, void* param)
                errorcode = mm_session_init(sessionType);
                if ( errorcode )
                {
-                               debug_critical("mm_session_init() failed\n");
-                               return errorcode;
+                       debug_critical("mm_session_init() failed\n");
+                       return errorcode;
                }
        }
 
@@ -88,8 +104,6 @@ _mmplayer_asm_register(MMPlayerASM* sm, ASM_sound_cb_t callback, void* param)
        /* interpret session type */
        event_type = __mmplayer_asm_get_event_type(sessionType);
 
-
-
        /* register audio-session-manager callback */
        if( ! ASM_register_sound(pid, &asm_handle, event_type, ASM_STATE_NONE, callback, (void*)param, ASM_RESOURCE_NONE, &errorcode))
        {
@@ -106,17 +120,14 @@ _mmplayer_asm_register(MMPlayerASM* sm, ASM_sound_cb_t callback, void* param)
 }
 
 gint
-_mmplayer_asm_deregister(MMPlayerASM* sm)
+_mmplayer_asm_unregister(MMPlayerASM* sm)
 {
        gint event_type = ASM_EVENT_NONE;
        gint errorcode = 0;
        gint pid = -1;
 
-       if ( ! sm )
-       {
-               debug_error("invalid session handle\n");
-               return MM_ERROR_PLAYER_NOT_INITIALIZED;
-       }
+       MMPLAYER_CHECK_SESSION_INSTANCE(sm);
+       MMPLAYER_CHECK_SESSION_SKIP(sm);
 
        /* check if it's running on the media_server */
        if ( sm->pid > 0 )
@@ -154,11 +165,8 @@ gint _mmplayer_asm_set_state(MMHandleType hplayer, ASM_sound_states_t state)
        mm_player_t *player = (mm_player_t *)hplayer;
        MMPlayerASM* sm  = &player->sm;
 
-       if ( ! sm )
-       {
-               debug_error("invalid session handle\n");
-               return MM_ERROR_PLAYER_NOT_INITIALIZED;
-       }
+       MMPLAYER_CHECK_SESSION_INSTANCE(sm);
+       MMPLAYER_CHECK_SESSION_SKIP(sm);
 
        /* check if it's running on the media_server */
        if ( sm->pid > 0 )
@@ -215,33 +223,69 @@ __mmplayer_asm_get_event_type(gint type)
        gint event_type = ASM_EVENT_NONE;
 
        /* interpret session type */
-               switch(type)
-               {
-                       case MM_SESSION_TYPE_SHARE:
-                               event_type = ASM_EVENT_SHARE_MMPLAYER;
+       switch(type)
+       {
+               case MM_SESSION_TYPE_SHARE:
+                       event_type = ASM_EVENT_SHARE_MMPLAYER;
                        break;
 
-                       case MM_SESSION_TYPE_EXCLUSIVE:
-                               event_type = ASM_EVENT_EXCLUSIVE_MMPLAYER;
+               case MM_SESSION_TYPE_EXCLUSIVE:
+                       event_type = ASM_EVENT_EXCLUSIVE_MMPLAYER;
                        break;
 
-                       case MM_SESSION_TYPE_NOTIFY:
-                               event_type = ASM_EVENT_NOTIFY;
+               case MM_SESSION_TYPE_NOTIFY:
+                       event_type = ASM_EVENT_NOTIFY;
                        break;
-                       
-                       case MM_SESSION_TYPE_ALARM:
-                               event_type = ASM_EVENT_ALARM;
+
+               case MM_SESSION_TYPE_ALARM:
+                       event_type = ASM_EVENT_ALARM;
                        break;
 
-                       case MM_SESSION_TYPE_EMERGENCY:
-                               event_type = ASM_EVENT_EMERGENCY;
+               case MM_SESSION_TYPE_EMERGENCY:
+                       event_type = ASM_EVENT_EMERGENCY;
                        break;
 
-                       default:
-                               debug_critical("unexpected case!\n");
-                               event_type = ASM_EVENT_SHARE_MMPLAYER;
+               default:
+                       debug_critical("unexpected case!\n");
+                       event_type = ASM_EVENT_SHARE_MMPLAYER;
                        break;
+       }
+
+       return event_type;
+}
+
+gint
+_mmplayer_asm_ignore_session(MMHandleType hplayer)
+{
+       mm_player_t *player = (mm_player_t *)hplayer;
+
+       debug_fenter();
+
+       return_val_if_fail (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+       /* check state */
+       if (player->state != MM_PLAYER_STATE_NULL)
+       {
+               debug_log("invalid state to make session mix");
+               return MM_ERROR_PLAYER_INVALID_STATE;
+       }
+
+       if (player->sm.skip_session == FALSE && player->sm.handle)
+       {
+               int error_code = 0;
+
+               if (!ASM_unregister_sound(player->sm.handle, player->sm.event, &error_code))
+               {
+                       debug_error("Unregister sound failed 0x%X", error_code);
+                       return MM_ERROR_POLICY_INTERNAL;
                }
+               player->sm.skip_session = TRUE;
+               player->sm.handle = 0;
 
-               return event_type;
+               debug_log("session skip enabled");
+       }
+
+       debug_fleave();
+
+       return MM_ERROR_NONE;
 }
index 1d511d5..8e00ab3 100644 (file)
@@ -203,10 +203,9 @@ __mmplayer_apply_attribute(MMHandleType handle, const char *attribute_name)
        {
                /* check videosink element is created */
                if ( !player->pipeline ||
-                        !player->pipeline->videobin ||
-                        !player->pipeline->videobin[MMPLAYER_V_SINK].gst )
+                       !player->pipeline->videobin ||
+                       !player->pipeline->videobin[MMPLAYER_V_SINK].gst )
                {
-                       debug_warning("videosink element is not yet ready");
                        /*
                         * The attribute should be committed even though videobin is not created yet.
                         * So, true should be returned here.
index b846e78..f1299b3 100755 (executable)
@@ -183,7 +183,7 @@ __mmplayer_capture_thread(gpointer data)
        unsigned char * linear_y_plane = NULL;\r
        unsigned char * linear_uv_plane = NULL;\r
 \r
-       return_if_fail (player);\r
+       return_val_if_fail(player, NULL);\r
 \r
        while (!player->capture_thread_exit)\r
        {\r
index 1961e65..a80644e 100644 (file)
@@ -278,7 +278,7 @@ gboolean _mmplayer_destroy_pd_downloader (MMHandleType handle)
 
        pd = MM_PLAYER_GET_PD(handle);
 
-       if ( pd && pd->downloader_pipeline)
+       if (pd && pd->downloader_pipeline)
                _mmplayer_unrealize_pd_downloader (handle);
 
        /* release PD handle */
index d918e87..717c4f6 100644 (file)
@@ -455,6 +455,10 @@ __mmplayer_gst_set_state (mm_player_t* player, GstElement * element,  GstState s
        if ( ret == GST_STATE_CHANGE_FAILURE )
        {
                debug_error("failed to set  [%s] state to [%d]\n", GST_ELEMENT_NAME(element), state);
+
+               /* dump state of all element */
+               __mmplayer_dump_pipeline_state( player );
+
                return MM_ERROR_PLAYER_INTERNAL;
        }
        
@@ -475,10 +479,13 @@ __mmplayer_gst_set_state (mm_player_t* player, GstElement * element,  GstState s
                        gst_element_state_get_name(state), timeout );
                
                debug_error(" [%s] state : %s   pending : %s \n", 
-                       GST_ELEMENT_NAME(element), 
-                       gst_element_state_get_name(element_state), 
+                       GST_ELEMENT_NAME(element),
+                       gst_element_state_get_name(element_state),
                        gst_element_state_get_name(element_pending_state) );
 
+               /* dump state of all element */
+               __mmplayer_dump_pipeline_state( player );
+
                return MM_ERROR_PLAYER_INTERNAL;
        }
 
@@ -717,14 +724,14 @@ _mmplayer_update_content_attrs(mm_player_t* player) // @
                        }
                        else
                        {
-                               debug_warning("failed to get negitiated caps from videosink");
+                               debug_log("no negitiated caps from videosink");
                        }
                        gst_object_unref( pad );
                        pad = NULL;
                }
                else
                {
-                       debug_warning("failed to get pad from videosink");
+                       debug_log("no videosink sink pad");
                }
        }
 
@@ -779,10 +786,10 @@ gboolean __mmplayer_update_stream_service_type( mm_player_t* player )
        debug_fenter();
 
        return_val_if_fail ( player &&
-                                       player->pipeline &&
-                                       player->pipeline->mainbin &&
-                                       player->pipeline->mainbin[MMPLAYER_M_SRC].gst,
-                                       FALSE );
+                       player->pipeline &&
+                       player->pipeline->mainbin &&
+                       player->pipeline->mainbin[MMPLAYER_M_SRC].gst,
+                       FALSE );
 
        /* streaming service type if streaming */
        if ( ! MMPLAYER_IS_STREAMING(player) );
@@ -825,12 +832,6 @@ gboolean __mmplayer_update_stream_service_type( mm_player_t* player )
        }
 
        mm_attrs_set_int_by_name ( attrs, "streaming_type", streaming_type );
-       /* validate all */
-       if (  mmf_attrs_commit ( attrs ) )
-       {
-               debug_warning("updating streaming service type failed. pause/resume/seek may not working properly if stream is live stream\n");
-               return FALSE;
-       }
 
        debug_fleave();
 
@@ -945,7 +946,7 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
                case MM_PLAYER_STATE_PLAYING:
                {
                        /* non-managed prepare case, should be updated */
-                       if ( ! player->need_update_content_dur)
+                       if ( ! player->need_update_content_dur )
                        {
                                player->need_update_content_dur = TRUE;
                                _mmplayer_update_content_attrs ( player );
@@ -1057,7 +1058,7 @@ __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessa
 
        if ( !player->msg_cb )
        {
-               debug_warning("no msg callback. can't post\n");
+               debug_warning("no msg callback. can't post msg now\n");
                return FALSE;
        }
 
@@ -1175,7 +1176,7 @@ static gpointer __mmplayer_repeat_thread(gpointer data)
                                MMPLAYER_POST_MSG( player, MM_MESSAGE_RESUMED_BY_REW, NULL );
                        }
 
-                       ret_value = __gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, 1.0,
+                       ret_value = __gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
                                GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
                                0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
 
@@ -2287,9 +2288,7 @@ __mmplayer_gst_decode_callback(GstElement *decodebin, GstPad *pad, gboolean last
 
                /* FIXIT : track number shouldn't be hardcoded */
                mm_attrs_set_int_by_name(attrs, "content_audio_track_num", 1);
-
                player->audiosink_linked  = 1;
-               debug_msg("player->audsink_linked set to 1\n");
 
                sinkpad = gst_element_get_static_pad( GST_ELEMENT(sinkbin), "sink" );
                if ( !sinkpad )
@@ -2302,9 +2301,7 @@ __mmplayer_gst_decode_callback(GstElement *decodebin, GstPad *pad, gboolean last
        {
                if (player->pipeline->videobin == NULL)
                {
-                       /*      NOTE : not make videobin because application dose not want to play it even though file has video stream.
-                       */
-
+                       /* NOTE : not make videobin because application dose not want to play it even though file has video stream. */
                        /* get video surface type */
                        int surface_type = 0;
                        mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &surface_type);
@@ -2334,9 +2331,7 @@ __mmplayer_gst_decode_callback(GstElement *decodebin, GstPad *pad, gboolean last
 
                /* FIXIT : track number shouldn't be hardcoded */
                mm_attrs_set_int_by_name(attrs, "content_video_track_num", 1);
-
                player->videosink_linked  = 1;
-               debug_msg("player->videosink_linked set to 1\n");
 
                sinkpad = gst_element_get_static_pad( GST_ELEMENT(sinkbin), "sink" );
                if ( !sinkpad )
@@ -2419,10 +2414,6 @@ __mmplayer_gst_decode_callback(GstElement *decodebin, GstPad *pad, gboolean last
                sinkpad = NULL;
        }
 
-       /* update track number attributes */
-       if ( mmf_attrs_commit ( attrs ) )
-               debug_error("failed to commit attrs\n");
-
        debug_log("linking sink bin success\n");
 
        /* FIXIT : we cannot hold callback for 'no-more-pad' signal because signal was emitted in
@@ -2454,10 +2445,10 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
 {
        int pro_value = 0; // in the case of expection, default will be returned.
        int dest_angle = rotation_angle;
-       char *element_name = NULL;
        int rotation_using_type = -1;
        #define ROTATION_USING_X        0
-       #define ROTATION_USING_FLIP     1
+       #define ROTATION_USING_FIMC     1
+       #define ROTATION_USING_FLIP     2
 
        return_val_if_fail(player, FALSE);
        return_val_if_fail(value, FALSE);
@@ -2477,7 +2468,14 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
 
        if (player->use_video_stream)
        {
-               rotation_using_type = ROTATION_USING_FLIP;
+               if (player->is_nv12_tiled)
+               {
+                       rotation_using_type = ROTATION_USING_FIMC;
+               }
+               else
+               {
+                       rotation_using_type = ROTATION_USING_FLIP;
+               }
        }
        else
        {
@@ -2491,6 +2489,20 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
                                rotation_using_type = ROTATION_USING_X;
                                break;
                        case MM_DISPLAY_SURFACE_EVAS:
+                               if (player->is_nv12_tiled && !strcmp(PLAYER_INI()->videosink_element_evas,"evasimagesink"))
+                               {
+                                       rotation_using_type = ROTATION_USING_FIMC;
+                               }
+                               else if (!player->is_nv12_tiled)
+                               {
+                                       rotation_using_type = ROTATION_USING_FLIP;
+                               }
+                               else
+                               {
+                                       debug_error("it should not be here..");
+                                       return FALSE;
+                               }
+                               break;
                        default:
                                rotation_using_type = ROTATION_USING_FLIP;
                                break;
@@ -2520,6 +2532,24 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
                                }
                        }
                        break;
+               case ROTATION_USING_FIMC: // fimcconvert
+                       {
+                                       switch (dest_angle)
+                                       {
+                                               case 0:
+                                                       break;
+                                               case 90:
+                                                       pro_value = 90; // clockwise 90
+                                                       break;
+                                               case 180:
+                                                       pro_value = 180;
+                                                       break;
+                                               case 270:
+                                                       pro_value = 270; // counter-clockwise 90
+                                                       break;
+                                       }
+                       }
+                       break;
                case ROTATION_USING_FLIP: // videoflip
                        {
                                        switch (dest_angle)
@@ -2619,11 +2649,42 @@ _mmplayer_update_video_param(mm_player_t* player) // @
        /* check video stream callback is used */
        if( player->use_video_stream )
        {
-               debug_log("using video stream callback with memsink. player handle : [%p]", player);
+               if (player->is_nv12_tiled)
+               {
+                       gchar *ename = NULL;
+                       int width = 0;
+                       int height = 0;
+
+                       mm_attrs_get_int_by_name(attrs, "display_width", &width);
+                       mm_attrs_get_int_by_name(attrs, "display_height", &height);
+
+                       /* resize video frame with requested values for fimcconvert */
+                       ename = GST_PLUGIN_FEATURE_NAME(gst_element_get_factory(player->pipeline->videobin[MMPLAYER_V_CONV].gst));
 
-               /* apply roate */
-               g_object_set(player->pipeline->videobin[MMPLAYER_V_FLIP].gst, "method", rotation_value, NULL);
+                       if (g_strrstr(ename, "fimcconvert"))
+                       {
+                               if (width)
+                                       g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "dst-width", width, NULL);
+
+                               if (height)
+                                       g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "dst-height", height, NULL);
+
+                               g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "rotate", rotation_value, NULL);
+                               debug_log("updating fimcconvert - r[%d], w[%d], h[%d]", rotation_value, width, height);
+                       }
+                       else
+                       {
+                               debug_error("no available video converter");
+                               return MM_ERROR_PLAYER_INTERNAL;
+                       }
+               }
+               else
+               {
+                       debug_log("using video stream callback with memsink. player handle : [%p]", player);
 
+                       g_object_set(player->pipeline->videobin[MMPLAYER_V_FLIP].gst, "method", rotation_value, NULL);
+               }
+               
                return MM_ERROR_NONE;
        }
 
@@ -2651,6 +2712,14 @@ _mmplayer_update_video_param(mm_player_t* player) // @
                        mm_attrs_get_data_by_name(attrs, "display_overlay", &xid);
                        if ( xid )
                        {
+#define GST_VAAPI_DISPLAY_TYPE_X11 1
+                if (!strncmp(PLAYER_INI()->videosink_element_x,"vaapisink", strlen("vaapisink"))){
+                    debug_log("set video param: vaapisink display %d", GST_VAAPI_DISPLAY_TYPE_X11);
+                    g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst,
+                            "display", GST_VAAPI_DISPLAY_TYPE_X11,
+                            NULL);
+                }
+
                                debug_log("set video param : xid %d", *(int*)xid);
                                gst_x_overlay_set_xwindow_id( GST_X_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ), *(int*)xid );
                        }
@@ -2694,6 +2763,15 @@ _mmplayer_update_video_param(mm_player_t* player) // @
                                debug_log("set video param : visible %d", visible);
                                debug_log("set video param : force aspect ratio %d", force_aspect_ratio);
                        }
+
+            /* if vaapisink */
+            if (!strncmp(PLAYER_INI()->videosink_element_x, "vaapisink", strlen("vaapisink")))
+            {
+                g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst,
+                        "rotation", rotation_value,
+                        NULL);
+                debug_log("set video param: vaapisink rotation %d", rotation_value);
+            }
                }
                break;
                case MM_DISPLAY_SURFACE_EVAS:
@@ -2721,6 +2799,43 @@ _mmplayer_update_video_param(mm_player_t* player) // @
                                return MM_ERROR_PLAYER_INTERNAL;
                        }
 
+                       /* if evasimagesink */
+                       if (!strcmp(PLAYER_INI()->videosink_element_evas,"evasimagesink") && player->is_nv12_tiled)
+                       {
+                               int width = 0;
+                               int height = 0;
+                               int no_scaling = !scaling;
+
+                               mm_attrs_get_int_by_name(attrs, "display_width", &width);
+                               mm_attrs_get_int_by_name(attrs, "display_height", &height);
+
+                               /* NOTE: fimcconvert does not manage index of src buffer from upstream src-plugin, decoder gives frame information in output buffer with no ordering */
+                               g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "dst-buffer-num", 5, NULL);
+
+                               if (no_scaling)
+                               {
+                                       /* no-scaling order to fimcconvert, original width, height size of media src will be passed to sink plugin */
+                                       g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst,
+                                                       "dst-width", 0, /* setting 0, output video width will be media src's width */
+                                                       "dst-height", 0, /* setting 0, output video height will be media src's height */
+                                                       NULL);
+                               }
+                               else
+                               {
+                                       /* scaling order to fimcconvert */
+                                       if (width)
+                                       {
+                                               g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "dst-width", width, NULL);
+                                       }
+                                       if (height)
+                                       {
+                                               g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "dst-height", height, NULL);
+                                       }
+                                       debug_log("set video param : video frame scaling down to width(%d) height(%d)", width, height);
+                               }
+                               debug_log("set video param : display_evas_do_scaling %d", scaling);
+                       }
+
                        /* if evaspixmapsink */
                        if (!strcmp(PLAYER_INI()->videosink_element_evas,"evaspixmapsink"))
                        {
@@ -2798,6 +2913,7 @@ _mmplayer_update_video_param(mm_player_t* player) // @
                                "display-geometry-method", display_method,
                                "draw-borders", FALSE,
                                "visible", visible,
+                               "rotate", rotation_value,
                                "pixmap-id-callback", pixmap_id_cb,
                                "pixmap-id-callback-userdata", pixmap_id_cb_user_data,
                                NULL );
@@ -3003,7 +3119,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
        if ( ! player->is_sound_extraction )
        {
                GstCaps* caps = NULL;
-               guint channels = 0;
+               gint channels = 0;
 
                /* for logical volume control */
                MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_VOL, "volume", "volume", TRUE);
@@ -3018,11 +3134,11 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                /*capsfilter */
                MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_CAPS_DEFAULT, "capsfilter", "audiocapsfilter", TRUE);
 
-               caps = gst_caps_from_string(            "audio/x-raw-int, "
-                                                                               "endianness = (int) LITTLE_ENDIAN, "
-                                                                               "signed = (boolean) true, "
-                                                                               "width = (int) 16, "
-                                                                               "depth = (int) 16"      );
+               caps = gst_caps_from_string( "audio/x-raw-int, "
+                                               "endianness = (int) LITTLE_ENDIAN, "
+                                               "signed = (boolean) true, "
+                                               "width = (int) 16, "
+                                               "depth = (int) 16" );
                g_object_set (GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL );
 
                gst_caps_unref( caps );
@@ -3033,9 +3149,9 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                        GstPad *srcpad = NULL;
                        GstCaps *caps = NULL;
 
-                       if (srcpad = gst_element_get_static_pad(player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst, "src"))
+                       if ((srcpad = gst_element_get_static_pad(player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst, "src")))
                        {
-                               if (caps = gst_pad_get_caps(srcpad))
+                               if ((caps = gst_pad_get_caps(srcpad)))
                                {
                                        MMPLAYER_LOG_GST_CAPS_TYPE(caps);
                                        GstStructure *str = gst_caps_get_structure(caps, 0);
@@ -3133,28 +3249,28 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
 
                /* get conf. values */
                mm_attrs_multiple_get(player->attrs, 
-                                               NULL,
-                                               "pcm_extraction_samplerate", &dst_samplerate,
-                                               "pcm_extraction_channels", &dst_channels,
-                                               "pcm_extraction_depth", &dst_depth,
-                                               NULL);
+                                       NULL,
+                                       "pcm_extraction_samplerate", &dst_samplerate,
+                                       "pcm_extraction_channels", &dst_channels,
+                                       "pcm_extraction_depth", &dst_depth,
+                                       NULL);
                /* capsfilter */
                MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_CAPS_DEFAULT, "capsfilter", "audiocapsfilter", TRUE);
 
                caps = gst_caps_new_simple ("audio/x-raw-int",
-                                              "rate", G_TYPE_INT, dst_samplerate,
-                                              "channels", G_TYPE_INT, dst_channels,
-                                              "depth", G_TYPE_INT, dst_depth,
+                                               "rate", G_TYPE_INT, dst_samplerate,
+                                               "channels", G_TYPE_INT, dst_channels,
+                                               "depth", G_TYPE_INT, dst_depth,
                                                NULL);
 
                caps_type = gst_caps_to_string(caps);
                debug_log("resampler new caps : %s\n", caps_type);
 
-                       g_object_set (GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL );
+               g_object_set (GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL );
 
-                       /* clean */
-                       gst_caps_unref( caps );
-                       MMPLAYER_FREEIF( caps_type );
+               /* clean */
+               gst_caps_unref( caps );
+               MMPLAYER_FREEIF( caps_type );
 
                /* fake sink */
                MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_SINK, "fakesink", "fakesink", TRUE);
@@ -3229,8 +3345,6 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
        g_list_free(element_bucket);
 
        mm_attrs_set_int_by_name(attrs, "content_audio_found", TRUE);
-       if ( mmf_attrs_commit ( attrs ) ) /* return -1 if error */
-               debug_error("failed to commit attribute ""content_audio_found"".\n");
 
        debug_fleave();
 
@@ -3314,7 +3428,7 @@ __mmplayer_audio_stream_probe (GstPad *pad, GstBuffer *buffer, gpointer u_data)
 /**
   * VIDEO PIPELINE
   * - x surface (arm/x86) : videoflip ! xvimagesink
-  * - evas surface  (arm) : ffmpegcolorspace ! videoflip ! evasimagesink
+  * - evas surface  (arm) : fimcconvert ! evasimagesink
   * - evas surface  (x86) : videoconvertor ! videoflip ! evasimagesink
   */
 static int
@@ -3360,18 +3474,21 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
        if( player->use_video_stream ) // video stream callback, so send raw video data to application
        {
                GstStructure *str = NULL;
-               guint32 fourcc = 0;
                gint ret = 0;
-               gint width = 0;         //width of video
-               gint height = 0;                //height of video
-               GstCaps* video_caps = NULL;
 
                debug_log("using memsink\n");
 
                /* first, create colorspace convert */
-               if (strlen(PLAYER_INI()->name_of_video_converter) > 0)
+               if (player->is_nv12_tiled)
                {
+                       vconv_factory = "fimcconvert";
+               }
+               else // get video converter from player ini file
+               {
+                       if (strlen(PLAYER_INI()->name_of_video_converter) > 0)
+                       {
                                vconv_factory = PLAYER_INI()->name_of_video_converter;
+                       }
                }
 
                if (vconv_factory)
@@ -3379,47 +3496,55 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                        MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_CONV, vconv_factory, "video converter", TRUE);
                }
 
-               /* rotator, scaler and capsfilter */
-               MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_FLIP, "videoflip", "video rotator", TRUE);
-               MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_SCALE, "videoscale", "video scaler", TRUE);
-               MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_CAPS, "capsfilter", "videocapsfilter", TRUE);
-
-               /* get video stream caps parsed by demuxer */
-               str = gst_caps_get_structure (player->v_stream_caps, 0);
-               if ( !str )
+               if ( !player->is_nv12_tiled)
                {
-                       debug_error("cannot get structure");
-                       goto ERROR;
-               }
+                       gint width = 0;         //width of video
+                       gint height = 0;                //height of video
+                       GstCaps* video_caps = NULL;
 
-               mm_attrs_get_int_by_name(attrs, "display_width", &width);
-               mm_attrs_get_int_by_name(attrs, "display_height", &height);
-               if (!width || !height)
-               {
-                       /* we set width/height of original media's size  to capsfilter for scaling video */
-                       ret = gst_structure_get_int (str, "width", &width);
-                       if ( !ret )
+                       /* rotator, scaler and capsfilter */
+            if (strncmp(PLAYER_INI()->videosink_element_x, "vaapisink", strlen("vaapisink"))){
+                       MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_FLIP, "videoflip", "video rotator", TRUE);
+                       MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_SCALE, "videoscale", "video scaler", TRUE);
+                       MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_CAPS, "capsfilter", "videocapsfilter", TRUE);
+            }
+
+                       /* get video stream caps parsed by demuxer */
+                       str = gst_caps_get_structure (player->v_stream_caps, 0);
+                       if ( !str )
                        {
-                               debug_error("cannot get width");
+                               debug_error("cannot get structure");
                                goto ERROR;
                        }
 
-                       ret = gst_structure_get_int(str, "height", &height);
-                       if ( !ret )
-                       {
-                               debug_error("cannot get height");
-                               goto ERROR;
+                       mm_attrs_get_int_by_name(attrs, "display_width", &width);
+                       mm_attrs_get_int_by_name(attrs, "display_height", &height);
+                       if (!width || !height) {
+                               /* we set width/height of original media's size  to capsfilter for scaling video */
+                               ret = gst_structure_get_int (str, "width", &width);
+                               if ( !ret )
+                               {
+                                       debug_error("cannot get width");
+                                       goto ERROR;
+                               }
+
+                               ret = gst_structure_get_int(str, "height", &height);
+                               if ( !ret )
+                               {
+                                       debug_error("cannot get height");
+                                       goto ERROR;
+                               }
                        }
-               }
 
-               video_caps = gst_caps_new_simple( "video/x-raw-rgb",
-                                                                               "width", G_TYPE_INT, width,
-                                                                               "height", G_TYPE_INT, height,
-                                                                               NULL);
+                       video_caps = gst_caps_new_simple( "video/x-raw-rgb",
+                                                                                       "width", G_TYPE_INT, width,
+                                                                                       "height", G_TYPE_INT, height,
+                                                                                       NULL);
 
-               g_object_set (GST_ELEMENT(videobin[MMPLAYER_V_CAPS].gst), "caps", video_caps, NULL );
+                       g_object_set (GST_ELEMENT(videobin[MMPLAYER_V_CAPS].gst), "caps", video_caps, NULL );
 
-               gst_caps_unref( video_caps );
+                       gst_caps_unref( video_caps );
+               }
 
                /* finally, create video sink. output will be BGRA8888. */
                MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_SINK, "avsysmemsink", "videosink", TRUE);
@@ -3438,6 +3563,17 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                if (strlen(PLAYER_INI()->name_of_video_converter) > 0)
                {
                        vconv_factory = PLAYER_INI()->name_of_video_converter;
+               
+                       if ( (player->is_nv12_tiled && (surface_type == MM_DISPLAY_SURFACE_EVAS) && 
+                               !strcmp(PLAYER_INI()->videosink_element_evas, "evasimagesink") ) )
+                       {
+                               vconv_factory = "fimcconvert";
+                       }
+                       else if (player->is_nv12_tiled)
+                       {
+                               vconv_factory = NULL;
+                       }
+
                        if (vconv_factory)
                        {
                                MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_CONV, vconv_factory, "video converter", TRUE);
@@ -3445,13 +3581,16 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                        }
                }
 
+        if (strncmp(PLAYER_INI()->videosink_element_x,"vaapisink", strlen("vaapisink"))){
                /* set video rotator */
-               MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_FLIP, "videoflip", "video rotator", TRUE);
+               if ( !player->is_nv12_tiled )
+                       MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_FLIP, "videoflip", "video rotator", TRUE);
 
                /* videoscaler */
                #if !defined(__arm__)
                MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_SCALE, "videoscale", "videoscaler", TRUE);
                #endif
+        }
 
                /* set video sink */
                switch (surface_type)
@@ -3475,7 +3614,6 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                        if (pixmap_id_cb) /* this is used for the videoTextue(canvasTexture) overlay */
                        {
                                videosink_element = PLAYER_INI()->videosink_element_x;
-                               debug_warning("video texture usage");
                        }
                        else
                        {
@@ -3563,8 +3701,6 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
        g_list_free(element_bucket);
 
        mm_attrs_set_int_by_name(attrs, "content_video_found", TRUE);
-       if ( mmf_attrs_commit ( attrs ) ) /* return -1 if error */
-               debug_error("failed to commit attribute ""content_video_found"".\n");
 
        debug_fleave();
 
@@ -3592,7 +3728,7 @@ ERROR:
        return MM_ERROR_PLAYER_INTERNAL;
 }
 
-static int             __mmplayer_gst_create_text_pipeline(mm_player_t* player)
+static int __mmplayer_gst_create_text_pipeline(mm_player_t* player)
 {
        MMPlayerGstElement* first_element = NULL;
        MMPlayerGstElement* textbin = NULL;
@@ -4842,11 +4978,7 @@ static int __gst_realize(mm_player_t* player) // @
        if ( ret != MM_ERROR_NONE )
        {
                /* return error if failed to set state */
-               debug_error("failed to set state PAUSED (live : READY).\n");
-
-               /* dump state of all element */
-               __mmplayer_dump_pipeline_state( player );
-
+               debug_error("failed to set READY state");
                return ret;
        }
        else 
@@ -4981,7 +5113,7 @@ static int __gst_start(mm_player_t* player) // @
 
        debug_log("current state before doing transition");
        MMPLAYER_PENDING_STATE(player) = MM_PLAYER_STATE_PLAYING;
-       MMPLAYER_PRINT_STATE(player);
+       MMPLAYER_PRINT_STATE(player);   
 
        /* set pipeline state to PLAYING  */
        ret = __mmplayer_gst_set_state(player,
@@ -4993,17 +5125,9 @@ static int __gst_start(mm_player_t* player) // @
        else
        {
                debug_error("failed to set state to PLAYING");
-
-               /* dump state of all element */
-               __mmplayer_dump_pipeline_state( player );
-
                return ret;
        }
 
-       /* FIXIT : analyze so called "async problem" */
-       /* set async off */
-       __gst_set_async_state_change( player, FALSE );
-
        /* generating debug info before returning error */
        MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-start" );
 
@@ -5097,17 +5221,13 @@ static int __gst_stop(mm_player_t* player) // @
        if ( ret != MM_ERROR_NONE )
        {
                debug_error("failed to set state.\n");
-
-               /* dump state of all element. don't care it success or not */
-               __mmplayer_dump_pipeline_state( player );
-
                return ret;
        }
 
        /* rewind */
        if ( rewind )
        {
-               if ( ! __gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, 1.0,
+               if ( ! __gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
                                GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, 0,
                                GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE) )
                {
@@ -5129,6 +5249,7 @@ static int __gst_stop(mm_player_t* player) // @
        {
                debug_error("fail to stop player.\n");
                ret = MM_ERROR_PLAYER_INTERNAL;
+               __mmplayer_dump_pipeline_state(player);
        }
 
        /* generate dot file if enabled */
@@ -5155,12 +5276,50 @@ int __gst_pause(mm_player_t* player, gboolean async) // @
        ret = __mmplayer_gst_set_state(player,
                player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PAUSED, async, MMPLAYER_STATE_CHANGE_TIMEOUT(player));
 
-       if ( ret != MM_ERROR_NONE )
+       if ( FALSE == async && ret != MM_ERROR_NONE )
        {
-               debug_error("failed to set state to PAUSED\n");
+               GstMessage *msg = NULL;
+               GTimer *timer = NULL;
+               gdouble MAX_TIMEOUT_SEC = 3;
 
-               /* dump state of all element */
-               __mmplayer_dump_pipeline_state( player );
+               debug_error("failed to set state to PAUSED");
+
+               timer = g_timer_new();
+               g_timer_start(timer);
+
+               GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
+               /* check if gst error posted or not */
+               do
+               {
+                       if (msg = gst_bus_timed_pop(bus, GST_SECOND /2))
+                       {
+                               if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ERROR)
+                               {
+                                       GError *error = NULL;
+                                       /* parse error code */
+                                       gst_message_parse_error(msg, &error, NULL);
+
+                                       if ( error->domain == GST_STREAM_ERROR )
+                                       {
+                                               ret = __gst_handle_stream_error( player, error, msg );
+                                               player->posted_msg = TRUE;
+                                               break;
+                                       }
+                                       else if ( error->domain == GST_RESOURCE_ERROR )
+                                       {
+                                               ret = __gst_handle_resource_error( player, error->code );
+                                               player->posted_msg = TRUE;
+                                               break;
+                                       }
+                               }
+                               gst_message_unref(msg);
+                       }
+               } while (g_timer_elapsed(timer, NULL) < MAX_TIMEOUT_SEC);
+
+               /* clean */
+               gst_object_unref(bus);
+               g_timer_stop (timer);
+               g_timer_destroy (timer);
 
                return ret;
        }
@@ -5188,6 +5347,7 @@ int __gst_resume(mm_player_t* player, gboolean async) // @
 {
        int ret = MM_ERROR_NONE;
        gint timeout = 0;
+       GstBus *bus = NULL;
 
        debug_fenter();
 
@@ -5206,23 +5366,26 @@ int __gst_resume(mm_player_t* player, gboolean async) // @
        if ( async )
                debug_log("do async state transition to PLAYING.\n");
 
+       /* clean bus sync handler because it's not needed any more */
+       bus = gst_pipeline_get_bus (GST_PIPELINE(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
+       gst_bus_set_sync_handler (bus, NULL, NULL);
+       gst_object_unref(bus);
+
        /* set pipeline state to PLAYING */
        timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player);
+
        ret = __mmplayer_gst_set_state(player,
                player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PLAYING, async, timeout );
        if (ret != MM_ERROR_NONE)
        {
                debug_error("failed to set state to PLAYING\n");
 
-               /* dump state of all element */
-               __mmplayer_dump_pipeline_state( player );
-
                return ret;
        }
        else
        {
                if (async == FALSE)
-               {
+               {       
                        MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_PLAYING );
                }
        }
@@ -5302,7 +5465,7 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
                                player->doing_seek = TRUE;
 
                        pos_nsec = position * G_GINT64_CONSTANT(1000000);
-                       ret = __gst_seek ( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, 1.0,
+                       ret = __gst_seek ( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
                                                        GST_FORMAT_TIME, ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE ),
                                                        GST_SEEK_TYPE_SET, pos_nsec, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE );
                        if ( !ret  )
@@ -5328,7 +5491,7 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
 
                        /* FIXIT : why don't we use 'GST_FORMAT_PERCENT' */
                        pos_nsec = (gint64) ( ( position * player->duration ) / 100 );
-                       ret = __gst_seek ( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, 1.0,
+                       ret = __gst_seek ( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
                                                        GST_FORMAT_TIME, ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE ),
                                                        GST_SEEK_TYPE_SET, pos_nsec, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE );
                        if ( !ret  )
@@ -5581,7 +5744,7 @@ static gboolean __mmfplayer_parse_profile(const char *uri, void *param, MMPlayer
                        }
                        else
                        {
-                       data->uri_type = MM_PLAYER_URI_TYPE_FILE;
+                               data->uri_type = MM_PLAYER_URI_TYPE_FILE;
                        }
                        ret = TRUE;
                }
@@ -5765,6 +5928,7 @@ gboolean _asm_postmsg(gpointer *data)
        
        return FALSE;
 }
+
 gboolean _asm_lazy_pause(gpointer *data)
 {
        mm_player_t* player = (mm_player_t*)data;
@@ -5798,6 +5962,7 @@ gboolean _asm_lazy_pause(gpointer *data)
 
        return FALSE;
 }
+
 ASM_cb_result_t
 __mmplayer_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_commands_t command, unsigned int sound_status, void* cb_data)
 {
@@ -5816,7 +5981,7 @@ __mmplayer_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_com
                debug_log("sound extraction is working...so, asm command is ignored.\n");
                return result;
        }
-       
+
        player->sm.by_asm_cb = 1; // it should be enabled for player state transition with called application command
        player->sm.event_src = event_src;
 
@@ -5832,7 +5997,7 @@ __mmplayer_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_com
        {
                /* can use video overlay simultaneously */
                /* video resource conflict */
-               if(player->pipeline->videobin) 
+               if(player->pipeline->videobin)
                {
                        if (PLAYER_INI()->multiple_codec_supported)
                        {
@@ -5858,7 +6023,7 @@ __mmplayer_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_com
 
                case ASM_COMMAND_STOP: // notification case
                {
-                       debug_log("Got msg from asm to stop");
+                       debug_warning("Got msg from asm to stop");
 
                        result = _mmplayer_stop((MMHandleType)player);
                        if (result != MM_ERROR_NONE)
@@ -5873,20 +6038,20 @@ __mmplayer_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_com
                        player->sm.by_asm_cb = 0; // reset because no message any more from asm
                }
                break;
-                       
+
                case ASM_COMMAND_PAUSE:
                {
-                       debug_log("Got msg from asm to Pause");
-                       
+                       debug_warning("Got msg from asm to Pause");
+
                        if(event_src == ASM_EVENT_SOURCE_CALL_START
                                || event_src == ASM_EVENT_SOURCE_ALARM_START
                                || event_src == ASM_EVENT_SOURCE_MEDIA)
                        {
                                //hold 0.7 second to excute "fadedown mute" effect
-                               debug_log ("do fade down->pause->undo fade down");
-                                       
+                               debug_warning ("do fade down->pause->undo fade down");
+
                                __mmplayer_do_sound_fadedown(player, MM_PLAYER_FADEOUT_TIME_DEFAULT);
-                                       
+
                                result = _mmplayer_pause((MMHandleType)player);
                                if (result != MM_ERROR_NONE)
                                {
@@ -5904,7 +6069,7 @@ __mmplayer_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_com
                                        g_object_set( player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "mute", 2, NULL);
 
                                player->lazy_pause_event_id = g_timeout_add(LAZY_PAUSE_TIMEOUT_MSEC, (GSourceFunc)_asm_lazy_pause, (gpointer)player);
-                               debug_log ("set lazy pause timer (id=[%d], timeout=[%d ms])", player->lazy_pause_event_id, LAZY_PAUSE_TIMEOUT_MSEC);
+                               debug_warning ("set lazy pause timer (id=[%d], timeout=[%d ms])", player->lazy_pause_event_id, LAZY_PAUSE_TIMEOUT_MSEC);
                        }
                        else
                        {
@@ -5915,10 +6080,10 @@ __mmplayer_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_com
                        cb_res = ASM_CB_RES_PAUSE;
                }
                break;
-                       
+
                case ASM_COMMAND_RESUME:
                {
-                       debug_log("Got msg from asm to Resume. So, application can resume. code (%d) \n", event_src);
+                       debug_warning("Got msg from asm to Resume. So, application can resume. code (%d) \n", event_src);
                        player->sm.by_asm_cb = 0;
                        //ASM server is single thread daemon. So use g_idle_add() to post resume msg
                        g_idle_add((GSourceFunc)_asm_postmsg, (gpointer)player);
@@ -5942,7 +6107,6 @@ int
 _mmplayer_create_player(MMHandleType handle) // @
 {
        mm_player_t* player = MM_PLAYER_CAST(handle);
-       gint i;
 
        debug_fenter();
 
@@ -6256,7 +6420,7 @@ _mmplayer_destroy(MMHandleType handle) // @
        }
 
        /* withdraw asm */
-       if ( MM_ERROR_NONE != _mmplayer_asm_deregister(&player->sm) )
+       if ( MM_ERROR_NONE != _mmplayer_asm_unregister(&player->sm) )
        {
                debug_error("failed to deregister asm server\n");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -6416,7 +6580,7 @@ _mmplayer_realize(MMHandleType hplayer) // @
        }
        else
        {
-               __mmplayer_realize_streaming_ext(player);
+               ret = __mmplayer_realize_streaming_ext(player);
        }
 
        debug_fleave();
@@ -6462,11 +6626,13 @@ _mmplayer_unrealize(MMHandleType hplayer) // @
        /* set player state if success */
        if ( MM_ERROR_NONE == ret )
        {
-               ret = _mmplayer_asm_set_state(hplayer, ASM_STATE_STOP);
-               if ( ret )
-               {
-                       debug_error("failed to set asm state to STOP\n");
-                       return ret;
+               if (player->sm.state != ASM_STATE_STOP) {
+                       ret = _mmplayer_asm_set_state(hplayer, ASM_STATE_STOP);
+                       if ( ret )
+                       {
+                               debug_error("failed to set asm state to STOP\n");
+                               return ret;
+                       }
                }
        }
 
@@ -7048,9 +7214,8 @@ _mmplayer_pause(MMHandleType hplayer) // @
                        * ( returning zero when getting current position in paused state) of some
                        * elements
                        */
-                       ret = gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,        &fmt, &pos_msec);
-                       if ( ! ret )
-                       debug_warning("getting current position failed in paused\n");
+                       if ( !gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, &fmt, &pos_msec))
+                               debug_warning("getting current position failed in paused\n");
 
                        player->last_position = pos_msec;
                }
@@ -7075,6 +7240,7 @@ _mmplayer_resume(MMHandleType hplayer)
 {
        mm_player_t* player = (mm_player_t*)hplayer;
        int ret = MM_ERROR_NONE;
+       gboolean async = FALSE;
 
        debug_fenter();
 
@@ -7152,7 +7318,7 @@ _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, uns
        __mmplayer_set_play_count( player, infinity );
 
        if ( (!__gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
-                                       1.0,
+                                       player->playback_rate,
                                        GST_FORMAT_TIME,
                                        ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE ),
                                        GST_SEEK_TYPE_SET, start_pos,
@@ -7174,10 +7340,10 @@ _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, uns
 static int 
 __mmplayer_set_pcm_extraction(mm_player_t* player)
 {
-       guint64 start_nsec = 0;
-       guint64 end_nsec = 0;
-       guint64 dur_nsec = 0;
-       guint64 dur_msec = 0;
+       gint64 start_nsec = 0;
+       gint64 end_nsec = 0;
+       gint64 dur_nsec = 0;
+       gint64 dur_msec = 0;
        GstFormat fmt = GST_FORMAT_TIME;
        int required_start = 0;
        int required_end = 0;
@@ -7419,8 +7585,6 @@ __mmplayer_is_midi_type( gchar* str_caps)
                return TRUE;
        }
 
-       debug_log("not midi.\n");
-
        return FALSE;
 }
 
@@ -7508,10 +7672,12 @@ GstCaps *caps, gpointer data)
        /* try to plug */
        if ( ! __mmplayer_try_to_plug( player, pad, caps ) )
        {
+               gboolean async = FALSE;
+
                debug_error("failed to autoplug for type : %s\n", player->type);
+               mm_attrs_get_int_by_name(player->attrs, "profile_prepare_async", &async);
 
-               if ( ( PLAYER_INI()->async_start ) &&
-               ( player->posted_msg == FALSE ) )
+               if (async && player->posted_msg == FALSE)
                {
                        __mmplayer_post_missed_plugin( player );
                }
@@ -7578,23 +7744,19 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
 
        debug_fenter();
 
-       return_val_if_fail( player &&
-                                               player->pipeline &&
-                                               player->pipeline->mainbin,
-                                               FALSE );
-
+       return_val_if_fail( player && player->pipeline && player->pipeline->mainbin, FALSE );
 
        mainbin = player->pipeline->mainbin;
 
        mime = gst_structure_get_name(gst_caps_get_structure(caps, 0));
 
        /* return if we got raw output */
-       if(g_str_has_prefix(mime, "video/x-raw") || g_str_has_prefix(mime, "audio/x-raw") || g_str_has_prefix(mime, "text/plain") ||g_str_has_prefix(mime, "text/x-pango-markup"))
+       if(g_str_has_prefix(mime, "video/x-raw") || g_str_has_prefix(mime, "audio/x-raw")
+               || g_str_has_prefix(mime, "video/x-surface")
+               || g_str_has_prefix(mime, "text/plain") ||g_str_has_prefix(mime, "text/x-pango-markup"))
        {
 
                element = (GstElement*)gst_pad_get_parent(pad);
-
-
 /* NOTE : When no decoder has added during autoplugging. like a simple wave playback.
  * No queue will be added. I think it can caused breaking sound when playing raw audio
  * frames but there's no different. Decodebin also doesn't add with those wav fils.
@@ -7605,13 +7767,11 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                 * has linked. if so, we need to add queue for quality of output. note that
                 * decodebin also has same problem.
                 */
-
                klass = gst_element_factory_get_klass( gst_element_get_factory(element) );
 
                /* add queue if needed */
-               if( (g_strrstr(klass, "Demux") ||
-               g_strrstr(klass, "Depayloader") ||
-                       g_strrstr(klass, "Parse")) &&  !g_str_has_prefix(mime, "text"))
+               if( (g_strrstr(klass, "Demux") || g_strrstr(klass, "Depayloader")
+                       || g_strrstr(klass, "Parse")) &&  !g_str_has_prefix(mime, "text"))
                {
                        debug_log("adding raw queue\n");
 
@@ -7678,7 +7838,6 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
        item = player->factories;
        for(; item != NULL ; item = item->next)
        {
-
                GstElementFactory *factory = GST_ELEMENT_FACTORY(item->data);
                const GList *pads;
                gint idx = 0;
@@ -7702,7 +7861,6 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
 
                if ( skip ) continue;
 
-
                /* check factory class for filtering */
                klass = gst_element_factory_get_klass(GST_ELEMENT_FACTORY(factory));
 
@@ -7711,17 +7869,14 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                 */
                if ( g_strrstr(klass, "Codec/Decoder/Image") )
                {
-                       debug_log("player doesn't need [%s] so, skipping it\n",
-                               GST_PLUGIN_FEATURE_NAME (factory) );
-
+                       debug_log("player doesn't need [%s] so, skipping it\n", GST_PLUGIN_FEATURE_NAME (factory) );
                        continue;
                }
 
-
                /* check pad compatability */
                for(pads = gst_element_factory_get_static_pad_templates(factory);
                     pads != NULL; pads=pads->next)
-              {
+               {
                       GstStaticPadTemplate *temp1 = pads->data;
                        GstCaps* static_caps = NULL;
 
@@ -7794,8 +7949,8 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                }
 
                                /* store specific handles for futher control */
-                               if(g_strrstr(klass, "Demux") || g_strrstr(klass, "Parse"))
-                       {
+                               if(g_strrstr(klass, "Demux") || g_strrstr(klass, "Parse"))
+                               {
                                        /* FIXIT : first value will be overwritten if there's more
                                         * than 1 demuxer/parser
                                         */
@@ -7805,19 +7960,18 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                }
                                else if(g_strrstr(klass, "Decoder") && __mmplayer_link_decoder(player,pad))
                                {                                                                       
-                                   if(mainbin[MMPLAYER_M_DEC1].gst == NULL)
-                                   {
-                                               debug_log("plugged element is decoder. take it[MMPLAYER_M_DEC1]\n");
-                                               mainbin[MMPLAYER_M_DEC1].id = MMPLAYER_M_DEC1;
-                                               mainbin[MMPLAYER_M_DEC1].gst = new_element;
-                                   }
-                                   else if(mainbin[MMPLAYER_M_DEC2].gst == NULL)
-                                   {
-                                               debug_log("plugged element is decoder. take it[MMPLAYER_M_DEC2]\n");
-                                               mainbin[MMPLAYER_M_DEC2].id = MMPLAYER_M_DEC2;
-                                               mainbin[MMPLAYER_M_DEC2].gst = new_element;
-                                   }
-
+                                       if(mainbin[MMPLAYER_M_DEC1].gst == NULL)
+                                       {
+                                               debug_log("plugged element is decoder. take it[MMPLAYER_M_DEC1]\n");
+                                               mainbin[MMPLAYER_M_DEC1].id = MMPLAYER_M_DEC1;
+                                               mainbin[MMPLAYER_M_DEC1].gst = new_element;
+                                       }
+                                       else if(mainbin[MMPLAYER_M_DEC2].gst == NULL)
+                                       {
+                                               debug_log("plugged element is decoder. take it[MMPLAYER_M_DEC2]\n");
+                                               mainbin[MMPLAYER_M_DEC2].id = MMPLAYER_M_DEC2;
+                                               mainbin[MMPLAYER_M_DEC2].gst = new_element;
+                                       }
                                        /* NOTE : IF one codec is found, add it to supported_codec and remove from
                                         * missing plugin. Both of them are used to check what's supported codec
                                         * before returning result of play start. And, missing plugin should be
@@ -7887,9 +8041,7 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
        
        return FALSE;
 
-
 ERROR:
-
        /* release */
        if ( queue )
                gst_object_unref( queue );
@@ -8861,13 +9013,6 @@ static void __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer da
                mm_attrs_set_int_by_name(player->attrs, "content_audio_channels", channels);
 
                debug_log("audio samplerate : %d        channels : %d", samplerate, channels);
-
-               /* validate all */
-               if (  mmf_attrs_commit ( player->attrs ) )
-               {
-                       debug_error("failed to update attributes");
-                       return;
-               }
        }
        else if (g_strrstr(name, "video"))
        {
@@ -9081,8 +9226,6 @@ __mmplayer_can_extract_pcm( mm_player_t* player )
        gboolean is_drm = FALSE;
        gboolean sound_extraction = FALSE;
 
-       debug_fenter();
-
        return_val_if_fail ( player, FALSE );
 
        attrs = MMPLAYER_GET_ATTRS(player);
@@ -9100,12 +9243,10 @@ __mmplayer_can_extract_pcm( mm_player_t* player )
 
        if ( ! sound_extraction || is_drm )
        {
-               debug_log("pcm extraction param.. is drm = %d, extraction mode = %d", is_drm, sound_extraction);
+               debug_log("checking pcm extraction mode : %d, drm : %d", sound_extraction, is_drm);
                return FALSE;
        }
 
-       debug_fleave();
-
        return TRUE;
 }
 
@@ -9161,15 +9302,7 @@ __mmplayer_handle_gst_error ( mm_player_t* player, GstMessage * message, GError*
        /* post error to application */
        if ( ! player->posted_msg )
        {
-               if (msg_param.code == MM_MESSAGE_DRM_NOT_AUTHORIZED )
-               {
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_DRM_NOT_AUTHORIZED, NULL );
-               }
-               else
-               {
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_ERROR, &msg_param );
-               }
-
+               MMPLAYER_POST_MSG( player, MM_MESSAGE_ERROR, &msg_param );
                /* don't post more if one was sent already */
                player->posted_msg = TRUE;
        }
@@ -9455,25 +9588,30 @@ __gst_handle_resource_error( mm_player_t* player, int code )
                        break;
                case GST_RESOURCE_ERROR_NOT_FOUND:
                case GST_RESOURCE_ERROR_OPEN_READ:
-                       if ( MMPLAYER_IS_HTTP_STREAMING(player) || MMPLAYER_IS_HTTP_LIVE_STREAMING ( player ) )
+                       if ( MMPLAYER_IS_HTTP_STREAMING(player) || MMPLAYER_IS_HTTP_LIVE_STREAMING ( player ) 
+                               || MMPLAYER_IS_RTSP_STREAMING(player))
                        {
                                trans_err = MM_ERROR_PLAYER_STREAMING_CONNECTION_FAIL;
                                break;
                        }
                case GST_RESOURCE_ERROR_READ:
-                       if ( MMPLAYER_IS_HTTP_STREAMING(player) ||  MMPLAYER_IS_HTTP_LIVE_STREAMING ( player ))
+                       if ( MMPLAYER_IS_HTTP_STREAMING(player) ||  MMPLAYER_IS_HTTP_LIVE_STREAMING ( player )
+                               || MMPLAYER_IS_RTSP_STREAMING(player))
                        {
                                trans_err = MM_ERROR_PLAYER_STREAMING_FAIL;
                                break;
                        }
-               case GST_RESOURCE_ERROR_SEEK:
+               case GST_RESOURCE_ERROR_WRITE:
                case GST_RESOURCE_ERROR_FAILED:
+                       trans_err = MM_ERROR_PLAYER_INTERNAL;
+                       break;
+
+               case GST_RESOURCE_ERROR_SEEK:
                case GST_RESOURCE_ERROR_TOO_LAZY:
                case GST_RESOURCE_ERROR_BUSY:
                case GST_RESOURCE_ERROR_OPEN_WRITE:
                case GST_RESOURCE_ERROR_OPEN_READ_WRITE:
                case GST_RESOURCE_ERROR_CLOSE:
-               case GST_RESOURCE_ERROR_WRITE:
                case GST_RESOURCE_ERROR_SYNC:
                case GST_RESOURCE_ERROR_SETTINGS:
                default:
@@ -9617,7 +9755,7 @@ __gst_transform_gsterror( mm_player_t* player, GstMessage * message, GError* err
                        /* Decoder Custom Message */
                        if ( strstr(error->message, "ongoing") )
                        {
-                               if ( strcasestr(klass, "audio") )
+                               if ( strncasecmp(klass, "audio", 5) )
                                {
                                        if ( ( player->can_support_codec & FOUND_PLUGIN_VIDEO ) )
                                        {
@@ -9630,7 +9768,7 @@ __gst_transform_gsterror( mm_player_t* player, GstMessage * message, GError* err
                                        }
 
                                }
-                               else if ( strcasestr(klass, "video") )
+                               else if ( strncasecmp(klass, "video", 5) )
                                {
                                        if ( ( player->can_support_codec & FOUND_PLUGIN_AUDIO ) )
                                        {
@@ -9657,7 +9795,21 @@ __gst_transform_gsterror( mm_player_t* player, GstMessage * message, GError* err
                case GST_STREAM_ERROR_DECRYPT_NOKEY:
                {
                        debug_error("decryption error, [%s] failed, reason : [%s]\n", src_element_name, error->message);
-                       return MM_MESSAGE_DRM_NOT_AUTHORIZED;
+
+                       if ( strstr(error->message, "rights expired") )
+                       {
+                               return MM_ERROR_PLAYER_DRM_EXPIRED;
+                       }
+                       else if ( strstr(error->message, "no rights") )
+                       {
+                               return MM_ERROR_PLAYER_DRM_NO_LICENSE;
+                       }
+                       else if ( strstr(error->message, "has future rights") )
+                       {
+                               return MM_ERROR_PLAYER_DRM_FUTURE_USE;
+                       }
+
+                       return MM_ERROR_PLAYER_DRM_NOT_AUTHORIZED;
                }
                break;
 
@@ -10203,6 +10355,7 @@ __get_state_name ( int state )
                        return "INVAID";
        }
 }
+
 gboolean
 __is_rtsp_streaming ( mm_player_t* player )
 {
index 261d7d4..5622447 100644 (file)
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
 bool util_exist_file_path(const char *file_path)
 {
-       debug_log("\n");
+       int fd = NULL;
+       struct stat stat_results = {0, };
 
        if (!file_path || !strlen(file_path))
                return FALSE;
 
-       int res = access(file_path, R_OK);
-       if (res)
+       fd = open (file_path, O_RDONLY);
+
+       if (fd < 0)
+       {
+               debug_error("failed to open %s, %s", file_path, strerror(errno));
                return FALSE;
+       }
+
+       if (fstat(fd, &stat_results) < 0)
+       {
+               debug_error("failed to get file status");
+       }
+       else
+       {
+               debug_warning("file size : %lld bytes", (long long)stat_results.st_size); //need to chech file validity
+       }
+
+       close(fd);
 
        return TRUE;
 }
@@ -311,7 +328,7 @@ util_is_sdp_file ( const char *path )
 
        uri = g_ascii_strdown ( path, -1 );
 
-       if ( uri == -1)
+       if ( uri == NULL)
        {
                return FALSE;
        }
@@ -333,7 +350,7 @@ util_is_sdp_file ( const char *path )
        if ( ! ret )
        {
                /* FIXIT : do it soon */
-               debug_warning("determining whether it's sdp or not with it's content is not implemented yet. ;)\n");
+               debug_log("determining whether it's sdp or not with it's content is not implemented yet. ;)\n");
        }
 
        g_free( uri);