Add video codec parameter for source 00/119500/2
authorSeokHoon Lee <andy.shlee@samsung.com>
Fri, 17 Mar 2017 06:45:28 +0000 (15:45 +0900)
committerSeokHoon Lee <andy.shlee@samsung.com>
Fri, 17 Mar 2017 06:49:15 +0000 (15:49 +0900)
- For video codec negotiation between source and sink,
  add video codec parameter in client

Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: I89b22ee50fc8806bbaf932e0b50eff110b030eca

gst/rtsp-server/rtsp-client-wfd.c
gst/rtsp-server/rtsp-client-wfd.h [changed mode: 0755->0644]
gst/rtsp-server/rtsp-server-wfd.c
gst/rtsp-server/rtsp-server-wfd.h [changed mode: 0755->0644]
packaging/gst-rtsp-server.spec

index 42a2417..c07f802 100644 (file)
@@ -115,6 +115,7 @@ struct _GstRTSPWFDClientPrivate
   guint cBitwidth;
   guint caLatency;
   guint cvCodec;
+  guint8 video_codec;
   guint cNative;
   guint64 cNativeResolution;
   guint64 video_resolution_supported;
@@ -2253,7 +2254,8 @@ _set_wfd_message_body (GstRTSPWFDClient * client, GstWFDMessageType msg_type,
     }
 
     /* Set the preffered video formats */
-    GST_INFO_OBJECT (priv, "Set the video formats... %d", priv->cvCodec);
+    GST_INFO_OBJECT (priv, "Set the video formats. source codec %d, sink codec %d", priv->video_codec, priv->cvCodec);
+    /* TODO : need to negotiate video codec between source and sink */
     if (priv->cvCodec != GST_WFD_VIDEO_UNKNOWN) {
       priv->cvCodec = GST_WFD_VIDEO_H264;
       priv->cProfile = tcProfile = GST_WFD_H264_BASE_PROFILE;
@@ -3075,6 +3077,21 @@ gst_rtsp_wfd_client_set_video_native_resolution (GstRTSPWFDClient * client,
 }
 
 GstRTSPResult
+gst_rtsp_wfd_client_set_video_codec (GstRTSPWFDClient * client,
+    guint8 video_codec)
+{
+  GstRTSPResult res = GST_RTSP_OK;
+  GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client);
+
+  g_return_val_if_fail (priv != NULL, GST_RTSP_EINVAL);
+
+  priv->video_codec = video_codec;
+  GST_DEBUG ("Video codec : %d", video_codec);
+
+  return res;
+}
+
+GstRTSPResult
 gst_rtsp_wfd_client_set_audio_codec (GstRTSPWFDClient * client,
     guint8 audio_codec)
 {
@@ -3552,7 +3569,7 @@ gst_rtsp_wfd_client_set_audio_latency (GstRTSPWFDClient * client, guint latency)
 }
 
 void
-gst_rtsp_wfd_client_set_video_codec (GstRTSPWFDClient * client, guint vcodec)
+gst_rtsp_wfd_client_set_vid_codec (GstRTSPWFDClient * client, guint vcodec)
 {
   GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client);
   g_return_if_fail (priv != NULL);
old mode 100755 (executable)
new mode 100644 (file)
index 4d78382..382ce16
@@ -143,6 +143,8 @@ GstRTSPResult         gst_rtsp_wfd_client_set_video_supported_resolution (
                           GstRTSPWFDClient * client, guint64 supported_reso);
 GstRTSPResult         gst_rtsp_wfd_client_set_video_native_resolution (
                                      GstRTSPWFDClient * client, guint64 native_reso);
