Skip to content

Commit

Permalink
qcom/media: update media code
Browse files Browse the repository at this point in the history
Change-Id: I8fab90e0696562b21b22143d3357d518cad6d8cc
Signed-off-by: Iliyan Malchev <[email protected]>
  • Loading branch information
Iliyan Malchev committed Jun 21, 2012
1 parent bac9307 commit 826ecec
Show file tree
Hide file tree
Showing 96 changed files with 42,751 additions and 3,790 deletions.
Empty file modified CleanSpec.mk
100644 → 100755
Empty file.
9 changes: 3 additions & 6 deletions libstagefrighthw/Android.mk
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2010 The Android Open Source Project
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,8 +14,6 @@
# limitations under the License.
#

ifeq ($(TARGET_BOARD_PLATFORM),msm7x30)

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

Expand All @@ -25,8 +23,8 @@ LOCAL_SRC_FILES := \
LOCAL_CFLAGS := $(PV_CFLAGS_MINUS_VISIBILITY)

LOCAL_C_INCLUDES:= \
$(TOP)/frameworks/native/include/media/hardware \
$(TOP)/frameworks/native/include/media/openmax
frameworks/native/include/media/openmax \
frameworks/native/include/media/hardware

LOCAL_SHARED_LIBRARIES := \
libbinder \
Expand All @@ -39,4 +37,3 @@ LOCAL_MODULE := libstagefrighthw

include $(BUILD_SHARED_LIBRARY)

endif
Empty file modified libstagefrighthw/MODULE_LICENSE_APACHE2
100644 → 100755
Empty file.
Empty file modified libstagefrighthw/NOTICE
100644 → 100755
Empty file.
30 changes: 30 additions & 0 deletions libstagefrighthw/QComOMXMetadata.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2011 The Code Aurora Forum. All rights reserved.
* Copyright (c) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <system/window.h>

namespace android {

typedef enum {
kMetadataBufferTypeCameraSource = 0,
kMetadataBufferTypeGrallocSource = 1,
} MetadataBufferType;

typedef struct encoder_media_buffer_type {
MetadataBufferType buffer_type;
buffer_handle_t meta_handle;
} encoder_media_buffer_type;
}
54 changes: 12 additions & 42 deletions libstagefrighthw/QComOMXPlugin.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,10 @@

#include <dlfcn.h>

#include <HardwareAPI.h>
#include <media/hardware/HardwareAPI.h>

