2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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 namespace Tizen.Multimedia
21 internal enum DisplayType
24 /// Overlay surface display
29 /// Evas image object surface display
34 /// This disposes off buffers
39 internal interface IDisplayable<ErrorType>
41 ErrorType ApplyEvasDisplay(DisplayType type, EvasObject evasObject);
45 /// Provides a means to wrap various display types.
47 /// <seealso cref="Player"/>
48 /// <seealso cref="Camera"/>
49 /// <seealso cref="ScreenMirroring"/>
52 private Display(DisplayType type, EvasObject target)
56 throw new ArgumentNullException(nameof(target));
59 if (target == IntPtr.Zero)
61 throw new ArgumentException("The evas object is not realized.");
69 /// Initializes a new instance of the <see cref="Display"/> class with a <see cref="MediaView"/> class.
71 /// <feature>http://tizen.org/feature/multimedia.raw_video</feature>
72 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
73 public Display(MediaView mediaView) : this(DisplayType.Surface, mediaView)
75 ValidationUtil.ValidateFeatureSupported(Features.RawVideo);
79 /// Initializes a new instance of the <see cref="Display"/> class with a <see cref="Window"/> class.
81 public Display(Window window) : this(DisplayType.Overlay, window)
85 private EvasObject EvasObject { get; }
87 private DisplayType Type { get; }
89 private object _owner;
91 internal object Owner => _owner;
93 internal void SetOwner(object newOwner)
95 if (_owner != null && newOwner != null)
97 throw new ArgumentException("The display has already been assigned to another.");
103 internal ErrorType ApplyTo<ErrorType>(IDisplayable<ErrorType> target)
105 return target.ApplyEvasDisplay(Type, EvasObject);