Steven Moreland | 0a0ff0b | 2021-04-02 00:06:01 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #pragma once |
| 18 | |
| 19 | #ifndef __ANDROID_VNDK__ |
| 20 | |
| 21 | #include <binder/IInterface.h> |
| 22 | |
| 23 | namespace android { |
| 24 | |
| 25 | // ---------------------------------------------------------------------- |
| 26 | |
| 27 | class IMediaResourceMonitor : public IInterface { |
| 28 | public: |
| 29 | DECLARE_META_INTERFACE(MediaResourceMonitor) |
| 30 | |
| 31 | // Values should be in sync with Intent.EXTRA_MEDIA_RESOURCE_TYPE_XXX. |
| 32 | enum { |
| 33 | TYPE_VIDEO_CODEC = 0, |
| 34 | TYPE_AUDIO_CODEC = 1, |
| 35 | }; |
| 36 | |
| 37 | virtual void notifyResourceGranted(/*in*/ int32_t pid, /*in*/ const int32_t type) = 0; |
| 38 | |
| 39 | enum { |
| 40 | NOTIFY_RESOURCE_GRANTED = IBinder::FIRST_CALL_TRANSACTION, |
| 41 | }; |
| 42 | }; |
| 43 | |
| 44 | // ---------------------------------------------------------------------- |
| 45 | |
| 46 | class BnMediaResourceMonitor : public BnInterface<IMediaResourceMonitor> { |
| 47 | public: |
| 48 | // NOLINTNEXTLINE(google-default-arguments) |
| 49 | virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply, |
| 50 | uint32_t flags = 0); |
| 51 | }; |
| 52 | |
| 53 | // ---------------------------------------------------------------------- |
| 54 | |
| 55 | } // namespace android |
| 56 | |
| 57 | #else // __ANDROID_VNDK__ |
| 58 | #error "This header is not visible to vendors" |
| 59 | #endif // __ANDROID_VNDK__ |