Skip to content

Commit

Permalink
Merge tag 'LA.UM.8.1.r1-11100-sm8150.0' of https://source.codeaurora.…
Browse files Browse the repository at this point in the history
…org/quic/la/platform/hardware/qcom/media into ten

"LA.UM.8.1.r1-11100-sm8150.0"
  • Loading branch information
Dyneteve committed Nov 16, 2019
2 parents cf2b0fd + 8353a01 commit 82dff6c
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 23 deletions.
12 changes: 6 additions & 6 deletions conf_files/atoll/media_profiles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="42000000"
width="4096"
width="3840"
height="2160"
frameRate="30" />

Expand Down Expand Up @@ -281,7 +281,7 @@
<EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="42000000"
width="4096"
width="3840"
height="2160"
frameRate="30" />

Expand Down Expand Up @@ -470,7 +470,7 @@
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="42000000"
width="4096"
width="3840"
height="2160"
frameRate="30" />

Expand Down Expand Up @@ -633,7 +633,7 @@
<EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="42000000"
width="4096"
width="3840"
height="2160"
frameRate="30" />

Expand Down Expand Up @@ -1119,7 +1119,7 @@
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="42000000"
width="4096"
width="3840"
height="2160"
frameRate="30" />

Expand Down Expand Up @@ -1289,7 +1289,7 @@
<EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="42000000"
width="4096"
width="3840"
height="2160"
frameRate="30" />

Expand Down
39 changes: 39 additions & 0 deletions conf_files/sm6150/c2_manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- Copyright (c) 2018, The Linux Foundation. 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 The Linux Foundation 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 "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.
-->
<manifest version="1.0" type="device" target-level="3">
<!-- Codec2 HAl service -->
<hal format="hidl">
<name>android.hardware.media.c2</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IComponentStore</name>
<instance>default</instance>
</interface>
</hal>
</manifest>
36 changes: 36 additions & 0 deletions conf_files/sm6150/codec2.vendor.ext.policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2019, The Linux Foundation. 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 The Linux Foundation 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 "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.

# device specific syscalls
pselect6: 1
eventfd2: 1
sendto: 1
recvfrom: 1
_llseek: 1
sysinfo: 1
getcwd: 1
getdents64: 1
18 changes: 18 additions & 0 deletions conf_files/sm6150/sm6150.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CONFIG_PATH := hardware/qcom/media/conf_files/$(MSMSTEPPE)

