Add a method to NativeImageSourceQueue 42/231442/4
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 30 Dec 2019 05:11:18 +0000 (14:11 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 7 May 2020 07:10:25 +0000 (07:10 +0000)
There is a case not to show an image which is enqueued previously.
So added a method to ignore a source buffer

Change-Id: I571af6aff235955d441eef644300033d888003f5

dali/devel-api/adaptor-framework/native-image-source-queue.cpp
dali/devel-api/adaptor-framework/native-image-source-queue.h
dali/internal/imaging/android/native-image-source-queue-impl-android.cpp
dali/internal/imaging/android/native-image-source-queue-impl-android.h
dali/internal/imaging/common/native-image-source-queue-impl.h
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h

index 297fd2a..acb10d5 100755 (executable)
@@ -56,6 +56,11 @@ void NativeImageSourceQueue::SetSize( uint32_t width, uint32_t height )
   return mImpl->SetSize( width, height );
 }
 
+void NativeImageSourceQueue::IgnoreSourceImage()
+{
+  mImpl->IgnoreSourceImage();
+}
+
 bool NativeImageSourceQueue::GlExtensionCreate()
 {
   return mImpl->GlExtensionCreate();
index 32b08c3..0e02903 100755 (executable)
@@ -104,6 +104,13 @@ public:
    */
   void SetSize( uint32_t width, uint32_t height );
 
+  /**
+   * @brief Ignores a source image which is inserted to the queue.
+   *
+   * @note This can be called from worker threads.
+   */
+  void IgnoreSourceImage();
+
 private:   // native image
 
   /**
index 7043979..45905bd 100644 (file)
@@ -72,6 +72,10 @@ void NativeImageSourceQueueAndroid::SetSize( uint32_t width, uint32_t height )
   mHeight = height;
 }
 
+void NativeImageSourceQueueAndroid::IgnoreSourceImage()
+{
+}
+
 bool NativeImageSourceQueueAndroid::GlExtensionCreate()
 {
   return true;
index e1cb045..be5b8b6 100644 (file)
@@ -65,6 +65,11 @@ public:
   void SetSize( uint32_t width, uint32_t height ) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueAndroid() override;
index 889935e..eeb87f2 100755 (executable)
@@ -53,6 +53,11 @@ public:
   virtual void SetSize( uint32_t width, uint32_t height ) = 0;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  virtual void IgnoreSourceImage() = 0;
+
+  /**
    * destructor
    */
   virtual ~NativeImageSourceQueue() = default;
index e7fa554..f95ee1a 100644 (file)
@@ -189,6 +189,26 @@ void NativeImageSourceQueueTizen::SetSize( uint32_t width, uint32_t height )
   ResetEglImageList();
 }
 
+void NativeImageSourceQueueTizen::IgnoreSourceImage()
+{
+  Dali::Mutex::ScopedLock lock( mMutex );
+  tbm_surface_h surface;
+
+  if( tbm_surface_queue_can_acquire( mTbmQueue, 0 ) )
+  {
+    if( tbm_surface_queue_acquire( mTbmQueue, &surface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
+    {
+      DALI_LOG_ERROR( "NativeImageSourceQueueTizen::IgnoreSourceImage: Failed to aquire a tbm_surface\n" );
+      return;
+    }
+
+    if( tbm_surface_internal_is_valid( surface ) )
+    {
+      tbm_surface_queue_release( mTbmQueue, surface );
+    }
+  }
+}
+
 bool NativeImageSourceQueueTizen::GlExtensionCreate()
 {
   mEglImageExtensions = mEglGraphics->GetImageExtensions();
index 88b27cb..7f16352 100755 (executable)
@@ -69,6 +69,11 @@ public:
   void SetSize( uint32_t width, uint32_t height ) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueTizen() override;
index 4bd539b..6488487 100644 (file)
@@ -73,6 +73,10 @@ void NativeImageSourceQueueX::SetSize( uint32_t width, uint32_t height )
   mHeight = height;
 }
 
+void NativeImageSourceQueueX::IgnoreSourceImage()
+{
+}
+
 bool NativeImageSourceQueueX::GlExtensionCreate()
 {
   return true;
index c252bec..689f733 100755 (executable)
@@ -65,6 +65,11 @@ public:
   void SetSize( uint32_t width, uint32_t height ) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueX() override;