blob: b02ed0e5bf9389d8c2705f21dd47b9ac08729cb3 [file] [log] [blame]
Andreas Huber53a76bd2009-10-06 16:20:44 -07001/*
Andreas Huberaee3c632010-01-11 15:35:19 -08002 * 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 */
Andreas Huber53a76bd2009-10-06 16:20:44 -070016
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>
Andreas Huberaee3c632010-01-11 15:35:19 -080024#include <utils/KeyedVector.h>
Andreas Huber53a76bd2009-10-06 16:20:44 -070025
26namespace android {
27
Andreas Huberaee3c632010-01-11 15:35:19 -080028struct DataSource;
Andreas Huber53a76bd2009-10-06 16:20:44 -070029class MediaExtractor;
30
31struct StagefrightMetadataRetriever : public MediaMetadataRetrieverInterface {
32 StagefrightMetadataRetriever();
33 virtual ~StagefrightMetadataRetriever();
34
Andreas Huber5b7ced62011-03-21 10:25:44 -070035 virtual status_t setDataSource(
36 const char *url,
37 const KeyedVector<String8, String8> *headers);
38
Andreas Huber53a76bd2009-10-06 16:20:44 -070039 virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
40
James Dongfaf09ba2010-12-02 17:42:08 -080041 virtual VideoFrame *getFrameAtTime(int64_t timeUs, int option);
Andreas Huber53a76bd2009-10-06 16:20:44 -070042 virtual MediaAlbumArt *extractAlbumArt();
43 virtual const char *extractMetadata(int keyCode);
44
45private:
46 OMXClient mClient;
Andreas Huberaee3c632010-01-11 15:35:19 -080047 sp<DataSource> mSource;
Andreas Huber53a76bd2009-10-06 16:20:44 -070048 sp<MediaExtractor> mExtractor;
49
Andreas Huberaee3c632010-01-11 15:35:19 -080050 bool mParsedMetaData;
51 KeyedVector<int, String8> mMetaData;
52 MediaAlbumArt *mAlbumArt;
53
54 void parseMetaData();
55
Andreas Huber53a76bd2009-10-06 16:20:44 -070056 StagefrightMetadataRetriever(const StagefrightMetadataRetriever &);
57
58 StagefrightMetadataRetriever &operator=(
59 const StagefrightMetadataRetriever &);
60};
61
62} // namespace android
63
64#endif // STAGEFRIGHT_METADATA_RETRIEVER_H_