Home | History | Annotate | Download | only in include
      1 /*
      2  * Copyright (C) 2010 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 STAGEFRIGHT_METADATA_RETRIEVER_H_
     18 
     19 #define STAGEFRIGHT_METADATA_RETRIEVER_H_
     20 
     21 #include <media/MediaMetadataRetrieverInterface.h>
     22 
     23 #include <media/stagefright/OMXClient.h>
     24 #include <utils/KeyedVector.h>
     25 
     26 namespace android {
     27 
     28 struct DataSource;
     29 class MediaExtractor;
     30 
     31 struct StagefrightMetadataRetriever : public MediaMetadataRetrieverInterface {
     32     StagefrightMetadataRetriever();
     33     virtual ~StagefrightMetadataRetriever();
     34 
     35     virtual status_t setDataSource(
     36             const sp<IMediaHTTPService> &httpService,
     37             const char *url,
     38             const KeyedVector<String8, String8> *headers);
     39 
     40     virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
     41 
     42     virtual VideoFrame *getFrameAtTime(int64_t timeUs, int option);
     43     virtual MediaAlbumArt *extractAlbumArt();
     44     virtual const char *extractMetadata(int keyCode);
     45 
     46 private:
     47     OMXClient mClient;
     48     sp<DataSource> mSource;
     49     sp<MediaExtractor> mExtractor;
     50 
     51     bool mParsedMetaData;
     52     KeyedVector<int, String8> mMetaData;
     53     MediaAlbumArt *mAlbumArt;
     54 
     55     void parseMetaData();
     56 
     57     StagefrightMetadataRetriever(const StagefrightMetadataRetriever &);
     58 
     59     StagefrightMetadataRetriever &operator=(
     60             const StagefrightMetadataRetriever &);
     61 };
     62 
     63 }  // namespace android
     64 
     65 #endif  // STAGEFRIGHT_METADATA_RETRIEVER_H_
     66