160b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar/*
260b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * Copyright (C) 2014 The Android Open Source Project
360b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar *
460b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * Licensed under the Apache License, Version 2.0 (the "License");
560b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * you may not use this file except in compliance with the License.
660b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * You may obtain a copy of the License at
760b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar *
860b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar *      http://www.apache.org/licenses/LICENSE-2.0
960b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar *
1060b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * Unless required by applicable law or agreed to in writing, software
1160b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * distributed under the License is distributed on an "AS IS" BASIS,
1260b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1360b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * See the License for the specific language governing permissions and
1460b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar * limitations under the License.
1560b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar */
1660b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
1760b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar#ifndef ANDROID_IMEDIACODECLIST_H
1860b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar#define ANDROID_IMEDIACODECLIST_H
1960b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
2060b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar#include <utils/Errors.h>  // for status_t
2160b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar#include <binder/IInterface.h>
2260b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar#include <binder/Parcel.h>
2360b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
2460b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnarnamespace android {
2560b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
2660b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnarstruct MediaCodecInfo;
2760b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
2860b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnarclass IMediaCodecList: public IInterface
2960b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar{
3060b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnarpublic:
3160b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar    DECLARE_META_INTERFACE(MediaCodecList);
3260b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
3360b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar    virtual size_t countCodecs() const = 0;
3460b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar    virtual sp<MediaCodecInfo> getCodecInfo(size_t index) const = 0;
3560b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
3660b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar    virtual ssize_t findCodecByType(
3760b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar            const char *type, bool encoder, size_t startIndex = 0) const = 0;
3860b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
3960b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar    virtual ssize_t findCodecByName(const char *name) const = 0;
4060b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar};
4160b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
4260b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar// ----------------------------------------------------------------------------
4360b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
4460b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnarclass BnMediaCodecList: public BnInterface<IMediaCodecList>
4560b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar{
4660b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnarpublic:
4760b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar    virtual status_t    onTransact( uint32_t code,
4860b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar                                    const Parcel& data,
4960b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar                                    Parcel* reply,
5060b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar                                    uint32_t flags = 0);
5160b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar};
5260b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
5360b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar}; // namespace android
5460b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar
5560b1c0e79d12a1c70758bc8d060156924635f8baLajos Molnar#endif // ANDROID_IMEDIACODECLIST_H
56