2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FMedia_AudioStreamCoordinator.h
20 * @brief This header file contains the declaration of the _AudioStreamCoordinator class.
23 #ifndef _FMEDIA_INTERNAL_AUDIO_STREAM_COORDINATOR_H_
24 #define _FMEDIA_INTERNAL_AUDIO_STREAM_COORDINATOR_H_
26 #include <FMediaAudioTypes.h>
27 #include "FMedia_CamPtrUtil.h"
29 namespace Tizen { namespace Media
31 class IAudioStreamFilter;
34 * @class _AudioStreamCoordinator
35 * @brief This class coordinates the audio stream data
38 class _AudioStreamCoordinator
39 : public Tizen::Base::Object
44 * This is the default constructor for this class.
48 _AudioStreamCoordinator(void);
51 * This is the destructor for this class. @n
52 * All allocated resources are deallocated by this method. This polymorphic destructor should be overridden if required.
53 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
56 virtual ~_AudioStreamCoordinator(void);
61 * Constructs the instance of this class. @n
64 * @return An error code
65 * @exception E_SUCCESS The method is successful.
68 result Construct(void);
71 * Adds the stream filter to process the audio stream data while recording.
74 * @return An error code
75 * @param[in] filter An instance of IAudioStreamFilter
76 * @exception E_SUCCESS The method is successful.
77 * @exception E_OBJ_ALREADY_EXIST The filter already exists.
78 * @exception E_OUT_OF_MEMORY The memory is insufficient.
80 result AddAudioStreamFilter(IAudioStreamFilter& filter);
83 * Removes the stream filter to stop processing the audio stream data.
86 * @return An error code
87 * @param[in] filter An instance of IAudioStreamFilter
88 * @exception E_SUCCESS The method is successful.
89 * @exception E_OBJ_NOT_FOUND The filter is not found.
91 result RemoveAudioStreamFilter(IAudioStreamFilter& filter);
94 * Process the audio stream data and send to filter
97 * @return An error code
98 * @param[in, out] pStream audio stream data
99 * @param[in] size audio stream data size
100 * @param[in] samplingRate sampling rate in Hz
101 * @param[in] channel audio channel
102 * @param[in] sampleType audio sample
103 * @exception E_SUCCESS The method is successful.
105 result ProcessAudioStreamData(byte* pStream, int size, int samplingRate, AudioChannelType channel, AudioSampleType sampleType);
108 * Return the count of the filter handle stored
110 * @return count of filter handle
112 int GetFilterListCount(void) const;
116 std::unique_ptr <Tizen::Base::Collection::ArrayListT< IAudioStreamFilter*>, _ListPtrUtil::Remover> __pStreamFilterList;