From bc7269278042e448299c2e80e4dbb16fed05791d Mon Sep 17 00:00:00 2001 From: niko Date: Mon, 20 Jul 2009 15:07:26 -0700 Subject: [PATCH] Added native metadata support. Metadata.java: Fixed typo 8k != 8092. The comment was correct though. In Metadata.h, the new Metadata class is declared in the ns android::media to limit the chances of conflict with other packages. The MetadataType in MediaPlayerInterface is gone and moved to Metadata as an inner typedef. Similarly the SortedVector instance have been replace by a new type Metadata::Filter. All the keys declared in the java counterpart are also in Metadata.h. Metadata.cpp: Contains the implementation of the native metadata packing. There an associated change in the opencore package that should go in at the same time as this one. --- include/media/MediaPlayerInterface.h | 9 +- include/media/Metadata.h | 133 ++++++++++++++ include/media/PVPlayer.h | 6 +- media/java/android/media/Metadata.java | 2 +- media/libmedia/Android.mk | 37 ++-- media/libmedia/Metadata.cpp | 168 ++++++++++++++++++ .../MediaPlayerService.cpp | 53 +++--- .../MediaPlayerService.h | 13 +- media/libmediaplayerservice/MidiFile.h | 4 - .../StagefrightPlayer.cpp | 7 +- .../libmediaplayerservice/StagefrightPlayer.h | 3 - media/libmediaplayerservice/TestPlayerStub.h | 4 - media/libmediaplayerservice/VorbisPlayer.h | 4 - .../players/invoke_mock_media_player.cpp | 3 - 14 files changed, 359 insertions(+), 87 deletions(-) create mode 100644 include/media/Metadata.h create mode 100644 media/libmedia/Metadata.cpp diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 97d55aa0537af..f723cfdc8e860 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -26,11 +26,10 @@ #include #include +#include namespace android { -typedef int32_t MetadataType; - class Parcel; template class SortedVector; @@ -129,8 +128,10 @@ public: // the known metadata should be returned. // @param[inout] records Parcel where the player appends its metadata. // @return OK if the call was successful. - virtual status_t getMetadata(const SortedVector& ids, - Parcel *records) = 0; + virtual status_t getMetadata(const media::Metadata::Filter& ids, + Parcel *records) { + return INVALID_OPERATION; + }; protected: virtual void sendEvent(int msg, int ext1=0, int ext2=0) { if (mNotify) mNotify(mCookie, msg, ext1, ext2); } diff --git a/include/media/Metadata.h b/include/media/Metadata.h new file mode 100644 index 0000000000000..241868a785c81 --- /dev/null +++ b/include/media/Metadata.h @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_MEDIA_METADATA_H__ +#define ANDROID_MEDIA_METADATA_H__ + +#include +#include +#include +#include + +namespace android { +class Parcel; + +namespace media { + +// Metadata is a class to build/serialize a set of metadata in a Parcel. +// +// This class should be kept in sync with android/media/Metadata.java. +// It provides all the metadata ids available and methods to build the +// header, add records and adjust the set size header field. +// +// Typical Usage: +// ============== +// Parcel p; +// media::Metadata data(&p); +// +// data.appendHeader(); +// data.appendBool(Metadata::kPauseAvailable, true); +// ... more append ... +// data.updateLength(); +// + +class Metadata { + public: + typedef int32_t Type; + typedef SortedVector Filter; + + static const Type kAny = 0; + + // Keep in sync with android/media/Metadata.java + static const Type kTitle = 1; // String + static const Type kComment = 2; // String + static const Type kCopyright = 3; // String + static const Type kAlbum = 4; // String + static const Type kArtist = 5; // String + static const Type kAuthor = 6; // String + static const Type kComposer = 7; // String + static const Type kGenre = 8; // String + static const Type kDate = 9; // Date + static const Type kDuration = 10; // Integer(millisec) + static const Type kCdTrackNum = 11; // Integer 1-based + static const Type kCdTrackMax = 12; // Integer + static const Type kRating = 13; // String + static const Type kAlbumArt = 14; // byte[] + static const Type kVideoFrame = 15; // Bitmap + static const Type kCaption = 16; // TimedText + + static const Type kBitRate = 17; // Integer, Aggregate rate of + // all the streams in bps. + + static const Type kAudioBitRate = 18; // Integer, bps + static const Type kVideoBitRate = 19; // Integer, bps + static const Type kAudioSampleRate = 20; // Integer, Hz + static const Type kVideoframeRate = 21; // Integer, Hz + + // See RFC2046 and RFC4281. + static const Type kMimeType = 22; // String + static const Type kAudioCodec = 23; // String + static const Type kVideoCodec = 24; // String + + static const Type kVideoHeight = 25; // Integer + static const Type kVideoWidth = 26; // Integer + static const Type kNumTracks = 27; // Integer + static const Type kDrmCrippled = 28; // Boolean + + // Playback capabilities. + static const Type kPauseAvailable = 29; // Boolean + static const Type kSeekBackwardAvailable = 30; // Boolean + static const Type kSeekForwardAvailable = 31; // Boolean + + // @param p[inout] The parcel to append the metadata records + // to. The global metadata header should have been set already. + explicit Metadata(Parcel *p); + ~Metadata(); + + // Rewind the underlying parcel, undoing all the changes. + void resetParcel(); + + // Append the size and 'META' marker. + bool appendHeader(); + + // Once all the records have been added, call this to update the + // lenght field in the header. + void updateLength(); + + // append* are methods to append metadata. + // @param key Is the metadata Id. + // @param val Is the value of the metadata. + // @return true if successful, false otherwise. + // TODO: add more as needed to handle other types. + bool appendBool(Type key, bool val); + bool appendInt32(Type key, int32_t val); + + private: + Metadata(const Metadata&); + Metadata& operator=(const Metadata&); + + + // Checks the key is valid and not already present. + bool checkKey(Type key); + + Parcel *mData; + size_t mBegin; +}; + +} // namespace android::media +} // namespace android + +#endif // ANDROID_MEDIA_METADATA_H__ diff --git a/include/media/PVPlayer.h b/include/media/PVPlayer.h index 40ccc14b2ecb0..8a66152e3bbc0 100644 --- a/include/media/PVPlayer.h +++ b/include/media/PVPlayer.h @@ -19,6 +19,7 @@ #include #include +#include #define MAX_OPENCORE_INSTANCES 25 @@ -53,8 +54,9 @@ public: virtual status_t setLooping(int loop); virtual player_type playerType() { return PV_PLAYER; } virtual status_t invoke(const Parcel& request, Parcel *reply); - virtual status_t getMetadata(const SortedVector& ids, - Parcel *records); + virtual status_t getMetadata( + const SortedVector& ids, + Parcel *records); // make available to PlayerDriver void sendEvent(int msg, int ext1=0, int ext2=0) { MediaPlayerBase::sendEvent(msg, ext1, ext2); } diff --git a/media/java/android/media/Metadata.java b/media/java/android/media/Metadata.java index 70e89a2c82a94..bd25da21c86e4 100644 --- a/media/java/android/media/Metadata.java +++ b/media/java/android/media/Metadata.java @@ -104,7 +104,7 @@ public class Metadata public static final int SEEK_FORWARD_AVAILABLE = 31; // Boolean private static final int LAST_SYSTEM = 31; - private static final int FIRST_CUSTOM = 8092; + private static final int FIRST_CUSTOM = 8192; // Shorthands to set the MediaPlayer's metadata filter. public static final Set MATCH_NONE = Collections.EMPTY_SET; diff --git a/media/libmedia/Android.mk b/media/libmedia/Android.mk index cdaab045b7625..07c81f776b919 100644 --- a/media/libmedia/Android.mk +++ b/media/libmedia/Android.mk @@ -2,24 +2,25 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ - AudioTrack.cpp \ - IAudioFlinger.cpp \ - IAudioFlingerClient.cpp \ - IAudioTrack.cpp \ - IAudioRecord.cpp \ - AudioRecord.cpp \ - AudioSystem.cpp \ - mediaplayer.cpp \ - IMediaPlayerService.cpp \ - IMediaPlayerClient.cpp \ - IMediaPlayer.cpp \ - IMediaRecorder.cpp \ - mediarecorder.cpp \ - IMediaMetadataRetriever.cpp \ - mediametadataretriever.cpp \ - ToneGenerator.cpp \ - JetPlayer.cpp \ - IOMX.cpp + AudioTrack.cpp \ + IAudioFlinger.cpp \ + IAudioFlingerClient.cpp \ + IAudioTrack.cpp \ + IAudioRecord.cpp \ + AudioRecord.cpp \ + AudioSystem.cpp \ + mediaplayer.cpp \ + IMediaPlayerService.cpp \ + IMediaPlayerClient.cpp \ + IMediaPlayer.cpp \ + IMediaRecorder.cpp \ + Metadata.cpp \ + mediarecorder.cpp \ + IMediaMetadataRetriever.cpp \ + mediametadataretriever.cpp \ + ToneGenerator.cpp \ + JetPlayer.cpp \ + IOMX.cpp LOCAL_SHARED_LIBRARIES := \ libui libcutils libutils libbinder libsonivox diff --git a/media/libmedia/Metadata.cpp b/media/libmedia/Metadata.cpp new file mode 100644 index 0000000000000..35ec6b34872f0 --- /dev/null +++ b/media/libmedia/Metadata.cpp @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "Metadata" +#include + +#include +#include +#include +#include +#include + +// This file contains code to serialize Metadata triples (key, type, +// value) into a parcel. The Parcel is destinated to be decoded by the +// Metadata.java class. + +namespace { +// All these constants below must be kept in sync with Metadata.java. +enum MetadataId { + FIRST_SYSTEM_ID = 1, + LAST_SYSTEM_ID = 31, + FIRST_CUSTOM_ID = 8192 +}; + +// Types +enum Types { + STRING_VAL = 1, + INTEGER_VAL, + BOOLEAN_VAL, + LONG_VAL, + DOUBLE_VAL, + TIMED_TEXT_VAL, + DATE_VAL, + BYTE_ARRAY_VAL, +}; + +const size_t kRecordHeaderSize = 3 * sizeof(int32_t); +const int32_t kMetaMarker = 0x4d455441; // 'M' 'E' 'T' 'A' + +} // anonymous namespace + +namespace android { +namespace media { + +Metadata::Metadata(Parcel *p) + :mData(p), + mBegin(p->dataPosition()) { } + +Metadata::~Metadata() { } + +void Metadata::resetParcel() +{ + mData->setDataPosition(mBegin); +} + +// Update the 4 bytes int at the beginning of the parcel which holds +// the number of bytes written so far. +void Metadata::updateLength() +{ + const size_t end = mData->dataPosition(); + + mData->setDataPosition(mBegin); + mData->writeInt32(end - mBegin); + mData->setDataPosition(end); +} + +// Write the header. The java layer will look for the marker. +bool Metadata::appendHeader() +{ + bool ok = true; + + // Placeholder for the length of the metadata + ok = ok && mData->writeInt32(-1) == OK; + ok = ok && mData->writeInt32(kMetaMarker) == OK; + return ok; +} + +bool Metadata::appendBool(int key, bool val) +{ + if (!checkKey(key)) { + return false; + } + + const size_t begin = mData->dataPosition(); + bool ok = true; + + // 4 int32s: size, key, type, value. + ok = ok && mData->writeInt32(4 * sizeof(int32_t)) == OK; + ok = ok && mData->writeInt32(key) == OK; + ok = ok && mData->writeInt32(BOOLEAN_VAL) == OK; + ok = ok && mData->writeInt32(val ? 1 : 0) == OK; + if (!ok) { + mData->setDataPosition(begin); + } + return ok; +} + +bool Metadata::appendInt32(int key, int32_t val) +{ + if (!checkKey(key)) { + return false; + } + + const size_t begin = mData->dataPosition(); + bool ok = true; + + // 4 int32s: size, key, type, value. + ok = ok && mData->writeInt32(4 * sizeof(int32_t)) == OK; + ok = ok && mData->writeInt32(key) == OK; + ok = ok && mData->writeInt32(INTEGER_VAL) == OK; + ok = ok && mData->writeInt32(val) == OK; + if (!ok) { + mData->setDataPosition(begin); + } + return ok; +} + +// Check the key (i.e metadata id) is valid if it is a system one. +// Loop over all the exiting ones in the Parcel to check for duplicate +// (not allowed). +bool Metadata::checkKey(int key) +{ + if (key < FIRST_SYSTEM_ID || + (LAST_SYSTEM_ID < key && key < FIRST_CUSTOM_ID)) { + LOGE("Bad key %d", key); + return false; + } + size_t curr = mData->dataPosition(); + // Loop over the keys to check if it has been used already. + mData->setDataPosition(mBegin); + + bool error = false; + size_t left = curr - mBegin; + while (left > 0) { + size_t pos = mData->dataPosition(); + size_t size = mData->readInt32(); + if (size < kRecordHeaderSize || size > left) { + error = true; + break; + } + if (mData->readInt32() == key) { + LOGE("Key exists already %d", key); + error = true; + break; + } + mData->setDataPosition(pos + size); + left -= size; + } + mData->setDataPosition(curr); + return !error; +} + +} // namespace android::media +} // namespace android diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index 5e62f9d8f8e52..77f743447997e 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -47,10 +47,9 @@ #include #include #include +#include #include -#include - #include "MediaRecorderClient.h" #include "MediaPlayerService.h" #include "MetadataRetrieverClient.h" @@ -85,21 +84,17 @@ pid_t gettid() { return syscall(__NR_gettid);} #endif namespace { +using android::media::Metadata; using android::status_t; using android::OK; using android::BAD_VALUE; using android::NOT_ENOUGH_DATA; -using android::MetadataType; using android::Parcel; -using android::SortedVector; // Max number of entries in the filter. const int kMaxFilterSize = 64; // I pulled that out of thin air. -// Keep in sync with ANY in Metadata.java -const int32_t kAny = 0; - -const int32_t kMetaMarker = 0x4d455441; // 'M' 'E' 'T' 'A' +// FIXME: Move all the metadata related function in the Metadata.cpp // Unmarshall a filter from a Parcel. @@ -124,7 +119,7 @@ const int32_t kMetaMarker = 0x4d455441; // 'M' 'E' 'T' 'A' // @param[out] status On exit contains the status code to be returned. // @return true if the parcel starts with a valid filter. bool unmarshallFilter(const Parcel& p, - SortedVector *filter, + Metadata::Filter *filter, status_t *status) { int32_t val; @@ -147,7 +142,7 @@ bool unmarshallFilter(const Parcel& p, filter->clear(); filter->setCapacity(num); - size_t size = num * sizeof(MetadataType); + size_t size = num * sizeof(Metadata::Type); if (p.dataAvail() < size) @@ -157,7 +152,8 @@ bool unmarshallFilter(const Parcel& p, return false; } - const MetadataType *data = static_cast(p.readInplace(size)); + const Metadata::Type *data = + static_cast(p.readInplace(size)); if (NULL == data) { @@ -181,11 +177,11 @@ bool unmarshallFilter(const Parcel& p, // @param filter Of metadata type. // @param val To be searched. // @return true if a match was found. -bool findMetadata(const SortedVector& filter, const int32_t val) +bool findMetadata(const Metadata::Filter& filter, const int32_t val) { // Deal with empty and ANY right away if (filter.isEmpty()) return false; - if (filter[0] == kAny) return true; + if (filter[0] == Metadata::kAny) return true; return filter.indexOf(val) >= 0; } @@ -857,7 +853,7 @@ status_t MediaPlayerService::Client::invoke(const Parcel& request, status_t MediaPlayerService::Client::setMetadataFilter(const Parcel& filter) { status_t status; - SortedVector allow, drop; + media::Metadata::Filter allow, drop; if (unmarshallFilter(filter, &allow, &status) && unmarshallFilter(filter, &drop, &status)) { @@ -872,14 +868,14 @@ status_t MediaPlayerService::Client::setMetadataFilter(const Parcel& filter) status_t MediaPlayerService::Client::getMetadata( bool update_only, bool apply_filter, Parcel *reply) { - sp p = getPlayer(); - if (p == 0) return UNKNOWN_ERROR; + sp player = getPlayer(); + if (player == 0) return UNKNOWN_ERROR; status_t status; // Placeholder for the return code, updated by the caller. reply->writeInt32(-1); - SortedVector ids; + media::Metadata::Filter ids; // We don't block notifications while we fetch the data. We clear // mMetadataUpdated first so we don't lose notifications happening @@ -892,14 +888,13 @@ status_t MediaPlayerService::Client::getMetadata( mMetadataUpdated.clear(); } - const size_t begin = reply->dataPosition(); - reply->writeInt32(-1); // Placeholder for the length of the metadata - reply->writeInt32(kMetaMarker); + media::Metadata metadata(reply); - status = p->getMetadata(ids, reply); + metadata.appendHeader(); + status = player->getMetadata(ids, reply); if (status != OK) { - reply->setDataPosition(begin); + metadata.resetParcel(); LOGE("getMetadata failed %d", status); return status; } @@ -908,12 +903,8 @@ status_t MediaPlayerService::Client::getMetadata( // filtering takes place on the update notifications already. This // would be when all the metadata are fetch and a filter is set. - const size_t end = reply->dataPosition(); - // Everything is fine, update the metadata length. - reply->setDataPosition(begin); - reply->writeInt32(end - begin); - reply->setDataPosition(end); + metadata.updateLength(); return OK; } @@ -1043,7 +1034,7 @@ void MediaPlayerService::Client::notify(void* cookie, int msg, int ext1, int ext if (MEDIA_INFO == msg && MEDIA_INFO_METADATA_UPDATE == ext1) { - const MetadataType metadata_type = ext2; + const media::Metadata::Type metadata_type = ext2; if(client->shouldDropMetadata(metadata_type)) { return; @@ -1058,7 +1049,7 @@ void MediaPlayerService::Client::notify(void* cookie, int msg, int ext1, int ext } -bool MediaPlayerService::Client::shouldDropMetadata(MetadataType code) const +bool MediaPlayerService::Client::shouldDropMetadata(media::Metadata::Type code) const { Mutex::Autolock lock(mLock); @@ -1074,7 +1065,7 @@ bool MediaPlayerService::Client::shouldDropMetadata(MetadataType code) const } -void MediaPlayerService::Client::addNewMetadataUpdate(MetadataType metadata_type) { +void MediaPlayerService::Client::addNewMetadataUpdate(media::Metadata::Type metadata_type) { Mutex::Autolock lock(mLock); if (mMetadataUpdated.indexOf(metadata_type) < 0) { mMetadataUpdated.add(metadata_type); @@ -1499,4 +1490,4 @@ void MediaPlayerService::AudioCache::notify(void* cookie, int msg, int ext1, int p->mSignal.signal(); } -}; // namespace android +} // namespace android diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h index 94cb9178a3ec8..a4be4142fb2ea 100644 --- a/media/libmediaplayerservice/MediaPlayerService.h +++ b/media/libmediaplayerservice/MediaPlayerService.h @@ -23,15 +23,14 @@ #include #include #include -#include #include #include #include #include +#include namespace android { -typedef int32_t MetadataType; class IMediaRecorder; class IMediaMetadataRetriever; @@ -239,12 +238,12 @@ private: // @param type Of the metadata to be tested. // @return true if the metadata should be dropped according to // the filters. - bool shouldDropMetadata(MetadataType type) const; + bool shouldDropMetadata(media::Metadata::Type type) const; // Add a new element to the set of metadata updated. Noop if // the element exists already. // @param type Of the metadata to be recorded. - void addNewMetadataUpdate(MetadataType type); + void addNewMetadataUpdate(media::Metadata::Type type); mutable Mutex mLock; sp mPlayer; @@ -257,14 +256,14 @@ private: int32_t mConnId; // Metadata filters. - SortedVector mMetadataAllow; // protected by mLock - SortedVector mMetadataDrop; // protected by mLock + media::Metadata::Filter mMetadataAllow; // protected by mLock + media::Metadata::Filter mMetadataDrop; // protected by mLock // Metadata updated. For each MEDIA_INFO_METADATA_UPDATE // notification we try to update mMetadataUpdated which is a // set: no duplicate. // getMetadata clears this set. - SortedVector mMetadataUpdated; // protected by mLock + media::Metadata::Filter mMetadataUpdated; // protected by mLock #if CALLBACK_ANTAGONIZER Antagonizer* mAntagonizer; diff --git a/media/libmediaplayerservice/MidiFile.h b/media/libmediaplayerservice/MidiFile.h index 30b6a2e0c3074..25d4a1b624bad 100644 --- a/media/libmediaplayerservice/MidiFile.h +++ b/media/libmediaplayerservice/MidiFile.h @@ -49,10 +49,6 @@ public: virtual status_t invoke(const Parcel& request, Parcel *reply) { return INVALID_OPERATION; } - virtual status_t getMetadata(const SortedVector& ids, - Parcel *records) { - return INVALID_OPERATION; - } private: status_t createOutputTrack(); diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp index 8597275048e7f..9a06d13be7476 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.cpp +++ b/media/libmediaplayerservice/StagefrightPlayer.cpp @@ -144,7 +144,7 @@ status_t StagefrightPlayer::seekTo(int msec) { if (mPlayer == NULL) { return NO_INIT; } - + status_t err = mPlayer->seekTo((int64_t)msec * 1000); sendEvent(MEDIA_SEEK_COMPLETE); @@ -205,9 +205,4 @@ void StagefrightPlayer::setAudioSink(const sp &audioSink) { } } -status_t StagefrightPlayer::getMetadata( - const SortedVector &ids, Parcel *records) { - return INVALID_OPERATION; -} - } // namespace android diff --git a/media/libmediaplayerservice/StagefrightPlayer.h b/media/libmediaplayerservice/StagefrightPlayer.h index f93c1f854999b..f214872c7c644 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.h +++ b/media/libmediaplayerservice/StagefrightPlayer.h @@ -48,9 +48,6 @@ public: virtual status_t invoke(const Parcel &request, Parcel *reply); virtual void setAudioSink(const sp &audioSink); - virtual status_t getMetadata( - const SortedVector &ids, Parcel *records); - private: MediaPlayerImpl *mPlayer; diff --git a/media/libmediaplayerservice/TestPlayerStub.h b/media/libmediaplayerservice/TestPlayerStub.h index 339b10851bc66..80d53a8b95d85 100644 --- a/media/libmediaplayerservice/TestPlayerStub.h +++ b/media/libmediaplayerservice/TestPlayerStub.h @@ -94,10 +94,6 @@ class TestPlayerStub : public MediaPlayerInterface { virtual status_t invoke(const android::Parcel& in, android::Parcel *out) { return mPlayer->invoke(in, out); } - virtual status_t getMetadata(const SortedVector& ids, - Parcel *records) { - return INVALID_OPERATION; - } // @return true if the current build is 'eng' or 'test' and the diff --git a/media/libmediaplayerservice/VorbisPlayer.h b/media/libmediaplayerservice/VorbisPlayer.h index 040eb36a7c7d3..40246543d4ce0 100644 --- a/media/libmediaplayerservice/VorbisPlayer.h +++ b/media/libmediaplayerservice/VorbisPlayer.h @@ -54,10 +54,6 @@ public: virtual status_t setLooping(int loop); virtual player_type playerType() { return VORBIS_PLAYER; } virtual status_t invoke(const Parcel& request, Parcel *reply) {return INVALID_OPERATION;} - virtual status_t getMetadata(const SortedVector& ids, - Parcel *records) { - return INVALID_OPERATION; - } private: status_t setdatasource(const char *path, int fd, int64_t offset, int64_t length); diff --git a/media/tests/players/invoke_mock_media_player.cpp b/media/tests/players/invoke_mock_media_player.cpp index 8d575a35b29c8..77bb5b2917109 100644 --- a/media/tests/players/invoke_mock_media_player.cpp +++ b/media/tests/players/invoke_mock_media_player.cpp @@ -27,7 +27,6 @@ using android::INVALID_OPERATION; using android::ISurface; using android::MediaPlayerBase; -using android::MetadataType; using android::OK; using android::Parcel; using android::SortedVector; @@ -78,8 +77,6 @@ class Player: public MediaPlayerBase virtual status_t setLooping(int loop) {return OK;} virtual player_type playerType() {return TEST_PLAYER;} virtual status_t invoke(const Parcel& request, Parcel *reply); - virtual status_t getMetadata(const SortedVector& ids, - Parcel *records) {return INVALID_OPERATION;} private: // Take a request, copy it to the reply.