fae8ea98aa77158511c4c4c5f788adc026d22337
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Camera / Camera / EncodedPlane.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System.Runtime.InteropServices;
18 using static Interop.Camera;
19
20 namespace Tizen.Multimedia
21 {
22     /// <summary>
23     /// The class containing the encoded image data.
24     /// </summary>
25     /// <since_tizen> 3 </since_tizen>
26     public class EncodedPlane : IPreviewPlane
27     {
28         internal EncodedPlane(EncodedPlaneStruct unmanagedData)
29         {
30             Data = new byte[unmanagedData.DataLength];
31             Marshal.Copy(unmanagedData.Data, Data, 0, (int)unmanagedData.DataLength);
32
33             IsDeltaFrame = unmanagedData.IsDeltaFrame;
34         }
35
36         /// <summary>
37         /// The buffer containing the encoded image data.
38         /// </summary>
39         /// <since_tizen> 3 </since_tizen>
40         public byte[] Data { get; }
41
42         /// <summary>
43         /// The flag indicating whether the current frame is a delta frame or not.
44         /// </summary>
45         /// <since_tizen> 8 </since_tizen>
46         public bool IsDeltaFrame { get; }
47     }
48 }