add tdm_layer_get_output 35/170435/2
authorBoram Park <boram1288.park@samsung.com>
Tue, 20 Feb 2018 04:56:16 +0000 (13:56 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 20 Feb 2018 06:13:04 +0000 (06:13 +0000)
Change-Id: Icbc2003297276a45b6d2d7f3cda54393aa12bc0d

include/tdm.h
src/tdm_layer.c

index 618f896..70c99af 100644 (file)
@@ -765,6 +765,14 @@ tdm_output_hwc_get_video_supported_formats(tdm_layer *layer, const tbm_format **
                                                                int *count);
 
 /**
+ * @brief Get a output object of a layer object
+ * @param[in] layer A layer object
+ * @return A TDM output object if success. Otherwise, NULL.
+ */
+tdm_output*
+tdm_layer_get_output(tdm_layer *layer, tdm_error *error);
+
+/**
  * @brief Get the capabilities of a layer object.
  * @param[in] layer A layer object
  * @param[out] capabilities The capabilities of a layer object
index 2f97c5c..0ce567e 100644 (file)
@@ -80,6 +80,25 @@ static void _tdm_layer_cb_output_commit(tdm_output *output, unsigned int sequenc
                                                                                unsigned int tv_sec, unsigned int tv_usec, void *user_data);
 static void _tdm_layer_reset_pending_data(tdm_private_layer *private_layer);
 
+EXTERN tdm_output*
+tdm_layer_get_output(tdm_layer *layer, tdm_error *error)
+{
+       tdm_output *output;
+
+       LAYER_FUNC_ENTRY_ERROR();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       if (error)
+               *error = TDM_ERROR_NONE;
+
+       output = private_layer->private_output;
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return output;
+}
+
 EXTERN tdm_error
 tdm_layer_get_capabilities(tdm_layer *layer, tdm_layer_capability *capabilities)
 {