13cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber/* 23cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * Copyright (C) 2010 The Android Open Source Project 33cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * 43cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License"); 53cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * you may not use this file except in compliance with the License. 63cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * You may obtain a copy of the License at 73cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * 83cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * http://www.apache.org/licenses/LICENSE-2.0 93cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * 103cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * Unless required by applicable law or agreed to in writing, software 113cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS, 123cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 133cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * See the License for the specific language governing permissions and 143cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber * limitations under the License. 153cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber */ 163cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 17ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber#ifndef OGG_EXTRACTOR_H_ 183cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 19ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber#define OGG_EXTRACTOR_H_ 203cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 2195d7e994c73c17b27c7134ba3cc3acbb5889aa87Mathias Agopian#include <utils/Errors.h> 223cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber#include <media/stagefright/MediaExtractor.h> 233cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 243cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Hubernamespace android { 253cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 265a1c3529e4fa2f8a11054181294e0ce79fff8dd3Andreas Huberstruct AMessage; 273cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huberclass DataSource; 283cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huberclass String8; 293cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 308c10a80cf1af68f15eb39552ca116ec6f04fc173Robert Shihstruct MyOggExtractor; 31ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huberstruct OggSource; 323cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 33ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huberstruct OggExtractor : public MediaExtractor { 34ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber OggExtractor(const sp<DataSource> &source); 353cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 363cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber virtual size_t countTracks(); 37b2487f03f12dcafdb801fc0007c8df8412397f44Marco Nelissen virtual sp<IMediaSource> getTrack(size_t index); 383cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber virtual sp<MetaData> getTrackMetaData(size_t index, uint32_t flags); 393cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 403cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber virtual sp<MetaData> getMetaData(); 41b2487f03f12dcafdb801fc0007c8df8412397f44Marco Nelissen virtual const char * name() { return "OggExtractor"; } 423cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 433cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huberprotected: 44ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber virtual ~OggExtractor(); 453cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 463cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huberprivate: 47ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber friend struct OggSource; 48ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber 493cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber sp<DataSource> mDataSource; 503cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber status_t mInitCheck; 513cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 528c10a80cf1af68f15eb39552ca116ec6f04fc173Robert Shih MyOggExtractor *mImpl; 53ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber 54ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber OggExtractor(const OggExtractor &); 55ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber OggExtractor &operator=(const OggExtractor &); 563cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber}; 573cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 58ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huberbool SniffOgg( 595a1c3529e4fa2f8a11054181294e0ce79fff8dd3Andreas Huber const sp<DataSource> &source, String8 *mimeType, float *confidence, 605a1c3529e4fa2f8a11054181294e0ce79fff8dd3Andreas Huber sp<AMessage> *); 613cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 62856990b491d84b7ed4fefe337485c8997ba9dd02Glenn Kastenvoid parseVorbisComment( 63856990b491d84b7ed4fefe337485c8997ba9dd02Glenn Kasten const sp<MetaData> &fileMeta, const char *comment, size_t commentLength); 64856990b491d84b7ed4fefe337485c8997ba9dd02Glenn Kasten 653cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber} // namespace android 663cf4e43cdd391502690c07e08e805aa8ff5db0c0Andreas Huber 67ee7ff20e69498ebd53dd9717a0f984188341a75eAndreas Huber#endif // OGG_EXTRACTOR_H_ 68