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 Trivinamespace android {
186e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
196e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi/**************************************************************************
206e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Important note: the functions below are helper functions for the
216e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *   implementation of the XAVideoDecoderCapabilitiesItf interface on
226e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *   Android. They are ONLY exposing the "hardware" video decoders
236e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *   as dynamically discovered on the platform. A hardware video decoder
246e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *   is defined as one where video decoding takes advantage of a hardware-
256e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *   specific feature of the platform, such as DSP or particular GPU.
266e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *   "Software" decoders, such as the ones available as default implementations
276e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *   in the Android tree, as not exposed here, but are rather listed in
286e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *   the CDD.
296e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi */
306e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
316e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi/*
326e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Initializes the list of supported video codecs, with their associated profiles and levels
336e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Return
346e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *     false if it failed to list the available codecs, true otherwise
356e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi */
366e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Triviextern bool android_videoCodec_expose();
376e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
386e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi/*
396e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Frees all resources associated with the listing and query of the available video codecs
406e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi */
416e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Triviextern void android_videoCodec_deinit();
426e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
436e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi/*
446e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Returns the number of video codecs supported on the platform.
456e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Returns 0 if android_videoCodec_expose() hasn't been called before (and returned true)
466e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi */
476e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Triviextern XAuint32 android_videoCodec_getNbDecoders();
486e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
496e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi/*
506e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Retrieve the supported decoder IDs
516e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Pre-condition
526e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    nbDecoders <= number of decoders
536e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    pDecoderIds != NULL
546e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    android_videoCodec_expose() has been called before (and returned true)
556e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi */
566e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Triviextern void android_videoCodec_getDecoderIds(XAuint32 nbDecoders, XAuint32 *pDecoderIds);
576e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
586e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi/*
596e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Retrieves the number of profile / level combinations for a given codec
606e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Pre-condition
616e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    pNb != NULL
626e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    android_videoCodec_expose() has been called before (and returned true)
636e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Return
646e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    SL_RESULT_SUCCESS if the number of combinations was successfully retrieved and at least
656e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *                         one profile/level is supported (*pNb > 0)
666e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    SL_RESULT_PARAMETER_INVALID otherwise
676e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi */
686e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Triviextern SLresult android_videoCodec_getProfileLevelCombinationNb(XAuint32 decoderId, XAuint32 *pNb);
696e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
706e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi/*
716e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Retrieves the profile / level at index plIndex in the list of profile / level combinations
726e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    supported by the given codec
736e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Pre-condition
746e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    pDescr != NULL
756e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    android_videoCodec_expose() has been called before (and returned true)
766e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Post-condition
776e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    pDescr->codecId == decoderId
786e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi * Return
796e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    SL_RESULT_SUCCESS if the profile/level was successfully retrieved
806e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi *    SL_RESULT_PARAMETER_INVALID otherwise: invalid codec or invalid profile/level index
816e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi */
826e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Triviextern SLresult android_videoCodec_getProfileLevelCombination(XAuint32 decoderId,
836e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi        XAuint32 plIndex, XAVideoCodecDescriptor *pDescr);
846e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi
856e7e174807fc639c49125ced8962aa369370fbf0Jean-Michel Trivi}; // namespace android
86