blob: afe7b67331ffd31cd0fd36caf1a75e49ac79e4ba [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#define LOG_TAG "MediaExtractorService"
18//#define LOG_NDEBUG 0
19#include <utils/Log.h>
20
21#include <media/stagefright/DataSource.h>
22#include <media/stagefright/MediaExtractor.h>
23#include "MediaExtractorService.h"
24
25namespace android {
26
27status_t MediaExtractorService::hello()
28{
29 ALOGI("@@@ MediaExtractorService::hello");
30 return NO_ERROR;
31}
32
33sp<IMediaExtractor> MediaExtractorService::makeExtractor(
34 const sp<IDataSource> &remoteSource, const char *mime) {
35 ALOGI("@@@ MediaExtractorService::makeExtractor for %s", mime);
36
37 sp<DataSource> localSource = DataSource::CreateFromIDataSource(remoteSource);
38
39 sp<MediaExtractor> ret = MediaExtractor::CreateFromService(localSource, mime);
40
41 ALOGI("extractor service created %p (%s)",
42 ret.get(),
43 ret == NULL ? "" : ret->name());
44
45 return ret;
46}
47
48
49status_t MediaExtractorService::onTransact(uint32_t code, const Parcel& data, Parcel* reply,
50 uint32_t flags)
51{
52 return BnMediaExtractorService::onTransact(code, data, reply, flags);
53}
54
55} // namespace android