update source code for tizen 2.1
authorHyunil Park <hyunil46.park@samsung.com>
Tue, 9 Apr 2013 06:54:25 +0000 (15:54 +0900)
committerHyunil Park <hyunil46.park@samsung.com>
Tue, 9 Apr 2013 07:40:40 +0000 (16:40 +0900)
Change-Id: I32db755464a64575e5307bdb8a2e30d15ad9a6d4

packaging/gst-rtsp-server-wfd.spec
src/include/rtsp-client.h
src/include/rtsp-server.h
src/include/wfdconfigmessage.h
src/rtsp-client.c
src/rtsp-media-factory.c
src/rtsp-media.c
src/rtsp-server.c
src/wfdconfigmessage.c

index 15c2b9e..426dd2c 100755 (executable)
@@ -2,7 +2,7 @@
 Name:       gst-rtsp-server-wfd
 Summary:    Multimedia Framework Wifi-Display Library
 Version:    0.1.0
-Release:    1
+Release:    11
 Group:      System/Libraries
 License:    LGPLv2+
 Source0:    %{name}-%{version}.tar.gz
index 9496dcb..209637b 100755 (executable)
@@ -214,6 +214,7 @@ struct _GstRTSPClient {
   guint32 cslice_enc_params;
   guint cframe_rate_control;
   guint bitrate;
+  guint MTUsize;
   guint cvLatency;
   WFDRTSPTransMode ctrans;
   WFDRTSPProfile cprofile;
@@ -225,6 +226,12 @@ struct _GstRTSPClient {
   WFDHDCPProtection hdcp_version;
   guint32 hdcp_tcpport;
   gboolean hdcp_support;
+#ifdef STANDBY_RESUME_CAPABILITY
+  gboolean standby_resume_capability_support;
+#endif
+  guint cseq;
+  gboolean keep_alive_flag;
+  GMutex *keep_alive_lock;
 
 };
 
@@ -233,6 +240,7 @@ struct _GstRTSPClientClass {
 
   /* signals */
   void     (*closed)        (GstRTSPClient *client);
+  void     (*on_error)      (GstRTSPClient *client);
 };
 
 GType                 gst_rtsp_client_get_type          (void);
@@ -265,7 +273,8 @@ gboolean gst_rtsp_client_pause (GstRTSPClient * client);
 gboolean gst_rtsp_client_resume (GstRTSPClient * client);
 gboolean gst_rtsp_client_standby (GstRTSPClient * client);
 gboolean gst_rtsp_client_stop (GstRTSPClient * client);
-void gst_rtsp_client_set_params (GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gchar *infile);
+void gst_rtsp_client_set_params (GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gint mtu_size, gchar *infile);
+
 G_END_DECLS
 
 #endif /* __GST_RTSP_CLIENT_H__ */
index f9c201a..c9fa341 100755 (executable)
@@ -148,9 +148,11 @@ gboolean gst_rtsp_server_negotiate_client (GstRTSPServer * server, GstRTSPClient
 gboolean gst_rtsp_server_start_client (GstRTSPServer * server, GstRTSPClient *client);
 gboolean gst_rtsp_server_pause_client (GstRTSPServer * server, GstRTSPClient *client);
 gboolean gst_rtsp_server_resume_client (GstRTSPServer * server, GstRTSPClient *client);
+gboolean gst_rtsp_server_lcd_off_client(GstRTSPServer * server, GstRTSPClient *client);
+gboolean gst_rtsp_server_lcd_on_client(GstRTSPServer * server, GstRTSPClient *client);
 gboolean gst_rtsp_server_standby_client (GstRTSPServer * server, GstRTSPClient *client);
 gboolean gst_rtsp_server_stop_client (GstRTSPServer * server, GstRTSPClient *client);
-void gst_rtsp_server_set_client_params (GstRTSPServer * server, GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gchar *infile);
+void gst_rtsp_server_set_client_params (GstRTSPServer * server, GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gint mtu_size, gchar *infile);
 G_END_DECLS
 
 #endif /* __GST_RTSP_SERVER_H__ */
index e9fd2bc..0813b67 100755 (executable)
@@ -430,7 +430,7 @@ typedef struct {
 } WFDUibcSetting;
 
 typedef struct {
-  gboolean standby_resume_cap;
+  gchar *standby_resume_cap;
 } WFDStandbyResumeCapability;
 
 typedef struct {
index 187fb54..a13757f 100755 (executable)
@@ -52,6 +52,7 @@
 #include <dri2.h>
 #include <utilX.h>
 
+#define DEFAULT_RTSP_TIMEOUT   60
 #define DRM_EXYNOS_VIDI_ON  1
 #define DRM_EXYNOS_VIDI_OFF  0
 
@@ -65,6 +66,8 @@ FILE *f;
 /* temporary multicast address until it's configurable somewhere */
 #define MCAST_ADDRESS "224.2.0.1"
 
+#define DEFAULT_WFD_MTU_SIZE 1400
+
 static GMutex *tunnels_lock;
 static GHashTable *tunnels;
 
@@ -79,6 +82,7 @@ enum
 enum
 {
   SIGNAL_CLOSED,
+  SIGNAL_ERROR,
   SIGNAL_LAST
 };
 
@@ -102,7 +106,10 @@ set_edid_info(gchar *edid_info, gboolean plug);
 
 static gboolean
 gst_rtsp_client_parse_methods (GstRTSPClient * client, GstRTSPMessage * response);
-
+gboolean
+keep_alive_condition(gpointer *userdata);
+gboolean
+gst_rtsp_client_sending_m16_message (GstRTSPClient * client);
 
 #ifdef WFD_PAD_PROBE
 static gboolean
@@ -165,6 +172,11 @@ gst_rtsp_client_class_init (GstRTSPClientClass * klass)
       G_STRUCT_OFFSET (GstRTSPClientClass, closed), NULL, NULL,
       g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
 
+  gst_rtsp_client_signals[SIGNAL_ERROR] =
+        g_signal_new ("error_noti", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
+        G_STRUCT_OFFSET (GstRTSPClientClass, on_error), NULL, NULL,
+        g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
+
   tunnels =
       g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
   tunnels_lock = g_mutex_new ();
@@ -176,11 +188,15 @@ static void
 gst_rtsp_client_init (GstRTSPClient * client)
 {
   client->state_lock = g_mutex_new ();
+  client->keep_alive_lock = g_mutex_new();
+  client->keep_alive_flag = TRUE;
+  client->cseq = 0;
   client->state_wait = g_cond_new ();
   client->client_state = CLIENT_STATE_UNKNOWN;
   client->videosrc_type = WFD_INI_VSRC_XVIMAGESRC;
   client->session_mode = 0;
   client->infile = NULL;
+  client->MTUsize = DEFAULT_WFD_MTU_SIZE;
 }
 
 static void
@@ -221,7 +237,15 @@ gst_rtsp_client_finalize (GObject * obj)
 
   client_cleanup_sessions (client);
 
-  gst_rtsp_connection_free (client->connection);
+  if(client->connection)
+  {
+    gst_rtsp_connection_close (client->connection);
+    gst_rtsp_connection_free(client->connection);
+    if (client->watch)
+      g_source_destroy ((GSource *) client->watch);
+    client->watchid = 0;
+    client->watch = NULL;
+  }
   if (client->session_pool)
     g_object_unref (client->session_pool);
   if (client->media_mapping)
@@ -235,9 +259,12 @@ gst_rtsp_client_finalize (GObject * obj)
     g_object_unref (client->media);
   g_free (client->server_ip);
   set_edid_info(NULL, FALSE);
-
+  if(client->keep_alive_lock)
+    g_mutex_free (client->keep_alive_lock);
+  client->keep_alive_lock = NULL;
   g_cond_signal (client->state_wait);
-
+  if (client->server)
+    g_object_unref (client->server);
   if(client->tcpsock)
     close(client->tcpsock);
   G_OBJECT_CLASS (gst_rtsp_client_parent_class)->finalize (obj);
@@ -383,19 +410,12 @@ send_response (GstRTSPClient * client, GstRTSPSession * session,
 
     GST_DEBUG ("session is not NULL - %p", session);
 
-    if (session->timeout != 60)
-      str =
-          g_strdup_printf ("%s; timeout=%d", session->sessionid,
-          session->timeout);
+    if (session->timeout > 30)
+      str = g_strdup_printf ("%s; timeout=%d", session->sessionid, session->timeout);
     else
-#if 0 //Changes for testing with dongle
-      str = g_strdup (session->sessionid);
-#else
     {
-      //str = g_strdup (session->sessionid);
-      str = g_strdup_printf ("%s;timeout=%d", session->sessionid, 30); //Changes for testing with dongle
+      str = g_strdup_printf ("%s;timeout=%d", session->sessionid, 30);
     }
-#endif
 
     gst_rtsp_message_take_header (response, GST_RTSP_HDR_SESSION, str);
   }
@@ -424,7 +444,7 @@ send_request (GstRTSPClient * client, GstRTSPSession * session, GstRTSPMessage *
 
     GST_DEBUG ("session is not NULL - %p", session);
 
-    if (session->timeout != 60)
+    if (session->timeout != DEFAULT_RTSP_TIMEOUT)
       str =
           g_strdup_printf ("%s; timeout=%d", session->sessionid,
           session->timeout);
@@ -1296,7 +1316,7 @@ handle_setup_request (GstRTSPClient * client, GstRTSPClientState * state)
      * something. */
     if (!(session = gst_rtsp_session_pool_create (client->session_pool)))
       goto service_unavailable;
-
+    session->timeout = DEFAULT_RTSP_TIMEOUT;
     state->session = session;
     client->sessionid = g_strdup(session->sessionid);
     /* we need a new media configuration in this session */
@@ -1487,9 +1507,8 @@ handle_describe_request (GstRTSPClient * client, GstRTSPClientState * state)
 
   /* check what kind of format is accepted, we don't really do anything with it
    * and always return SDP for now. */
-  for (i = 0; i++;) {
+  for (i = 0; ;i++) {
     gchar *accept;
-
     res =
         gst_rtsp_message_get_header (state->request, GST_RTSP_HDR_ACCEPT,
         &accept, i);
@@ -1931,6 +1950,7 @@ handle_request (GstRTSPClient * client, GstRTSPMessage * request)
       break;
     case GST_RTSP_PLAY:
       handle_play_request (client, &state);
+      g_timeout_add((DEFAULT_RTSP_TIMEOUT - 5)*1000, keep_alive_condition, client);
       break;
     case GST_RTSP_PAUSE:
       handle_pause_request (client, &state);
@@ -2233,6 +2253,9 @@ message_received (GstRTSPWatch * watch, GstRTSPMessage * message,
 
         gst_rtsp_message_parse_response (message, &code, &uristr, &version);
         GST_INFO_OBJECT (client, "revd message method = %d", code);
+        g_mutex_lock(client->keep_alive_lock);
+        client->keep_alive_flag = TRUE;
+        g_mutex_unlock(client->keep_alive_lock);
       }
       break;
     case GST_RTSP_MESSAGE_DATA:
@@ -2631,8 +2654,7 @@ gst_rtsp_client_accept (GstRTSPClient * client, GIOChannel * channel, GSource *s
 
   client->connection = conn;
   /* create watch for the connection and attach */
-  client->watch = gst_rtsp_watch_new (client->connection, &watch_funcs,
-      g_object_ref (client), (GDestroyNotify) client_watch_notify);
+  client->watch = gst_rtsp_watch_new (client->connection, &watch_funcs, client, (GDestroyNotify) client_watch_notify);
 
 #if 0
   /* find the context to add the watch */
@@ -2698,7 +2720,7 @@ prepare_request (GstRTSPClient *client, GstRTSPMessage *request,
   GstRTSPResult res = GST_RTSP_OK;
   gchar *str = NULL;
   WFDResult wfd_res = WFD_OK;
-
+  GString *cseqstr;
   /* initialize the request */
   res = gst_rtsp_message_init_request (request, method, url);
   if (res < 0) {
@@ -2706,6 +2728,16 @@ prepare_request (GstRTSPClient *client, GstRTSPMessage *request,
     return res;
   }
 
+  client->cseq++;
+  cseqstr = g_string_new ("");
+  g_string_append_printf (cseqstr,"%d",client->cseq);
+  GST_DEBUG ("CSeq value has been incremented to %d", client->cseq);
+  res = gst_rtsp_message_add_header (request, GST_RTSP_HDR_CSEQ, g_string_free (cseqstr, FALSE));
+  if (res < 0) {
+    GST_ERROR ("Failed to add header");
+    return res;
+  }
+
   switch (method) {
 
     /* Prepare OPTIONS request to send */
@@ -2810,15 +2842,16 @@ prepare_request (GstRTSPClient *client, GstRTSPMessage *request,
         GST_ERROR_OBJECT (client, "Failed to set coupled sink type on wfd message...");
         res = GST_RTSP_ERROR;
         goto error;
-      }
+      } */
+#ifdef STANDBY_RESUME_CAPABILITY
       GST_DEBUG ("wfdconfig_set_standby_resume_capability...");
       wfd_res = wfdconfig_set_standby_resume_capability(msg3, FALSE);
       if (wfd_res != WFD_OK) {
         GST_ERROR_OBJECT (client, "Failed to set coupled sink type on wfd message...");
         res = GST_RTSP_ERROR;
         goto error;
-      }*/
-
+      }
+#endif
       /* set the preffered RTP ports for the WFD server*/
       wfd_res = wfdconfig_set_prefered_RTP_ports(msg3, WFD_RTSP_TRANS_UNKNOWN, WFD_RTSP_PROFILE_UNKNOWN,
                         WFD_RTSP_LOWER_TRANS_UNKNOWN, 0, 0);
@@ -2980,6 +3013,16 @@ prepare_request (GstRTSPClient *client, GstRTSPMessage *request,
               goto error;
             }
           }
+#ifdef STANDBY_RESUME_CAPABILITY          
+       if(client->standby_resume_capability_support){
+            wfd_res = wfdconfig_set_standby_resume_capability(msg4, TRUE);
+            if (wfd_res != WFD_OK) {
+              GST_ERROR_OBJECT (client, "Failed to set supported standby resume capability  type on wfd message...");
+              res = GST_RTSP_ERROR;
+              goto error;
+            }
+          }
+#endif
           wfd_res = wfdconfig_message_dump(msg4);
           if (wfd_res != WFD_OK) {
             GST_ERROR_OBJECT (client, "Failed to dump wfd message...");
@@ -3533,7 +3576,9 @@ handle_M3_message (GstRTSPClient * client)
   client->hdcp_version = WFD_HDCP_NONE;
   client->hdcp_tcpport = 0;
   client->hdcp_support = FALSE;
-
+#ifdef STANDBY_RESUME_CAPABILITY
+  client->standby_resume_capability_support = FALSE;
+#endif
 
   url = gst_rtsp_connection_get_url (client->connection);
   if (url == NULL) {
@@ -3658,7 +3703,16 @@ handle_M3_message (GstRTSPClient * client)
         goto error;
       }
    }
-
+#ifdef STANDBY_RESUME_CAPABILITY
+   if (msg3res->standby_resume_capability) {
+     /*Get the standby_resume_capability value by WFDSink*/
+     wfd_res = wfdconfig_get_standby_resume_capability(msg3res, &client->standby_resume_capability_support );
+     if (wfd_res != WFD_OK) {
+       GST_WARNING_OBJECT (client, "Failed to get wfd standby resume capability...");
+       goto error;
+     }
+   }
+#endif
     wfdconfig_message_dump(msg3res);
   }
 
@@ -3789,6 +3843,7 @@ handle_M5_message (GstRTSPClient * client, WFDTrigger trigger_type)
 
 }
 
+
 /**
 * handle_M12_message:
 * @client: client object
@@ -3941,11 +3996,12 @@ gst_rtsp_client_start (GstRTSPClient * client)
 }
 
 void
-gst_rtsp_client_set_params (GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gchar *infile)
+gst_rtsp_client_set_params (GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gint mtu_size, gchar *infile)
 {
   client->videosrc_type = videosrc_type;
   client->session_mode = session_mode;
   client->bitrate = videobitrate;
+  client->MTUsize = mtu_size;
   client->infile = g_strdup (infile);
 
   g_print ("\n\n\nvideo src type = %d & session_mode = %d & filename = %s\n",
@@ -4165,7 +4221,7 @@ gst_rtsp_client_create_audio_capture_bin (GstRTSPClient * client, GstRTSPClientS
   //g_object_set (audiosrc, "latency-time", 1000, NULL);
   //g_object_set (audiosrc, "actual-latency-time", 1000, NULL);
 
-  //g_object_set (audiosrc, "is-live", 1, NULL);
+  g_object_set (audiosrc, "is-live", 1, NULL);
   g_object_set (audiosrc, "do-timestamp", 1, NULL);
   /* create audio caps element */
   acaps  = gst_element_factory_make ("capsfilter", "audiocaps");
@@ -4448,7 +4504,7 @@ gst_rtsp_client_create_srcbin (GstRTSPClient * client)
   }
 
   g_object_set (payload, "pt", 33, NULL);
-  g_object_set (payload, "max-ptime", 2000000, NULL); // Why max-ptime is 2microsec ???
+  g_object_set (payload, "mtu", client->MTUsize, NULL);
 
   gst_bin_add_many (srcbin->srcbin, mux, payload, NULL);
 
@@ -4554,3 +4610,92 @@ static gboolean gst_dump_data (GstPad * pad, GstMiniObject * obj, gpointer u_dat
 }
 #endif
 
+static void
+keep_alive_response_check (gpointer *userdata)
+{
+  GstRTSPClient *client = (GstRTSPClient *)userdata;
+  if (!client) {
+    return;
+  }
+  if (client->keep_alive_flag) {
+    return;
+  }
+  else {
+    GST_INFO ("%p: source error notification", client);
+    g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_ERROR], 0, NULL);
+  }
+}
+
+/*CHecking whether source has got response of any request.
+ * If yes, keep alive message is sent otherwise error message
+ * will be displayed.*/
+gboolean
+keep_alive_condition(gpointer *userdata)
+{
+  GstRTSPClient *client;
+  gboolean res;
+  client = (GstRTSPClient *)userdata;
+  if (!client) {
+    return FALSE;
+  }
+  if(client->keep_alive_lock)
+    g_mutex_lock(client->keep_alive_lock);
+  else
+    return FALSE;
+  if(!client->keep_alive_flag) {
+    g_timeout_add(5000, keep_alive_response_check, client);
+  }
+  else {
+    GST_DEBUG_OBJECT (client, "have received last keep alive message response");
+  }
+  GST_DEBUG("sending keep alive message");
+  res = gst_rtsp_client_sending_m16_message(client);
+  if(res) {
+    client->keep_alive_flag = FALSE;
+  }
+  else {
+    GST_ERROR_OBJECT (client, "Failed to send Keep Alive Message");
+    g_mutex_unlock(client->keep_alive_lock);
+    return FALSE;
+  }
+  g_mutex_unlock(client->keep_alive_lock);
+  return TRUE;
+}
+/*Sending keep_alive (M16) message.
+  Without calling prepare_request function.*/
+
+gboolean
+gst_rtsp_client_sending_m16_message (GstRTSPClient * client)
+{
+  GstRTSPResult res = GST_RTSP_OK;
+  GstRTSPUrl *url = NULL;
+  GstRTSPMessage request = { 0 };
+  gchar *url_str = NULL;
+  GstRTSPSession *session = NULL;
+
+  url = gst_rtsp_connection_get_url (client->connection);
+  if (url == NULL) {
+    GST_ERROR_OBJECT (client, "Failed to get connection URL");
+    return FALSE;
+  }
+
+  url_str = gst_rtsp_url_get_request_uri (url);
+  if (url_str == NULL) {
+    GST_ERROR_OBJECT (client, "Failed to get connection URL");
+    return FALSE;
+  }
+
+  res = gst_rtsp_message_init_request (&request, GST_RTSP_GET_PARAMETER, url_str);
+  if (res < 0) {
+    GST_ERROR ("init request failed");
+    return FALSE;
+  }
+
+  if (client->sessionid) {
+    session = gst_rtsp_session_pool_find (client->session_pool, client->sessionid);
+    GST_INFO_OBJECT (client, "session = %p & sessionid = %s", session, session->sessionid);
+  }
+  send_request (client, session, &request);
+  return TRUE;
+}
+
index c4e0d4e..d40fcbd 100755 (executable)
@@ -132,9 +132,13 @@ gst_rtsp_media_factory_finalize (GObject * obj)
   GstRTSPMediaFactory *factory = GST_RTSP_MEDIA_FACTORY (obj);
 
   g_hash_table_unref (factory->medias);
+  factory->medias = NULL;
   g_mutex_free (factory->medias_lock);
+  factory->medias_lock = NULL;
   g_free (factory->launch);
+  factory->launch = NULL;
   g_mutex_free (factory->lock);
+  factory->lock = NULL;
   if (factory->auth)
     g_object_unref (factory->auth);
 
index b162819..cb60359 100755 (executable)
 
 #include <string.h>
 #include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
 
 #include <gst/app/gstappsrc.h>
 #include <gst/app/gstappsink.h>
@@ -1519,7 +1523,7 @@ default_handle_message (GstRTSPMedia * media, GstMessage * message)
 
       gst_message_parse_error (message, &gerror, &debug);
 
-      GST_WARNING ("%p: got error %s (%s)", media, gerror->message, debug);
+      GST_ERROR ("%p: got error %s (%s)", media, gerror->message, debug);
       g_error_free (gerror);
       g_free (debug);
 
index 47c0b62..1d8b7b4 100755 (executable)
@@ -886,6 +886,13 @@ unmanage_client (GstRTSPClient * client, GstRTSPServer * server)
   g_io_channel_shutdown(server->channel, TRUE, NULL);
 }
 
+static void
+client_error_noti (GstRTSPClient * client, GstRTSPServer * server)
+{
+  GST_DEBUG_OBJECT (server, "client is notifying an error %p", client);
+  if(server->user_cb) server->user_cb( TRUE,server->user_param);
+}
+
 /* add the client to the active list of clients, takes ownership of
  * the client */
 static void
@@ -896,6 +903,7 @@ manage_client (GstRTSPServer * server, GstRTSPClient * client)
 
   GST_RTSP_SERVER_LOCK (server);
   g_signal_connect (client, "closed", (GCallback) unmanage_client, server);
+  g_signal_connect (client, "error_noti", (GCallback) client_error_noti, server);
   server->clients = g_list_prepend (server->clients, client);
   GST_RTSP_SERVER_UNLOCK (server);
 }
@@ -1154,7 +1162,7 @@ gst_rtsp_server_create_watch (GstRTSPServer * server)
 
   /* configure the callback */
   g_source_set_callback (server->source,
-      (GSourceFunc) gst_rtsp_server_io_func, g_object_ref (server),
+      (GSourceFunc) gst_rtsp_server_io_func, server,
       (GDestroyNotify) watch_destroyed);
 
   return server->source;
@@ -1328,9 +1336,9 @@ gst_rtsp_server_stop_client (GstRTSPServer * server, GstRTSPClient *client)
   }
 
 void
