It is only valid in the Player and so checking the feature is now placed in the Display property of it.
Change-Id: I539fc1595ab81874a4850a900d5327de1ba70a21
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
{
add
{
- ValidationUtil.ValidateFeatureSupported(Features.RawVideo);
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.RawVideo);
_videoFrameDecoded += value;
}
remove
{
- ValidationUtil.ValidateFeatureSupported(Features.RawVideo);
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.RawVideo);
_videoFrameDecoded -= value;
}
/// Gets or sets the display.
/// </summary>
/// <value>A <see cref="Multimedia.Display"/> that specifies the display.</value>
- /// <remarks>The player must be in the <see cref="PlayerState.Idle"/> state.</remarks>
+ /// <remarks>
+ /// The player must be in the <see cref="PlayerState.Idle"/> state.<br/>
+ /// The raw video feature(http://tizen.org/feature/multimedia.raw_video) is required if
+ /// the display is created with <see cref="MediaView"/>.
+ /// </remarks>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="ArgumentException">The value has already been assigned to another player.</exception>
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
/// <since_tizen> 3 </since_tizen>
public Display Display
{
{
ValidatePlayerState(PlayerState.Idle);
+ if (value != null && value.HasMediaView)
+ {
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.RawVideo);
+ }
+
if (value?.Owner != null)
{
if (ReferenceEquals(this, value.Owner))
{
if (_audioEffect == null)
{
- throw new NotSupportedException($"The feature({Features.AudioEffect}) is not supported.");
+ throw new NotSupportedException($"The feature({PlayerFeatures.AudioEffect}) is not supported.");
}
return _audioEffect;
RetrieveProperties();
- if (Features.IsSupported(Features.AudioEffect))
+ if (Features.IsSupported(PlayerFeatures.AudioEffect))
{
_audioEffect = new AudioEffect(this);
}
- if (Features.IsSupported(Features.RawVideo))
+ if (Features.IsSupported(PlayerFeatures.RawVideo))
{
RegisterVideoFrameDecodedCallback();
}
/// <since_tizen> 3 </since_tizen>
public async Task<CapturedFrame> CaptureVideoAsync()
{
- ValidationUtil.ValidateFeatureSupported(Features.RawVideo);
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.RawVideo);
ValidatePlayerState(PlayerState.Playing, PlayerState.Paused);
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Tizen.Multimedia
+{
+ internal static class PlayerFeatures
+ {
+ internal const string AudioEffect = "http://tizen.org/feature/multimedia.custom_audio_effect";
+ internal const string RawVideo = "http://tizen.org/feature/multimedia.raw_video";
+ }
+}
{
internal static class Features
{
- internal const string AudioEffect = "http://tizen.org/feature/multimedia.custom_audio_effect";
- internal const string RawVideo = "http://tizen.org/feature/multimedia.raw_video";
-
internal static bool IsSupported(string featureKey)
{
- bool supported = false;
- Information.TryGetValue(featureKey, out supported);
- return supported;
+ return Information.TryGetValue(featureKey, out bool supported) && supported;
}
}
/// Initializes a new instance of the <see cref="Display"/> class with a <see cref="MediaView"/> class.
/// </summary>
/// <param name="mediaView">A <see cref="MediaView"/> to display.</param>
- /// <feature>http://tizen.org/feature/multimedia.raw_video</feature>
- /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
/// <since_tizen> 3 </since_tizen>
public Display(MediaView mediaView)
{
- ValidationUtil.ValidateFeatureSupported(Features.RawVideo);
-
if (mediaView == null)
{
throw new ArgumentNullException(nameof(mediaView));
}
_setter = new EvasDisplaySetter(DisplayType.Surface, mediaView);
+
+ HasMediaView = true;
}
/// <summary>
private object _owner;
+ internal bool HasMediaView { get; } = false;
+
internal object Owner => _owner;
internal void SetOwner(object newOwner)