Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 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_EXTRACTOR_SERVICE_H |
| 18 | #define ANDROID_MEDIA_EXTRACTOR_SERVICE_H |
| 19 | |
| 20 | #include <binder/BinderService.h> |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 21 | #include <android/BnMediaExtractorService.h> |
| 22 | #include <android/IMediaExtractor.h> |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 23 | |
| 24 | namespace android { |
| 25 | |
| 26 | class MediaExtractorService : public BinderService<MediaExtractorService>, public BnMediaExtractorService |
| 27 | { |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 28 | public: |
Dongwon Kang | 7fa7c86 | 2018-12-06 09:07:58 -0800 | [diff] [blame] | 29 | MediaExtractorService(); |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 30 | virtual ~MediaExtractorService(); |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 31 | |
| 32 | static const char* getServiceName() { return "media.extractor"; } |
| 33 | |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 34 | virtual ::android::binder::Status makeExtractor( |
| 35 | const ::android::sp<::android::IDataSource>& source, |
Jooyung Han | b3f7cd2 | 2020-01-23 12:27:18 +0900 | [diff] [blame] | 36 | const ::std::optional< ::std::string> &mime, |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 37 | ::android::sp<::android::IMediaExtractor>* _aidl_return); |
Andy Hung | d49dbd6 | 2016-07-07 14:20:35 -0700 | [diff] [blame] | 38 | |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 39 | virtual ::android::binder::Status makeIDataSource( |
Jiyong Park | 5120751 | 2019-12-03 16:24:48 +0900 | [diff] [blame] | 40 | base::unique_fd fd, |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 41 | int64_t offset, |
| 42 | int64_t length, |
| 43 | ::android::sp<::android::IDataSource>* _aidl_return); |
Andy Hung | d49dbd6 | 2016-07-07 14:20:35 -0700 | [diff] [blame] | 44 | |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 45 | virtual ::android::binder::Status getSupportedTypes(::std::vector<::std::string>* _aidl_return); |
Marco Nelissen | 5782209 | 2019-01-07 14:51:32 -0800 | [diff] [blame] | 46 | |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 47 | virtual status_t dump(int fd, const Vector<String16>& args); |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 48 | |
| 49 | private: |
| 50 | Mutex mLock; |
| 51 | }; |
| 52 | |
| 53 | } // namespace android |
| 54 | |
| 55 | #endif // ANDROID_MEDIA_EXTRACTOR_SERVICE_H |