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 | |
| 28 | namespace media { |
| 29 | |
| 30 | using android::media::MediaTranscodingService; |
| 31 | |
| 32 | MediaTranscodingService::MediaTranscodingService() { |
| 33 | ALOGV("MediaTranscodingService is created"); |
| 34 | } |
| 35 | |
| 36 | MediaTranscodingService::~MediaTranscodingService() { |
| 37 | ALOGE("Should not be in ~MediaTranscodingService"); |
| 38 | } |
| 39 | |
| 40 | binder_status_t MediaTranscodingService::dump(int /* fd */, const char** /*args*/, |
| 41 | uint32_t /*numArgs*/) { |
| 42 | // TODO(hkuang): Add implementation. |
| 43 | return OK; |
| 44 | } |
| 45 | |
| 46 | //static |
| 47 | void MediaTranscodingService::instantiate() { |
| 48 | std::shared_ptr<MediaTranscodingService> service = |
| 49 | ::ndk::SharedRefBase::make<MediaTranscodingService>(); |
| 50 | binder_status_t status = |
| 51 | AServiceManager_addService(service->asBinder().get(), getServiceName()); |
| 52 | if (status != STATUS_OK) { |
| 53 | return; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | Status MediaTranscodingService::registerClient( |
| 58 | const std::shared_ptr<ITranscodingServiceClient>& /*in_client*/, |
| 59 | int32_t* /*_aidl_return*/) { |
| 60 | // TODO(hkuang): Add implementation. |
| 61 | return Status::ok(); |
| 62 | } |
| 63 | |
| 64 | Status MediaTranscodingService::unregisterClient(int32_t /*clientId*/, bool* /*_aidl_return*/) { |
| 65 | // TODO(hkuang): Add implementation. |
| 66 | return Status::ok(); |
| 67 | } |
| 68 | |
| 69 | Status MediaTranscodingService::submitRequest(int32_t /*clientId*/, |
| 70 | const TranscodingRequest& /*request*/, |
| 71 | TranscodingJob* /*job*/, int32_t* /*_aidl_return*/) { |
| 72 | // TODO(hkuang): Add implementation. |
| 73 | return Status::ok(); |
| 74 | } |
| 75 | |
| 76 | Status MediaTranscodingService::cancelJob(int32_t /*in_clientId*/, int32_t /*in_jobId*/, |
| 77 | bool* /*_aidl_return*/) { |
| 78 | // TODO(hkuang): Add implementation. |
| 79 | return Status::ok(); |
| 80 | } |
| 81 | |
| 82 | Status MediaTranscodingService::getJobWithId(int32_t /*in_jobId*/, TranscodingJob* /*out_job*/, |
| 83 | bool* /*_aidl_return*/) { |
| 84 | // TODO(hkuang): Add implementation. |
| 85 | return Status::ok(); |
| 86 | } |
| 87 | |
| 88 | } // namespace media |
| 89 | } // namespace android |