Add a method to NativeImageSourceQueue 92/232692/1
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:11:00 +0000 (16:11 +0900)
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 297fd2ad8414bf5d72f49bb00544f3cbe362f06a..acb10d50f06cbd6af6dfcab89e7e28e60edbc9a0 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 32b08c3ed1dc820573e348dae9fa9b34df0e7ab7..0e0290303fdefa50421657a7947d3bbaa7091ee8 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 70439798019d782dcc46b833b06c9b98da902a83..45905bdc288a4ddb4e1997a4a3fcb5b469835e30 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 e1cb04578682485258ddbc49497edcc29879331e..be5b8b6d649856ab1151acb381892a5fb1f58c94 100644 (file)
@@ -64,6 +64,11 @@ public:
    */
   void SetSize( uint32_t width, uint32_t height ) override;
 
+  /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
   /**
    * destructor
    */
index 889935e372c910080e8107a1b8032add3a0db235..eeb87f20a2f2bbbd352582f2f4812b63fc99225f 100755 (executable)
@@ -52,6 +52,11 @@ public:
    */
   virtual void SetSize( uint32_t width, uint32_t height ) = 0;
 
+  /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  virtual void IgnoreSourceImage() = 0;
+
   /**
    * destructor
    */
index e7fa5548325730be4ea103c58b6dceb68a698527..f95ee1a00cd1969ffb30518d8089b85ca7f62217 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 88b27cbea4a2bb97564c6bdb2cda6699856bffe4..7f163522161f14abdca9dcbc129c7bb64ac3afc1 100755 (executable)
@@ -68,6 +68,11 @@ public:
    */
   void SetSize( uint32_t width, uint32_t height ) override;
 
+  /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
   /**
    * destructor
    */
index 4bd539bc89f4b96062895c799c73f11919185e7a..648848717ebe602fdbb874eb4fb8e104eace8a06 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 c252bec574754663e27dff2f647577ec6cceb7e5..689f733f9c80665910f768f0c235b34ff473862e 100755 (executable)
@@ -64,6 +64,11 @@ public:
    */
   void SetSize( uint32_t width, uint32_t height ) override;
 
+  /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
   /**
    * destructor
    */