|
|
|
@ -422,14 +422,12 @@ sp<MediaCodec> MediaCodec::CreateByType(
|
|
|
|
|
const sp<ALooper> &looper, const AString &mime, bool encoder, status_t *err, pid_t pid,
|
|
|
|
|
uid_t uid) {
|
|
|
|
|
Vector<AString> matchingCodecs;
|
|
|
|
|
Vector<AString> owners;
|
|
|
|
|
|
|
|
|
|
MediaCodecList::findMatchingCodecs(
|
|
|
|
|
mime.c_str(),
|
|
|
|
|
encoder,
|
|
|
|
|
0,
|
|
|
|
|
&matchingCodecs,
|
|
|
|
|
&owners);
|
|
|
|
|
&matchingCodecs);
|
|
|
|
|
|
|
|
|
|
if (err != NULL) {
|
|
|
|
|
*err = NAME_NOT_FOUND;
|
|
|
|
@ -1217,6 +1215,22 @@ status_t MediaCodec::getName(AString *name) const {
|
|
|
|
|
return OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
status_t MediaCodec::getCodecInfo(sp<MediaCodecInfo> *codecInfo) const {
|
|
|
|
|
sp<AMessage> msg = new AMessage(kWhatGetCodecInfo, this);
|
|
|
|
|
|
|
|
|
|
sp<AMessage> response;
|
|
|
|
|
status_t err;
|
|
|
|
|
if ((err = PostAndAwaitResponse(msg, &response)) != OK) {
|
|
|
|
|
return err;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sp<RefBase> obj;
|
|
|
|
|
CHECK(response->findObject("codecInfo", &obj));
|
|
|
|
|
*codecInfo = static_cast<MediaCodecInfo *>(obj.get());
|
|
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
status_t MediaCodec::getMetrics(MediaAnalyticsItem * &reply) {
|
|
|
|
|
|
|
|
|
|
reply = NULL;
|
|
|
|
@ -2610,6 +2624,17 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case kWhatGetCodecInfo:
|
|
|
|
|
{
|
|
|
|
|
sp<AReplyToken> replyID;
|
|
|
|
|
CHECK(msg->senderAwaitsResponse(&replyID));
|
|
|
|
|
|
|
|
|
|
sp<AMessage> response = new AMessage;
|
|
|
|
|
response->setObject("codecInfo", mCodecInfo);
|
|
|
|
|
response->postReply(replyID);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case kWhatSetParameters:
|
|
|
|
|
{
|
|
|
|
|
sp<AReplyToken> replyID;
|
|
|
|
|