blob: e6f8cf79a73fc6fd618573a922442eb73024226b [file] [log] [blame]
Marco Nelissen08b9e2d2014-12-16 12:46:34 -08001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#ifndef MIDI_IO_WRAPPER_H_
18#define MIDI_IO_WRAPPER_H_
19
20#include <libsonivox/eas_types.h>
21
Marco Nelissenfaf4efc2014-12-17 14:44:33 -080022#include "media/stagefright/DataSource.h"
23
Marco Nelissen08b9e2d2014-12-16 12:46:34 -080024namespace android {
25
26class MidiIoWrapper : public RefBase {
27public:
28 MidiIoWrapper(const char *path);
29 MidiIoWrapper(int fd, off64_t offset, int64_t size);
Marco Nelissenfaf4efc2014-12-17 14:44:33 -080030 MidiIoWrapper(const sp<DataSource> &source);
Marco Nelissen08b9e2d2014-12-16 12:46:34 -080031
32 ~MidiIoWrapper();
33
34 int readAt(void *buffer, int offset, int size);
35 int size();
36
37 EAS_FILE_LOCATOR getLocator();
38
39private:
40 int mFd;
41 off64_t mBase;
42 int64_t mLength;
Marco Nelissenfaf4efc2014-12-17 14:44:33 -080043 sp<DataSource> mDataSource;
Marco Nelissen08b9e2d2014-12-16 12:46:34 -080044 EAS_FILE mEasFile;
45};
46
47
48} // namespace android
49
50#endif // MIDI_IO_WRAPPER_H_