blob: d225f9a83ce7a79004c903c8b5890025c8c203ac [file] [log] [blame]
Hangyu Kuang71b9fb42019-11-27 10:33:32 -08001/*
2 * Copyright (C) 2019 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#ifndef ANDROID_MEDIA_TRANSCODING_SERVICE_H
18#define ANDROID_MEDIA_TRANSCODING_SERVICE_H
19
20#include <aidl/android/media/BnMediaTranscodingService.h>
21#include <binder/IServiceManager.h>
22
23namespace android {
24
Hangyu Kuang71b9fb42019-11-27 10:33:32 -080025using Status = ::ndk::ScopedAStatus;
26using ::aidl::android::media::BnMediaTranscodingService;
27using ::aidl::android::media::ITranscodingServiceClient;
hkuang48c365e2020-01-13 16:33:42 -080028using ::aidl::android::media::TranscodingJobParcel;
29using ::aidl::android::media::TranscodingRequestParcel;
Hangyu Kuang71b9fb42019-11-27 10:33:32 -080030
31class MediaTranscodingService : public BnMediaTranscodingService {
32public:
33 MediaTranscodingService();
34 virtual ~MediaTranscodingService();
35
36 static void instantiate();
37
38 static const char* getServiceName() { return "media.transcoding"; }
39
40 Status registerClient(const std::shared_ptr<ITranscodingServiceClient>& in_client,
hkuang48c365e2020-01-13 16:33:42 -080041 const std::string& in_opPackageName, int32_t in_clientUid,
42 int32_t in_clientPid, int32_t* _aidl_return) override;
Hangyu Kuang71b9fb42019-11-27 10:33:32 -080043
44 Status unregisterClient(int32_t clientId, bool* _aidl_return) override;
45
hkuang48c365e2020-01-13 16:33:42 -080046 Status submitRequest(int32_t in_clientId, const TranscodingRequestParcel& in_request,
47 TranscodingJobParcel* out_job, int32_t* _aidl_return) override;
Hangyu Kuang71b9fb42019-11-27 10:33:32 -080048
49 Status cancelJob(int32_t in_clientId, int32_t in_jobId, bool* _aidl_return) override;
50
hkuang48c365e2020-01-13 16:33:42 -080051 Status getJobWithId(int32_t in_jobId, TranscodingJobParcel* out_job,
52 bool* _aidl_return) override;
Hangyu Kuang71b9fb42019-11-27 10:33:32 -080053
54 virtual inline binder_status_t dump(int /*fd*/, const char** /*args*/, uint32_t /*numArgs*/);
55
56private:
57};
58
Hangyu Kuang71b9fb42019-11-27 10:33:32 -080059} // namespace android
60
61#endif // ANDROID_MEDIA_TRANSCODING_SERVICE_H