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
22 /// Provides functionality to read and write the media buffer.
24 /// <since_tizen> 3 </since_tizen>
25 public interface IMediaBuffer
28 /// Gets or sets a value at the specified index.
30 /// <param name="index">The index of the value to get or set.</param>
31 /// <exception cref="ArgumentOutOfRangeException">
32 /// <paramref name="index"/> is less than zero.<br/>
34 /// <paramref name="index"/> is equal to or greater than <see cref="Length"/>.
36 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
37 /// <exception cref="InvalidOperationException">The buffer is not available, i.e. not writable state.</exception>
38 /// <since_tizen> 4 </since_tizen>
46 /// Gets the size of the buffer, in bytes.
48 /// <since_tizen> 4 </since_tizen>
52 /// Gets the value indicating whether the <see cref="IMediaBuffer"/> is read-only.
54 /// <value> true if the <see cref="IMediaBuffer"/> is read-only; otherwise, false.</value>
55 /// <since_tizen> 4 </since_tizen>
56 bool IsReadOnly { get; }
59 /// Copies data from the buffer to a byte array.
61 /// <param name="dest">The array to copy to.</param>
62 /// <param name="startIndex">The zero-based index in the source array where copying should start.</param>
63 /// <param name="length">The number of array elements to copy.</param>
64 /// <exception cref="ArgumentNullException"><paramref name="dest"/> is null.</exception>
65 /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/> or <paramref name="length"/> is not valid.</exception>
66 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
67 /// <since_tizen> 4 </since_tizen>
68 void CopyTo(byte[] dest, int startIndex, int length);
71 /// Copies data from the buffer to a byte array.
73 /// <param name="dest">The array to copy to.</param>
74 /// <param name="startIndex">The zero-based index in the source array where copying should start.</param>
75 /// <param name="length">The number of array elements to copy.</param>
76 /// <param name="offset">The zero-based index in the buffer where copying should start.</param>
77 /// <exception cref="ArgumentNullException"><paramref name="dest"/> is null.</exception>
78 /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/>, <paramref name="length"/>,
79 /// or <paramref name="offset"/> is not valid.</exception>
80 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
81 /// <since_tizen> 4 </since_tizen>
82 void CopyTo(byte[] dest, int startIndex, int length, int offset);
85 /// Copies data from a byte array to the buffer.
87 /// <param name="source">The array to copy from.</param>
88 /// <param name="startIndex">The zero-based index in the destination array where copying should start.</param>
89 /// <param name="length">The number of elements to copy.</param>
90 /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
91 /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/> or <paramref name="length"/> is not valid.</exception>
92 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
93 /// <exception cref="InvalidOperationException">The buffer is not available. i.e. not writable state.</exception>
94 /// <since_tizen> 3 </since_tizen>
95 void CopyFrom(byte[] source, int startIndex, int length);
98 /// Copies data from a byte array to the buffer.
100 /// <param name="source">The array to copy from.</param>
101 /// <param name="startIndex">The zero-based index in the destination array where copying should start.</param>
102 /// <param name="length">The number of elements to copy.</param>
103 /// <param name="offset">The zero-based index in the buffer where copying should start.</param>
104 /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
105 /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/>, <paramref name="length"/>,
106 /// or <paramref name="offset"/> is not valid.</exception>
107 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
108 /// <exception cref="InvalidOperationException">The buffer is not available. i.e. not writable state.</exception>
109 /// <since_tizen> 3 </since_tizen>
110 void CopyFrom(byte[] source, int startIndex, int length, int offset);