Turn out remaining gst-1.0 code
[platform/core/multimedia/libmm-player.git] / src / mm_player_attrs.c
old mode 100755 (executable)
new mode 100644 (file)
index 444066c..1077e00
@@ -3,8 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>,
- * YoungHwan An <younghwan_.an@samsung.com>
+ * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <vconf.h>
 #include <mm_attrs_private.h>
 #include <mm_attrs.h>
+#ifndef GST_API_VERSION_1
 #include <gst/interfaces/xoverlay.h>
-
+#else
+#include <gst/video/videooverlay.h>
+#endif
 #include "mm_player_priv.h"
 #include "mm_player_attrs.h"
 
@@ -197,17 +199,16 @@ __mmplayer_apply_attribute(MMHandleType handle, const char *attribute_name)
        return_val_if_fail(handle, MM_ERROR_COMMON_INVALID_ARGUMENT);
        return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
 
-       attrs = MM_PLAYER_GET_ATTRS(handle);;
+       attrs = MM_PLAYER_GET_ATTRS(handle);
        player = MM_PLAYER_CAST(handle);
 
        if ( g_strrstr(attribute_name, "display") )
        {
                /* 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\n");
                        /*
                         * The attribute should be committed even though videobin is not created yet.
                         * So, true should be returned here.
@@ -218,7 +219,7 @@ __mmplayer_apply_attribute(MMHandleType handle, const char *attribute_name)
 
                if ( MM_ERROR_NONE != _mmplayer_update_video_param( player ) )
                {
-                       debug_error("failed to update video param\n");
+                       debug_error("failed to update video param");
                        return MM_ERROR_PLAYER_INTERNAL;
                }
        }
@@ -240,7 +241,7 @@ _mmplayer_construct_attribute(MMHandleType handle)
 
        debug_fenter();
 
-       return_if_fail(handle);
+       return_val_if_fail (handle, 0);
 
        MMPlayerAttrsSpec player_attrs[] =
        {
@@ -272,10 +273,10 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        MMPLAYER_MAX_INT
                },
                {
-                       "profile_async_start",
+                       "profile_prepare_async",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
-                       (void *) 1,
+                       (void *) 0,
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        0,
                        1
@@ -674,7 +675,7 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        0
                },
                {
-                       "display_overlay_ext",
+                       "display_overlay_user_data",
                        MM_ATTRS_TYPE_DATA,
                        MM_ATTRS_FLAG_RW,
                        (void *) NULL,
@@ -695,19 +696,10 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        "display_surface_type",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
-                       (void *) 0,
+                       (void *) MM_DISPLAY_SURFACE_NULL,
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        MM_DISPLAY_SURFACE_X,
-                       MM_DISPLAY_SURFACE_NULL
-               },
-               {
-                       "display_surface_use_multi",
-                       MM_ATTRS_TYPE_INT,
-                       MM_ATTRS_FLAG_RW,
-                       (void *) FALSE,
-                       MM_ATTRS_VALID_TYPE_INT_RANGE,
-                       FALSE,
-                       TRUE
+                       MM_DISPLAY_SURFACE_X_EXT
                },
                {
                        "display_evas_surface_sink",
@@ -827,6 +819,15 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        2
                },
                {
+                       "audio_latency_mode",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       (void *) 1,                     // 0: low latency, 1: middle latency 2: high latency
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       0,
+                       2
+               },
+               {
                        "pcm_extraction",               // enable pcm extraction
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
@@ -942,8 +943,8 @@ _mmplayer_construct_attribute(MMHandleType handle)
 
        if ( !base )
        {
-               debug_error("Cannot create mmplayer attribute\n");
-               goto ERROR;
+               debug_error("failed to alloc attrs constructor");
+               return 0;
        }
 
        /* initialize values of attributes */
@@ -967,8 +968,8 @@ _mmplayer_construct_attribute(MMHandleType handle)
 
        if ( !attrs )
        {
-               debug_error("Cannot create mmplayer attribute\n");
-               goto ERROR;
+               debug_error("failed to create player attrs");
+               return 0;
        }
 
        /* set validity type and range */
@@ -1016,11 +1017,6 @@ _mmplayer_construct_attribute(MMHandleType handle)
        debug_fleave();
 
        return attrs;
-
-ERROR:
-       _mmplayer_deconstruct_attribute(handle);
-
-       return FALSE;
 }
 
 bool
@@ -1030,7 +1026,7 @@ _mmplayer_deconstruct_attribute(MMHandleType handle) // @
 
        mm_player_t *player = MM_PLAYER_CAST(handle);
 
-       return_if_fail( player );
+       return_val_if_fail ( player, FALSE );
 
        if (player->attrs)
        {
@@ -1039,4 +1035,6 @@ _mmplayer_deconstruct_attribute(MMHandleType handle) // @
        }
 
        debug_fleave();
+
+       return TRUE;
 }