-gst_rtsp_server_set_client_params (GstRTSPServer * server, GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gchar *infile)
+gst_rtsp_server_set_client_params (GstRTSPServer * server, GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gint mtu_size, gchar *infile)
 {
   GST_DEBUG_OBJECT (server, "Client = %p", client);
 
-  gst_rtsp_client_set_params(client, videosrc_type, session_mode, videobitrate, infile);
+  gst_rtsp_client_set_params(client, videosrc_type, session_mode, videobitrate, mtu_size, infile);
 }
index 3b4374b..d1cad58 100755 (executable)
@@ -41,7 +41,7 @@
 #define FREE_STRING(field)              if(field != NULL) g_free (field); (field) = NULL
 #define REPLACE_STRING(field, val)      FREE_STRING(field); (field) = g_strdup (val)
 #define EDID_BLOCK_SIZE 128
-#define LIBHDCP "/usr/lib/libhdcp2.so"
+#define LIBHDCP "/usr/lib/libhdcp library"
 enum
 {
   WFD_SESSION,
@@ -1993,7 +1993,7 @@ WFDResult wfdconfig_get_uibc_status(WFDMessage *msg, gboolean *uibc_enable)
   if(msg->uibc_setting) *uibc_enable = msg->uibc_setting->uibc_setting;
   return WFD_OK;
 }
-
+#ifdef STANDBY_RESUME_CAPABILITY
 WFDResult wfdconfig_set_standby_resume_capability(WFDMessage *msg, gboolean supported)
 {
   g_return_val_if_fail (msg != NULL, WFD_EINVAL);
@@ -2008,7 +2008,7 @@ WFDResult wfdconfig_get_standby_resume_capability(WFDMessage *msg, gboolean *sup
   if(msg->standby_resume_capability) *supported = msg->standby_resume_capability->standby_resume_cap;
   return WFD_OK;
 }
-
+#endif
 WFDResult wfdconfig_set_standby(WFDMessage *msg, gboolean standby_enable)
 {
   g_return_val_if_fail (msg != NULL, WFD_EINVAL);