+GstRTSPResult         gst_rtsp_wfd_client_set_video_codec (
+                                     GstRTSPWFDClient * client, guint8 video_codec);
 GstRTSPResult         gst_rtsp_wfd_client_set_audio_codec (
                                      GstRTSPWFDClient * client, guint8 audio_codec);
 GstRTSPResult         gst_prepare_request (GstRTSPWFDClient * client,
@@ -191,7 +193,7 @@ void gst_rtsp_wfd_client_set_aud_codec(GstRTSPWFDClient *client, guint acodec);
 void gst_rtsp_wfd_client_set_audio_channels(GstRTSPWFDClient *client, guint channels);
 void gst_rtsp_wfd_client_set_audio_bit_width(GstRTSPWFDClient *client, guint bwidth);
 void gst_rtsp_wfd_client_set_audio_latency(GstRTSPWFDClient *client, guint latency);
-void gst_rtsp_wfd_client_set_video_codec(GstRTSPWFDClient *client, guint vcodec);
+void gst_rtsp_wfd_client_set_vid_codec(GstRTSPWFDClient *client, guint vcodec);
 void gst_rtsp_wfd_client_set_video_native(GstRTSPWFDClient *client, guint native);
 void gst_rtsp_wfd_client_set_vid_native_resolution(GstRTSPWFDClient *client, guint64 res);
 void gst_rtsp_wfd_client_set_video_cea_resolution(GstRTSPWFDClient *client, guint64 res);
index 042ec3b..47cc17a 100644 (file)
@@ -75,6 +75,7 @@ struct _GstRTSPWFDServerPrivate
   guint64 native_resolution;
   guint64 supported_resolution;
   guint8 audio_codec;
+  guint8 video_codec;
 };
 
 G_DEFINE_TYPE (GstRTSPWFDServer, gst_rtsp_wfd_server, GST_TYPE_RTSP_SERVER);
@@ -244,6 +245,8 @@ create_client_wfd (GstRTSPServer * server)
 
   gst_rtsp_wfd_client_set_audio_codec (client, priv->audio_codec);
 
+  gst_rtsp_wfd_client_set_video_codec (client, priv->video_codec);
+
   GST_RTSP_WFD_SERVER_UNLOCK (server);
 
   return GST_RTSP_CLIENT (client);
@@ -318,6 +321,24 @@ gst_rtsp_wfd_server_set_video_native_reso (GstRTSPWFDServer * server,
 }
 
 GstRTSPResult
+gst_rtsp_wfd_server_set_video_codec (GstRTSPWFDServer * server,
+    guint8 video_codec)
+{
+  GstRTSPResult res = GST_RTSP_OK;
+  GstRTSPWFDServerPrivate *priv = GST_RTSP_WFD_SERVER_GET_PRIVATE (server);
+
+  g_return_val_if_fail (GST_IS_RTSP_WFD_SERVER (server), GST_RTSP_ERROR);
+  g_return_val_if_fail (priv != NULL, GST_RTSP_ERROR);
+
+  GST_RTSP_WFD_SERVER_LOCK (server);
+
+  priv->video_codec = video_codec;
+
+  GST_RTSP_WFD_SERVER_UNLOCK (server);
+  return res;
+}
+
+GstRTSPResult
 gst_rtsp_wfd_server_set_audio_codec (GstRTSPWFDServer * server,
     guint8 audio_codec)
 {
old mode 100755 (executable)
new mode 100644 (file)
index 1666f18..663a9a4
@@ -80,6 +80,7 @@ GstRTSPResult         gst_rtsp_wfd_server_trigger_request      (GstRTSPServer *s
 
 GstRTSPResult         gst_rtsp_wfd_server_set_supported_reso (GstRTSPWFDServer *server, guint64 supported_reso);
 GstRTSPResult         gst_rtsp_wfd_server_set_video_native_reso    (GstRTSPWFDServer *server, guint64 native_reso);
+GstRTSPResult         gst_rtsp_wfd_server_set_video_codec    (GstRTSPWFDServer *server, guint8 video_codec);
 GstRTSPResult         gst_rtsp_wfd_server_set_audio_codec    (GstRTSPWFDServer *server, guint8 audio_codec);
 GstRTSPResult         gst_rtsp_wfd_server_switch_to_udp (GstRTSPWFDServer *server);
 GstRTSPResult         gst_rtsp_wfd_server_switch_to_tcp (GstRTSPWFDServer *server);
index bf13245..ba801c2 100644 (file)
@@ -1,7 +1,7 @@
 Name:       gst-rtsp-server
 Summary:    Multimedia Framework Library
 Version:    1.6.1
-Release:    9
+Release:    10
 Url:        http://gstreamer.freedesktop.org/
 Group:      System/Libraries
 License:    LGPL-2.0+