blob: cd20635a98458324861e5338a71528a7069a068e [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
Marco Nelissenb2487f02015-09-01 13:23:23 -070027sp<IMediaExtractor> MediaExtractorService::makeExtractor(
28 const sp<IDataSource> &remoteSource, const char *mime) {
Marco Nelissenebab3582015-11-04 09:56:21 -080029 ALOGV("@@@ MediaExtractorService::makeExtractor for %s", mime);
Marco Nelissenb2487f02015-09-01 13:23:23 -070030
31 sp<DataSource> localSource = DataSource::CreateFromIDataSource(remoteSource);
32
33 sp<MediaExtractor> ret = MediaExtractor::CreateFromService(localSource, mime);
34
Marco Nelissenebab3582015-11-04 09:56:21 -080035 ALOGV("extractor service created %p (%s)",
Marco Nelissenb2487f02015-09-01 13:23:23 -070036 ret.get(),
37 ret == NULL ? "" : ret->name());
38
39 return ret;
40}
41
42
43status_t MediaExtractorService::onTransact(uint32_t code, const Parcel& data, Parcel* reply,
44 uint32_t flags)
45{
46 return BnMediaExtractorService::onTransact(code, data, reply, flags);
47}
48
49} // namespace android