blob: 0081e7eea17eb38237b77a0b2890ffce0d11612c [file] [log] [blame]
Marco Nelissenb2487f02015-09-01 13:23:23 -07001/*
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 Nelissendab79b32019-11-18 08:25:47 -080021#include <android/BnMediaExtractorService.h>
22#include <android/IMediaExtractor.h>
Marco Nelissenb2487f02015-09-01 13:23:23 -070023
24namespace android {
25
26class MediaExtractorService : public BinderService<MediaExtractorService>, public BnMediaExtractorService
27{
Marco Nelissenb2487f02015-09-01 13:23:23 -070028public:
Dongwon Kang7fa7c862018-12-06 09:07:58 -080029 MediaExtractorService();
Marco Nelissendab79b32019-11-18 08:25:47 -080030 virtual ~MediaExtractorService();
Marco Nelissenb2487f02015-09-01 13:23:23 -070031
32 static const char* getServiceName() { return "media.extractor"; }
33
Marco Nelissendab79b32019-11-18 08:25:47 -080034 virtual ::android::binder::Status makeExtractor(
35 const ::android::sp<::android::IDataSource>& source,
Jooyung Hanb3f7cd22020-01-23 12:27:18 +090036 const ::std::optional< ::std::string> &mime,
Marco Nelissendab79b32019-11-18 08:25:47 -080037 ::android::sp<::android::IMediaExtractor>* _aidl_return);
Andy Hungd49dbd62016-07-07 14:20:35 -070038
Marco Nelissendab79b32019-11-18 08:25:47 -080039 virtual ::android::binder::Status makeIDataSource(
Jiyong Park51207512019-12-03 16:24:48 +090040 base::unique_fd fd,
Marco Nelissendab79b32019-11-18 08:25:47 -080041 int64_t offset,
42 int64_t length,
43 ::android::sp<::android::IDataSource>* _aidl_return);
Andy Hungd49dbd62016-07-07 14:20:35 -070044
Marco Nelissendab79b32019-11-18 08:25:47 -080045 virtual ::android::binder::Status getSupportedTypes(::std::vector<::std::string>* _aidl_return);
Marco Nelissen57822092019-01-07 14:51:32 -080046
Marco Nelissendab79b32019-11-18 08:25:47 -080047 virtual status_t dump(int fd, const Vector<String16>& args);
Marco Nelissenb2487f02015-09-01 13:23:23 -070048
49private:
50 Mutex mLock;
51};
52
53} // namespace android
54
55#endif // ANDROID_MEDIA_EXTRACTOR_SERVICE_H