# Video configuration files
PRODUCT_COPY_FILES += \
$(CONFIG_PATH)/codec2.vendor.ext.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/codec2.vendor.ext.policy \
$(CONFIG_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
$(CONFIG_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
$(CONFIG_PATH)/media_codecs_vendor.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor.xml \
Expand All @@ -18,6 +19,18 @@ PRODUCT_COPY_FILES += \
$(CONFIG_PATH)/mediacodec-seccomp.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
$(CONFIG_PATH)/system_properties.xml:$(TARGET_COPY_OUT_VENDOR)/etc/system_properties.xml

# Produce packages addition
PRODUCT_PACKAGES += \
libcodec2_vndk.vendor \
[email protected]

ifeq ($(TARGET_FWK_SUPPORTS_FULL_VALUEADDS),true)
$(warning "Compiling with full value-added framework")
else
$(warning "Compiling without full value-added framework - enabling GENERIC_ODM_IMAGE")
GENERIC_ODM_IMAGE := true
endif

# Vendor property overrides

ifeq ($(GENERIC_ODM_IMAGE),true)
Expand All @@ -31,3 +44,8 @@ else
PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.omx_default_rank.sw-audio=1
PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.omx_default_rank=0
endif

# Enable Codec2.0 HAL for pure AOSP variants.
ifeq ($(GENERIC_ODM_IMAGE),true)
DEVICE_MANIFEST_FILE += hardware/qcom/media/conf_files/$(MSMSTEPPE)/c2_manifest.xml
endif
4 changes: 2 additions & 2 deletions mm-core/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ LOCAL_CFLAGS := $(OMXCORE_CFLAGS)

LOCAL_SRC_FILES := src/common/omx_core_cmp.cpp
LOCAL_SRC_FILES += src/common/qc_omx_core.c
ifneq (,$(filter msmnile $(MSMSTEPPE) $(TRINKET) atoll,$(TARGET_BOARD_PLATFORM)))
ifneq (,$(filter msmnile sdmshrike $(MSMSTEPPE) $(TRINKET) atoll,$(TARGET_BOARD_PLATFORM)))
LOCAL_SRC_FILES += src/registry_table_android.c
else
LOCAL_SRC_FILES += src/qc_registry_table_android.c
Expand Down Expand Up @@ -117,7 +117,7 @@ LOCAL_CFLAGS := $(OMXCORE_CFLAGS)

LOCAL_SRC_FILES := src/common/omx_core_cmp.cpp
LOCAL_SRC_FILES += src/common/qc_omx_core.c
ifneq (,$(filter msmnile $(MSMSTEPPE) $(TRINKET) atoll,$(TARGET_BOARD_PLATFORM)))
ifneq (,$(filter msmnile sdmshrike $(MSMSTEPPE) $(TRINKET) atoll,$(TARGET_BOARD_PLATFORM)))
LOCAL_SRC_FILES += src/$(MM_CORE_TARGET)/registry_table.c
else
LOCAL_SRC_FILES += src/$(MM_CORE_TARGET)/qc_registry_table.c
Expand Down
2 changes: 1 addition & 1 deletion mm-core/src/registry_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ omx_core_cb_type core[] =
OMX_REGISTRY_ENTRY("OMX.qti.vdec.vpp", "libOmxVpp.so", "video_decoder.vpp"),
#endif //_STEPPE_ || _ATOLL_

#if !defined(_ATOLL_) || !defined(_TRINKET)
#if !defined(_ATOLL_) && !defined(_TRINKET_)
OMX_REGISTRY_ENTRY("OMX.qti.video.decoder.vc1sw", "libOmxSwVdec.so", "video_decoder.vc1"),
OMX_REGISTRY_ENTRY("OMX.qti.video.decoder.wmvsw", "libOmxSwVdec.so", "video_decoder.vc1"),
#endif //_ATOLL_ || _TRINKET_
Expand Down
2 changes: 1 addition & 1 deletion mm-core/src/registry_table_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ omx_core_cb_type core[] =
OMX_REGISTRY_ENTRY("OMX.qti.vdec.vpp", "libOmxVpp.so", "iv_processor.yuv"),
#endif //_STEPPE_

#if !defined(_ATOLL_) || !defined(_TRINKET)
#if !defined(_ATOLL_) && !defined(_TRINKET_)
OMX_REGISTRY_ENTRY("OMX.qti.video.decoder.vc1sw", "libOmxSwVdec.so", "video_decoder.vc1"),
#endif //_ATOLL_ || _TRINKET_

Expand Down
8 changes: 7 additions & 1 deletion mm-video-v4l2/vidc/common/inc/vidc_debug.h
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
Copyright (c) 2013 - 2017, The Linux Foundation. All rights reserved.
Copyright (c) 2013 - 2019, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -158,6 +158,12 @@ class Signal {
ts.tv_sec += 1;
}
int ret = pthread_cond_timedwait(&condition, &mutex, &ts);
//as the mutex lock is released inside timedwait first
//the singalled variant maybe changed by the main thread in some rare cases
//meanwhile still returns wait time out
//need to double check it and return 0 to process the last cmd/event during time out
if (signalled)
ret = 0;
signalled = false;
pthread_mutex_unlock(&mutex);
return ret;
Expand Down
5 changes: 3 additions & 2 deletions mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3543,8 +3543,9 @@ OMX_ERRORTYPE omx_swvdec::get_buffer_requirements_swvdec(

m_port_ip.def.nBufferSize = p_buffer_req->size;
m_port_ip.def.nBufferCountMin = p_buffer_req->mincount;
m_port_ip.def.nBufferCountActual = MAX(p_buffer_req->mincount,
OMX_SWVDEC_IP_BUFFER_COUNT_MIN);
m_port_ip.def.nBufferCountActual = MAX((MAX(p_buffer_req->mincount,
OMX_SWVDEC_IP_BUFFER_COUNT_MIN)),
m_port_ip.def.nBufferCountActual);
m_port_ip.def.nBufferAlignment = p_buffer_req->alignment;

OMX_SWVDEC_LOG_HIGH("ip port: %d bytes x %d, %d-byte aligned",
Expand Down
6 changes: 3 additions & 3 deletions mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4287,7 +4287,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
if (ret) {
DEBUG_PRINT_ERROR("Set Resolution failed");
eRet = OMX_ErrorUnsupportedSetting;
eRet = errno == EBUSY ? OMX_ErrorInsufficientResources : OMX_ErrorUnsupportedSetting;
} else
eRet = get_buffer_req(&drv_ctx.op_buf);
}
Expand Down Expand Up @@ -4429,7 +4429,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
if (ret) {
DEBUG_PRINT_ERROR("Set Resolution failed");
eRet = OMX_ErrorUnsupportedSetting;
eRet = errno == EBUSY ? OMX_ErrorInsufficientResources : OMX_ErrorUnsupportedSetting;
} else {
if (!is_down_scalar_enabled)
eRet = get_buffer_req(&drv_ctx.op_buf);
Expand Down Expand Up @@ -5528,7 +5528,7 @@ OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp,
}

if (ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
ret = errno == -EBUSY ? OMX_ErrorInsufficientResources :
ret = errno == EBUSY ? OMX_ErrorInsufficientResources :
OMX_ErrorUnsupportedSetting;
DEBUG_PRINT_ERROR("Failed to set operating rate %u fps (%s)",
rate->nU32 >> 16, errno == -EBUSY ? "HW Overload" : strerror(errno));
Expand Down
2 changes: 2 additions & 0 deletions mm-video-v4l2/vidc/venc/inc/omx_video_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ static const char* MEM_DEVICE = "/dev/ion";
#define LEGACY_CAM_METADATA_TYPE encoder_media_buffer_type
#endif

class omx_video;
void post_message(omx_video *omx, unsigned char id);
void* message_thread_enc(void *);
bool is_ubwc_interlaced(private_handle_t *handle);

Expand Down
7 changes: 7 additions & 0 deletions mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,13 @@ OMX_ERRORTYPE omx_venc::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
DEBUG_PRINT_HIGH("Calling swvenc_deinit()");
swvenc_deinit(m_hSwVenc);

if (msg_thread_created) {
msg_thread_created = false;
msg_thread_stop = true;
post_message(this, OMX_COMPONENT_CLOSE_MSG);
DEBUG_PRINT_HIGH("omx_video: Waiting on Msg Thread exit");
pthread_join(msg_thread_id,NULL);
}
DEBUG_PRINT_HIGH("OMX_Venc:Component Deinit");

RETURN(OMX_ErrorNone);
Expand Down
7 changes: 0 additions & 7 deletions mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,6 @@ omx_video::omx_video():
omx_video::~omx_video()
{
DEBUG_PRINT_HIGH("~omx_video(): Inside Destructor()");
if (msg_thread_created) {
msg_thread_stop = true;
post_message(this, OMX_COMPONENT_CLOSE_MSG);
DEBUG_PRINT_HIGH("omx_video: Waiting on Msg Thread exit");
pthread_join(msg_thread_id,NULL);
}
DEBUG_PRINT_HIGH("omx_video: Waiting on Async Thread exit");
/*For V4L2 based drivers, pthread_join is done in device_close
* so no need to do it here*/
pthread_mutex_destroy(&m_lock);
Expand Down
7 changes: 7 additions & 0 deletions mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,13 @@ void venc_dev::venc_close()
if (async_thread_created)
pthread_join(m_tid,NULL);

if (venc_handle->msg_thread_created) {
venc_handle->msg_thread_created = false;
venc_handle->msg_thread_stop = true;
post_message(venc_handle, omx_video::OMX_COMPONENT_CLOSE_MSG);
DEBUG_PRINT_HIGH("omx_video: Waiting on Msg Thread exit");
pthread_join(venc_handle->msg_thread_id, NULL);
}
DEBUG_PRINT_HIGH("venc_close X");
unsubscribe_to_events(m_nDriver_fd);
close(m_poll_efd);
Expand Down

0 comments on commit 82dff6c

Please sign in to comment.