"enable trustzone config in gstbasesrc"" 87/104287/2 accepted/tizen/3.0/common/20161216.123750 accepted/tizen/3.0/ivi/20161216.084317 accepted/tizen/3.0/mobile/20161216.083920 accepted/tizen/3.0/tv/20161216.084050 accepted/tizen/3.0/wearable/20161216.084120 submit/tizen_3.0/20161213.081002 submit/tizen_3.0/20161215.110001
authoreunhae choi <eunhae1.choi@samsung.com>
Tue, 13 Dec 2016 04:21:41 +0000 (20:21 -0800)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 13 Dec 2016 04:28:29 +0000 (13:28 +0900)
This reverts commit 27fc028fd7d977f8d6832df50e414bfdeb39fc14.

Change-Id: I99fd913dbd7821e8dac4ae58522460a16e7a4fc0

libs/gst/base/gstbasesrc.c
libs/gst/base/gstbasesrc.h
packaging/gstreamer.spec

index 31ac75e..70f48c9 100644 (file)
@@ -2503,7 +2503,17 @@ again:
   if (G_UNLIKELY (g_atomic_int_get (&src->priv->has_pending_eos))) {
     if (ret == GST_FLOW_OK) {
       if (*buf == NULL)
+      {
+#ifdef TIZEN_FEATURE_TRUSTZONE
+        /*tzappsrc patch : release handle when unref res_buf*/
+        if(bclass->tz_src_release_handle)
+        {
+          GST_INFO_OBJECT (src, "tzappsrc release the handle");
+          bclass->tz_src_release_handle(src,res_buf);
+        }
+#endif
         gst_buffer_unref (res_buf);
+      }
     }
     src->priv->forced_eos = TRUE;
     goto eos;
@@ -2562,7 +2572,18 @@ again:
        * it got unlocked because we did a state change. In any case, get rid of
        * the buffer. */
       if (*buf == NULL)
+      {
+#ifdef TIZEN_FEATURE_TRUSTZONE
+        /*tzappsrc patch : release handle when unref res_buf*/
+        GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+        if(klass->tz_src_release_handle)
+        {
+          GST_INFO_OBJECT (src, "tzappsrc release the handle");
+          klass->tz_src_release_handle(src,res_buf);
+        }
+#endif
         gst_buffer_unref (res_buf);
+      }
 
       if (!src->live_running) {
         /* We return FLUSHING when we are not running to stop the dataflow also
@@ -2584,7 +2605,18 @@ again:
           (_("Internal clock error.")),
           ("clock returned unexpected return value %d", status));
       if (*buf == NULL)
+      {
+#ifdef TIZEN_FEATURE_TRUSTZONE
+        /*tzappsrc patch : release handle when unref res_buf*/
+        GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+        if(klass->tz_src_release_handle)
+        {
+          GST_INFO_OBJECT (src, "tzappsrc release the handle");
+          klass->tz_src_release_handle(src,res_buf);
+        }
+#endif
         gst_buffer_unref (res_buf);
+      }
       ret = GST_FLOW_ERROR;
       break;
   }
@@ -2612,7 +2644,18 @@ map_failed:
         (_("Failed to map buffer.")),
         ("failed to map result buffer in WRITE mode"));
     if (*buf == NULL)
+    {
+#ifdef TIZEN_FEATURE_TRUSTZONE
+      /*tzappsrc patch : release handle when unref res_buf*/
+      GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+      if(klass->tz_src_release_handle)
+      {
+        GST_INFO_OBJECT (src, "tzappsrc release the handle");
+        klass->tz_src_release_handle(src,res_buf);
+      }
+#endif
       gst_buffer_unref (res_buf);
+    }
     return GST_FLOW_ERROR;
   }
 not_started:
@@ -2640,7 +2683,18 @@ flushing:
   {
     GST_DEBUG_OBJECT (src, "we are flushing");
     if (*buf == NULL)
+    {
+#ifdef TIZEN_FEATURE_TRUSTZONE
+      /*tzappsrc patch : release handle when unref res_buf*/
+      GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+      if(klass->tz_src_release_handle)
+      {
+        GST_INFO_OBJECT (src, "tzappsrc release the handle");
+        klass->tz_src_release_handle(src,res_buf);
+      }
+#endif
       gst_buffer_unref (res_buf);
+    }
     return GST_FLOW_FLUSHING;
   }
 eos:
@@ -2887,6 +2941,15 @@ gst_base_src_loop (GstPad * pad)
 
   ret = gst_pad_push (pad, buf);
   if (G_UNLIKELY (ret != GST_FLOW_OK)) {
+#ifdef TIZEN_FEATURE_TRUSTZONE
+    /*tzappsrc patch : release handle when unref res_buf*/
+    GstBaseSrcClass *klass = GST_BASE_SRC_GET_CLASS(src);
+    if(klass->tz_src_release_handle)
+    {
+      GST_INFO_OBJECT (src, "tzappsrc release the handle");
+      klass->tz_src_release_handle(src,buf);
+    }
+#endif
     if (ret == GST_FLOW_NOT_NEGOTIATED) {
       goto not_negotiated;
     }
index 1167cd3..190dc48 100644 (file)
@@ -231,6 +231,12 @@ struct _GstBaseSrcClass {
 
   /*< private >*/
   gpointer       _gst_reserved[GST_PADDING_LARGE];
+#ifdef TIZEN_FEATURE_TRUSTZONE
+  /*tzappsrc patch*/
+  int (*tz_flush) (GstBaseSrc *src, unsigned int handle);
+  int (*tz_src_flush) (GstBaseSrc *src);
+  int (*tz_src_release_handle) (GstBaseSrc *src, GstBuffer *buf);
+#endif
 };
 
 GType gst_base_src_get_type (void);
index 6206a4a..2e2b702 100644 (file)
@@ -74,6 +74,7 @@ export CFLAGS="%{optflags} \
 %if "%{?profile}" == "tv"
        -DTIZEN_PROFILE_TV\
         -DRVU_LIVESTREAMING_OPTIMIZATION\
+       -DTIZEN_FEATURE_TRUSTZONE\
 %endif
        -DTIZEN_FEATURE_RTSPSRC_MODIFICATION\
        -fno-strict-aliasing"