Added APIs for setting display mode in video-player 59/170059/8
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 13 Feb 2018 06:13:13 +0000 (15:13 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Mon, 5 Mar 2018 09:01:28 +0000 (18:01 +0900)
Change-Id: I0ebffe5d69734f817dfa627c4f96c4c4763e85ec

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp [changed mode: 0644->0755]
automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp [changed mode: 0644->0755]
build/tizen/docs/dali.doxy.in [changed mode: 0644->0755]
dali-toolkit/internal/controls/video-view/video-view-impl.cpp [changed mode: 0644->0755]
dali-toolkit/internal/controls/video-view/video-view-impl.h [changed mode: 0644->0755]
dali-toolkit/public-api/controls/video-view/video-view.h [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 6e539eb..52e2d41
@@ -38,6 +38,7 @@ public:
     mMuted = false;
     mLooping = false;
     mPlayPosition = 0;
+    mDisplyMode = Dali::VideoPlayerPlugin::DisplayMode::DST_ROI;
   }
 
   void SetMuted( bool muted )
@@ -78,6 +79,17 @@ public:
     mPlayPosition = pos;
   }
 
+  Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const
+  {
+    return mDisplyMode;
+  }
+
+  void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mDisplyMode )
+  {
+    mDisplyMode = mDisplyMode;
+  }
+
+
 public:
 
   std::string mUrl;
@@ -90,6 +102,7 @@ private:
   bool mMuted;
   bool mLooping;
   int mPlayPosition;
+  Dali::VideoPlayerPlugin::DisplayMode::Type mDisplyMode;
 };
 
 inline VideoPlayer& GetImplementation( Dali::VideoPlayer& player )
@@ -261,5 +274,15 @@ Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
   return Dali::VideoPlayerPlugin::CodecType::DEFAULT;
 }
 
+void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
+{
+  Internal::Adaptor::GetImplementation( *this ).SetDisplayMode( mode );
+}
+
+Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
+{
+  return Internal::Adaptor::GetImplementation( *this ).GetDisplayMode();
+}
+
 } // namespace Dali;
 
old mode 100644 (file)
new mode 100755 (executable)
index 4ea5bd3..d1d35b1
@@ -507,3 +507,24 @@ int UtcDaliVideoViewNew2(void)
 
   END_TEST;
 }
+
+int UtcDaliVideoViewPropertyDisplayMode(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliVideoViewPropertyDisplayMode");
+
+  VideoView view = VideoView::New();
+  DALI_TEST_CHECK( view );
+
+  Stage::GetCurrent().Add( view );
+  view.Play();
+
+  application.SendNotification();
+  application.Render();
+
+  view.SetProperty( Toolkit::VideoView::Property::DISPLAY_MODE, Toolkit::VideoView::DisplayMode::DST_ROI );
+  int displayMode = view.GetProperty( Toolkit::VideoView::Property::DISPLAY_MODE ).Get< int >();
+  DALI_TEST_CHECK( displayMode == Toolkit::VideoView::DisplayMode::DST_ROI );
+
+  END_TEST;
+}
old mode 100644 (file)
new mode 100755 (executable)
index f95ad4a..1b23769
@@ -358,7 +358,7 @@ ALIASES += SINCE_1_2_32="@since 1.2.32"
 ALIASES += SINCE_1_3_4="@since 1.3.4"
 ALIASES += SINCE_1_3_5="@since 1.3.5"
 ALIASES += SINCE_1_3_9="@since 1.3.9"
-
+ALIASES += SINCE_1_3_15="@since 1.3.15"
 ALIASES += DEPRECATED_1_0="@deprecated Deprecated since 1.0"
 ALIASES += DEPRECATED_1_1="@deprecated Deprecated since 1.1"
 ALIASES += DEPRECATED_1_2_8="@deprecated Deprecated since 1.2.8"
@@ -393,6 +393,7 @@ ALIASES += REMARK_RAWVIDEO=""
 #ALIASES += SINCE_1_3_4="\par Since:\n 4.0, DALi version 1.3.4"
 #ALIASES += SINCE_1_3_5="\par Since:\n 4.0, DALi version 1.3.5"
 #ALIASES += SINCE_1_3_9="\par Since:\n 4.0, DALi version 1.3.9"
