blob: 6b510c68b9e41bd4578ddb6ed92a650a73244752 [file] [log] [blame]
Marco Nelissen1900e772016-02-02 16:12:16 -08001/*
2 * Copyright (C) 2015 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 "MediaCodecService"
18//#define LOG_NDEBUG 0
19#include <utils/Log.h>
20
21#include "MediaCodecService.h"
22
23namespace android {
24
25sp<IOMX> MediaCodecService::getOMX() {
26
Pawin Vongmasafbe70ae2017-07-27 02:21:57 -070027 Mutex::Autolock autoLock(mOMXLock);
Marco Nelissen1900e772016-02-02 16:12:16 -080028
29 if (mOMX.get() == NULL) {
Pawin Vongmasafbe70ae2017-07-27 02:21:57 -070030 mOMX = new OMX();
Marco Nelissen1900e772016-02-02 16:12:16 -080031 }
32
33 return mOMX;
34}
35
Pawin Vongmasafbe70ae2017-07-27 02:21:57 -070036sp<IOMXStore> MediaCodecService::getOMXStore() {
37
38 Mutex::Autolock autoLock(mOMXStoreLock);
39
40 if (mOMXStore.get() == NULL) {
41 mOMXStore = new OMXStore();
42 }
43
44 return mOMXStore;
45}
Marco Nelissen1900e772016-02-02 16:12:16 -080046
47status_t MediaCodecService::onTransact(uint32_t code, const Parcel& data, Parcel* reply,
48 uint32_t flags)
49{
50 return BnMediaCodecService::onTransact(code, data, reply, flags);
51}
52
53} // namespace android