Removed MediaCodec files.
authorcoderhyme <jhyo.kim@samsung.com>
Fri, 12 May 2017 05:25:17 +0000 (14:25 +0900)
committercoderhyme <jhyo.kim@samsung.com>
Fri, 12 May 2017 06:04:17 +0000 (15:04 +0900)
MediaCodec is now a separated assembly.

Change-Id: I5c4dd85fd8cd22b763233bb48604749ebc2defa4
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
src/Tizen.Multimedia/MediaCodec/BufferStatusChangedEventArgs.cs [deleted file]
src/Tizen.Multimedia/MediaCodec/InputProcessedEventArgs.cs [deleted file]
src/Tizen.Multimedia/MediaCodec/MediaCodec.cs [deleted file]
src/Tizen.Multimedia/MediaCodec/MediaCodecError.cs [deleted file]
src/Tizen.Multimedia/MediaCodec/MediaCodecErrorOccurredEventArgs.cs [deleted file]
src/Tizen.Multimedia/MediaCodec/MediaCodecStatus.cs [deleted file]
src/Tizen.Multimedia/MediaCodec/MediaCodecType.cs [deleted file]
src/Tizen.Multimedia/MediaCodec/OutputAvailableEventArgs.cs [deleted file]
src/Tizen.Multimedia/MediaCodec/SupportedCodecType.cs [deleted file]
src/Tizen.Multimedia/Tizen.Multimedia.csproj

