TizenRT Public API  v2.0 M2
FileInputDataSource.h
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_FILEINPUTDATASOURCE_H
30 #define __MEDIA_FILEINPUTDATASOURCE_H
31 
32 #include <media/InputDataSource.h>
33 
34 namespace media {
35 namespace stream {
43 {
44 public:
56  virtual ~FileInputDataSource();
63  FileInputDataSource(const std::string &dataPath);
76 
83  bool isPrepare() override;
90  bool open() override;
97  bool close() override;
106  ssize_t read(unsigned char *buf, size_t size) override;
107 
108 private:
109  std::string mDataPath;
110  FILE *mFp;
111 };
112 } // namespace stream
113 } // namespace media
114 
115 #endif
116  // end of MEDIA group
FileInputDataSource & operator=(const FileInputDataSource &source)
Operator= for FileInputDataSource.
bool close() override
Close the file.
FileInputDataSource()
Constructs an empty FileInputDataSource.
virtual ~FileInputDataSource()
Deconstructs an empty FileInputDataSource.
bool open() override
Open the file.
bool isPrepare() override
Whether file is ready to be read.
ssize_t read(unsigned char *buf, size_t size) override
Read the file.