Merge "Convert MP3Extractor to use AMediaFormat"

gugelfrei
Marco Nelissen 6 years ago committed by Android (Google) Code Review
commit fdd42e9535

@ -366,7 +366,6 @@ void FLACParser::metadataCallback(const FLAC__StreamMetadata *metadata)
const FLAC__StreamMetadata_Picture *p = &metadata->data.picture; const FLAC__StreamMetadata_Picture *p = &metadata->data.picture;
mFileMetadata->setData(kKeyAlbumArt, mFileMetadata->setData(kKeyAlbumArt,
MetaData::TYPE_NONE, p->data, p->data_length); MetaData::TYPE_NONE, p->data, p->data_length);
mFileMetadata->setCString(kKeyAlbumArtMIME, p->mime_type);
} }
break; break;
default: default:

@ -13,6 +13,7 @@ cc_library_shared {
shared_libs: [ shared_libs: [
"liblog", "liblog",
"libmediaextractor", "libmediaextractor",
"libmediandk",
"libstagefright_foundation", "libstagefright_foundation",
], ],

@ -207,19 +207,19 @@ static bool Resync(
return valid; return valid;
} }
class MP3Source : public MediaTrackHelper { class MP3Source : public MediaTrackHelperV2 {
public: public:
MP3Source( MP3Source(
MetaDataBase &meta, DataSourceHelper *source, AMediaFormat *meta, DataSourceHelper *source,
off64_t first_frame_pos, uint32_t fixed_header, off64_t first_frame_pos, uint32_t fixed_header,
MP3Seeker *seeker); MP3Seeker *seeker);
virtual status_t start(); virtual media_status_t start();
virtual status_t stop(); virtual media_status_t stop();
virtual status_t getFormat(MetaDataBase &meta); virtual media_status_t getFormat(AMediaFormat *meta);
virtual status_t read( virtual media_status_t read(
MediaBufferBase **buffer, const ReadOptions *options = NULL); MediaBufferBase **buffer, const ReadOptions *options = NULL);
protected: protected:
@ -227,7 +227,7 @@ protected:
private: private:
static const size_t kMaxFrameSize; static const size_t kMaxFrameSize;
MetaDataBase &mMeta; AMediaFormat *mMeta;
DataSourceHelper *mDataSource; DataSourceHelper *mDataSource;
off64_t mFirstFramePos; off64_t mFirstFramePos;
uint32_t mFixedHeader; uint32_t mFixedHeader;
@ -283,6 +283,7 @@ MP3Extractor::MP3Extractor(
mFixedHeader = header; mFixedHeader = header;
XINGSeeker *seeker = XINGSeeker::CreateFromSource(mDataSource, mFirstFramePos); XINGSeeker *seeker = XINGSeeker::CreateFromSource(mDataSource, mFirstFramePos);
mMeta = AMediaFormat_new();
if (seeker == NULL) { if (seeker == NULL) {
mSeeker = VBRISeeker::CreateFromSource(mDataSource, post_id3_pos); mSeeker = VBRISeeker::CreateFromSource(mDataSource, post_id3_pos);
} else { } else {
@ -290,8 +291,8 @@ MP3Extractor::MP3Extractor(
int encd = seeker->getEncoderDelay(); int encd = seeker->getEncoderDelay();
int encp = seeker->getEncoderPadding(); int encp = seeker->getEncoderPadding();
if (encd != 0 || encp != 0) { if (encd != 0 || encp != 0) {
mMeta.setInt32(kKeyEncoderDelay, encd); AMediaFormat_setInt32(mMeta, AMEDIAFORMAT_KEY_ENCODER_DELAY, encd);
mMeta.setInt32(kKeyEncoderPadding, encp); AMediaFormat_setInt32(mMeta, AMEDIAFORMAT_KEY_ENCODER_PADDING, encp);
} }
} }
@ -327,21 +328,23 @@ MP3Extractor::MP3Extractor(
switch (layer) { switch (layer) {
case 1: case 1:
mMeta.setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_I); AMediaFormat_setString(mMeta,
AMEDIAFORMAT_KEY_MIME, MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_I);
break; break;
case 2: case 2:
mMeta.setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II); AMediaFormat_setString(mMeta,
AMEDIAFORMAT_KEY_MIME, MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II);
break; break;
case 3: case 3:
mMeta.setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_MPEG); AMediaFormat_setString(mMeta, AMEDIAFORMAT_KEY_MIME, MEDIA_MIMETYPE_AUDIO_MPEG);
break; break;
default: default:
TRESPASS(); TRESPASS();
} }
mMeta.setInt32(kKeySampleRate, sample_rate); AMediaFormat_setInt32(mMeta, AMEDIAFORMAT_KEY_SAMPLE_RATE, sample_rate);
mMeta.setInt32(kKeyBitRate, bitrate * 1000); AMediaFormat_setInt32(mMeta, AMEDIAFORMAT_KEY_BIT_RATE, bitrate * 1000);
mMeta.setInt32(kKeyChannelCount, num_channels); AMediaFormat_setInt32(mMeta, AMEDIAFORMAT_KEY_CHANNEL_COUNT, num_channels);
int64_t durationUs; int64_t durationUs;
@ -361,7 +364,7 @@ MP3Extractor::MP3Extractor(
} }
if (durationUs >= 0) { if (durationUs >= 0) {
mMeta.setInt64(kKeyDuration, durationUs); AMediaFormat_setInt64(mMeta, AMEDIAFORMAT_KEY_DURATION, durationUs);
} }
mInitCheck = OK; mInitCheck = OK;
@ -389,8 +392,8 @@ MP3Extractor::MP3Extractor(
int32_t delay, padding; int32_t delay, padding;
if (sscanf(value, " %*x %x %x %*x", &delay, &padding) == 2) { if (sscanf(value, " %*x %x %x %*x", &delay, &padding) == 2) {
mMeta.setInt32(kKeyEncoderDelay, delay); AMediaFormat_setInt32(mMeta, AMEDIAFORMAT_KEY_ENCODER_DELAY, delay);
mMeta.setInt32(kKeyEncoderPadding, padding); AMediaFormat_setInt32(mMeta, AMEDIAFORMAT_KEY_ENCODER_PADDING, padding);
} }
break; break;
} }
@ -404,13 +407,14 @@ MP3Extractor::MP3Extractor(
MP3Extractor::~MP3Extractor() { MP3Extractor::~MP3Extractor() {
delete mSeeker; delete mSeeker;
delete mDataSource; delete mDataSource;
AMediaFormat_delete(mMeta);
} }
size_t MP3Extractor::countTracks() { size_t MP3Extractor::countTracks() {
return mInitCheck != OK ? 0 : 1; return mInitCheck != OK ? 0 : 1;
} }
MediaTrackHelper *MP3Extractor::getTrack(size_t index) { MediaTrackHelperV2 *MP3Extractor::getTrack(size_t index) {
if (mInitCheck != OK || index != 0) { if (mInitCheck != OK || index != 0) {
return NULL; return NULL;
} }
@ -420,14 +424,14 @@ MediaTrackHelper *MP3Extractor::getTrack(size_t index) {
mSeeker); mSeeker);
} }
status_t MP3Extractor::getTrackMetaData( media_status_t MP3Extractor::getTrackMetaData(
MetaDataBase &meta, AMediaFormat *meta,
size_t index, uint32_t /* flags */) { size_t index, uint32_t /* flags */) {
if (mInitCheck != OK || index != 0) { if (mInitCheck != OK || index != 0) {
return UNKNOWN_ERROR; return AMEDIA_ERROR_UNKNOWN;
} }
meta = mMeta; AMediaFormat_copy(meta, mMeta);
return OK; return AMEDIA_OK;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -440,7 +444,7 @@ status_t MP3Extractor::getTrackMetaData(
// Set our max frame size to the nearest power of 2 above this size (aka, 4kB) // Set our max frame size to the nearest power of 2 above this size (aka, 4kB)
const size_t MP3Source::kMaxFrameSize = (1 << 12); /* 4096 bytes */ const size_t MP3Source::kMaxFrameSize = (1 << 12); /* 4096 bytes */
MP3Source::MP3Source( MP3Source::MP3Source(
MetaDataBase &meta, DataSourceHelper *source, AMediaFormat *meta, DataSourceHelper *source,
off64_t first_frame_pos, uint32_t fixed_header, off64_t first_frame_pos, uint32_t fixed_header,
MP3Seeker *seeker) MP3Seeker *seeker)
: mMeta(meta), : mMeta(meta),
@ -462,7 +466,7 @@ MP3Source::~MP3Source() {
} }
} }
status_t MP3Source::start() { media_status_t MP3Source::start() {
CHECK(!mStarted); CHECK(!mStarted);
mGroup = new MediaBufferGroup; mGroup = new MediaBufferGroup;
@ -477,10 +481,10 @@ status_t MP3Source::start() {
mStarted = true; mStarted = true;
return OK; return AMEDIA_OK;
} }
status_t MP3Source::stop() { media_status_t MP3Source::stop() {
CHECK(mStarted); CHECK(mStarted);
delete mGroup; delete mGroup;
@ -488,15 +492,14 @@ status_t MP3Source::stop() {
mStarted = false; mStarted = false;
return OK; return AMEDIA_OK;
} }
status_t MP3Source::getFormat(MetaDataBase &meta) { media_status_t MP3Source::getFormat(AMediaFormat *meta) {
meta = mMeta; return AMediaFormat_copy(meta, mMeta);
return OK;
} }
status_t MP3Source::read( media_status_t MP3Source::read(
MediaBufferBase **out, const ReadOptions *options) { MediaBufferBase **out, const ReadOptions *options) {
*out = NULL; *out = NULL;
@ -509,11 +512,11 @@ status_t MP3Source::read(
if (mSeeker == NULL if (mSeeker == NULL
|| !mSeeker->getOffsetForTime(&actualSeekTimeUs, &mCurrentPos)) { || !mSeeker->getOffsetForTime(&actualSeekTimeUs, &mCurrentPos)) {
int32_t bitrate; int32_t bitrate;
if (!mMeta.findInt32(kKeyBitRate, &bitrate)) { if (!AMediaFormat_getInt32(mMeta, AMEDIAFORMAT_KEY_BIT_RATE, &bitrate)) {
// bitrate is in bits/sec. // bitrate is in bits/sec.
ALOGI("no bitrate"); ALOGI("no bitrate");
return ERROR_UNSUPPORTED; return AMEDIA_ERROR_UNSUPPORTED;
} }
mCurrentTimeUs = seekTimeUs; mCurrentTimeUs = seekTimeUs;
@ -530,7 +533,7 @@ status_t MP3Source::read(
MediaBufferBase *buffer; MediaBufferBase *buffer;
status_t err = mGroup->acquire_buffer(&buffer); status_t err = mGroup->acquire_buffer(&buffer);
if (err != OK) { if (err != OK) {
return err; return AMEDIA_ERROR_UNKNOWN;
} }
size_t frame_size; size_t frame_size;
@ -543,7 +546,7 @@ status_t MP3Source::read(
buffer->release(); buffer->release();
buffer = NULL; buffer = NULL;
return (n < 0 ? n : ERROR_END_OF_STREAM); return (n < 0 ? AMEDIA_ERROR_UNKNOWN : AMEDIA_ERROR_END_OF_STREAM);
} }
uint32_t header = U32_AT((const uint8_t *)buffer->data()); uint32_t header = U32_AT((const uint8_t *)buffer->data());
@ -572,7 +575,7 @@ status_t MP3Source::read(
buffer->release(); buffer->release();
buffer = NULL; buffer = NULL;
return ERROR_END_OF_STREAM; return AMEDIA_ERROR_END_OF_STREAM;
} }
mCurrentPos = pos; mCurrentPos = pos;
@ -587,7 +590,7 @@ status_t MP3Source::read(
buffer->release(); buffer->release();
buffer = NULL; buffer = NULL;
return (n < 0 ? n : ERROR_END_OF_STREAM); return (n < 0 ? AMEDIA_ERROR_UNKNOWN : AMEDIA_ERROR_END_OF_STREAM);
} }
buffer->set_range(0, frame_size); buffer->set_range(0, frame_size);
@ -602,40 +605,40 @@ status_t MP3Source::read(
*out = buffer; *out = buffer;
return OK; return AMEDIA_OK;
} }
status_t MP3Extractor::getMetaData(MetaDataBase &meta) { media_status_t MP3Extractor::getMetaData(AMediaFormat *meta) {
meta.clear(); AMediaFormat_clear(meta);
if (mInitCheck != OK) { if (mInitCheck != OK) {
return UNKNOWN_ERROR; return AMEDIA_ERROR_UNKNOWN;
} }
meta.setCString(kKeyMIMEType, "audio/mpeg"); AMediaFormat_setString(meta, AMEDIAFORMAT_KEY_MIME, "audio/mpeg");
DataSourceHelper helper(mDataSource); DataSourceHelper helper(mDataSource);
ID3 id3(&helper); ID3 id3(&helper);
if (!id3.isValid()) { if (!id3.isValid()) {
return OK; return AMEDIA_OK;
} }
struct Map { struct Map {
int key; const char *key;
const char *tag1; const char *tag1;
const char *tag2; const char *tag2;
}; };
static const Map kMap[] = { static const Map kMap[] = {
{ kKeyAlbum, "TALB", "TAL" }, { AMEDIAFORMAT_KEY_ALBUM, "TALB", "TAL" },
{ kKeyArtist, "TPE1", "TP1" }, { AMEDIAFORMAT_KEY_ARTIST, "TPE1", "TP1" },
{ kKeyAlbumArtist, "TPE2", "TP2" }, { AMEDIAFORMAT_KEY_ALBUMARTIST, "TPE2", "TP2" },
{ kKeyComposer, "TCOM", "TCM" }, { AMEDIAFORMAT_KEY_COMPOSER, "TCOM", "TCM" },
{ kKeyGenre, "TCON", "TCO" }, { AMEDIAFORMAT_KEY_GENRE, "TCON", "TCO" },
{ kKeyTitle, "TIT2", "TT2" }, { AMEDIAFORMAT_KEY_TITLE, "TIT2", "TT2" },
{ kKeyYear, "TYE", "TYER" }, { AMEDIAFORMAT_KEY_YEAR, "TYE", "TYER" },
{ kKeyAuthor, "TXT", "TEXT" }, { AMEDIAFORMAT_KEY_AUTHOR, "TXT", "TEXT" },
{ kKeyCDTrackNumber, "TRK", "TRCK" }, { AMEDIAFORMAT_KEY_CDTRACKNUMBER, "TRK", "TRCK" },
{ kKeyDiscNumber, "TPA", "TPOS" }, { AMEDIAFORMAT_KEY_DISCNUMBER, "TPA", "TPOS" },
{ kKeyCompilation, "TCP", "TCMP" }, { AMEDIAFORMAT_KEY_COMPILATION, "TCP", "TCMP" },
}; };
static const size_t kNumMapEntries = sizeof(kMap) / sizeof(kMap[0]); static const size_t kNumMapEntries = sizeof(kMap) / sizeof(kMap[0]);
@ -655,7 +658,7 @@ status_t MP3Extractor::getMetaData(MetaDataBase &meta) {
it->getString(&s); it->getString(&s);
delete it; delete it;
meta.setCString(kMap[i].key, s); AMediaFormat_setString(meta, kMap[i].key, s.string());
} }
size_t dataSize; size_t dataSize;
@ -663,21 +666,20 @@ status_t MP3Extractor::getMetaData(MetaDataBase &meta) {
const void *data = id3.getAlbumArt(&dataSize, &mime); const void *data = id3.getAlbumArt(&dataSize, &mime);
if (data) { if (data) {
meta.setData(kKeyAlbumArt, MetaData::TYPE_NONE, data, dataSize); AMediaFormat_setBuffer(meta, AMEDIAFORMAT_KEY_ALBUMART, data, dataSize);
meta.setCString(kKeyAlbumArtMIME, mime.string());
} }
return OK; return AMEDIA_OK;
} }
static CMediaExtractor* CreateExtractor( static CMediaExtractorV2* CreateExtractor(
CDataSource *source, CDataSource *source,
void *meta) { void *meta) {
Mp3Meta *metaData = static_cast<Mp3Meta *>(meta); Mp3Meta *metaData = static_cast<Mp3Meta *>(meta);
return wrap(new MP3Extractor(new DataSourceHelper(source), metaData)); return wrapV2(new MP3Extractor(new DataSourceHelper(source), metaData));
} }
static CreatorFunc Sniff( static CreatorFuncV2 Sniff(
CDataSource *source, float *confidence, void **meta, CDataSource *source, float *confidence, void **meta,
FreeMetaFunc *freeMeta) { FreeMetaFunc *freeMeta) {
off64_t pos = 0; off64_t pos = 0;
@ -714,11 +716,11 @@ extern "C" {
__attribute__ ((visibility ("default"))) __attribute__ ((visibility ("default")))
ExtractorDef GETEXTRACTORDEF() { ExtractorDef GETEXTRACTORDEF() {
return { return {
EXTRACTORDEF_VERSION, EXTRACTORDEF_VERSION_CURRENT,
UUID("812a3f6c-c8cf-46de-b529-3774b14103d4"), UUID("812a3f6c-c8cf-46de-b529-3774b14103d4"),
1, // version 1, // version
"MP3 Extractor", "MP3 Extractor",
{ Sniff } { .v2 = Sniff }
}; };
} }

@ -21,7 +21,7 @@
#include <utils/Errors.h> #include <utils/Errors.h>
#include <media/MediaExtractorPluginApi.h> #include <media/MediaExtractorPluginApi.h>
#include <media/MediaExtractorPluginHelper.h> #include <media/MediaExtractorPluginHelper.h>
#include <media/stagefright/MetaDataBase.h> #include <media/NdkMediaFormat.h>
namespace android { namespace android {
@ -32,16 +32,16 @@ struct MP3Seeker;
class String8; class String8;
struct Mp3Meta; struct Mp3Meta;
class MP3Extractor : public MediaExtractorPluginHelper { class MP3Extractor : public MediaExtractorPluginHelperV2 {
public: public:
MP3Extractor(DataSourceHelper *source, Mp3Meta *meta); MP3Extractor(DataSourceHelper *source, Mp3Meta *meta);
~MP3Extractor(); ~MP3Extractor();
virtual size_t countTracks(); virtual size_t countTracks();
virtual MediaTrackHelper *getTrack(size_t index); virtual MediaTrackHelperV2 *getTrack(size_t index);
virtual status_t getTrackMetaData(MetaDataBase& meta, size_t index, uint32_t flags); virtual media_status_t getTrackMetaData(AMediaFormat *meta, size_t index, uint32_t flags);
virtual status_t getMetaData(MetaDataBase& meta); virtual media_status_t getMetaData(AMediaFormat *meta);
virtual const char * name() { return "MP3Extractor"; } virtual const char * name() { return "MP3Extractor"; }
private: private:
@ -49,7 +49,7 @@ private:
DataSourceHelper *mDataSource; DataSourceHelper *mDataSource;
off64_t mFirstFramePos; off64_t mFirstFramePos;
MetaDataBase mMeta; AMediaFormat *mMeta;
uint32_t mFixedHeader; uint32_t mFixedHeader;
MP3Seeker *mSeeker; MP3Seeker *mSeeker;

@ -3608,7 +3608,6 @@ void MPEG4Extractor::parseID3v2MetaData(off64_t offset) {
if (data) { if (data) {
mFileMetaData.setData(kKeyAlbumArt, MetaData::TYPE_NONE, data, dataSize); mFileMetaData.setData(kKeyAlbumArt, MetaData::TYPE_NONE, data, dataSize);
mFileMetaData.setCString(kKeyAlbumArtMIME, mime.string());
} }
} }
} }

@ -100,8 +100,6 @@ static void extractAlbumArt(
fileMeta->setData( fileMeta->setData(
kKeyAlbumArt, 0, &flac[8 + typeLen + 4 + descLen + 20], dataLen); kKeyAlbumArt, 0, &flac[8 + typeLen + 4 + descLen + 20], dataLen);
fileMeta->setCString(kKeyAlbumArtMIME, type);
} }
void parseVorbisComment( void parseVorbisComment(

@ -101,7 +101,6 @@ enum {
kKeyTitle = 'titl', // cstring kKeyTitle = 'titl', // cstring
kKeyYear = 'year', // cstring kKeyYear = 'year', // cstring
kKeyAlbumArt = 'albA', // compressed image data kKeyAlbumArt = 'albA', // compressed image data
kKeyAlbumArtMIME = 'alAM', // cstring
kKeyAuthor = 'auth', // cstring kKeyAuthor = 'auth', // cstring
kKeyCDTrackNumber = 'cdtr', // cstring kKeyCDTrackNumber = 'cdtr', // cstring
kKeyDiscNumber = 'dnum', // cstring kKeyDiscNumber = 'dnum', // cstring

@ -569,6 +569,51 @@ static void parseVp9ProfileLevelFromCsd(const sp<ABuffer> &csd, sp<AMessage> &fo
} }
std::vector<std::pair<const char *, uint32_t>> tagMappings {
{
{ "album", kKeyAlbum },
{ "albumartist", kKeyAlbumArtist },
{ "artist", kKeyArtist },
{ "author", kKeyAuthor },
{ "cdtracknum", kKeyCDTrackNumber },
{ "compilation", kKeyCompilation },
{ "composer", kKeyComposer },
{ "discnum", kKeyDiscNumber },
{ "genre", kKeyGenre },
{ "title", kKeyTitle },
{ "year", kKeyYear },
}
};
void convertMessageToMetaDataTags(const sp<AMessage> &msg, sp<MetaData> &meta) {
for (auto elem : tagMappings) {
AString value;
if (msg->findString(elem.first, &value)) {
meta->setCString(elem.second, value.c_str());
}
}
sp<ABuffer> buf;
if (msg->findBuffer("albumart", &buf)) {
meta->setData(kKeyAlbumArt, MetaDataBase::Type::TYPE_NONE, buf->data(), buf->size());
}
}
void convertMetaDataToMessageTags(const MetaDataBase *meta, sp<AMessage> format) {
for (auto elem : tagMappings) {
const char *value;
if (meta->findCString(elem.second, &value)) {
format->setString(elem.first, value, strlen(value));
}
}
uint32_t type;
const void* data;
size_t size;
if (meta->findData(kKeyAlbumArt, &type, &data, &size)) {
sp<ABuffer> buf = ABuffer::CreateAsCopy(data, size);
format->setBuffer("albumart", buf);
}
}
status_t convertMetaDataToMessage( status_t convertMetaDataToMessage(
const sp<MetaData> &meta, sp<AMessage> *format) { const sp<MetaData> &meta, sp<AMessage> *format) {
return convertMetaDataToMessage(meta.get(), format); return convertMetaDataToMessage(meta.get(), format);
@ -592,6 +637,8 @@ status_t convertMetaDataToMessage(
sp<AMessage> msg = new AMessage; sp<AMessage> msg = new AMessage;
msg->setString("mime", mime); msg->setString("mime", mime);
convertMetaDataToMessageTags(meta, msg);
uint32_t type; uint32_t type;
const void *data; const void *data;
size_t size; size_t size;
@ -1298,6 +1345,8 @@ void convertMessageToMetaData(const sp<AMessage> &msg, sp<MetaData> &meta) {
ALOGW("did not find mime type"); ALOGW("did not find mime type");
} }
convertMessageToMetaDataTags(msg, meta);
int64_t durationUs; int64_t durationUs;
if (msg->findInt64("durationUs", &durationUs)) { if (msg->findInt64("durationUs", &durationUs)) {
meta->setInt64(kKeyDuration, durationUs); meta->setInt64(kKeyDuration, durationUs);

@ -268,27 +268,39 @@ EXPORT const char* AMEDIAFORMAT_KEY_AAC_ENCODED_TARGET_LEVEL = "aac-encoded-targ
EXPORT const char* AMEDIAFORMAT_KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT = "aac-max-output-channel_count"; EXPORT const char* AMEDIAFORMAT_KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT = "aac-max-output-channel_count";
EXPORT const char* AMEDIAFORMAT_KEY_AAC_PROFILE = "aac-profile"; EXPORT const char* AMEDIAFORMAT_KEY_AAC_PROFILE = "aac-profile";
EXPORT const char* AMEDIAFORMAT_KEY_AAC_SBR_MODE = "aac-sbr-mode"; EXPORT const char* AMEDIAFORMAT_KEY_AAC_SBR_MODE = "aac-sbr-mode";
EXPORT const char* AMEDIAFORMAT_KEY_ALBUM = "album";
EXPORT const char* AMEDIAFORMAT_KEY_ALBUMART = "albumart";
EXPORT const char* AMEDIAFORMAT_KEY_ALBUMARTIST = "albumartist";
EXPORT const char* AMEDIAFORMAT_KEY_ARTIST = "artist";
EXPORT const char* AMEDIAFORMAT_KEY_AUDIO_SESSION_ID = "audio-session-id"; EXPORT const char* AMEDIAFORMAT_KEY_AUDIO_SESSION_ID = "audio-session-id";
EXPORT const char* AMEDIAFORMAT_KEY_AUTHOR = "author";
EXPORT const char* AMEDIAFORMAT_KEY_BITRATE_MODE = "bitrate-mode"; EXPORT const char* AMEDIAFORMAT_KEY_BITRATE_MODE = "bitrate-mode";
EXPORT const char* AMEDIAFORMAT_KEY_BIT_RATE = "bitrate"; EXPORT const char* AMEDIAFORMAT_KEY_BIT_RATE = "bitrate";
EXPORT const char* AMEDIAFORMAT_KEY_CAPTURE_RATE = "capture-rate"; EXPORT const char* AMEDIAFORMAT_KEY_CAPTURE_RATE = "capture-rate";
EXPORT const char* AMEDIAFORMAT_KEY_CDTRACKNUMBER = "cdtracknum";
EXPORT const char* AMEDIAFORMAT_KEY_CHANNEL_COUNT = "channel-count"; EXPORT const char* AMEDIAFORMAT_KEY_CHANNEL_COUNT = "channel-count";
EXPORT const char* AMEDIAFORMAT_KEY_CHANNEL_MASK = "channel-mask"; EXPORT const char* AMEDIAFORMAT_KEY_CHANNEL_MASK = "channel-mask";
EXPORT const char* AMEDIAFORMAT_KEY_COLOR_FORMAT = "color-format"; EXPORT const char* AMEDIAFORMAT_KEY_COLOR_FORMAT = "color-format";
EXPORT const char* AMEDIAFORMAT_KEY_COLOR_RANGE = "color-range"; EXPORT const char* AMEDIAFORMAT_KEY_COLOR_RANGE = "color-range";
EXPORT const char* AMEDIAFORMAT_KEY_COLOR_STANDARD = "color-standard"; EXPORT const char* AMEDIAFORMAT_KEY_COLOR_STANDARD = "color-standard";
EXPORT const char* AMEDIAFORMAT_KEY_COLOR_TRANSFER = "color-transfer"; EXPORT const char* AMEDIAFORMAT_KEY_COLOR_TRANSFER = "color-transfer";
EXPORT const char* AMEDIAFORMAT_KEY_COMPILATION = "compilation";
EXPORT const char* AMEDIAFORMAT_KEY_COMPLEXITY = "complexity"; EXPORT const char* AMEDIAFORMAT_KEY_COMPLEXITY = "complexity";
EXPORT const char* AMEDIAFORMAT_KEY_COMPOSER = "composer";
EXPORT const char* AMEDIAFORMAT_KEY_CSD = "csd"; EXPORT const char* AMEDIAFORMAT_KEY_CSD = "csd";
EXPORT const char* AMEDIAFORMAT_KEY_CSD_0 = "csd-0"; EXPORT const char* AMEDIAFORMAT_KEY_CSD_0 = "csd-0";
EXPORT const char* AMEDIAFORMAT_KEY_CSD_1 = "csd-1"; EXPORT const char* AMEDIAFORMAT_KEY_CSD_1 = "csd-1";
EXPORT const char* AMEDIAFORMAT_KEY_CSD_2 = "csd-2"; EXPORT const char* AMEDIAFORMAT_KEY_CSD_2 = "csd-2";
EXPORT const char* AMEDIAFORMAT_KEY_DISCNUMBER = "discnum";
EXPORT const char* AMEDIAFORMAT_KEY_DISPLAY_CROP = "crop"; EXPORT const char* AMEDIAFORMAT_KEY_DISPLAY_CROP = "crop";
EXPORT const char* AMEDIAFORMAT_KEY_DISPLAY_HEIGHT = "display-height"; EXPORT const char* AMEDIAFORMAT_KEY_DISPLAY_HEIGHT = "display-height";
EXPORT const char* AMEDIAFORMAT_KEY_DISPLAY_WIDTH = "display-width"; EXPORT const char* AMEDIAFORMAT_KEY_DISPLAY_WIDTH = "display-width";
EXPORT const char* AMEDIAFORMAT_KEY_DURATION = "durationUs"; EXPORT const char* AMEDIAFORMAT_KEY_DURATION = "durationUs";
EXPORT const char* AMEDIAFORMAT_KEY_ENCODER_DELAY = "encoder-delay";
EXPORT const char* AMEDIAFORMAT_KEY_ENCODER_PADDING = "encoder-padding";
EXPORT const char* AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL = "flac-compression-level"; EXPORT const char* AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL = "flac-compression-level";
EXPORT const char* AMEDIAFORMAT_KEY_FRAME_RATE = "frame-rate"; EXPORT const char* AMEDIAFORMAT_KEY_FRAME_RATE = "frame-rate";
EXPORT const char* AMEDIAFORMAT_KEY_GENRE = "genre";
EXPORT const char* AMEDIAFORMAT_KEY_GRID_COLUMNS = "grid-cols"; EXPORT const char* AMEDIAFORMAT_KEY_GRID_COLUMNS = "grid-cols";
EXPORT const char* AMEDIAFORMAT_KEY_GRID_ROWS = "grid-rows"; EXPORT const char* AMEDIAFORMAT_KEY_GRID_ROWS = "grid-rows";
EXPORT const char* AMEDIAFORMAT_KEY_HDR_STATIC_INFO = "hdr-static-info"; EXPORT const char* AMEDIAFORMAT_KEY_HDR_STATIC_INFO = "hdr-static-info";
@ -323,9 +335,11 @@ EXPORT const char* AMEDIAFORMAT_KEY_TEMPORAL_LAYERING = "ts-schema";
EXPORT const char* AMEDIAFORMAT_KEY_TILE_HEIGHT = "tile-height"; EXPORT const char* AMEDIAFORMAT_KEY_TILE_HEIGHT = "tile-height";
EXPORT const char* AMEDIAFORMAT_KEY_TILE_WIDTH = "tile-width"; EXPORT const char* AMEDIAFORMAT_KEY_TILE_WIDTH = "tile-width";
EXPORT const char* AMEDIAFORMAT_KEY_TIME_US = "timeUs"; EXPORT const char* AMEDIAFORMAT_KEY_TIME_US = "timeUs";
EXPORT const char* AMEDIAFORMAT_KEY_TITLE = "title";
EXPORT const char* AMEDIAFORMAT_KEY_TRACK_ID = "track-id"; EXPORT const char* AMEDIAFORMAT_KEY_TRACK_ID = "track-id";
EXPORT const char* AMEDIAFORMAT_KEY_TRACK_INDEX = "track-index"; EXPORT const char* AMEDIAFORMAT_KEY_TRACK_INDEX = "track-index";
EXPORT const char* AMEDIAFORMAT_KEY_WIDTH = "width"; EXPORT const char* AMEDIAFORMAT_KEY_WIDTH = "width";
EXPORT const char* AMEDIAFORMAT_KEY_YEAR = "year";
} // extern "C" } // extern "C"

@ -86,10 +86,6 @@ void AMediaFormat_setString(AMediaFormat*, const char* name, const char* value)
void AMediaFormat_setBuffer(AMediaFormat*, const char* name, const void* data, size_t size) __INTRODUCED_IN(21); void AMediaFormat_setBuffer(AMediaFormat*, const char* name, const void* data, size_t size) __INTRODUCED_IN(21);
/**
* XXX should these be ints/enums that we look up in a table as needed?
*/
extern const char* AMEDIAFORMAT_KEY_AAC_DRC_ATTENUATION_FACTOR __INTRODUCED_IN(28); extern const char* AMEDIAFORMAT_KEY_AAC_DRC_ATTENUATION_FACTOR __INTRODUCED_IN(28);
extern const char* AMEDIAFORMAT_KEY_AAC_DRC_BOOST_FACTOR __INTRODUCED_IN(28); extern const char* AMEDIAFORMAT_KEY_AAC_DRC_BOOST_FACTOR __INTRODUCED_IN(28);
extern const char* AMEDIAFORMAT_KEY_AAC_DRC_HEAVY_COMPRESSION __INTRODUCED_IN(28); extern const char* AMEDIAFORMAT_KEY_AAC_DRC_HEAVY_COMPRESSION __INTRODUCED_IN(28);
@ -156,7 +152,6 @@ extern const char* AMEDIAFORMAT_KEY_TIME_US __INTRODUCED_IN(28);
extern const char* AMEDIAFORMAT_KEY_TRACK_ID __INTRODUCED_IN(28); extern const char* AMEDIAFORMAT_KEY_TRACK_ID __INTRODUCED_IN(28);
extern const char* AMEDIAFORMAT_KEY_TRACK_INDEX __INTRODUCED_IN(28); extern const char* AMEDIAFORMAT_KEY_TRACK_INDEX __INTRODUCED_IN(28);
extern const char* AMEDIAFORMAT_KEY_WIDTH __INTRODUCED_IN(21); extern const char* AMEDIAFORMAT_KEY_WIDTH __INTRODUCED_IN(21);
#endif /* __ANDROID_API__ >= 21 */ #endif /* __ANDROID_API__ >= 21 */
#if __ANDROID_API__ >= 28 #if __ANDROID_API__ >= 28
@ -180,6 +175,22 @@ void AMediaFormat_clear(AMediaFormat*) __INTRODUCED_IN(29);
* copy one AMediaFormat to another * copy one AMediaFormat to another
*/ */
media_status_t AMediaFormat_copy(AMediaFormat *to, AMediaFormat *from) __INTRODUCED_IN(29); media_status_t AMediaFormat_copy(AMediaFormat *to, AMediaFormat *from) __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_ALBUM __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_ALBUMART __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_ALBUMARTIST __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_ARTIST __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_AUTHOR __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_CDTRACKNUMBER __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_COMPILATION __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_COMPOSER __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_DISCNUMBER __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_ENCODER_DELAY __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_ENCODER_PADDING __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_GENRE __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_TITLE __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_YEAR __INTRODUCED_IN(29);
#endif /* __ANDROID_API__ >= 29 */ #endif /* __ANDROID_API__ >= 29 */
__END_DECLS __END_DECLS

Loading…
Cancel
Save