TizenRT Public API  v2.0 M2
BufferOutputDataSource.h
Go to the documentation of this file.
1 /* ****************************************************************
2  *
3  * Copyright 2018 Samsung Electronics All Rights Reserved.
4  *
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
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  ******************************************************************/
18 
29 #ifndef __MEDIA_BUFFEROUTPUTDATASOURCE_H
30 #define __MEDIA_BUFFEROUTPUTDATASOURCE_H
31 
32 #include <media/OutputDataSource.h>
33 
34 namespace media {
35 namespace stream {
43 {
44 public:
61  BufferOutputDataSource(unsigned int channels, unsigned int sampleRate, audio_format_type_t pcmFormat);
79  virtual ~BufferOutputDataSource();
80 
87  bool isPrepare() override;
94  bool open() override;
101  bool close() override;
102 
111  ssize_t write(unsigned char *buf, size_t size);
112 
113 private:
114  bool mIsPrepare;
115 };
116 
117 } // namespace stream
118 } // namespace media
119 
120 #endif
121  // end of MEDIA group
ssize_t write(unsigned char *buf, size_t size)
Write the file.
virtual ~BufferOutputDataSource()
Deconstructs an empty BufferOutputDataSource.
bool close() override
Close the file.
BufferOutputDataSource & operator=(const BufferOutputDataSource &source)
Operator= for BufferOutputDataSource.
Media OutputDataSource APIs.
BufferOutputDataSource()
Constructs an empty BufferOutputDataSource.
bool isPrepare() override
Whether file is ready to be write.
bool open() override
Open the file.