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 public interface IMediaBuffer
27 /// Gets or sets a value at the specified index.
29 /// <param name="index">The index of the value to get or set.</param>
30 /// <exception cref="ArgumentOutOfRangeException">
31 /// <paramref name="index"/> is less than zero.\n
33 /// <paramref name="index"/> is equal to or greater than <see cref="Length"/>.
35 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
36 /// <exception cref="InvalidOperationException">The buffer is not available, i.e. not writable state.</exception>
44 /// Gets the size of the buffer, in bytes.
49 /// Gets the value indicating whether the <see cref="IMediaBuffer"/> is read-only.
51 /// <value> true if the <see cref="IMediaBuffer"/> is read-only; otherwise, false.</value>
52 bool IsReadOnly { get; }
55 /// Copies data from a byte array to the buffer.
57 /// <param name="dest">The array to copy to.</param>
58 /// <param name="startIndex">The zero-based index in the source array where copying should start.</param>
59 /// <param name="length">The number of array elements to copy.</param>
60 /// <exception cref="ArgumentNullException"><paramref name="dest"/> is null.</exception>
61 /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/> or <paramref name="length"/> is not valid.</exception>
62 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
63 void CopyTo(byte[] dest, int startIndex, int length);
66 /// Copies data from a byte array to the buffer.
68 /// <param name="dest">The array to copy to.</param>
69 /// <param name="startIndex">The zero-based index in the source array where copying should start.</param>
70 /// <param name="length">The number of array elements to copy.</param>
71 /// <param name="offset">The zero-based index in the buffer where copying should start.</param>
72 /// <exception cref="ArgumentNullException"><paramref name="dest"/> is null.</exception>
73 /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/>, <paramref name="length"/>,
74 /// or <paramref name="offset"/> is not valid.</exception>
75 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
76 void CopyTo(byte[] dest, int startIndex, int length, int offset);
79 /// Copies data from the buffer to a byte array.
81 /// <param name="source">The array to copy from.</param>
82 /// <param name="startIndex">The zero-based index in the destination array where copying should start.</param>
83 /// <param name="length">The number of elements to copy.</param>
84 /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
85 /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/> or <paramref name="length"/> is not valid.</exception>
86 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
87 /// <exception cref="InvalidOperationException">The buffer is not available. i.e. not writable state.</exception>
88 void CopyFrom(byte[] source, int startIndex, int length);
91 /// Copies data from the buffer to a byte array.
93 /// <param name="source">The array to copy from.</param>
94 /// <param name="startIndex">The zero-based index in the destination array where copying should start.</param>
95 /// <param name="length">The number of elements to copy.</param>
96 /// <param name="offset">The zero-based index in the buffer where copying should start.</param>
97 /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
98 /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/>, <paramref name="length"/>,
99 /// or <paramref name="offset"/> is not valid.</exception>
100 /// <exception cref="ObjectDisposedException">The object that owns the current buffer has already been disposed of.</exception>
101 /// <exception cref="InvalidOperationException">The buffer is not available. i.e. not writable state.</exception>
102 void CopyFrom(byte[] source, int startIndex, int length, int offset);