Hangyu Kuang | 71b9fb4 | 2019-11-27 10:33:32 -0800 | [diff] [blame] | 1 | /* |
| 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 | //#define LOG_NDEBUG 0 |
| 18 | #define LOG_TAG "MediaTranscodingService" |
| 19 | #include "MediaTranscodingService.h" |
| 20 | |
| 21 | #include <android/binder_manager.h> |
| 22 | #include <android/binder_process.h> |
| 23 | #include <utils/Log.h> |
| 24 | #include <utils/Vector.h> |
| 25 | |
| 26 | namespace android { |
| 27 | |
Hangyu Kuang | 71b9fb4 | 2019-11-27 10:33:32 -0800 | [diff] [blame] | 28 | MediaTranscodingService::MediaTranscodingService() { |
| 29 | ALOGV("MediaTranscodingService is created"); |
| 30 | } |
| 31 | |
| 32 | MediaTranscodingService::~MediaTranscodingService() { |
| 33 | ALOGE("Should not be in ~MediaTranscodingService"); |
| 34 | } |
| 35 | |
| 36 | binder_status_t MediaTranscodingService::dump(int /* fd */, const char** /*args*/, |
| 37 | uint32_t /*numArgs*/) { |
| 38 | // TODO(hkuang): Add implementation. |
| 39 | return OK; |
| 40 | } |
| 41 | |
| 42 | //static |
| 43 | void MediaTranscodingService::instantiate() { |
| 44 | std::shared_ptr<MediaTranscodingService> service = |
| 45 | ::ndk::SharedRefBase::make<MediaTranscodingService>(); |
| 46 | binder_status_t status = |
| 47 | AServiceManager_addService(service->asBinder().get(), getServiceName()); |
| 48 | if (status != STATUS_OK) { |
| 49 | return; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | Status MediaTranscodingService::registerClient( |
| 54 | const std::shared_ptr<ITranscodingServiceClient>& /*in_client*/, |
hkuang | 48c365e | 2020-01-13 16:33:42 -0800 | [diff] [blame] | 55 | const std::string& /* in_opPackageName */, int32_t /* in_clientUid */, |
| 56 | int32_t /* in_clientPid */, int32_t* /*_aidl_return*/) { |
Hangyu Kuang | 71b9fb4 | 2019-11-27 10:33:32 -0800 | [diff] [blame] | 57 | // TODO(hkuang): Add implementation. |
| 58 | return Status::ok(); |
| 59 | } |
| 60 | |
| 61 | Status MediaTranscodingService::unregisterClient(int32_t /*clientId*/, bool* /*_aidl_return*/) { |
| 62 | // TODO(hkuang): Add implementation. |
| 63 | return Status::ok(); |
| 64 | } |
| 65 | |
| 66 | Status MediaTranscodingService::submitRequest(int32_t /*clientId*/, |
hkuang | 48c365e | 2020-01-13 16:33:42 -0800 | [diff] [blame] | 67 | const TranscodingRequestParcel& /*request*/, |
| 68 | TranscodingJobParcel* /*job*/, |
| 69 | int32_t* /*_aidl_return*/) { |
Hangyu Kuang | 71b9fb4 | 2019-11-27 10:33:32 -0800 | [diff] [blame] | 70 | // TODO(hkuang): Add implementation. |
| 71 | return Status::ok(); |
| 72 | } |
| 73 | |
| 74 | Status MediaTranscodingService::cancelJob(int32_t /*in_clientId*/, int32_t /*in_jobId*/, |
| 75 | bool* /*_aidl_return*/) { |
| 76 | // TODO(hkuang): Add implementation. |
| 77 | return Status::ok(); |
| 78 | } |
| 79 | |
hkuang | 48c365e | 2020-01-13 16:33:42 -0800 | [diff] [blame] | 80 | Status MediaTranscodingService::getJobWithId(int32_t /*in_jobId*/, |
| 81 | TranscodingJobParcel* /*out_job*/, |
Hangyu Kuang | 71b9fb4 | 2019-11-27 10:33:32 -0800 | [diff] [blame] | 82 | bool* /*_aidl_return*/) { |
| 83 | // TODO(hkuang): Add implementation. |
| 84 | return Status::ok(); |
| 85 | } |
| 86 | |
Hangyu Kuang | 71b9fb4 | 2019-11-27 10:33:32 -0800 | [diff] [blame] | 87 | } // namespace android |