62 lines
1.8 KiB
C
62 lines
1.8 KiB
C
|
/*
|
||
|
* Copyright (c) 2008-2016 Allwinner Technology Co. Ltd.
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
* File : awmetadataretriever.h
|
||
|
* Description : metadataretriever
|
||
|
* History :
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#ifndef AW_METADATA_RETRIEVER
|
||
|
#define AW_METADATA_RETRIEVER
|
||
|
|
||
|
#include <utils/String8.h>
|
||
|
#include <media/MediaMetadataRetrieverInterface.h>
|
||
|
#include <media/stagefright/MetaData.h>
|
||
|
#include <utils/KeyedVector.h>
|
||
|
#include <media/MediaPlayerInterface.h>
|
||
|
|
||
|
using namespace android;
|
||
|
|
||
|
struct AwMetadataRetriever : public MediaMetadataRetrieverInterface
|
||
|
{
|
||
|
AwMetadataRetriever();
|
||
|
virtual ~AwMetadataRetriever();
|
||
|
|
||
|
#if (CONF_ANDROID_MAJOR_VER >= 5)
|
||
|
virtual status_t setDataSource(const sp<IMediaHTTPService> &httpService,
|
||
|
const char* pUrl, const KeyedVector<String8, String8>* pHeaders);
|
||
|
#else
|
||
|
virtual status_t setDataSource(const char* pUrl,
|
||
|
const KeyedVector<String8, String8>* pHeaders);
|
||
|
#endif
|
||
|
virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
|
||
|
#if (CONF_ANDROID_MAJOR_VER >= 6)
|
||
|
virtual status_t setDataSource(const sp<DataSource>& source);
|
||
|
#endif
|
||
|
|
||
|
/* option enumerate is defined in
|
||
|
* 'android/framework/base/media/java/android/media/MediaMetadataRetriver.java'
|
||
|
* option == 0: OPTION_PREVIOUS_SYNC
|
||
|
* option == 1: OPTION_NEXT_SYNC
|
||
|
* option == 2: OPTION_CLOSEST_SYNC
|
||
|
* option == 3: OPTION_CLOSEST
|
||
|
*/
|
||
|
virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option);
|
||
|
virtual MediaAlbumArt* extractAlbumArt();
|
||
|
virtual const char* extractMetadata(int keyCode);
|
||
|
virtual sp<IMemory> getStreamAtTime(int64_t timeUs);
|
||
|
|
||
|
private:
|
||
|
struct MetadataPriData *mPriData;
|
||
|
|
||
|
private:
|
||
|
void clear();
|
||
|
void storeMetadata();
|
||
|
AwMetadataRetriever(const AwMetadataRetriever &);
|
||
|
AwMetadataRetriever &operator=(const AwMetadataRetriever &);
|
||
|
};
|
||
|
|
||
|
#endif
|