diff --git a/src/Tizen.Multimedia/MediaCodec/BufferStatusChangedEventArgs.cs b/src/Tizen.Multimedia/MediaCodec/BufferStatusChangedEventArgs.cs
deleted file mode 100644 (file)
index 6beac7c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-
-namespace Tizen.Multimedia.MediaCodec
-{
-    /// <summary>
-    /// Provides data for the <see cref="MediaCodec.BufferStatusChanged"/> event.
-    /// </summary>
-    public class BufferStatusChangedEventArgs : EventArgs
-    {
-        /// <summary>
-        /// Initializes a new instance of the BufferStatusChangedEventArgs class.
-        /// </summary>
-        /// <param name="status">The value representing new status of the codec.</param>
-        public BufferStatusChangedEventArgs(MediaCodecStatus status)
-        {
-            Status = status;
-        }
-
-        /// <summary>
-        /// Gets the value indicating new status of the codec.
-        /// </summary>
-        public MediaCodecStatus Status { get; }
-
-    }
-}
diff --git a/src/Tizen.Multimedia/MediaCodec/InputProcessedEventArgs.cs b/src/Tizen.Multimedia/MediaCodec/InputProcessedEventArgs.cs
deleted file mode 100644 (file)
index 1883d95..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Diagnostics;
-
-namespace Tizen.Multimedia.MediaCodec
-{
-    /// <summary>
-    /// Provides data for the <see cref="MediaCodec.InputProcessed"/> event.
-    /// </summary>
-    public class InputProcessedEventArgs : EventArgs
-    {
-        /// <summary>
-        /// Initializes a new instance of the InputProcessedEventArgs class.
-        /// </summary>
-        /// <param name="packet">The packet that the codec has processed.</param>
-        internal InputProcessedEventArgs(MediaPacket packet)
-        {
-            Debug.Assert(packet != null);
-
-            Packet = packet;
-        }
-
-        /// <summary>
-        /// Gets the packet that the codec has processed.
-        /// </summary>
-        public MediaPacket Packet { get; }
-    }
-}
diff --git a/src/Tizen.Multimedia/MediaCodec/MediaCodec.cs b/src/Tizen.Multimedia/MediaCodec/MediaCodec.cs
deleted file mode 100644 (file)
index be828ae..0000000
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-
-namespace Tizen.Multimedia.MediaCodec
-{
-    /// <summary>
-    /// Provides the means to encode and decode video and audio data.
-    /// </summary>
-    public class MediaCodec : IDisposable
-    {
-        private static readonly int CodecTypeMask = 0xFFFF;
-        private static readonly int CodecKindMask = 0x3000;
-        private static readonly int CodecKindAudio = 0x1000;
-        private static readonly int CodecKindVideo = 0x2000;
-
-        private IntPtr _handle;
-
-        /// <summary>
-        /// Initialize a new instance of the MediaCodec class.
-        /// </summary>
-        public MediaCodec()
-        {
-            int ret = Interop.MediaCodec.Create(out _handle);
-
-            if (ret == (int)MediaCodecErrorCode.InvalidOperation)
-            {
-                throw new InvalidOperationException("Not able to initialize a new media codec.");
-            }
-
-            MultimediaDebug.AssertNoError(ret);
-
-            RegisterInputProcessed();
-            RegisterErrorOccurred();
-        }
-
-        #region IDisposable-support
-        private bool _isDisposed = false;
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (!_isDisposed)
-            {
-                if (_handle != IntPtr.Zero)
-                {
-                    Interop.MediaCodec.Destroy(_handle);
-                    _handle = IntPtr.Zero;
-                }
-
-                _isDisposed = true;
-            }
-        }
-
-        ~MediaCodec()
-        {
-            Dispose(false);
-        }
-
-        public void Dispose()
-        {
-            Dispose(true);
-
-            GC.SuppressFinalize(this);
-        }
-        #endregion
-
-        /// <summary>
-        /// Validates if the object already has been disposed of.
-        /// </summary>
-        /// <exception cref="ObjectDisposedException">The current object has been disposed of.</exception>
-        private void ValidateNotDisposed()
-        {
-            if (_isDisposed)
-            {
-                throw new ObjectDisposedException(nameof(MediaCodec));
-            }
-        }
-
-        private static IEnumerable<MediaFormatVideoMimeType> _supportedVideoCodecs;
-
-        /// <summary>
-        /// Gets the audio codec list that the current device supports.
-        /// </summary>
-        public static IEnumerable<MediaFormatVideoMimeType> SupportedVideoCodecs
-        {
-            get
-            {
-                if (_supportedVideoCodecs == null)
-                {
-                    LoadSupportedCodec();
-                }
-
-                return _supportedVideoCodecs;
-            }
-        }
-
-        private static IEnumerable<MediaFormatAudioMimeType> _supportedAudioCodecs;
-
-
-        /// <summary>
-        /// Gets the audio codec list that the current device supports.
-        /// </summary>
-        public static IEnumerable<MediaFormatAudioMimeType> SupportedAudioCodecs
-        {
-            get
-            {
-                if (_supportedAudioCodecs == null)
-                {
-                    LoadSupportedCodec();
-                }
-
-                return _supportedAudioCodecs;
-            }
-        }
-
-        private static bool TryGetMimeTypeFromCodecType<T>(int codecType, ref T result)
-        {
-            if (codecType == -1)
-            {
-                return false;
-            }
-
-            foreach (T value in Enum.GetValues(typeof(T)))
-            {
-                if ((Convert.ToInt32(value) & CodecTypeMask) == codecType)
-                {
-                    result = value;
-                    return true;
-                }
-            }
-
-            Debug.Fail($"Unknown codec : { codecType }.");
-            return false;
-        }
-
-        private static void LoadSupportedCodec()
-        {
-            var videoCodecList = new List<MediaFormatVideoMimeType>();
-            var audioCodecList = new List<MediaFormatAudioMimeType>();
-
-            Interop.MediaCodec.SupportedCodecCallback cb = (codecType, _) =>
-            {
-                if ((codecType & CodecKindMask) == CodecKindVideo)
-                {
-                    MediaFormatVideoMimeType mimeType = 0;
-                    if (TryGetMimeTypeFromCodecType(codecType, ref mimeType))
-                    {
-                        videoCodecList.Add(mimeType);
-                    }
-                }
-                else
-                {
-                    MediaFormatAudioMimeType mimeType = 0;
-                    if (TryGetMimeTypeFromCodecType(codecType, ref mimeType))
-                    {
-                        audioCodecList.Add(mimeType);
-                    }
-                }
-
-                return true;
-            };
-
-            int ret = Interop.MediaCodec.ForeachSupportedCodec(cb, IntPtr.Zero);
-
-            MultimediaDebug.AssertNoError(ret);
-
-            _supportedVideoCodecs = videoCodecList.AsReadOnly();
-            _supportedAudioCodecs = audioCodecList.AsReadOnly();
-        }
-
-        /// <summary>
-        /// Prepares the MediaCodec for encoding or decoding.
-        /// </summary>
-        /// <exception cref="InvalidOperationException">
-        ///     The codec is not configured, yet.
-        ///     <para>-or-</para>
-        ///     Internal error.
-        /// </exception>
-        public void Prepare()
-        {
-            ValidateNotDisposed();
-
-            int ret = Interop.MediaCodec.Prepare(_handle);
-
-            if (ret == (int)MediaCodecErrorCode.NotInitialized)
-            {
-                throw new InvalidOperationException("The codec is not configured.");
-            }
-            if (ret != (int)MediaCodecErrorCode.None)
-            {
-                throw new InvalidOperationException("Operation failed.");
-            }
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        /// <summary>
-        /// Unprepares the MediaCodec.
-        /// </summary>
-        public void Unprepare()
-        {
-            ValidateNotDisposed();
-
-            int ret = Interop.MediaCodec.Unprepare(_handle);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        /// <summary>
-        /// Configures the MediaCodec.
-        /// </summary>
-        /// <param name="format">The <see cref="MediaFormat"/> for properties of media data to decode or encode.</param>
-        /// <param name="encoder">The value indicating whether the codec works as a encoder or a decoder.</param>
-        /// <param name="codecType">The value indicating whether the codec uses hardware acceleration.</param>
-        /// <exception cref="ArgumentNullException">format is null</exception>
-        /// <exception cref="ArgumentException">
-        ///     codecType is invalid.
-        ///     <para>-or-</para>
-        ///     format is neither audio type or video type.
-        ///     </exception>
-        /// <exception cref="NotSupportedException">the mime type of the format is not supported.</exception>
-        /// <see cref="SupportedAudioCodecs"/>
-        /// <see cref="SupportedVideoCodecs"/>
-        public void Configure(MediaFormat format, bool encoder, MediaCodecTypes codecType)
-        {
-            ValidateNotDisposed();
-
-            if (format == null)
-            {
-                throw new ArgumentNullException(nameof(format));
-            }
-
-            if (codecType != MediaCodecTypes.Hardware && codecType != MediaCodecTypes.Software)
-            {
-                throw new ArgumentException("codecType is invalid.");
-            }
-
-            if (format.Type == MediaFormatType.Audio)
-            {
-                ConfigureAudio((AudioMediaFormat)format, encoder, codecType);
-            }
-            else if (format.Type == MediaFormatType.Video)
-            {
-                ConfigureVideo((VideoMediaFormat)format, encoder, codecType);
-            }
-            else
-            {
-                throw new ArgumentException("Only video and audio formats are allowed.");
-            }
-        }
-
-        private void ConfigureAudio(AudioMediaFormat format, bool encoder,
-            MediaCodecTypes supportType)
-        {
-            int codecType = (int)format.MimeType & CodecTypeMask;
-
-            if (!Enum.IsDefined(typeof(SupportedCodecType), codecType))
-            {
-                throw new NotSupportedException("The format is not supported " +
-                    $"mime type : { Enum.GetName(typeof(MediaFormatAudioMimeType), format.MimeType) }");
-            }
-
-            DoConfigure(codecType, encoder, supportType);
-
-            if (encoder)
-            {
-                int ret = Interop.MediaCodec.SetAudioEncoderInfo(_handle, format.SampleRate,
-                    format.Channel, format.Bit, format.BitRate);
-
-                MultimediaDebug.AssertNoError(ret);
-            }
-            else
-            {
-                int ret = Interop.MediaCodec.SetAudioDecoderInfo(_handle, format.SampleRate,
-                    format.Channel, format.Bit);
-
-                MultimediaDebug.AssertNoError(ret);
-            }
-        }
-
-        private void ConfigureVideo(VideoMediaFormat format, bool encoder,
-            MediaCodecTypes supportType)
-        {
-            int codecType = (int)format.MimeType & CodecTypeMask;
-
-            if (!Enum.IsDefined(typeof(SupportedCodecType), codecType))
-            {
-                throw new NotSupportedException("The format is not supported." +
-                    $"mime type : { Enum.GetName(typeof(MediaFormatVideoMimeType), format.MimeType) }");
-            }
-
-            DoConfigure(codecType, encoder, supportType);
-
-            if (encoder)
-            {
-                int ret = Interop.MediaCodec.SetVideoEncoderInfo(_handle, format.Size.Width,
-                    format.Size.Height, format.FrameRate, format.BitRate / 1000);
-
-                MultimediaDebug.AssertNoError(ret);
-            }
-            else
-            {
-                int ret = Interop.MediaCodec.SetVideoDecoderInfo(_handle, format.Size.Width, format.Size.Height);
-
-                MultimediaDebug.AssertNoError(ret);
-            }
-        }
-
-        private void DoConfigure(int codecType, bool encoder, MediaCodecTypes supportType)
-        {
-            Debug.Assert(Enum.IsDefined(typeof(SupportedCodecType), codecType));
-
-            int flags = (int)(encoder ? MediaCodecCodingType.Encoder : MediaCodecCodingType.Decoder);
-
-            flags |= (int)supportType;
-
-            int ret = Interop.MediaCodec.Configure(_handle, codecType, flags);
-
-            if (ret == (int)MediaCodecErrorCode.NotSupportedOnDevice)
-            {
-                throw new NotSupportedException("The format is not supported.");
-            }
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        /// <summary>
-        /// Adds the packet to the internal queue of the codec.
-        /// </summary>
-        /// <param name="packet">The packet to be encoded or decoded.</param>
-        /// <exception cref="ArgumentNullException">packet is null.</exception>
-        /// <exception cref="InvalidOperationException">the current codec is not prepared, yet.</exception>
-        /// <remarks>Any attempts to modify the packet will be failed until the <see cref="InputProcessed"/> event for the packet is invoked.</remarks>
-        public void ProcessInput(MediaPacket packet)
-        {
-            ValidateNotDisposed();
-
-            if (packet == null)
-            {
-                throw new ArgumentNullException(nameof(packet));
-            }
-
-            MediaPacket.Lock packetLock = MediaPacket.Lock.Get(packet);
-
-            int ret = Interop.MediaCodec.Process(_handle, packetLock.GetHandle(), 0);
-
-            if (ret == (int)MediaCodecErrorCode.InvalidState)
-            {
-                throw new InvalidOperationException("The codec is in invalid state.");
-            }
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        /// <summary>
-        /// Flushes both input and output buffers.
-        /// </summary>
-        public void FlushBuffers()
-        {
-            ValidateNotDisposed();
-
-            int ret = Interop.MediaCodec.FlushBuffers(_handle);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        /// <summary>
-        /// Retrieves supported codec types for the specified params.
-        /// </summary>
-        /// <param name="encoder">The value indicating encoder or decoder.</param>
-        /// <param name="type">The mime type to query.</param>
-        /// <returns>The values indicating which codec types are supported on the current device.</returns>
-        /// <exception cref="ArgumentException">type is invalid.</exception>
-        public MediaCodecTypes GetCodecType(bool encoder, MediaFormatVideoMimeType type)
-        {
-            ValidateNotDisposed();
-
-            if (CheckMimeType(typeof(MediaFormatVideoMimeType), (int)type) == false)
-            {
-                return 0;
-            }
-
-            return GetCodecType((int)type, encoder);
-        }
-
-        /// <summary>
-        /// Retrieves supported codec types for the specified params.
-        /// </summary>
-        /// <param name="encoder">The value indicating encoder or decoder.</param>
-        /// <param name="type">The mime type to query.</param>
-        /// <returns>The values indicating which codec types are supported on the current device.</returns>
-        /// <exception cref="ArgumentException">type is invalid.</exception>
-        public MediaCodecTypes GetCodecType(bool encoder, MediaFormatAudioMimeType type)
-        {
-            ValidateNotDisposed();
-
-            if (CheckMimeType(typeof(MediaFormatAudioMimeType), (int)type) == false)
-            {
-                return 0;
-            }
-
-            return GetCodecType((int)type, encoder);
-        }
-
-        private MediaCodecTypes GetCodecType(int mimeType, bool isEncoder)
-        {
-            int codecType = mimeType & CodecTypeMask;
-            int value = 0;
-
-            int ret = Interop.MediaCodec.GetSupportedType(_handle, codecType, isEncoder, out value);
-
-            MultimediaDebug.AssertNoError(ret);
-
-            return (MediaCodecTypes)value;
-        }
-
-        private bool CheckMimeType(Type type, int value)
-        {
-            int codecType = value & CodecTypeMask;
-
-            if (!Enum.IsDefined(type, value))
-            {
-                throw new ArgumentException($"The mime type value is invalid : { value }.");
-            }
-
-            return Enum.IsDefined(typeof(SupportedCodecType), codecType);
-        }
-
-        #region OutputAvailable event
-        private EventHandler<OutputAvailableEventArgs> _outputAvailable;
-        private Interop.MediaCodec.OutputBufferAvailableCallback _outputBufferAvailableCb;
-
-        /// <summary>
-        /// Occurs when an output buffer is available.
-        /// </summary>
-        /// <remarks>The output packet needs to be disposed after it is used to clean up unmanaged resources.</remarks>
-        public event EventHandler<OutputAvailableEventArgs> OutputAvailable
-        {
-            add
-            {
-                ValidateNotDisposed();
-
-                if (_outputAvailable == null)
-                {
-                    RegisterOutputAvailableCallback();
-                }
-                _outputAvailable += value;
-
-            }
-            remove
-            {
-                ValidateNotDisposed();
-
-                _outputAvailable -= value;
-                if (_outputAvailable == null)
-                {
-                    UnregisterOutputAvailableCallback();
-                }
-            }
-        }
-
-        private void RegisterOutputAvailableCallback()
-        {
-            _outputBufferAvailableCb = (packetHandle, _) =>
-            {
-                OutputAvailableEventArgs args = null;
-
-                try
-                {
-                    args = new OutputAvailableEventArgs(packetHandle);
-                }
-                catch (Exception)
-                {
-                    Interop.MediaPacket.Destroy(packetHandle);
-
-                    // TODO should we throw it to unmanaged code?
-                    throw;
-                }
-
-                //TODO dispose if no event handler registered
-                _outputAvailable?.Invoke(this, args);
-            };
-
-            int ret = Interop.MediaCodec.SetOutputBufferAvaiableCb(_handle,
-                _outputBufferAvailableCb, IntPtr.Zero);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        private void UnregisterOutputAvailableCallback()
-        {
-            int ret = Interop.MediaCodec.UnsetOutputBufferAvaiableCb(_handle);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-        #endregion
-
-        #region InputProcessed event
-        private Interop.MediaCodec.InputBufferUsedCallback _inputBufferUsedCb;
-
-        /// <summary>
-        /// Occurs when an input packet is processed.
-        /// </summary>
-        /// <see cref="ProcessInput(MediaPacket)"/>
-        public event EventHandler<InputProcessedEventArgs> InputProcessed;
-
-        private void RegisterInputProcessed()
-        {
-            _inputBufferUsedCb = (lockedPacketHandle, _) =>
-            {
-                MediaPacket packet = null;
-
-                // Lock must be disposed here, note that the packet won't be disposed.
-                using (MediaPacket.Lock packetLock =
-                    MediaPacket.Lock.FromHandle(lockedPacketHandle))
-                {
-                    Debug.Assert(packetLock != null);
-
-                    packet = packetLock.MediaPacket;
-                }
-                Debug.Assert(packet != null);
-
-                InputProcessed?.Invoke(this, new InputProcessedEventArgs(packet));
-            };
-
-            int ret = Interop.MediaCodec.SetInputBufferUsedCb(_handle,
-                _inputBufferUsedCb, IntPtr.Zero);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        private void UnregisterInputProcessed()
-        {
-            int ret = Interop.MediaCodec.UnsetInputBufferUsedCb(_handle);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-        #endregion
-
-        #region ErrorOccurred event
-        private Interop.MediaCodec.ErrorCallback _errorCb;
-
-        /// <summary>
-        /// Occurs whenever an error is produced in the codec.
-        /// </summary>
-        public event EventHandler<MediaCodecErrorOccurredEventArgs> ErrorOccurred;
-
-        private void RegisterErrorOccurred()
-        {
-            _errorCb = (errorCode, _) =>
-            {
-                MediaCodecError error = (Enum.IsDefined(typeof(MediaCodecError), errorCode)) ?
-                    (MediaCodecError)errorCode : MediaCodecError.InternalError;
-
-                ErrorOccurred?.Invoke(this, new MediaCodecErrorOccurredEventArgs(error));
-            };
-            int ret = Interop.MediaCodec.SetErrorCb(_handle, _errorCb, IntPtr.Zero);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        private void UnregisterErrorOccurred()
-        {
-            int ret = Interop.MediaCodec.UnsetErrorCb(_handle);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-        #endregion
-
-        #region EosReached event
-        private EventHandler<EventArgs> _eosReached;
-        private Interop.MediaCodec.EosCallback _eosCb;
-
-        // TODO replace
-        /// <summary>
-        /// Occurs when the codec processes all input data.
-        /// </summary>
-        public event EventHandler<EventArgs> EosReached
-        {
-            add
-            {
-                ValidateNotDisposed();
-
-                if (_eosReached == null)
-                {
-                    RegisterEosReached();
-                }
-                _eosReached += value;
-
-            }
-            remove
-            {
-                ValidateNotDisposed();
-
-                _eosReached -= value;
-                if (_eosReached == null)
-                {
-                    UnregisterEosReached();
-                }
-            }
-        }
-
-        private void RegisterEosReached()
-        {
-            _eosCb = _ => _eosReached?.Invoke(this, EventArgs.Empty);
-
-            int ret = Interop.MediaCodec.SetEosCb(_handle, _eosCb, IntPtr.Zero);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        private void UnregisterEosReached()
-        {
-            int ret = Interop.MediaCodec.UnsetEosCb(_handle);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-        #endregion
-
-        #region BufferStatusChanged event
-        private EventHandler<BufferStatusChangedEventArgs> _bufferStatusChanged;
-        private Interop.MediaCodec.BufferStatusCallback _bufferStatusCb;
-
-        /// <summary>
-        /// Occurs when the codec needs more data or has enough data.
-        /// </summary>
-        public event EventHandler<BufferStatusChangedEventArgs> BufferStatusChanged
-        {
-            add
-            {
-                ValidateNotDisposed();
-
-                if (_bufferStatusChanged == null)
-                {
-                    RegisterBufferStatusChanged();
-                }
-                _bufferStatusChanged += value;
-
-            }
-            remove
-            {
-                ValidateNotDisposed();
-
-                _bufferStatusChanged -= value;
-                if (_bufferStatusChanged == null)
-                {
-                    UnregisterBufferStatusChanged();
-                }
-            }
-        }
-
-        private void RegisterBufferStatusChanged()
-        {
-            _bufferStatusCb = (statusCode, _) =>
-            {
-                Debug.Assert(Enum.IsDefined(typeof(MediaCodecStatus), statusCode),
-                    $"{ statusCode } is not defined in MediaCodecStatus!");
-
-                _bufferStatusChanged?.Invoke(this,
-                    new BufferStatusChangedEventArgs((MediaCodecStatus)statusCode));
-            };
-
-            int ret = Interop.MediaCodec.SetBufferStatusCb(_handle, _bufferStatusCb, IntPtr.Zero);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-
-        private void UnregisterBufferStatusChanged()
-        {
-            int ret = Interop.MediaCodec.UnsetBufferStatusCb(_handle);
-
-            MultimediaDebug.AssertNoError(ret);
-        }
-        #endregion
-    }
-}
diff --git a/src/Tizen.Multimedia/MediaCodec/MediaCodecError.cs b/src/Tizen.Multimedia/MediaCodec/MediaCodecError.cs
deleted file mode 100644 (file)
index 14508f2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-
-using Tizen.Internals.Errors;
-
-namespace Tizen.Multimedia.MediaCodec
-{
-    internal enum MediaCodecErrorCode
-    {
-        CodecDefinedBase = -0x019B0000,
-
-        None = ErrorCode.None,
-        OutOfMemory = ErrorCode.OutOfMemory,
-        InvalidParameter = ErrorCode.InvalidParameter,
-        InvalidOperation = ErrorCode.InvalidParameter,
-        NotSupportedOnDevice = ErrorCode.NotSupported,
-        PermissionDenied = ErrorCode.PermissionDenied,
-
-        InvalidState = CodecDefinedBase | 0x01,
-        InvalidInBuffer = CodecDefinedBase | 0x02,
-        InvalidOutBuffer = CodecDefinedBase | 0x03,
-        Internal = CodecDefinedBase | 0x04,
-        NotInitialized = CodecDefinedBase | 0x05,
-        InvalidStream = CodecDefinedBase | 0x06,
-        CodecNotFound = CodecDefinedBase | 0x07,
-        DecodingError = CodecDefinedBase | 0x08,
-        OutOfStorage = CodecDefinedBase | 0x09,
-        StreamNotFound = CodecDefinedBase | 0x0a,
-        NotSupportedFormat = CodecDefinedBase | 0x0b,
-        NoAvailableBuffer = CodecDefinedBase | 0x0c,
-        OverflowInBuffer = CodecDefinedBase | 0x0d,
-    }
-
-    public enum MediaCodecError
-    {
-        NotSupportedFormat = MediaCodecErrorCode.NotSupportedFormat,
-        InternalError = MediaCodecErrorCode.Internal,
-        OutOfStorage = MediaCodecErrorCode.OutOfStorage,
-        InvalidStream = MediaCodecErrorCode.InvalidStream,
-    }
-}
diff --git a/src/Tizen.Multimedia/MediaCodec/MediaCodecErrorOccurredEventArgs.cs b/src/Tizen.Multimedia/MediaCodec/MediaCodecErrorOccurredEventArgs.cs
deleted file mode 100644 (file)
index 8311200..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-using System;
-
-namespace Tizen.Multimedia.MediaCodec
-{
-    /// <summary>
-    /// Provides data for the <see cref="MediaCodec.ErrorOccurred"/> event.
-    /// </summary>
-    public class MediaCodecErrorOccurredEventArgs : EventArgs
-    {
-        /// <summary>
-        /// Initializes a new instance of the ErrorOccurredEventArgs class.
-        /// </summary>
-        /// <param name="error">The value representing the type of the error.</param>
-        public MediaCodecErrorOccurredEventArgs(MediaCodecError error)
-        {
-            Error = error;
-        }
-
-        /// <summary>
-        /// Gets the value indicating what kind of the error.
-        /// </summary>
-        public MediaCodecError Error { get; }
-    }
-}
diff --git a/src/Tizen.Multimedia/MediaCodec/MediaCodecStatus.cs b/src/Tizen.Multimedia/MediaCodec/MediaCodecStatus.cs
deleted file mode 100644 (file)
index 32e453d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.MediaCodec
-{
-    /// <summary>
-    /// Specifies the status of a codec.
-    /// </summary>
-    public enum MediaCodecStatus
-    {
-        /// <summary>
-        /// Not enough data to decode or encode.
-        /// </summary>
-        LackOfData,
-
-        /// <summary>
-        /// Enough data to decode or encode.
-        /// </summary>
-        EnoughData
-    }
-}
diff --git a/src/Tizen.Multimedia/MediaCodec/MediaCodecType.cs b/src/Tizen.Multimedia/MediaCodec/MediaCodecType.cs
deleted file mode 100644 (file)
index 34da665..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-
-namespace Tizen.Multimedia.MediaCodec
-{
-    [Flags]
-    internal enum MediaCodecCodingType
-    {
-        Encoder = 0x1,
-        Decoder = 0x2
-    }
-
-    /// <summary>
-    /// Specifies types of codec.
-    /// </summary>
-    [Flags]
-    public enum MediaCodecTypes
-    {
-        /// <summary>
-        /// The hardware-accelerated codec.
-        /// </summary>
-        Hardware = 0x4,
-
-        /// <summary>
-        /// The software codec.
-        /// </summary>
-        Software = 0x8
-    }
-}
diff --git a/src/Tizen.Multimedia/MediaCodec/OutputAvailableEventArgs.cs b/src/Tizen.Multimedia/MediaCodec/OutputAvailableEventArgs.cs
deleted file mode 100644 (file)
index 9c84828..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-
-namespace Tizen.Multimedia.MediaCodec
-{
-    /// <summary>
-    /// Provides data for the <see cref="MediaCodec.OutputAvailable"/> event.
-    /// </summary>
-    /// <remarks>The output packet needs to be disposed after it is used to clean up unmanaged resources.</remarks>
-    public class OutputAvailableEventArgs : EventArgs
-    {
-        internal OutputAvailableEventArgs(IntPtr packetHandle)
-        {
-            Packet = MediaPacket.From(packetHandle);
-        }
-
-        /// <summary>
-        /// Gets the result packet.
-        /// </summary>
-        public MediaPacket Packet { get; }
-    }
-}
diff --git a/src/Tizen.Multimedia/MediaCodec/SupportedCodecType.cs b/src/Tizen.Multimedia/MediaCodec/SupportedCodecType.cs
deleted file mode 100644 (file)
index 999808f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.MediaCodec
-{
-    internal enum SupportedCodecType
-    {
-        // L16 = 0x1010,
-        // ALaw = 0x1020,
-        // ULaw = 0x1030,
-        Amr = 0x1040,
-        AmrNB = 0x1040,
-        AmrWb = 0x1041,
-        // G729 = 0x1050,
-        Aac = 0x1060,
-        AacLC = 0x1060,
-        AacHE = 0x1061,
-        AacHEPS = 0x1062,
-        MP3 = 0x1070,
-        Vorbis = 0x1080,
-        Flac = 0x1090,
-        Wma1 = 0x10A0,
-        Wma2 = 0x10A1,
-        WmaPro = 0x10A2,
-        WmaLossless = 0x10A3,
-
-        H261 = 0x2010,
-        H263 = 0x2020,
-        H264 = 0x2030,
-        MJpeg = 0x2040,
-        Mpeg1 = 0x2050,
-        Mpeg2 = 0x2060,
-        Mpeg4 = 0x2070,
-        // Hevc = 0x2080,
-        // VP8 = 0x2090,
-        // VP9 = 0x20A0,
-        // VC1 = 0x20B0,
-    }
-}
index cb15a6a..a46b2a6 100755 (executable)
     <Compile Include="Interop\Interop.VideoUtil.cs" />
     <Compile Include="Interop\Interop.Volume.cs" />
     <Compile Include="Interop\Interop.WavPlayer.cs" />
-    <Compile Include="MediaCodec\BufferStatusChangedEventArgs.cs" />
-    <Compile Include="MediaCodec\InputProcessedEventArgs.cs" />
-    <Compile Include="MediaCodec\MediaCodec.cs" />
-    <Compile Include="MediaCodec\MediaCodecError.cs" />
-    <Compile Include="MediaCodec\MediaCodecErrorOccurredEventArgs.cs" />
-    <Compile Include="MediaCodec\MediaCodecStatus.cs" />
-    <Compile Include="MediaCodec\MediaCodecType.cs" />
-    <Compile Include="MediaCodec\OutputAvailableEventArgs.cs" />
-    <Compile Include="MediaCodec\SupportedCodecType.cs" />
     <Compile Include="MediaController\CustomCommandEventArgs.cs" />
     <Compile Include="MediaController\CustomCommandReplyEventArgs.cs" />
     <Compile Include="MediaController\MediaControllerClient.cs" />