+#ALIASES += SINCE_1_3_15="\par Since:\n 4.0, DALi version 1.3.15"
 
 ## DALi has no deprecated API in Tizen 2.4 because it's DALi's first release.
 ## Thus deprecated APIs in DALi 1.0.xx will be deprecated in Tizen 3.0.
old mode 100644 (file)
new mode 100755 (executable)
index 5876633..fe3088d
@@ -64,6 +64,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "muted", BOOLEAN, MUTED )
 DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "volume", MAP, VOLUME )
 DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "underlay", BOOLEAN, UNDERLAY )
 DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "playPosition", INTEGER, PLAY_POSITION )
+DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "displayMode", INTEGER, DISPLAY_MODE )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, VideoView, "finished", FINISHED_SIGNAL )
 
@@ -461,6 +462,15 @@ void VideoView::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::VideoView::Property::DISPLAY_MODE:
+      {
+        int mode;
+        if( value.Get( mode ) )
+        {
+          impl.SetDisplayMode( mode );
+        }
+        break;
+      }
     }
   }
 }
@@ -519,6 +529,11 @@ Property::Value VideoView::GetProperty( BaseObject* object, Property::Index prop
         value = impl.GetPlayPosition();
         break;
       }
+      case Toolkit::VideoView::Property::DISPLAY_MODE:
+      {
+        value = impl.GetDisplayMode();
+        break;
+      }
     }
   }
 
@@ -763,6 +778,16 @@ void VideoView::SetPlayPosition( int pos )
   mVideoPlayer.SetPlayPosition( pos );
 }
 
+void VideoView::SetDisplayMode( int mode )
+{
+  mVideoPlayer.SetDisplayMode( static_cast< Dali::VideoPlayerPlugin::DisplayMode::Type >( mode ) );
+}
+
+int VideoView::GetDisplayMode() const
+{
+  return static_cast< int >( mVideoPlayer.GetDisplayMode() );
+}
+
 } // namespace Internal
 
 } // namespace toolkit
old mode 100644 (file)
new mode 100755 (executable)
index 1f58785..728539a
@@ -239,6 +239,16 @@ public:
    */
   void SetPlayPosition( int pos );
 
+  /**
+   * @brief Sets Display mode.
+   */
+  void SetDisplayMode( int mode );
+
+  /**
+   * @brief Gets Display mode.
+   */
+  int GetDisplayMode() const;
+
 private: // From Control
 
   /**
old mode 100644 (file)
new mode 100755 (executable)
index 0933801..4f0e12e
@@ -122,7 +122,54 @@ public:
        * @details Name "playPosition", type Property::INTEGER
        * @SINCE_1_3_9
        */
-      PLAY_POSITION
+      PLAY_POSITION,
+
+      /**
+        * @brief The display mode of the video.
+        * @SINCE_1_3_15
+        */
+      DISPLAY_MODE
+    };
+  };
+
+  /**
+   * @brief The values of this enum determine how the video should be display mode to the view
+   * @SINCE_1_3_15
+   */
+  struct DisplayMode
+  {
+    enum Type
+    {
+      /**
+       * @brief Letter box
+       * @SINCE_1_3_15
+       */
+      LETTER_BOX = 0,
+      /**
+       * @brief Origin size
+       * @SINCE_1_3_15
+       */
+      ORIGIN_SIZE,
+      /**
+       * @brief Full-screen
+       * @SINCE_1_3_15
+       */
+      FULL_SCREEN,
+      /**
+       * @brief Cropped full-screen
+       * @SINCE_1_3_15
+       */
+      CROPPED_FULL,
+      /**
+       * @brief  Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size)
+       * @SINCE_1_3_15
+       */
+      ORIGIN_OR_LETTER,
+      /**
+       * @brief  Region of Interest
+       * @SINCE_1_3_15
+       */
+      DST_ROI
     };
   };