blob: 8b92a6be6c31c596214b507699828ca34fae2aba [file] [log] [blame]
Andreas Huber20111aa2009-07-14 16:56:47 -07001/*
2 * Copyright (C) 2009 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
Dongwon Kangba8128f2017-08-07 18:51:24 -070017#include <media/stagefright/CallbackMediaSource.h>
Andreas Huber20111aa2009-07-14 16:56:47 -070018#include <media/stagefright/MediaSource.h>
Dongwon Kangba8128f2017-08-07 18:51:24 -070019#include <media/stagefright/RemoteMediaSource.h>
Andreas Huber20111aa2009-07-14 16:56:47 -070020
21namespace android {
22
23MediaSource::MediaSource() {}
24
25MediaSource::~MediaSource() {}
26
Dongwon Kangba8128f2017-08-07 18:51:24 -070027// static
28sp<MediaSource> MediaSource::CreateFromIMediaSource(const sp<IMediaSource> &source) {
29 if (source == nullptr) {
30 return nullptr;
31 }
32 return new CallbackMediaSource(source);
33}
34
35sp<IMediaSource> MediaSource::asIMediaSource() {
36 return RemoteMediaSource::wrap(sp<MediaSource>(this));
37}
38
Andreas Huber20111aa2009-07-14 16:56:47 -070039} // namespace android