From: Sejun Park Date: Mon, 4 Sep 2017 09:13:53 +0000 (+0900) Subject: Removed TM1 kernel dependency X-Git-Tag: accepted/tizen/unified/20170915.191019~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F30%2F147430%2F4;p=platform%2Fcore%2Fapi%2Fmediacodec.git Removed TM1 kernel dependency Change-Id: Ie02972ac83881534744efd2e51e811348d5709f6 --- diff --git a/include/media_codec_port_gst.h b/include/media_codec_port_gst.h index 626f9ad..4373b7b 100644 --- a/include/media_codec_port_gst.h +++ b/include/media_codec_port_gst.h @@ -71,15 +71,6 @@ typedef enum { BUF_SHARE_METHOD_FLUSH_BUFFER } buf_share_method_t; -#ifdef TIZEN_PROFILE_LITE -struct _ion_mmu_data_t { - gint master_id; - gint fd_buffer; - unsigned long iova_addr; - size_t iova_size; -}; -#endif - struct _mc_gst_port_t { mc_gst_core_t *core; guint num_buffers; diff --git a/packaging/capi-media-codec.spec b/packaging/capi-media-codec.spec old mode 100644 new mode 100755 index ff08340..d1871f2 --- a/packaging/capi-media-codec.spec +++ b/packaging/capi-media-codec.spec @@ -29,21 +29,7 @@ BuildRequires: pkgconfig(iniparser) %description A Media Codec library in Tizen Native API -%ifarch %{arm} -# This is for backward-compatibility. This does not deteriorate 4.0 Configurability -# if mobile || "undefined" -%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common" -%package extension-TM1 -Summary: Extension for mobile TM1 -Requires: %{name} = %{version}-%{release} -#!BuildIgnore: kernel-headers -BuildConflicts: linux-glibc-devel -BuildRequires: kernel-headers-3.10-sc7730 - -%description extension-TM1 -A Media Codec library in Tizen Native API Extension for mobile TM1 -%endif -%endif + %package devel @@ -59,40 +45,8 @@ Requires: %{name} = %{version}-%{release} %build -%if 0%{?sec_build_binary_debug_enable} -export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" -export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" -export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" -%endif -%ifarch %{arm} -export CFLAGS="$CFLAGS -DENABLE_FFMPEG_CODEC" -%endif export CFLAGS="$CFLAGS -DSYSCONFDIR=\\\"%{_sysconfdir}\\\"" -export CFLAGS_DEFAULT="$CFLAGS" - -%ifarch %{arm} -# This is for backward-compatibility. This does not deteriorate 4.0 Configurability -# if mobile || "undefined" -%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common" -# extension-TM1 -export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_PROFILE_LITE" - -MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -%cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} - -make %{?jobs:-j%jobs} - -mkdir -p tm1 - -%make_install -ls -al %{buildroot}%{_libdir}/libcapi-media-codec.so.* -cp -a %{buildroot}%{_libdir}/libcapi-media-codec.so.* tm1/ - -%endif -%endif -# common -export CFLAGS="$CFLAGS_DEFAULT" MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} @@ -106,44 +60,6 @@ cp test/media_codec_test %{buildroot}/usr/bin %make_install - -%ifarch %{arm} -# This is for backward-compatibility. This does not deteriorate 4.0 Configurability -# if mobile || "undefined" -%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common" -# extension-TM1 -pushd tm1 -for FILE in libcapi-media-codec.so.*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.tm1"; done -popd - -%post extension-TM1 -pushd %{_libdir} -for FILE in libcapi-media-codec.so.*.tm1; do mv "$FILE" "${FILE%.tm1}"; done -popd -/sbin/ldconfig - -%preun extension-TM1 -case "$1" in - 0) - # This is an un-installation. - pushd %{_libdir} - for FILE in libcapi-media-codec.so.*; do mv "$FILE" "${FILE%.tm1}"; done - popd - /sbin/ldconfig - ;; - 1) - # This is an upgrade. - # Do nothing. - : - ;; -esac - -%files extension-TM1 -%manifest capi-media-codec.manifest -%{_libdir}/libcapi-media-codec.so.*.tm1 -%endif -%endif - %post /sbin/ldconfig @@ -153,9 +69,7 @@ esac %files %manifest capi-media-codec.manifest %{_libdir}/libcapi-media-codec.so.* -%ifarch %{arm} -%exclude %{_libdir}/libcapi-media-codec.so.*.tm1 -%endif + %license LICENSE.APLv2 /usr/bin/* #%{_bindir}/* diff --git a/src/media_codec_port_gst.c b/src/media_codec_port_gst.c index c639c02..27663cf 100644 --- a/src/media_codec_port_gst.c +++ b/src/media_codec_port_gst.c @@ -28,12 +28,6 @@ #include #include -#ifdef TIZEN_PROFILE_LITE -#include -#include -#include -#endif - /* * Internal Implementation */ @@ -75,9 +69,6 @@ static const gchar * _mc_bit_to_string(int bit); static int _mc_get_support_bit_from_format(media_format_mimetype_e format); static int _mc_link_vtable(mc_gst_core_t *core, mediacodec_codec_type_e id, gboolean is_encoder, gboolean is_hw); -#ifdef TIZEN_PROFILE_LITE -static int __tbm_get_physical_addr_bo(tbm_bo_handle tbm_bo_handle_fd_t, int *phy_addr, int *phy_size); -#endif static int _mc_gst_flush_buffers(mc_gst_core_t *core); static void _mc_gst_set_flush_input(mc_gst_core_t *core); static void _mc_gst_set_flush_output(mc_gst_core_t *core); @@ -1558,9 +1549,7 @@ static int _mc_link_vtable(mc_gst_core_t *core, mediacodec_codec_type_e id, gboo if (encoder) { core->vtable = is_hw ? venc_h264_hw_vtable : venc_vtable; core->caps = gst_caps_new_empty_simple("video/x-raw"); -#ifdef TIZEN_PROFILE_LITE g_object_set(GST_OBJECT(core->codec), "byte-stream", TRUE, NULL); -#endif } else { if (is_hw) { core->vtable = vdec_h264_hw_vtable; @@ -2617,21 +2606,6 @@ static MMVideoBuffer *__mc_gst_make_tbm_buffer(mc_gst_core_t *core, media_packet tbm_bo_unmap(mm_vbuffer->handle.bo[i]); } -#ifdef TIZEN_PROFILE_LITE - gint phy_addr = 0; - gint phy_size = 0; - tbm_bo_handle handle_fd = tbm_bo_get_handle(mm_vbuffer->handle.bo[0], TBM_DEVICE_MM); - if (handle_fd.ptr == NULL) { - LOGE("Invaild bo handle"); - return NULL; - } - - if (__tbm_get_physical_addr_bo(handle_fd, &phy_addr, &phy_size) == 0) { - mm_vbuffer->handle.paddr[0] = (void *)phy_addr; - LOGD("mm_vbuffer->paddr : %p", mm_vbuffer->handle.paddr[0]); - } -#endif - mm_vbuffer->type = MM_VIDEO_BUFFER_TYPE_TBM_BO; mm_vbuffer->width[0] = surface_info.width; mm_vbuffer->height[0] = surface_info.height; @@ -2952,49 +2926,6 @@ static void _mc_gst_set_flush_output(mc_gst_core_t *core) MEDIACODEC_FLEAVE(); } -#ifdef TIZEN_PROFILE_LITE -gint __tbm_get_physical_addr_bo(tbm_bo_handle handle_bo, int *phy_addr, int *phy_size) -{ - gint ret = 0; - gint open_flags = O_RDWR; - gint ion_fd = -1; - - ion_mmu_data_t mmu_data; - struct ion_custom_data custom_data; - - memset(&mmu_data, 0x0, sizeof(ion_mmu_data_t)); - - mmu_data.fd_buffer = handle_bo.u32; - custom_data.cmd = 4; - custom_data.arg = (unsigned long)&mmu_data; - - ion_fd = open("/dev/ion", open_flags); - if (ion_fd < 0) - LOGE("[tbm_get_physical_addr_bo] ion_fd open device failed"); - - if (ioctl(ion_fd, ION_IOC_CUSTOM, &custom_data) < 0) { - LOGE("[tbm_get_physical_addr_bo] ION_IOC_CUSTOM failed"); - ret = -1; - } - - if (!ret) { - *phy_addr = mmu_data.iova_addr; - *phy_size = mmu_data.iova_size; - } else { - *phy_addr = 0; - *phy_size = 0; - LOGW("[tbm_get_physical_addr_bo] getting physical address is failed. phy_addr = 0"); - } - - if (ion_fd != -1) { - close(ion_fd); - ion_fd = -1; - } - - return 0; -} -#endif - #if TIZEN_EXYNOS_SPECIFIC /* * Get tiled address of position(x,y)