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 618f896c804031062475830145401ffa62522feb..70c99af664c98843dd15ae35dd37c533d9270d88 100644 (file)
@@ -764,6 +764,14 @@ tdm_error
 tdm_output_hwc_get_video_supported_formats(tdm_layer *layer, const tbm_format **formats,
                                                                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
index 2f97c5c7fbdf1f4faef6823a715e86483acc34cc..0ce567e08c4f877bca7e46f4528aef4fa1cf549f 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)
 {