StagefrightMetadataRetriever.h revision 67e5a4f6f6879d512a859e5dba92e9beec7a2f91
1/*
2**
3** Copyright 2009, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9**     http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18#ifndef STAGEFRIGHT_METADATA_RETRIEVER_H_
19
20#define STAGEFRIGHT_METADATA_RETRIEVER_H_
21
22#include <media/MediaMetadataRetrieverInterface.h>
23
24#include <media/stagefright/OMXClient.h>
25
26namespace android {
27
28class MediaExtractor;
29
30struct StagefrightMetadataRetriever : public MediaMetadataRetrieverInterface {
31    StagefrightMetadataRetriever();
32    virtual ~StagefrightMetadataRetriever();
33
34    virtual status_t setDataSource(const char *url);
35    virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
36
37    virtual VideoFrame *captureFrame();
38    virtual MediaAlbumArt *extractAlbumArt();
39    virtual const char *extractMetadata(int keyCode);
40
41private:
42    OMXClient mClient;
43    sp<MediaExtractor> mExtractor;
44
45    StagefrightMetadataRetriever(const StagefrightMetadataRetriever &);
46
47    StagefrightMetadataRetriever &operator=(
48            const StagefrightMetadataRetriever &);
49};
50
51}  // namespace android
52
53#endif  // STAGEFRIGHT_METADATA_RETRIEVER_H_
54