16e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi/*
26e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Copyright (C) 2011 The Android Open Source Project
36e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *
46e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Licensed under the Apache License, Version 2.0 (the "License");
56e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * you may not use this file except in compliance with the License.
66e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * You may obtain a copy of the License at
76e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *
86e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *      http://www.apache.org/licenses/LICENSE-2.0
96e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *
106e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Unless required by applicable law or agreed to in writing, software
116e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * distributed under the License is distributed on an "AS IS" BASIS,
126e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
136e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * See the License for the specific language governing permissions and
146e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * limitations under the License.
156e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi */
166e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
176e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi#include "sles_allinclusive.h"
186e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
196e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi#include <media/IMediaPlayerService.h>
206e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi#include <media/stagefright/OMXClient.h>
216e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi#include <media/stagefright/OMXCodec.h>
226e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi#include <media/IOMX.h>
236e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi#include <media/stagefright/MediaDefs.h>
246e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
256e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
266e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivinamespace android {
276e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
286e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi// listed in same order as VideoCodecIds[] in file "../devices.c" with ANDROID defined
296e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivistatic const char *kVideoMimeTypes[] = {
306e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        MEDIA_MIMETYPE_VIDEO_MPEG2,
316e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        MEDIA_MIMETYPE_VIDEO_H263,
326e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        MEDIA_MIMETYPE_VIDEO_MPEG4,
336e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        MEDIA_MIMETYPE_VIDEO_AVC,
346e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        MEDIA_MIMETYPE_VIDEO_VPX
356e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi};
36df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten// must == kMaxVideoDecoders
376e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivistatic const size_t kNbVideoMimeTypes = sizeof(kVideoMimeTypes) / sizeof(kVideoMimeTypes[0]);
386e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
396e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi// codec capabilities in the following arrays maps to the mime types defined in kVideoMimeTypes
40df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten// CodecCapabilities is from OMXCodec.h
416e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivistatic Vector<CodecCapabilities> VideoDecoderCapabilities[kNbVideoMimeTypes];
426e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivistatic XAuint32 VideoDecoderNbProfLevel[kNbVideoMimeTypes];
436e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
446e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivistatic XAuint32 NbSupportedDecoderTypes = 0;
456e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
466e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
476e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel TriviXAuint32 convertOpenMaxIlToAl(OMX_U32 ilVideoProfileOrLevel) {
486e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    // For video codec profiles and levels, the number of trailing zeroes in OpenMAX IL
496e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    // are equal to the matching OpenMAX AL constant value plus 1, for example:
506e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    //    XA_VIDEOPROFILE_H263_BACKWARDCOMPATIBLE ((XAuint32) 0x00000003)
516e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    //        matches
526e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    //    OMX_VIDEO_H263ProfileBackwardCompatible  = 0x04
536e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    return (XAuint32) (__builtin_ctz(ilVideoProfileOrLevel) + 1);
546e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi}
556e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
566e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
576e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivibool android_videoCodec_expose() {
586e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    SL_LOGV("android_videoCodec_expose()");
596e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
603888f4ba1b3c391104c104ce054f7ad4ec71556cGlenn Kasten    sp<IMediaPlayerService> service(IMediaDeathNotifier::getMediaPlayerService());
613888f4ba1b3c391104c104ce054f7ad4ec71556cGlenn Kasten    if (service == NULL) {
623888f4ba1b3c391104c104ce054f7ad4ec71556cGlenn Kasten        // no need to SL_LOGE; getMediaPlayerService already will have done so
636e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        return false;
646e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    }
656e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
66df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten    sp<IOMX> omx(service->getOMX());
676e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    if (omx.get() == NULL) {
68b47c7beddecd38ae565d84b72da526843bfdd43eSteve Block        ALOGE("android_videoCodec_expose() couldn't access OMX interface");
696e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        return false;
706e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    }
716e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
726e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    // used to check whether no codecs were found, which is a sign of failure
736e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    NbSupportedDecoderTypes = 0;
746e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    for (size_t m = 0 ; m < kNbVideoMimeTypes ; m++) {
75df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten        // QueryCodecs is from OMXCodec.h
766e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        if (OK == QueryCodecs(omx, kVideoMimeTypes[m], true /* queryDecoders */,
776e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi                true /* hwCodecOnly */, &VideoDecoderCapabilities[m])) {
78df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten            if (VideoDecoderCapabilities[m].empty()) {
79df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                VideoDecoderNbProfLevel[m] = 0;
80df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten            } else {
81df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                // get the number of profiles and levels for the first codec implementation
82df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                // for a given decoder ID / MIME type
83df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                Vector<CodecProfileLevel> &profileLevels =
84df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                        VideoDecoderCapabilities[m].editItemAt(0).mProfileLevels;
85df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten#if 0   // Intentionally disabled example of making modifications to profile / level combinations
86df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                if (VideoDecoderIds[m] == XA_VIDEOCODEC_AVC) {
87df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                    // remove non-core profile / level combinations
88df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                    for (size_t i = 0, size = profileLevels.size(); i < size; ) {
89df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                        CodecProfileLevel profileLevel = profileLevels.itemAt(i);
90df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                        if (profileLevel.mProfile == XA_VIDEOPROFILE_AVC_BASELINE) {
91df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                            // either skip past this item and don't change vector size
92df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                            ++i;
93df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                        } else {
94df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                            // or remove this item, decrement the vector size,
95df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                            // and next time through the loop check a different item at same index
96df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                            profileLevels.removeAt(i);
97df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                            --size;
98df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                        }
99df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                    }
100df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                }
101df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten#endif
102df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                if ((VideoDecoderNbProfLevel[m] = profileLevels.size()) > 0) {
103df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                    NbSupportedDecoderTypes++;
104df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                } else {
105df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten                    VideoDecoderCapabilities[m].clear();
1066e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi                }
1076e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            }
1086e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        }
1096e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    }
1106e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1116e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    return (NbSupportedDecoderTypes > 0);
1126e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi}
1136e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1146e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1156e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivivoid android_videoCodec_deinit() {
1166e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    SL_LOGV("android_videoCodec_deinit()");
1176e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    for (size_t m = 0 ; m < kNbVideoMimeTypes ; m++) {
1186e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        VideoDecoderCapabilities[m].clear();
1196e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    }
120df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten    // not needed
121df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten    // memset(VideoDecoderNbProfLevel, 0, sizeof(VideoDecoderNbProfLevel));
122df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten    // NbSupportedDecoderTypes = 0;
1236e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi}
1246e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1256e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1266e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel TriviXAuint32 android_videoCodec_getNbDecoders() {
1276e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    return NbSupportedDecoderTypes;
1286e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi}
1296e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1306e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1316e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivivoid android_videoCodec_getDecoderIds(XAuint32 nbDecoders, XAuint32 *pDecoderIds) {
1326e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    XAuint32 *pIds = pDecoderIds;
1336e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    XAuint32 nbFound = 0;
1346e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    for (size_t m = 0 ; m < kNbVideoMimeTypes ; m++) {
1356e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        if (!VideoDecoderCapabilities[m].empty()) {
1366e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            *pIds = VideoDecoderIds[m];
1376e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            pIds++;
1386e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            nbFound++;
1396e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        }
1406e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        // range check: function can be called for fewer codecs than there are
1416e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        if (nbFound == nbDecoders) {
1426e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            break;
1436e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        }
1446e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    }
1456e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi}
1466e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1476e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1486e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel TriviSLresult android_videoCodec_getProfileLevelCombinationNb(XAuint32 decoderId, XAuint32 *pNb)
1496e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi{
1506e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    // translate a decoder ID to an index in the codec table
1516e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    size_t decoderIndex = 0;
1526e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    while (decoderIndex < kNbVideoMimeTypes) {
1536e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        if (decoderId == VideoDecoderIds[decoderIndex]) {
1546e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            *pNb = VideoDecoderNbProfLevel[decoderIndex];
155df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten            return XA_RESULT_SUCCESS;
1566e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        }
1576e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        decoderIndex++;
1586e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    }
1596e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
160df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten    // spec doesn't allow a decoder to report zero profile/level combinations
161df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten    *pNb = 0;
162df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten    return XA_RESULT_PARAMETER_INVALID;
1636e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi}
1646e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1656e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1666e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel TriviSLresult android_videoCodec_getProfileLevelCombination(XAuint32 decoderId, XAuint32 plIndex,
1676e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        XAVideoCodecDescriptor *pDescr)
1686e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi{
1696e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    // translate a decoder ID to an index in the codec table
1706e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    size_t decoderIndex = 0;
1716e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    while (decoderIndex < kNbVideoMimeTypes) {
1726e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        if (decoderId == VideoDecoderIds[decoderIndex]) {
173df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten            // We only look at the first codec implementation for a given decoder ID / MIME type.
174df200f6a98da83bf2c1b14aff0ed356263dfb8b7Glenn Kasten            // OpenMAX AL doesn't let you expose the capabilities of multiple codec implementations.
1756e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            if (!(plIndex < VideoDecoderCapabilities[decoderIndex].itemAt(0).mProfileLevels.size()))
1766e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            {
1776e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi                // asking for invalid profile/level
1786e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi                return XA_RESULT_PARAMETER_INVALID;
1796e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            }
180106a99988093bd3b3b3aafb2da0fbc0d35634787Jean-Michel Trivi            //     set the fields we know about
1816e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            pDescr->codecId = decoderId;
1826e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            pDescr->profileSetting = convertOpenMaxIlToAl(VideoDecoderCapabilities[decoderIndex].
1836e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi                    itemAt(0).mProfileLevels.itemAt(plIndex).mProfile);
18422ced1dc023dc000118e3a26517b14e9babd7c5aGlenn Kasten            pDescr->levelSetting = convertOpenMaxIlToAl(VideoDecoderCapabilities[decoderIndex].
1856e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi                    itemAt(0).mProfileLevels.itemAt(plIndex).mLevel);
186106a99988093bd3b3b3aafb2da0fbc0d35634787Jean-Michel Trivi            //     initialize the fields we don't know about
187106a99988093bd3b3b3aafb2da0fbc0d35634787Jean-Michel Trivi            pDescr->maxWidth = 0;
188106a99988093bd3b3b3aafb2da0fbc0d35634787Jean-Michel Trivi            pDescr->maxHeight = 0;
189106a99988093bd3b3b3aafb2da0fbc0d35634787Jean-Michel Trivi            pDescr->maxFrameRate = 0;
190106a99988093bd3b3b3aafb2da0fbc0d35634787Jean-Michel Trivi            pDescr->maxBitRate = 0;
191106a99988093bd3b3b3aafb2da0fbc0d35634787Jean-Michel Trivi            pDescr->rateControlSupported = 0;
1926e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi            break;
1936e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        }
1946e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        decoderIndex++;
1956e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    }
1966e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi    return (decoderIndex < kNbVideoMimeTypes) ? XA_RESULT_SUCCESS : XA_RESULT_PARAMETER_INVALID;
1976e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi}
1986e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
1996e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi} // namespace android
200