MediaExtractor.h revision 693d271e62a3726689ff68f4505ba49228eb94b2
120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber/*
220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * Copyright (C) 2009 The Android Open Source Project
320111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber *
420111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License");
520111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * you may not use this file except in compliance with the License.
620111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * You may obtain a copy of the License at
720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber *
820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber *      http://www.apache.org/licenses/LICENSE-2.0
920111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber *
1020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * Unless required by applicable law or agreed to in writing, software
1120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS,
1220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * See the License for the specific language governing permissions and
1420111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * limitations under the License.
1520111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber */
1620111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
1720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#ifndef MEDIA_EXTRACTOR_H_
1820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
1920111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#define MEDIA_EXTRACTOR_H_
2020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
2120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#include <utils/RefBase.h>
2220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
2320111aa043c5f404472bc63b90bc5aad906b1101Andreas Hubernamespace android {
2420111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
2520111aa043c5f404472bc63b90bc5aad906b1101Andreas Huberclass DataSource;
2620111aa043c5f404472bc63b90bc5aad906b1101Andreas Huberclass MediaSource;
2720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huberclass MetaData;
2820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
29693d271e62a3726689ff68f4505ba49228eb94b2Andreas Huberclass MediaExtractor : public RefBase {
3020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huberpublic:
31693d271e62a3726689ff68f4505ba49228eb94b2Andreas Huber    static sp<MediaExtractor> Create(
32693d271e62a3726689ff68f4505ba49228eb94b2Andreas Huber            const sp<DataSource> &source, const char *mime = NULL);
3320111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
34693d271e62a3726689ff68f4505ba49228eb94b2Andreas Huber    virtual size_t countTracks() = 0;
35693d271e62a3726689ff68f4505ba49228eb94b2Andreas Huber    virtual sp<MediaSource> getTrack(size_t index) = 0;
36693d271e62a3726689ff68f4505ba49228eb94b2Andreas Huber    virtual sp<MetaData> getTrackMetaData(size_t index) = 0;
3720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
3820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huberprotected:
3920111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    MediaExtractor() {}
40693d271e62a3726689ff68f4505ba49228eb94b2Andreas Huber    virtual ~MediaExtractor() {}
4120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
4220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huberprivate:
4320111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    MediaExtractor(const MediaExtractor &);
4420111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    MediaExtractor &operator=(const MediaExtractor &);
4520111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber};
4620111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
4720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber}  // namespace android
4820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
4920111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#endif  // MEDIA_EXTRACTOR_H_
50