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>
21 #include <android/BnMediaExtractorService.h>
22 #include <android/IMediaExtractor.h>
23 
24 namespace android {
25 
26 class MediaExtractorService : public BinderService<MediaExtractorService>, public BnMediaExtractorService
27 {
28 public:
29     MediaExtractorService();
30     virtual ~MediaExtractorService();
31 
getServiceName()32     static const char*  getServiceName() { return "media.extractor"; }
33 
34     virtual ::android::binder::Status makeExtractor(
35             const ::android::sp<::android::IDataSource>& source,
36             const ::std::optional< ::std::string> &mime,
37             ::android::sp<::android::IMediaExtractor>* _aidl_return);
38 
39     virtual ::android::binder::Status makeIDataSource(
40             base::unique_fd fd,
41             int64_t offset,
42             int64_t length,
43             ::android::sp<::android::IDataSource>* _aidl_return);
44 
45     virtual ::android::binder::Status getSupportedTypes(::std::vector<::std::string>* _aidl_return);
46 
47     virtual status_t dump(int fd, const Vector<String16>& args);
48 
49 private:
50     Mutex               mLock;
51 };
52 
53 }   // namespace android
54 
55 #endif  // ANDROID_MEDIA_EXTRACTOR_SERVICE_H
56