2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/devel-api/adaptor-framework/video-player.h>
22 #include <dali/public-api/object/any.h>
25 #include <dali/internal/video/common/video-player-impl.h>
29 VideoPlayer::VideoPlayer()
33 VideoPlayer::VideoPlayer(Internal::Adaptor::VideoPlayer* internal)
34 : BaseHandle(internal)
38 VideoPlayer::~VideoPlayer()
42 VideoPlayer VideoPlayer::New()
44 Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
49 player->Initialize(actor, VideoSyncMode::DISABLED);
52 return VideoPlayer(player.Get());
55 VideoPlayer VideoPlayer::New(Dali::Actor actor, VideoSyncMode syncMode)
57 Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
61 player->Initialize(actor, syncMode);
64 return VideoPlayer(player.Get());
67 VideoPlayer::VideoPlayer(const VideoPlayer& player)
72 VideoPlayer& VideoPlayer::operator=(const VideoPlayer& player)
76 BaseHandle::operator=(player);
81 VideoPlayer VideoPlayer::DownCast(BaseHandle handle)
83 return VideoPlayer(dynamic_cast<Internal::Adaptor::VideoPlayer*>(handle.GetObjectPtr()));
86 void VideoPlayer::SetUrl(const std::string& url)
88 GetImplementation(*this).SetUrl(url);
91 std::string VideoPlayer::GetUrl()
93 return GetImplementation(*this).GetUrl();
96 void VideoPlayer::SetLooping(bool looping)
98 GetImplementation(*this).SetLooping(looping);
101 bool VideoPlayer::IsLooping()
103 return GetImplementation(*this).IsLooping();
106 void VideoPlayer::Play()
108 GetImplementation(*this).Play();
111 void VideoPlayer::Pause()
113 GetImplementation(*this).Pause();
116 void VideoPlayer::Stop()
118 GetImplementation(*this).Stop();
121 void VideoPlayer::SetMute(bool mute)
123 GetImplementation(*this).SetMute(mute);
126 bool VideoPlayer::IsMuted()
128 return GetImplementation(*this).IsMuted();
131 void VideoPlayer::SetVolume(float left, float right)
133 GetImplementation(*this).SetVolume(left, right);
136 void VideoPlayer::GetVolume(float& left, float& right)
138 GetImplementation(*this).GetVolume(left, right);
141 void VideoPlayer::SetRenderingTarget(Any target)
143 GetImplementation(*this).SetRenderingTarget(target);
146 void VideoPlayer::SetPlayPosition(int millisecond)
148 GetImplementation(*this).SetPlayPosition(millisecond);
151 int VideoPlayer::GetPlayPosition()
153 return GetImplementation(*this).GetPlayPosition();
156 void VideoPlayer::SetDisplayArea(DisplayArea area)
158 GetImplementation(*this).SetDisplayArea(area);
161 void VideoPlayer::SetDisplayRotation(Dali::VideoPlayerPlugin::DisplayRotation rotation)
163 GetImplementation(*this).SetDisplayRotation(rotation);
166 Dali::VideoPlayerPlugin::DisplayRotation VideoPlayer::GetDisplayRotation()
168 return GetImplementation(*this).GetDisplayRotation();
171 Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal()
173 return GetImplementation(*this).FinishedSignal();
176 void VideoPlayer::Forward(int millisecond)
178 GetImplementation(*this).Forward(millisecond);
181 void VideoPlayer::Backward(int millisecond)
183 GetImplementation(*this).Backward(millisecond);
186 bool VideoPlayer::IsVideoTextureSupported()
188 return GetImplementation(*this).IsVideoTextureSupported();
191 void VideoPlayer::SetCodecType(Dali::VideoPlayerPlugin::CodecType type)
193 GetImplementation(*this).SetCodecType(type);
196 Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
198 return GetImplementation(*this).GetCodecType();
201 void VideoPlayer::SetDisplayMode(Dali::VideoPlayerPlugin::DisplayMode::Type mode)
203 GetImplementation(*this).SetDisplayMode(mode);
206 Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
208 return GetImplementation(*this).GetDisplayMode();
211 Any VideoPlayer::GetMediaPlayer()
213 return GetImplementation(*this).GetMediaPlayer();
216 void VideoPlayer::StartSynchronization()
218 GetImplementation(*this).StartSynchronization();
221 void VideoPlayer::FinishSynchronization()
223 GetImplementation(*this).FinishSynchronization();
226 void VideoPlayer::RaiseAbove(Dali::VideoPlayer target)
228 GetImplementation(*this).RaiseAbove(target);
231 void VideoPlayer::LowerBelow(Dali::VideoPlayer target)
233 GetImplementation(*this).LowerBelow(target);
236 void VideoPlayer::RaiseToTop()
238 GetImplementation(*this).RaiseToTop();
241 void VideoPlayer::LowerToBottom()
243 GetImplementation(*this).LowerToBottom();