(VideoPlayer) Use internal constraints tags for internal case 41/321941/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 1 Apr 2025 07:00:06 +0000 (16:00 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Tue, 8 Apr 2025 01:59:36 +0000 (01:59 +0000)
Let we make VideoPlayer tag use internal API so user cannot remove it.

Change-Id: Ia73b1e4075d04db5a8b6ffc3ebcbb2e7b1b06dba
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-extension/video-player/ecore-wl2/tizen-video-player-ecore-wl2.cpp

index 2759ba65e10db98f470a488f651e173a5e24eb13..cf5753c25a7a7c65f133f78e09c1e8d459714162 100644 (file)
@@ -24,7 +24,9 @@
 #include <dali/devel-api/common/stage-devel.h>
 #include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/threading/mutex.h>
+#include <dali/integration-api/constraint-integ.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/animation/constraint-tag-ranges.h>
 #include <system_info.h>
 
 #include <mutex>
@@ -58,6 +60,8 @@ namespace
 {
 const char* TIZEN_GLIB_CONTEXT_ENV = "TIZEN_GLIB_CONTEXT";
 
+static constexpr uint32_t VIDEO_PLAYER_CONSTRAINT_TAG = Dali::ConstraintTagRanges::CORE_CONSTRAINT_TAG_MAX + 1u + (Dali::ConstraintTagRanges::INTERNAL_TAG_MAX_COUNT_PER_DERIVATION)*4 + 123u;
+
 static void MediaPacketVideoDecodedCb(media_packet_h packet, void* user_data)
 {
   TizenVideoPlayer* player = static_cast<TizenVideoPlayer*>(user_data);
@@ -1483,6 +1487,7 @@ void TizenVideoPlayer::CreateVideoShellConstraint()
       mVideoShellSizePropertyConstraint.AddSource(LocalSource(Actor::Property::SIZE));
       mVideoShellSizePropertyConstraint.AddSource(LocalSource(Actor::Property::WORLD_SCALE));
       mVideoShellSizePropertyConstraint.AddSource(LocalSource(Actor::Property::WORLD_POSITION));
+      Dali::Integration::ConstraintSetInternalTag(mVideoShellSizePropertyConstraint, VIDEO_PLAYER_CONSTRAINT_TAG);
     }
   }
 #else
@@ -1601,10 +1606,12 @@ void TizenVideoPlayer::CreateVideoConstraint(Dali::NativeImageSourcePtr nativeIm
 
     mVideoRotationConstraint = Constraint::New<Vector4>(syncActor, mVideoRotationPropertyIndex, VideoPlayerRotationConstraint);
     mVideoRotationConstraint.AddSource(LocalSource(idIndex));
+    Dali::Integration::ConstraintSetInternalTag(mVideoRotationConstraint, VIDEO_PLAYER_CONSTRAINT_TAG);
     mVideoRotationConstraint.Apply();
 
     mVideoLetterBoxConstraint = Constraint::New<Vector2>(syncActor, mVideoRatioPropertyIndex, VideoPlayerRatioConstraint);
     mVideoLetterBoxConstraint.AddSource(LocalSource(idIndex));
+    Dali::Integration::ConstraintSetInternalTag(mVideoLetterBoxConstraint, VIDEO_PLAYER_CONSTRAINT_TAG);
     mVideoLetterBoxConstraint.Apply();
   }
 }