blob: c2c30b9e514c939bcd032e0f602b413953e64873 [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
25namespace media {
26
27using Status = ::ndk::ScopedAStatus;
28using ::aidl::android::media::BnMediaTranscodingService;
29using ::aidl::android::media::ITranscodingServiceClient;
30using ::aidl::android::media::TranscodingJob;
31using ::aidl::android::media::TranscodingRequest;
32
33class MediaTranscodingService : public BnMediaTranscodingService {
34public:
35 MediaTranscodingService();
36 virtual ~MediaTranscodingService();
37
38 static void instantiate();
39
40 static const char* getServiceName() { return "media.transcoding"; }
41
42 Status registerClient(const std::shared_ptr<ITranscodingServiceClient>& in_client,
43 int32_t* _aidl_return) override;
44
45 Status unregisterClient(int32_t clientId, bool* _aidl_return) override;
46
47 Status submitRequest(int32_t in_clientId, const TranscodingRequest& in_request,
48 TranscodingJob* out_job, int32_t* _aidl_return) override;
49
50 Status cancelJob(int32_t in_clientId, int32_t in_jobId, bool* _aidl_return) override;
51
52 Status getJobWithId(int32_t in_jobId, TranscodingJob* out_job, bool* _aidl_return) override;
53
54 virtual inline binder_status_t dump(int /*fd*/, const char** /*args*/, uint32_t /*numArgs*/);
55
56private:
57};
58
59} // namespace media
60} // namespace android
61
62#endif // ANDROID_MEDIA_TRANSCODING_SERVICE_H