namespace android {

static const char kPrefix[] = "7x30.";

static OMX_ERRORTYPE AddPrefix(char *name) {
if (strncmp("OMX.qcom.", name, 9)) {
return OMX_ErrorUndefined;
}
String8 tmp(name, 9);
tmp.append(kPrefix);
tmp.append(&name[9]);
strcpy(name, tmp.string());
return OMX_ErrorNone;
}

static void RemovePrefix(const char *name, String8 *out) {
out->setTo(name, 9); // "OMX.qcom."
out->append(&name[9 + strlen(kPrefix)]);
}

OMXPluginBase *createOMXPlugin() {
return new QComOMXPlugin;
}
Expand Down Expand Up @@ -88,10 +70,6 @@ OMX_ERRORTYPE QComOMXPlugin::makeComponentInstance(
return OMX_ErrorUndefined;
}

String8 tmp;
RemovePrefix(name, &tmp);
name = tmp.string();

return (*mGetHandle)(
reinterpret_cast<OMX_HANDLETYPE *>(component),
const_cast<char *>(name),
Expand All @@ -115,13 +93,7 @@ OMX_ERRORTYPE QComOMXPlugin::enumerateComponents(
return OMX_ErrorUndefined;
}

OMX_ERRORTYPE res = (*mComponentNameEnum)(name, size, index);

if (res != OMX_ErrorNone) {
return res;
}

return AddPrefix(name);
return (*mComponentNameEnum)(name, size, index);
}

OMX_ERRORTYPE QComOMXPlugin::getRolesOfComponent(
Expand All @@ -133,10 +105,6 @@ OMX_ERRORTYPE QComOMXPlugin::getRolesOfComponent(
return OMX_ErrorUndefined;
}

String8 tmp;
RemovePrefix(name, &tmp);
name = tmp.string();

OMX_U32 numRoles;
OMX_ERRORTYPE err = (*mGetRolesOfComponentHandle)(
const_cast<OMX_STRING>(name), &numRoles, NULL);
Expand All @@ -155,15 +123,17 @@ OMX_ERRORTYPE QComOMXPlugin::getRolesOfComponent(
err = (*mGetRolesOfComponentHandle)(
const_cast<OMX_STRING>(name), &numRoles2, array);

if (err == OMX_ErrorNone && numRoles != numRoles2) {
err = OMX_ErrorUndefined;
}
if (err != OMX_ErrorNone) {
return err;
}

if (numRoles2 != numRoles) {
return err;
}

for (OMX_U32 i = 0; i < numRoles; ++i) {
if (err == OMX_ErrorNone) {
String8 s((const char *)array[i]);
roles->push(s);
}
String8 s((const char *)array[i]);
roles->push(s);

delete[] array[i];
array[i] = NULL;
Expand All @@ -173,7 +143,7 @@ OMX_ERRORTYPE QComOMXPlugin::getRolesOfComponent(
array = NULL;
}

return err;
return OMX_ErrorNone;
}

} // namespace android
2 changes: 1 addition & 1 deletion libstagefrighthw/QComOMXPlugin.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#define QCOM_OMX_PLUGIN_H_

#include <OMXPluginBase.h>
#include <media/hardware/OMXPluginBase.h>

namespace android {

Expand Down
122 changes: 90 additions & 32 deletions mm-core/Android.mk
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,38 +1,96 @@
#--------------------------------------------------------------------------
#Copyright (c) 2009, Code Aurora Forum. All rights reserved.

#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Code Aurora nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.

#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
#NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
#EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#--------------------------------------------------------------------------

OMX_CORE_PATH := $(call my-dir)
ifneq ($(BUILD_TINY_ANDROID),true)

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

ifneq ($(BUILD_TINY_ANDROID),true)
OMXCORE_CFLAGS += -D_ANDROID_
OMXCORE_CFLAGS += -U_ENABLE_QC_MSG_LOG_

ifeq ($(TARGET_BOARD_PLATFORM),msm7x30)
include $(OMX_CORE_PATH)/omxcore/Android.mk
#===============================================================================
# Figure out the targets
#===============================================================================

ifeq ($(TARGET_BOARD_PLATFORM),msm7627a)
MM_CORE_TARGET = 7627A
else ifeq ($(TARGET_BOARD_PLATFORM),msm8660)
MM_CORE_TARGET = 8660
#Comment out following line to disable drm.play component
OMXCORE_CFLAGS += -DENABLE_DRMPLAY
else ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
MM_CORE_TARGET = 8960
else ifeq ($(TARGET_BOARD_PLATFORM),msm8974)
MM_CORE_TARGET = 8974
else
MM_CORE_TARGET = default
endif

#===============================================================================
# Deploy the headers that can be exposed
#===============================================================================

LOCAL_COPY_HEADERS_TO := mm-core/omxcore
LOCAL_COPY_HEADERS := inc/OMX_Audio.h
LOCAL_COPY_HEADERS += inc/OMX_Component.h
LOCAL_COPY_HEADERS += inc/OMX_ContentPipe.h
LOCAL_COPY_HEADERS += inc/OMX_Core.h
LOCAL_COPY_HEADERS += inc/OMX_Image.h
LOCAL_COPY_HEADERS += inc/OMX_Index.h
LOCAL_COPY_HEADERS += inc/OMX_IVCommon.h
LOCAL_COPY_HEADERS += inc/OMX_Other.h
LOCAL_COPY_HEADERS += inc/OMX_QCOMExtns.h
LOCAL_COPY_HEADERS += inc/OMX_Types.h
LOCAL_COPY_HEADERS += inc/OMX_Video.h
LOCAL_COPY_HEADERS += inc/qc_omx_common.h
LOCAL_COPY_HEADERS += inc/qc_omx_component.h
LOCAL_COPY_HEADERS += inc/qc_omx_msg.h
LOCAL_COPY_HEADERS += inc/QOMX_AudioExtensions.h
LOCAL_COPY_HEADERS += inc/QOMX_AudioIndexExtensions.h
LOCAL_COPY_HEADERS += inc/OMX_CoreExt.h
LOCAL_COPY_HEADERS += inc/QOMX_CoreExtensions.h
LOCAL_COPY_HEADERS += inc/QOMX_FileFormatExtensions.h
LOCAL_COPY_HEADERS += inc/QOMX_IVCommonExtensions.h
LOCAL_COPY_HEADERS += inc/QOMX_SourceExtensions.h
LOCAL_COPY_HEADERS += inc/QOMX_VideoExtensions.h
LOCAL_COPY_HEADERS += inc/OMX_IndexExt.h
LOCAL_COPY_HEADERS += inc/QOMX_StreamingExtensions.h


#===============================================================================
# LIBRARY for Android apps
#===============================================================================

LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := libOmxCore
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := liblog libdl
LOCAL_CFLAGS := $(OMXCORE_CFLAGS)

LOCAL_SRC_FILES := src/common/omx_core_cmp.cpp
LOCAL_SRC_FILES += src/common/qc_omx_core.c
LOCAL_SRC_FILES += src/$(MM_CORE_TARGET)/qc_registry_table_android.c

include $(BUILD_SHARED_LIBRARY)

#===============================================================================
# LIBRARY for command line test apps
#===============================================================================

include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := libmm-omxcore
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := liblog libdl
LOCAL_CFLAGS := $(OMXCORE_CFLAGS)

LOCAL_SRC_FILES := src/common/omx_core_cmp.cpp
LOCAL_SRC_FILES += src/common/qc_omx_core.c
LOCAL_SRC_FILES += src/$(MM_CORE_TARGET)/qc_registry_table.c

include $(BUILD_SHARED_LIBRARY)

endif #BUILD_TINY_ANDROID
Loading

0 comments on commit 826ecec

Please sign in to comment.