aidl 接口
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
// frameworks/av/media/libmedia/aidl/android/media/MediaResourceParcel.aidl parcelable MediaResourceParcel { // TODO: default enum value is not supported yet. // Set default enum value when b/142739329 is fixed. /** * Type of the media resource. */ MediaResourceType type;// = MediaResourceTypeEnum::kUnspecified; /** * Sub-type of the media resource. */ MediaResourceSubType subType;// = MediaResourceSubTypeEnum::kUnspecifiedSubType; /** * Identifier of the media resource (eg. Drm session id). */ byte[] id; /** * Number of units of the media resource (bytes of graphic memory, number of codecs, etc.). */ long value = 0; } |
MediaResourceType 类型
1 2 3 4 5 6 7 8 9 10 11 |
// frameworks/av/media/libmedia/aidl/android/media/MediaResourceType.aidl @Backing(type="int") enum MediaResourceType { kUnspecified = 0, kSecureCodec = 1, kNonSecureCodec = 2, kGraphicMemory = 3, kCpuBoost = 4, kBattery = 5, kDrmSession = 6, } |
MediaResourceSubType 子类型
1 2 3 4 5 6 7 |
// frameworks/av/media/libmedia/aidl/android/media/MediaResourceSubType.aidl @Backing(type="int") enum MediaResourceSubType { kUnspecifiedSubType = 0, kAudioCodec = 1, kVideoCodec = 2, } |
对应 API 中的类 MediaResource
API 中的类 MediaResource, 实现了 aidl 接口 MediaResourceParcel.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// frameworks/av/media/libmedia/include/media/MediaResource.h class MediaResource : public MediaResourceParcel { public: using Type = MediaResourceType; using SubType = MediaResourceSubType; MediaResource() = delete; MediaResource(Type type, int64_t value); MediaResource(Type type, SubType subType, int64_t value); MediaResource(Type type, const std::vector<int8_t> &id, int64_t value); // 提供创建的静态函数接口 static MediaResource CodecResource(bool secure, bool video); static MediaResource GraphicMemoryResource(int64_t value); static MediaResource CpuBoostResource(); static MediaResource VideoBatteryResource(); static MediaResource DrmSessionResource(const std::vector<int8_t> &id, int64_t value); }; |
MediaResource 存储的信息, type subType value.
提供了一些创建的静态函数接口.
0 Comments