summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Kibum <kb0929.kim@samsung.com>2012-04-29 17:01:36 +0900
committerKim Kibum <kb0929.kim@samsung.com>2012-04-29 17:01:36 +0900
commitf48e5455f367ed6e53b5978071c2b36c32817c4a (patch)
tree941ae6316a5ff50038c4e6dcb0d2f9a1bfd0be3c
parentc695582de47261e1142509da6c8c0fd9e7f1d920 (diff)
downloadmedia-server-f48e5455f367ed6e53b5978071c2b36c32817c4a.tar.gz
media-server-f48e5455f367ed6e53b5978071c2b36c32817c4a.tar.bz2
media-server-f48e5455f367ed6e53b5978071c2b36c32817c4a.zip
upload tizen1.0 source
-rwxr-xr-xMakefile.am28
-rwxr-xr-xTC/_export_env.sh16
-rwxr-xr-xTC/_export_target_env.sh15
-rwxr-xr-xTC/build.sh18
-rwxr-xr-xTC/execute.sh32
-rwxr-xr-xTC/making_new_tet_scen.py69
-rwxr-xr-xTC/tet_scen7
-rw-r--r--TC/tetbuild.cfg6
-rw-r--r--TC/tetclean.cfg6
-rw-r--r--TC/tetexec.cfg6
-rw-r--r--TC/tslist.txt1
-rwxr-xr-xTC/utc/.cproject210
-rwxr-xr-xTC/utc/.project79
-rwxr-xr-xTC/utc/Makefile38
-rwxr-xr-xTC/utc/tslist2
-rwxr-xr-xTC/utc/utc_media_file_register.c99
-rwxr-xr-xTC/utc/utc_media_file_register.h65
-rwxr-xr-xTC/utc/utc_ms_noti_update_complete.c91
-rwxr-xr-xTC/utc/utc_ms_noti_update_complete.h63
-rwxr-xr-xcommon/include/media-server-db-svc.h92
-rwxr-xr-xcommon/include/media-server-error.h8
-rwxr-xr-xcommon/include/media-server-scan-internal.h4
-rwxr-xr-xcommon/include/media-server-utils.h3
-rwxr-xr-xcommon/media-server-db-svc.c1064
-rwxr-xr-xcommon/media-server-inotify.c120
-rwxr-xr-xcommon/media-server-main.c14
-rwxr-xr-xcommon/media-server-scan-internal.c17
-rwxr-xr-xcommon/media-server-scan.c15
-rwxr-xr-xcommon/media-server-socket.c13
-rwxr-xr-xcommon/media-server-utils.c125
-rwxr-xr-xconfigure.ac22
-rwxr-xr-xdebian/changelog32
-rwxr-xr-xdebian/control6
-rwxr-xr-xlib/include/media-util-noti.h2
-rwxr-xr-xlib/include/media-util-register.h2
-rwxr-xr-xlib/media-util-noti.c4
-rwxr-xr-xlib/media-util-register.c4
-rw-r--r--packaging/media-server.spec73
38 files changed, 1670 insertions, 801 deletions
diff --git a/Makefile.am b/Makefile.am
index b47cbd8..b8c8ad5 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,7 @@ SUBDIRS = .
AM_CPPFLAGS = $(FMS_DEBUG_FLAGS)
-AM_LDFLAGS=-Wl,--as-needed --hash-style=both
+AM_LDFLAGS=-Wl,--as-needed -Wl,--hash-style=both
### pkgconfig ###
pkgconfigdir = $(libdir)/pkgconfig
@@ -31,12 +31,10 @@ libmedia_utils_la_SOURCES = lib/media-util-noti.c \
lib/media-util-register.c
libmedia_utils_la_CFLAGS = -I${srcdir}/lib/include \
- $(MEDIA_INFO_CFLAGS) \
$(GLIB_CFLAGS) \
$(DLOG_CFLAGS)
-libmedia_utils_la_LIBADD = $(MEDIA_INFO_LIBS) \
- $(GLIB_LIBS) \
+libmedia_utils_la_LIBADD = $(GLIB_LIBS) \
$(DLOG_LIBS)
@@ -44,8 +42,8 @@ libmedia_utils_la_LIBADD = $(MEDIA_INFO_LIBS) \
bin_PROGRAMS = media-server
media_server_SOURCES = common/media-server-utils.c \
- common/media-server-db-svc.c \
common/media-server-external-storage.c \
+ common/media-server-db-svc.c \
common/media-server-inotify-internal.c \
common/media-server-inotify.c \
common/media-server-scan-internal.c \
@@ -57,32 +55,22 @@ media_server_CFLAGS = -I${srcdir}/common/include \
-I${srcdir}/lib/include \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
- $(MM_FILEINFO_CFLAGS) \
- $(MEDIA_INFO_CFLAGS) \
$(PHONESTATUS_CFLAGS) \
- $(UTIL_CFLAGS) \
$(DLOG_CFLAGS) \
$(DRM_SERVICE_CFLAGS) \
- $(DB_UTIL_CFLAGS) \
$(AUL_CFLAG)\
- $(DBUS_CFLAGS)\
- $(LIBPMCONTROL_CFLAGS)\
- $(THUMB_GEN_CFLAGS)
+ $(LIBPMCONTROL_CFLAGS)
# $(LIBQUICKPANEL_CFLAGS)
media_server_LDADD = $(GLIB_LIBS) \
$(GTHREAD_LIBS) \
- $(MM_FILEINFO_LIBS) \
- $(MEDIA_INFO_LIBS) \
$(PHONESTATUS_LIBS) \
- $(UTIL_LIBS) \
$(DLOG_LIBS) \
$(DRM_SERVICE_LIBS) \
- $(DB_UTIL_LIBS) \
- $(AUL_LIBS)\
- $(DBUS_LIBS)\
- $(LIBPMCONTROL_LIBS)\
- $(THUMB_GEN_LIBS)
+ $(AUL_LIBS) \
+ $(LIBPMCONTROL_LIBS) \
+ $(THUMB_GEN_LIBS) \
+ -ldl #this is for using dlsym
# $(LIBQUICKPANEL_LIBS)
### includeheaders ###
diff --git a/TC/_export_env.sh b/TC/_export_env.sh
new file mode 100755
index 0000000..56e2167
--- /dev/null
+++ b/TC/_export_env.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+export ARCH=target
+
+export TET_INSTALL_PATH=/usr/bin/tetware/TETware # tetware root path
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+
+export TET_ROOT=$TET_TARGET_PATH
+
+set $(pwd)
+export TET_SUITE_ROOT=$1
+
+set $(date +%s)
+FILE_NAME_EXTENSION=$1
+
diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh
new file mode 100755
index 0000000..afeb412
--- /dev/null
+++ b/TC/_export_target_env.sh
@@ -0,0 +1,15 @@
+export ARCH=target
+
+export TET_INSTALL_PATH=/mnt/nfs/tetware
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+
+export TET_ROOT=$TET_TARGET_PATH
+
+set $(pwd)
+export TET_SUITE_ROOT=$1
+
+set $(data +s)
+FILE_NAME_EXTENSION=$1
+
diff --git a/TC/build.sh b/TC/build.sh
new file mode 100755
index 0000000..dc464e7
--- /dev/null
+++ b/TC/build.sh
@@ -0,0 +1,18 @@
+. ./_export_env.sh # setting environment variables
+
+echo PATH=$PATH
+echo LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+echo TET_ROOT=$TET_ROOT
+echo TET_SUITE_ROOT=$TET_SUITE_ROOT
+echo ARCH=$ARCH
+
+RESULT_DIR=results-$ARCH
+HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir $RESULT_DIR
+
+tcc -c -p ./ # executing tcc, with clean option (-c)
+tcc -b -j $JOURNAL_RESULT -p ./ # executing tcc to build test cases (-b)
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT # reporting the result
+
diff --git a/TC/execute.sh b/TC/execute.sh
new file mode 100755
index 0000000..9de8291
--- /dev/null
+++ b/TC/execute.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+export ARCH=target
+
+export TET_INSTALL_PATH=/mnt/nfs/tetware/TETware # path to mount
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+
+export TET_ROOT=$TET_TARGET_PATH
+
+set $(pwd)
+export TET_SUITE_ROOT=$1
+
+set $(date +%s)
+FILE_NAME_EXTENSION=$1
+
+echo PATH=$PATH
+echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
+echo TET_ROOT=$TET_ROOT
+echo TET_SUITE_ROOT=$TET_SUITE_ROOT
+echo ARCH=$ARCH
+
+RESULT_DIR=results-$ARCH
+HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir $RESULT_DIR
+
+tcc -e -j $JOURNAL_RESULT -p ./
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT # reporting the result
+
diff --git a/TC/making_new_tet_scen.py b/TC/making_new_tet_scen.py
new file mode 100755
index 0000000..6c5b845
--- /dev/null
+++ b/TC/making_new_tet_scen.py
@@ -0,0 +1,69 @@
+#!/usr/bin/python
+
+#############################################
+# tet_scen auto generator
+#
+# ** argv[1] = TC root
+#############################################
+
+import sys,string,os
+
+
+write_file = open("tet_scen", 'w')
+
+#
+# making new tet_scen
+#
+def making_tet_scen (filename):
+ #tmp_list = filename.strip().split('/')
+ n_filename = filename.replace(' ', '\\ ')
+ #print n_filename
+ #new_path = "/"+ sys.argv[1] +"/"+n_filename[2:-6]
+ new_path = "/"+n_filename[:-6]
+ #print new_path
+ file = open(filename, 'r')
+ lines = file.readlines()
+ for line in lines:
+ if len(line.strip()) > 1:
+ list = line.strip().split('/')
+ #print new_path + list[-1]
+ write_file.write("\t"+new_path+list[-1]+"\n")
+
+#
+# usage()
+#
+def usage():
+ print(" ")
+ print("./making_new_tet_scen.py tc_root")
+ print("Put the Test Case's root directory.")
+ print("Do not include '/' at the end")
+ print(" ")
+
+#
+# main()
+#
+def main():
+ if len(sys.argv) < 2:
+ usage()
+ sys.exit(0)
+
+ os.system('find '+ sys.argv[1] +' -name "tslist" > tslist.txt')
+
+ #write_file = open("tetscen", w)
+ write_file.write("# auto generated tet_scen\n")
+ write_file.write("all\n")
+ write_file.write("\t\"Starting Full Test Suite\"\n")
+
+ for file in open("tslist.txt", 'r'):
+ #print file.strip()
+ making_tet_scen(file.strip())
+
+ write_file.write("\t\"Completed Full Test Suite\"\n")
+ write_file.write("# EOF\n")
+ write_file.close()
+ print(" ")
+ print("==============================")
+ print("New tet_scen file is made~~~~")
+ print("==============================")
+ print(" ")
+main()
diff --git a/TC/tet_scen b/TC/tet_scen
new file mode 100755
index 0000000..90f5c13
--- /dev/null
+++ b/TC/tet_scen
@@ -0,0 +1,7 @@
+# auto generated tet_scen
+all
+ "Starting Full Test Suite"
+ /./utc/utc_ms_noti_update_complete
+ /./utc/utc_media_file_register
+ "Completed Full Test Suite"
+# EOF
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
new file mode 100644
index 0000000..d947407
--- /dev/null
+++ b/TC/tetbuild.cfg
@@ -0,0 +1,6 @@
+TET_OUTPUT_CAPTURE=True
+TET_BUILD_TOOL=make
+TET_BUILD_FILE=-f Makefile
+TET_API_COMPLIANT=True
+TET_PASS_TC_NAME=True
+
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
new file mode 100644
index 0000000..97c71c7
--- /dev/null
+++ b/TC/tetclean.cfg
@@ -0,0 +1,6 @@
+TET_OUTPUT_CAPTURE=True
+TET_BUILD_TOOL=make clean
+TET_BUILD_FILE=Makefile
+TET_API_COMPLIANT=True
+TET_PASS_TC_NAME=True
+
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
new file mode 100644
index 0000000..ed4e15d
--- /dev/null
+++ b/TC/tetexec.cfg
@@ -0,0 +1,6 @@
+TET_OUTPUT_CAPTURE=True
+TET_BUILD_TOOL=
+TET_BUILD_FILE=
+TET_API_COMPLIANT=True
+TET_PASS_TC_NAME=True
+
diff --git a/TC/tslist.txt b/TC/tslist.txt
new file mode 100644
index 0000000..652d8f4
--- /dev/null
+++ b/TC/tslist.txt
@@ -0,0 +1 @@
+./utc/tslist
diff --git a/TC/utc/.cproject b/TC/utc/.cproject
new file mode 100755
index 0000000..1dadf26
--- /dev/null
+++ b/TC/utc/.cproject
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="0.1424057240">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1424057240" moduleId="org.eclipse.cdt.core.settings" name="Default">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration buildProperties="" description="" id="0.1424057240" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
+ <folderInfo id="0.1424057240." name="/" resourcePath="">
+ <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.90615989" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
+ <targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.90615989.2030895102" name=""/>
+ <builder id="org.eclipse.cdt.build.core.settings.default.builder.1718853552" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.libs.518106426" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.280825162" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.350119631" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.143986256" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.827177070" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.469051175" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.655660498" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <scannerConfigBuildInfo instanceId="0.1424057240">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="utc.null.1911877445" name="utc"/>
+ </storageModule>
+</cproject>
diff --git a/TC/utc/.project b/TC/utc/.project
new file mode 100755
index 0000000..c1905de
--- /dev/null
+++ b/TC/utc/.project
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>utc</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+</projectDescription>
diff --git a/TC/utc/Makefile b/TC/utc/Makefile
new file mode 100755
index 0000000..5fd0724
--- /dev/null
+++ b/TC/utc/Makefile
@@ -0,0 +1,38 @@
+ifeq ($(ARCH),target)
+ PKG_CONFIG_PATH=/usr/lib/pkgconfig
+ export PKG_CONFIG_PATH
+ CC=arm-linux-gcc -Wall
+ CXX=arm-linux-g++ -Wall
+else
+ PKG_CONFIG_PATH=/usr/lib/pkgconfig
+ export PKG_CONFIG_PATH
+ CC=gcc -Wall
+ CXX=gcc -Wall
+endif
+
+TS10=utc_ms_noti_update_complete
+TS11=utc_media_file_register
+
+LIBS = `pkg-config --libs glib-2.0 libmedia-utils`
+LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o
+LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s
+LIBS +=-L$(TET_ROOT)/lib/tet3/ -lapi_s
+
+INCS = -I. `pkg-config --cflags glib-2.0 libmedia-utils`
+INCS += -I$(TET_ROOT)/inc/tet3
+INCS += -I/usr/include
+
+CFLAGS = $(INCS)
+CC += $(CFLAGS)
+LDFLAGS = $(LIBS)
+
+all : $(TS10) $(TS11)
+
+$(TS10): $(TS10).c
+ $(CC) -o $(TS10) $(TS10).c $(LDFLAGS)
+$(TS11): $(TS11).c
+ $(CC) -o $(TS11) $(TS11).c $(LDFLAGS)
+
+clean :
+ rm -rf *~ *.o $(TS10)
+ rm -rf *~ *.o $(TS11)
diff --git a/TC/utc/tslist b/TC/utc/tslist
new file mode 100755
index 0000000..2906212
--- /dev/null
+++ b/TC/utc/tslist
@@ -0,0 +1,2 @@
+utc_media_file_register
+utc_ms_noti_update_complete
diff --git a/TC/utc/utc_media_file_register.c b/TC/utc/utc_media_file_register.c
new file mode 100755
index 0000000..3ef4b35
--- /dev/null
+++ b/TC/utc/utc_media_file_register.c
@@ -0,0 +1,99 @@
+/*
+ * Testcase for libmedia-utils
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
+ *
+ * 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.
+ *
+ */
+
+/***************************************
+* add your header file here
+* e.g.,
+* #include "utc_ApplicationLib_recurGetDayOfWeek_func.h"
+***************************************/
+#include "utc_media_file_register.h"
+
+/***************************************
+* add Test Case Wide Declarations
+* e.g.,
+* static char msg[256];
+***************************************/
+
+static void startup()
+{
+ tet_printf("\n TC startup");
+ /* add your code here */
+
+}
+
+static void cleanup()
+{
+ tet_printf("\n TC End");
+ /* add your code here */
+
+}
+
+/***************************************
+* Add your callback function here
+* if needed
+***************************************/
+
+/***************************************
+* add your Test Cases
+* e.g.,
+* static void utc_ApplicationLib_recurGetDayOfWeek_01()
+* {
+* int ret;
+*
+* ret = target_api();
+* if(ret == 1)
+* tet_result(TET_PASS);
+* else
+* tet_result(TET_FAIL);
+* }
+*
+* static void utc_ApplicationLib_recurGetDayOfWeek_02()
+* {
+* code..
+* condition1
+* tet_result(TET_PASS);
+* condition2
+* tet_result(TET_FAIL);
+* }
+*
+***************************************/
+
+static void utc_media_file_register_01()
+{
+ int ret = 0;
+
+ ret = media_file_register("/opt/media/Images/image1.jpg");
+ if (ret == 0)
+ tet_result(TET_PASS);
+ else
+ tet_result(TET_FAIL);
+}
+
+static void utc_media_file_register_02()
+{
+ int ret = 0;
+
+ ret = media_file_register("/opt/media/Images/photo100.jpg"); /* invalid parameter */
+ if (ret != 0)
+ tet_result(TET_PASS);
+ else
+ tet_result(TET_FAIL);
+}
diff --git a/TC/utc/utc_media_file_register.h b/TC/utc/utc_media_file_register.h
new file mode 100755
index 0000000..d114712
--- /dev/null
+++ b/TC/utc/utc_media_file_register.h
@@ -0,0 +1,65 @@
+/*
+ * Testcase for libmedia-utils
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
+ *
+ * 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 <tet_api.h>
+#include <stdio.h>
+#include <string.h>
+#include <media-util-register.h>
+/****************************************************
+* add your header file
+* e.g.,
+* #include <time.h>
+* #include <stdio.h>
+* #include <stdlib.h>
+* #include <getopt.h>
+* #include "calendar.h"
+****************************************************/
+
+static void startup(), cleanup();
+void (*tet_startup) () = startup;
+void (*tet_cleanup) () = cleanup;
+
+/****************************************************
+* add your tc function
+* e.g.,
+* static void utc_ApplicationLib_recurGetDayOfWeek_func_01(void);
+* static void utc_ApplicationLib_recurGetDayOfWeek_func_02(void);
+****************************************************/
+
+static void utc_media_file_register_01();
+static void utc_media_file_register_02();
+
+/****************************************************
+* add your test case list here
+* e.g.,
+* struct tet_testlist tet_testlist[] = {
+* { utc_ApplicationLib_recurGetDayOfWeek_func_01,1},
+* { utc_ApplicationLib_recurGetDayOfWeek_func_02,2},
+* {NULL,0}
+* };
+****************************************************/
+
+struct tet_testlist tet_testlist[] = {
+ {utc_media_file_register_01, 1},
+ {utc_media_file_register_02, 2},
+ {NULL, 0}
+};
+
diff --git a/TC/utc/utc_ms_noti_update_complete.c b/TC/utc/utc_ms_noti_update_complete.c
new file mode 100755
index 0000000..a8aa25c
--- /dev/null
+++ b/TC/utc/utc_ms_noti_update_complete.c
@@ -0,0 +1,91 @@
+/*
+ * Testcase for libmedia-utils
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
+ *
+ * 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.
+ *
+ */
+
+/***************************************
+* add your header file here
+* e.g.,
+* #include "utc_ApplicationLib_recurGetDayOfWeek_func.h"
+***************************************/
+#include "utc_ms_noti_update_complete.h"
+
+/***************************************
+* add Test Case Wide Declarations
+* e.g.,
+* static char msg[256];
+***************************************/
+
+static void startup()
+{
+ tet_printf("\n TC startup");
+ /* add your code here */
+
+}
+
+static void cleanup()
+{
+ tet_printf("\n TC End");
+ /* add your code here */
+
+}
+
+/***************************************
+* Add your callback function here
+* if needed
+***************************************/
+
+/***************************************
+* add your Test Cases
+* e.g.,
+* static void utc_ApplicationLib_recurGetDayOfWeek_01()
+* {
+* int ret;
+*
+* ret = target_api();
+* if(ret == 1)
+* tet_result(TET_PASS);
+* else
+* tet_result(TET_FAIL);
+* }
+*
+* static void utc_ApplicationLib_recurGetDayOfWeek_02()
+* {
+* code..
+* condition1
+* tet_result(TET_PASS);
+* condition2
+* tet_result(TET_FAIL);
+* }
+*
+***************************************/
+
+static void utc_ms_noti_update_complete_01()
+{
+ int ret = 0;
+
+ ret = ms_noti_update_complete();
+ if (ret == 0) {
+ tet_result(TET_PASS);
+ rmdir("/opt/data/file-manager-service/_FILEOPERATION_END");
+ }
+ else
+ tet_result(TET_FAIL);
+}
+
diff --git a/TC/utc/utc_ms_noti_update_complete.h b/TC/utc/utc_ms_noti_update_complete.h
new file mode 100755
index 0000000..ce5212d
--- /dev/null
+++ b/TC/utc/utc_ms_noti_update_complete.h
@@ -0,0 +1,63 @@
+/*
+ * Testcase for libmedia-utils
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
+ *
+ * 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 <tet_api.h>
+#include <stdio.h>
+#include <string.h>
+#include <media-util-noti.h>
+/****************************************************
+* add your header file
+* e.g.,
+* #include <time.h>
+* #include <stdio.h>
+* #include <stdlib.h>
+* #include <getopt.h>
+* #include "calendar.h"
+****************************************************/
+
+static void startup(), cleanup();
+void (*tet_startup) () = startup;
+void (*tet_cleanup) () = cleanup;
+
+/****************************************************
+* add your tc function
+* e.g.,
+* static void utc_ApplicationLib_recurGetDayOfWeek_func_01(void);
+* static void utc_ApplicationLib_recurGetDayOfWeek_func_02(void);
+****************************************************/
+
+static void utc_ms_noti_update_complete_01();
+
+/****************************************************
+* add your test case list here
+* e.g.,
+* struct tet_testlist tet_testlist[] = {
+* { utc_ApplicationLib_recurGetDayOfWeek_func_01,1},
+* { utc_ApplicationLib_recurGetDayOfWeek_func_02,2},
+* {NULL,0}
+* };
+****************************************************/
+
+struct tet_testlist tet_testlist[] = {
+ {utc_ms_noti_update_complete_01, 1},
+ {NULL, 0}
+};
+
diff --git a/common/include/media-server-db-svc.h b/common/include/media-server-db-svc.h
index f3d9577..67998b1 100755
--- a/common/include/media-server-db-svc.h
+++ b/common/include/media-server-db-svc.h
@@ -27,68 +27,90 @@
* @version 1.0
* @brief
*/
-#include <media-svc.h>
#include "media-server-global.h"
-int
-ms_update_valid_type(MediaSvcHandle *handle, char *path);
-
-int
-ms_media_db_open(MediaSvcHandle **handle);
+typedef int (*CHECK_ITEM)(const char*, const char*, char **);
+typedef int (*CONNECT)(void**, char **);
+typedef int (*DISCONNECT)(void*, char **);
+typedef int (*CHECK_ITEM_EXIST)(void*, const char*, int, char **);
+typedef int (*INSERT_ITEM_BEGIN)(void*, int, char **);
+typedef int (*INSERT_ITEM_END)(void*, char **);
+typedef int (*INSERT_ITEM)(void*, const char*, int, const char*, char **);
+typedef int (*INSERT_ITEM_IMMEDIATELY)(void*, const char*, int, const char*, char **);
+typedef int (*MOVE_ITEM_BEGIN)(void*, int, char **);
+typedef int (*MOVE_ITEM_END)(void*, char **);
+typedef int (*MOVE_ITEM)(void*, const char*, int, const char*, int, const char*, char **);
+typedef int (*SET_ALL_STORAGE_ITEMS_VALIDITY)(void*, int, int, char **);
+typedef int (*SET_ITEM_VALIDITY_BEGIN)(void*, int, char **);
+typedef int (*SET_ITEM_VALIDITY_END)(void*, char **);
+typedef int (*SET_ITEM_VALIDITY)(void*, const char*, int, const char*, int, char **);
+typedef int (*DELETE_ITEM)(void*, const char*, int, char **);
+typedef int (*DELETE_ALL_ITEMS_IN_STORAGE)(void*, int, char **);
+typedef int (*DELETE_ALL_INVALID_ITMES_IN_STORAGE)(void*, int, char **);
+typedef int (*UPDATE_BEGIN)(char **);
+typedef int (*UPDATE_END)(char **);
int
-ms_media_db_close(MediaSvcHandle *handle);
+ms_load_functions(void);
void
-ms_register_start(MediaSvcHandle *handle);
-
-void
-ms_register_end(MediaSvcHandle *handle);
+ms_unload_functions(void);
int
-ms_register_file(MediaSvcHandle *handle, const char *path, GAsyncQueue* queue);
+ms_connect_db(void **handle);
int
-ms_register_scanfile(MediaSvcHandle *handle, const char *path);
-
-void
-ms_update_valid_type_start(MediaSvcHandle *handle);
-
-void
-ms_update_valid_type_end(MediaSvcHandle *handle);
+ms_disconnect_db(void *handle);
int
-ms_change_valid_type(MediaSvcHandle *handle, ms_store_type_t table_id, bool validation);
+ms_validate_item(void *handle, char *path);
-#ifdef THUMB_THREAD
int
-ms_media_db_insert_with_thumb(MediaSvcHandle *handle, const char *path, int category);
-#endif
+ms_register_file(void *handle, const char *path, GAsyncQueue* queue);
int
-ms_media_db_insert(MediaSvcHandle *handle, const char *path, int category, bool bulk);
+ms_insert_item_batch(void *handle, const char *path);
int
-ms_check_file_exist_in_db(MediaSvcHandle *handle, const char *file_full_path);
+ms_insert_item(void *handle, const char *path);
int
-ms_media_db_delete(MediaSvcHandle *handle, const char *full_file_path);
-
-void
-ms_media_db_move_start(MediaSvcHandle *handle);
-
-void
-ms_media_db_move_end(MediaSvcHandle *handle);
+ms_delete_item(void *handle, const char *full_file_path);
int
-ms_media_db_move(MediaSvcHandle *handle,
+ms_move_item(void *handle,
ms_store_type_t src_store_type,
ms_store_type_t dest_store_type,
const char *src_file_full_path,
const char *dest_file_full_path);
bool
-ms_delete_all_record(MediaSvcHandle *handle, ms_store_type_t store_type);
+ms_delete_all_items(void *handle, ms_store_type_t store_type);
+
+int
+ms_invalidate_all_items(void *handle, ms_store_type_t table_id);
bool
-ms_delete_invalid_records(MediaSvcHandle *handle, ms_store_type_t store_type); \ No newline at end of file
+ms_delete_invalid_items(void *handle, ms_store_type_t store_type);
+
+/****************************************************************************************************
+FOR BULK COMMIT
+*****************************************************************************************************/
+
+void
+ms_register_start(void *handle);
+
+void
+ms_register_end(void *handle);
+
+void
+ms_move_start(void *handle);
+
+void
+ms_move_end(void *handle);
+
+void
+ms_validate_start(void *handle);
+
+void
+ms_validate_end(void *handle); \ No newline at end of file
diff --git a/common/include/media-server-error.h b/common/include/media-server-error.h
index ff2ff1a..b2ec284 100755
--- a/common/include/media-server-error.h
+++ b/common/include/media-server-error.h
@@ -61,14 +61,14 @@
#define MS_ERR_DB_DELETE_RECORD_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x32)) /**< deleting record fails */
#define MS_ERR_DB_UPDATE_RECORD_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x33)) /**< updating record fails */
#define MS_ERR_DB_CONNECT_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x34)) /**< connecting database fails */
-#define MS_ERR_DB_DISCONNECT_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x35)) /**< connecting database fails */
-#define MS_ERR_DB_OPERATION_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x36)) /**< connecting database fails */
+#define MS_ERR_DB_DISCONNECT_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x35)) /**< disconnecting database fails */
/*drm operation error*/
-#define MS_ERR_DRM_GET_TYPE (MID_CONTENTS_MGR_ERROR - ERROR(0x40))
+#define MS_ERR_DRM_GET_TYPE_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x40))
#define MS_ERR_DRM_MOVE_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x41)) /**< can't copy/move drm file because of permission */
#define MS_ERR_DRM_REGISTER_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x42))
-#define MS_ERR_DRM_EXTRACT_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x43))
+#define MS_ERR_DRM_EXTRACT_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x43))
+#define MS_ERR_DRM_GET_INFO_FAIL (MID_CONTENTS_MGR_ERROR - ERROR(0x40))
/*IPC operation error*/
#define MS_ERR_SOCKET_CONN (MID_CONTENTS_MGR_ERROR - ERROR(0x50)) /**< Socket connect error */
diff --git a/common/include/media-server-scan-internal.h b/common/include/media-server-scan-internal.h
index c3563e5..d9b8351 100755
--- a/common/include/media-server-scan-internal.h
+++ b/common/include/media-server-scan-internal.h
@@ -32,7 +32,7 @@
#ifdef PROGRESS
struct quickpanel;
-void _ms_dir_scan(MediaSvcHandle *handle, ms_scan_data_t * scan_data, struct quickpanel *ms_quickpanel);
+void _ms_dir_scan(void *handle, ms_scan_data_t * scan_data, struct quickpanel *ms_quickpanel);
#else
-void _ms_dir_scan(MediaSvcHandle *handle, ms_scan_data_t * scan_data);
+void _ms_dir_scan(void *handle, ms_scan_data_t * scan_data);
#endif
diff --git a/common/include/media-server-utils.h b/common/include/media-server-utils.h
index f4da8ff..b7ee0ef 100755
--- a/common/include/media-server-utils.h
+++ b/common/include/media-server-utils.h
@@ -81,9 +81,6 @@ ms_config_set_str(const char *key, const char *value);
void
ms_check_db_updating(void);
-int
-ms_get_category_from_mime(const char *path, int *category);
-
#ifdef FMS_PERF
void
ms_check_start_time(struct timeval *start_time);
diff --git a/common/media-server-db-svc.c b/common/media-server-db-svc.c
index b72be77..c9bec72 100755
--- a/common/media-server-db-svc.c
+++ b/common/media-server-db-svc.c
@@ -27,15 +27,11 @@
* @version 1.0
* @brief This file implements main database operation.
*/
-#include <db-util.h>
+
+#include <dlfcn.h>
+
+#include <aul/aul.h>
#include <drm-service.h>
-#include <media-thumbnail.h>
-#include <visual-svc-error.h>
-#include <visual-svc-types.h>
-#include <visual-svc.h>
-#include <audio-svc-error.h>
-#include <audio-svc-types.h>
-#include <audio-svc.h>
#include "media-server-utils.h"
#include "media-server-inotify.h"
@@ -53,7 +49,55 @@ GMutex *queue_mutex;
#define MS_VALID_COUNT 100 /*For bundle commit*/
#define MS_MOVE_COUNT 100 /*For bundle commit*/
-void _ms_insert_reg_list(const char *path)
+void **func_handle = NULL; /*dlopen handel*/
+
+CHECK_ITEM f_check;
+CONNECT f_connect;
+DISCONNECT f_disconnect;
+CHECK_ITEM_EXIST f_exist;
+INSERT_ITEM_BEGIN f_insert_begin;
+INSERT_ITEM_END f_insert_end;
+INSERT_ITEM f_insert_batch;
+INSERT_ITEM_IMMEDIATELY f_insert;
+MOVE_ITEM_BEGIN f_move_begin;
+MOVE_ITEM_END f_move_end;
+MOVE_ITEM f_move;
+SET_ALL_STORAGE_ITEMS_VALIDITY f_set_all_validity;
+SET_ITEM_VALIDITY_BEGIN f_set_validity_begin;
+SET_ITEM_VALIDITY_END f_set_validity_end;
+SET_ITEM_VALIDITY f_set_validity;
+DELETE_ITEM f_delete;
+DELETE_ALL_ITEMS_IN_STORAGE f_delete_all;
+DELETE_ALL_INVALID_ITMES_IN_STORAGE f_delete_invalid_items;
+UPDATE_BEGIN f_update_begin;
+UPDATE_END f_update_end;
+
+enum func_list {
+ eCHECK,
+ eCONNECT,
+ eDISCONNECT,
+ eEXIST,
+ eINSERT_BEGIN,
+ eINSERT_END,
+ eINSERT_BATCH,
+ eINSERT,
+ eMOVE_BEGIN,
+ eMOVE_END,
+ eMOVE,
+ eSET_ALL_VALIDITY,
+ eSET_VALIDITY_BEGIN,
+ eSET_VALIDITY_END,
+ eSET_VALIDITY,
+ eDELETE,
+ eDELETE_ALL,
+ eDELETE_INVALID_ITEMS,
+ eUPDATE_BEGIN,
+ eUPDATE_END,
+ eFUNC_MAX
+};
+
+static void
+_ms_insert_reg_list(const char *path)
{
char *reg_path = strdup(path);
@@ -64,43 +108,45 @@ void _ms_insert_reg_list(const char *path)
g_mutex_unlock(list_mutex);
}
-bool _ms_find_reg_list(const char *path)
+static bool
+_ms_find_reg_list(const char *path)
{
- int i;
+ int list_index;
int len = reg_list->len;
char *data;
- bool ret = false;
+ bool res = false;
g_mutex_lock(list_mutex);
MS_DBG("array length : %d", len);
- for(i = 0; i < len; i++) {
- data = g_array_index (reg_list, char*, i);
+ for(list_index = 0; list_index < len; list_index++) {
+ data = g_array_index (reg_list, char*, list_index);
if(!strcmp(data, path))
- ret = true;
+ res = true;
}
g_mutex_unlock(list_mutex);
- return ret;
+ return res;
}
-void _ms_delete_reg_list(const char *path)
+static void
+_ms_delete_reg_list(const char *path)
{
- int i;
+ int list_index;
int len = reg_list->len;
char *data;
MS_DBG("Delete : %s", path);
g_mutex_lock(list_mutex);
- for(i = 0; i < len; i++) {
- data = g_array_index (reg_list, char*, i);
+ for(list_index = 0; list_index < len; list_index++) {
+ data = g_array_index (reg_list, char*, list_index);
MS_DBG("%s", data);
if(!strcmp(data, path)) {
MS_DBG("Delete complete : %s", data);
free(data);
- g_array_remove_index(reg_list, i);
+ g_array_remove_index(reg_list, list_index);
break;
}
}
@@ -108,165 +154,360 @@ void _ms_delete_reg_list(const char *path)
g_mutex_unlock(list_mutex);
}
+static int
+_ms_get_mime_in_drm_info(const char *path, char *mime)
+{
+ int ret;
+ drm_content_info_t contentInfo = { 0 };
+ if (path == NULL || mime == NULL)
+ return MS_ERR_ARG_INVALID;
-int
-ms_media_db_open(MediaSvcHandle **handle)
-{
- int err;
+ ret = drm_svc_get_content_info(path, &contentInfo);
+ if (ret != DRM_RESULT_SUCCESS) {
+ MS_DBG("drm_svc_get_content_info() fails. ");
+ return MS_ERR_DRM_GET_INFO_FAIL;
+ }
- /*Lock mutex for openning db*/
- g_mutex_lock(db_mutex);
+ strncpy(mime, contentInfo.contentType, 100);
+ MS_DBG("DRM contentType : %s", contentInfo.contentType);
+ MS_DBG("DRM mime : %s", mime);
+
+ return MS_ERR_NONE;
+}
+
+static int
+_ms_get_mime(const char *path, char *mimetype)
+{
+ MS_DBG_START();
- err = media_svc_connect(handle);
- if (err != MEDIA_INFO_ERROR_NONE) {
- MS_DBG("media_svc_connect() error : %d", err);
+ int ret = 0;
- g_mutex_unlock(db_mutex);
+ if (path == NULL)
+ return MS_ERR_ARG_INVALID;
- return MS_ERR_DB_CONNECT_FAIL;
+ /*get content type and mime type from file. */
+ /*in case of drm file. */
+ if (drm_svc_is_drm_file(path) == DRM_TRUE) {
+ DRM_FILE_TYPE drm_type = DRM_FILE_TYPE_NONE;
+ drm_type = drm_svc_get_drm_type(path);
+ if (drm_type == DRM_FILE_TYPE_NONE) {
+ MS_DBG("There is no TYPE");
+ return MS_ERR_DRM_GET_TYPE_FAIL;
+ } else {
+ ret = _ms_get_mime_in_drm_info(path, mimetype);
+ if (ret != 0) {
+ MS_DBG("Fail to get mime");
+ return ret;
+ }
+ }
+ } else {
+ /*in case of normal files */
+ if (aul_get_mime_from_file(path, mimetype, 255) < 0) {
+ MS_DBG("aul_get_mime_from_file fail");
+ return MS_ERR_ARG_INVALID;
+ }
}
- MS_DBG("connect Media DB");
+ MS_DBG("mime type : %s", mimetype);
- g_mutex_unlock(db_mutex);
+ MS_DBG_END();
return MS_ERR_NONE;
}
-int
-ms_media_db_close(MediaSvcHandle *handle)
+#define CONFIG_PATH "/opt/data/file-manager-service/plugin-config"
+#define EXT ".so"
+#define EXT_LEN 3
+
+GArray *so_array;
+void ***func_array;
+int lib_num;
+
+static int
+_ms_check_category(const char *path, const char *mimetype, int index)
{
- int err;
+ int ret;
+ char *err_msg = NULL;
- err = media_svc_disconnect(handle);
- if (err != MEDIA_INFO_ERROR_NONE) {
- MS_DBG("media_svc_disconnect() error : %d", err);
- return MS_ERR_DB_DISCONNECT_FAIL;
+ ret = ((CHECK_ITEM)func_array[index][eCHECK])(path, mimetype, &err_msg);
+ if (ret != 0)
+ free(err_msg);
+
+ return ret;
+}
+
+static int
+_ms_drm_register(const char* path)
+{
+ MS_DBG("THIS IS DRM FILE");
+ int res = MS_ERR_NONE;
+ DRM_RESULT dres;
+
+ ms_inoti_add_ignore_file(path);
+ dres = drm_svc_register_file(path);
+ if (dres != DRM_RESULT_SUCCESS) {
+ MS_DBG("drm_svc_register_file error : %d", res);
+ res = MS_ERR_DRM_REGISTER_FAIL;
}
- MS_DBG("Disconnect Media DB");
+ return res;
+}
- return MS_ERR_NONE;
+static void
+_ms_drm_unregister(const char* path)
+{
+ ms_ignore_file_info *ignore_file;
+
+ drm_svc_unregister_file(path, false);
+
+ ignore_file = ms_inoti_find_ignore_file(path);
+ if (ignore_file != NULL)
+ ms_inoti_delete_ignore_file(ignore_file);
}
-int
-ms_update_valid_type(MediaSvcHandle *handle, char *path)
+static int
+_ms_token_data(char *buf, char **name)
{
- MS_DBG_START();
+ int len;
+ char* pos = NULL;
+
+ pos = strstr(buf, EXT);
+ if (pos == NULL) {
+ MS_DBG("This is not shared object library.");
+ name = NULL;
+ return -1;
+ } else {
+ len = pos - buf + EXT_LEN;
+ *name = strndup(buf, len);
+ MS_DBG("%s", *name);
+ }
- int res = MS_ERR_NONE;
- int err;
- int category = MS_CATEGORY_UNKNOWN;
+ return 0;
+}
- MS_DBG("%s", path);
- err = ms_get_category_from_mime(path, &category);
- if (err < 0) {
- MS_DBG("ms_get_category_from_mime fails");
- return err;
- }
-
- /*if music, call mp_svc_set_item_valid() */
- if (category & MS_CATEGORY_MUSIC || category & MS_CATEGORY_SOUND) {
- /*check exist in Music DB, If file is not exist, insert data in DB. */
- err = audio_svc_check_item_exist(handle, path);
- if (err == AUDIO_SVC_ERROR_DB_NO_RECORD) {
- MS_DBG("not exist in Music DB. insert data");
-#ifdef THUMB_THREAD
- err = ms_media_db_insert_with_thumb(handle, path, category);
-#else
- err = ms_media_db_insert(handle, path, category, true);
-#endif
- if (err != MS_ERR_NONE) {
- MS_DBG ("ms_media_db_insert() error %d", err);
- res = err;
- }
+static bool
+_ms_load_config()
+{
+ char *cret;
+ int ret;
+ FILE *fp;
+ char *so_name = NULL;
+ char buf[256] = {0};
+
+ fp = fopen(CONFIG_PATH, "rt");
+ if (fp == NULL) {
+ MS_DBG("fp is NULL");
+ return MS_ERR_FILE_OPEN_FAIL;
+ }
+ while(1) {
+ cret = fgets(buf, 256, fp);
+ if (cret == NULL)
+ break;
+
+ ret = _ms_token_data(buf, &so_name);
+ if (ret == 0) {
+ /*add to array*/
+ g_array_append_val(so_array, so_name);
+ so_name = NULL;
}
- else if (err == AUDIO_SVC_ERROR_NONE) {
- /*if meta data of file exist, change valid field to "1" */
- MS_DBG("Item exist");
+ }
+
+ fclose(fp);
- err = audio_svc_set_item_valid(handle, path, true);
- if (err != AUDIO_SVC_ERROR_NONE)
- MS_DBG("audio_svc_set_item_valid() error : %d", err);
+ return MS_ERR_NONE;
+}
+
+int
+ms_load_functions(void)
+{
+ int lib_index = 0, func_index;
+ char func_list[eFUNC_MAX][40] = {
+ "check_item",
+ "connect",
+ "disconnect",
+ "check_item_exist",
+ "insert_item_begin",
+ "insert_item_end",
+ "insert_item",
+ "insert_item_immediately",
+ "move_item_begin",
+ "move_item_end",
+ "move_item",
+ "set_all_storage_items_validity",
+ "set_item_validity_begin",
+ "set_item_validity_end",
+ "set_item_validity",
+ "delete_item",
+ "delete_all_items_in_storage",
+ "delete_all_invalid_items_in_storage",
+ "update_begin",
+ "update_end"
+ };
+ /*init array for adding name of so*/
+ so_array = g_array_new(FALSE, FALSE, sizeof(char*));
+
+ /*load information of so*/
+ _ms_load_config();
+
+ if(so_array->len == 0) {
+ MS_DBG("There is no information for functions");
+ return -1;
+ }
+
+ /*the number of functions*/
+ lib_num = so_array->len;
+
+ MS_DBG("The number of information of so : %d", lib_num);
+ func_handle = malloc(sizeof(void*) * lib_num);
+
+ while(lib_index < lib_num) {
+ /*get handle*/
+ MS_DBG("[name of so : %s]", g_array_index(so_array, char*, lib_index));
+ func_handle[lib_index] = dlopen(g_array_index(so_array, char*, lib_index), RTLD_LAZY);
+ if (!func_handle[lib_index]) {
+ MS_DBG("%s", dlerror());
+ return -1;
}
- else
- {
- MS_DBG("audio_svc_check_item_exist() error : %d", err);
- res = MS_ERR_DB_OPERATION_FAIL;
+ lib_index++;
+ }
+
+ dlerror(); /* Clear any existing error */
+
+ /*allocate for array of functions*/
+ func_array = malloc(sizeof(void*) * lib_num);
+ for(lib_index = 0 ; lib_index < lib_num; lib_index ++) {
+ func_array[lib_index] = malloc(sizeof(void*) * eFUNC_MAX);
+ }
+
+ /*add functions to array */
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ for (func_index = 0; func_index < eFUNC_MAX ; func_index++) {
+ func_array[lib_index][func_index] = dlsym(func_handle[lib_index], func_list[func_index]);
}
}
- /*if file is image file, call mb_svc_set_db_item_valid() */
- else if (category & MS_CATEGORY_VIDEO || category & MS_CATEGORY_IMAGE) {
- ms_store_type_t store_type;
- minfo_store_type mb_stroage;
- store_type = ms_get_store_type_by_full(path);
- mb_stroage = (store_type == MS_MMC) ? MINFO_MMC : MINFO_PHONE;
+ MS_DBG("FUNCTIONS LOAD COMPLETE");
- err = minfo_set_item_valid(handle, mb_stroage, path, true);
- if (err != MB_SVC_ERROR_NONE) {
- MS_DBG("not exist in Media DB. insert data");
+ return MS_ERR_NONE;
+}
- ms_update_valid_type_end(handle);
+void
+ms_unload_functions(void)
+{
+ int lib_index, func_index;
-#ifdef THUMB_THREAD
- err = ms_media_db_insert_with_thumb(handle, path, category);
-#else
- err = ms_media_db_insert(handle, path, category, true);
-#endif
- if (err != MS_ERR_NONE)
- MS_DBG("ms_media_db_insert() error : %d", err);
+ for (lib_index = 0; lib_index < lib_num; lib_index ++)
+ dlclose(func_handle[lib_index]);
- ms_update_valid_type_start(handle);
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ for (func_index = 0; func_index < eFUNC_MAX ; func_index++) {
+ free(func_array[lib_index][func_index]);
}
- else {
- MS_DBG("Item exist");
+ }
+
+ free(func_array);
+ free(func_handle);
+ g_array_free(so_array, TRUE);
+}
+
+int
+ms_connect_db(void **handle)
+{
+ int lib_index;
+ int ret;
+ char * err_msg = NULL;
+
+ /*Lock mutex for openning db*/
+ g_mutex_lock(db_mutex);
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((CONNECT)func_array[lib_index][eCONNECT])(handle, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ g_mutex_unlock(db_mutex);
+
+ return MS_ERR_DB_CONNECT_FAIL;
}
}
- if (category & MS_CATEGORY_DRM) {
- DRM_RESULT drm_res;
+ MS_DBG("connect Media DB");
+
+ g_mutex_unlock(db_mutex);
- ms_inoti_add_ignore_file(path);
- drm_res = drm_svc_register_file(path);
- if (drm_res != DRM_RESULT_SUCCESS) {
- MS_DBG("drm_svc_register_file error : %d", drm_res);
- res = MS_ERR_DRM_REGISTER_FAIL;
+ return MS_ERR_NONE;
+}
+
+int
+ms_disconnect_db(void *handle)
+{
+ int lib_index;
+ int ret;
+ char * err_msg = NULL;
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((DISCONNECT)func_array[lib_index][eDISCONNECT])(handle, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ return MS_ERR_DB_DISCONNECT_FAIL;
}
}
- MS_DBG_END();
+ MS_DBG("Disconnect Media DB");
- return res;
+ return MS_ERR_NONE;
}
int
-ms_change_valid_type(MediaSvcHandle *handle, ms_store_type_t store_type, bool validation)
+ms_validate_item(void *handle, char *path)
{
MS_DBG_START();
+
+ int lib_index;
int res = MS_ERR_NONE;
- int err;
+ int ret;
+ char *err_msg = NULL;
+ char mimetype[255] = {0};
+ ms_store_type_t storage_type;
+
+ MS_DBG("%s", path);
- audio_svc_storage_type_e audio_storage;
- minfo_store_type visual_storage;
+ _ms_get_mime(path, mimetype);
+ storage_type = ms_get_store_type_by_full(path);
- audio_storage = (store_type == MS_PHONE)
- ? AUDIO_SVC_STORAGE_PHONE : AUDIO_SVC_STORAGE_MMC;
- visual_storage = (store_type == MS_PHONE)
- ? MINFO_PHONE : MINFO_MMC;
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ if (!_ms_check_category(path, mimetype, lib_index)) {
+ /*check exist in Media DB, If file is not exist, insert data in DB. */
+ ret = ((CHECK_ITEM_EXIST)func_array[lib_index][eEXIST])(handle, path, storage_type, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("not exist in Music DB. insert data");
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
- err = audio_svc_set_db_valid(handle, audio_storage, validation);
- if (err < AUDIO_SVC_ERROR_NONE) {
- MS_DBG("audio_svc_set_db_valid error :%d", err);
- res = MS_ERR_DB_OPERATION_FAIL;
+ ret = ms_insert_item_batch(handle, path);
+ if (ret != MS_ERR_NONE) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ res = ret;
+ }
+ } else {
+ /*if meta data of file exist, change valid field to "1" */
+ MS_DBG("Item exist");
+
+ ret = ((SET_ITEM_VALIDITY)func_array[lib_index][eSET_VALIDITY])(handle, path, true, mimetype, true, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ res = MS_ERR_DB_UPDATE_RECORD_FAIL;
+ }
+ }
+ }
}
- err = minfo_set_db_valid(handle, visual_storage, validation);
- if (err < MB_SVC_ERROR_NONE) {
- MS_DBG("minfo_set_db_valid : error %d", err);
- res = MS_ERR_DB_OPERATION_FAIL;
+ if (drm_svc_is_drm_file(path) == DRM_TRUE) {
+ ret = _ms_drm_register(path);
}
MS_DBG_END();
@@ -274,15 +515,37 @@ ms_change_valid_type(MediaSvcHandle *handle, ms_store_type_t store_type, bool va
return res;
}
+int
+ms_invalidate_all_items(void *handle, ms_store_type_t store_type)
+{
+ MS_DBG_START();
+ int lib_index;
+ int res = MS_ERR_NONE;
+ int ret;
+ char *err_msg = NULL;
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((SET_ALL_STORAGE_ITEMS_VALIDITY)func_array[lib_index][eSET_ALL_VALIDITY])(handle, store_type, false, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ res = MS_ERR_DB_UPDATE_RECORD_FAIL;
+ }
+ }
+
+ MS_DBG_END();
+
+ return res;
+}
int
-ms_register_file(MediaSvcHandle *handle, const char *path, GAsyncQueue* queue)
+ms_register_file(void *handle, const char *path, GAsyncQueue* queue)
{
MS_DBG_START();
MS_DBG("[%d]register file : %s", syscall(__NR_gettid), path);
- int err;
- int category = MS_CATEGORY_UNKNOWN;
+ int res = MS_ERR_NONE;
+ int ret;
if (path == NULL) {
MS_DBG("path == NULL");
@@ -305,58 +568,36 @@ ms_register_file(MediaSvcHandle *handle, const char *path, GAsyncQueue* queue)
}
g_mutex_unlock(queue_mutex);
- err = ms_get_category_from_mime(path, &category);
- if (err != MS_ERR_NONE) {
- MS_DBG("ms_get_category_from_mime error : %d", err);
- goto FREE_RESOURCE;
- }
-
- if (category <= MS_CATEGORY_ETC) {
- MS_DBG("This is not media contents");
- err = MS_ERR_NOT_MEDIA_FILE;
- goto FREE_RESOURCE;
- } else {
-#ifdef THUMB_THREAD
- err = ms_media_db_insert_with_thumb(handle, path, category);
-#else
- err = ms_media_db_insert(handle, path, category, false);
-#endif
- if (err != MS_ERR_NONE) {
- MS_DBG("ms_media_db_insert error : %d", err);
-
- /*if music, call mp_svc_set_item_valid() */
- if (category & MS_CATEGORY_MUSIC || category & MS_CATEGORY_SOUND) {
- /*check exist in Music DB, If file is not exist, insert data in DB. */
- err = audio_svc_check_item_exist(handle, path);
- if (err == AUDIO_SVC_ERROR_NONE) {
- MS_DBG("Audio Item exist");
- err = MS_ERR_NONE;
- }
- } else if (category & MS_CATEGORY_VIDEO || category & MS_CATEGORY_IMAGE) {
- Mitem *mi = NULL;
-
- /*get an item based on its url. */
- err = minfo_get_item(handle, path, &mi);
- if (err == MB_SVC_ERROR_NONE) {
- MS_DBG("Visual Item exist");
- err = MS_ERR_NONE;
+ ret = ms_insert_item(handle, path);
+ if (ret != MS_ERR_NONE) {
+ MS_DBG("ms_media_db_insert error : %d", ret);
+ int lib_index;
+ char mimetype[255];
+ ms_store_type_t storage_type;
+
+ _ms_get_mime(path, mimetype);
+ storage_type = ms_get_store_type_by_full(path);
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ /*check item is already inserted*/
+ if (!_ms_check_category(path, mimetype, lib_index)) {
+ char *err_msg = NULL;
+
+ ret = ((CHECK_ITEM_EXIST)func_array[lib_index][eEXIST])(handle, path, storage_type, &err_msg); /*dlopen*/
+ if (ret == 0) {
+ MS_DBG("Media Item exist");
+ res = MS_ERR_NONE;
+ } else {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ res = MS_ERR_DB_INSERT_RECORD_FAIL;
}
-
- minfo_destroy_mtype_item(mi);
}
}
+ }
- if (category & MS_CATEGORY_DRM) {
- MS_DBG("THIS IS DRM FILE");
- DRM_RESULT res;
-
- ms_inoti_add_ignore_file(path);
- res = drm_svc_register_file(path);
- if (res != DRM_RESULT_SUCCESS) {
- MS_DBG("drm_svc_register_file error : %d", res);
- err = MS_ERR_DRM_REGISTER_FAIL;
- }
- }
+ if (drm_svc_is_drm_file(path) == DRM_TRUE) {
+ ret = _ms_drm_register(path);
}
FREE_RESOURCE:
@@ -365,353 +606,186 @@ FREE_RESOURCE:
_ms_delete_reg_list(path);
if (soc_queue != NULL) {
- MS_DBG("%d", err);
- g_async_queue_push(soc_queue, GINT_TO_POINTER(err+MS_ERR_MAX));
+ MS_DBG("%d", res);
+ g_async_queue_push(soc_queue, GINT_TO_POINTER(res+MS_ERR_MAX));
MS_DBG("Return OK");
}
soc_queue = NULL;
g_mutex_unlock(queue_mutex);
MS_DBG_END();
- return err;
+ return res;
}
int
-ms_register_scanfile(MediaSvcHandle *handle, const char *path)
+ms_insert_item_batch(void *handle, const char *path)
{
MS_DBG_START();
- MS_DBG("register scanfile : %s", path);
-
- int err = MS_ERR_NONE;
- int category = MS_CATEGORY_UNKNOWN;
-
- if (path == NULL) {
- MS_DBG("path == NULL");
- return MS_ERR_ARG_INVALID;
- }
-
- err = ms_get_category_from_mime(path, &category);
- if (err != MS_ERR_NONE) {
- MS_DBG("ms_get_category_from_mime error : %d", err);
- return err;
- }
-
- if (category <= MS_CATEGORY_ETC) {
- MS_DBG("This is not media contents");
- return MS_ERR_NOT_MEDIA_FILE;
- }
- err = ms_media_db_insert(handle, path, category, true);
- if (err != MS_ERR_NONE) {
- MS_DBG("ms_media_db_insert error : %d", err);
- }
-
- if (category & MS_CATEGORY_DRM) {
- MS_DBG("THIS IS DRM FILE");
- DRM_RESULT res;
-
- ms_inoti_add_ignore_file(path);
-
- res = drm_svc_register_file(path);
- if (res != DRM_RESULT_SUCCESS) {
- MS_DBG("drm_svc_register_file error : %d", err);
- err = MS_ERR_DRM_REGISTER_FAIL;
- }
- }
-
- MS_DBG_END();
- return err;
-}
+ int lib_index;
+ int res = MS_ERR_NONE;
+ int ret;
+ char mimetype[255] = {0};
+ char *err_msg = NULL;
+ ms_store_type_t storage_type;
-#ifdef THUMB_THREAD
-int
-ms_media_db_insert_with_thumb(MediaSvcHandle *handle, const char *path, int category)
-{
- MS_DBG_START();
MS_DBG("%s", path);
- int ret = MS_ERR_NONE;
- int err;
- ms_store_type_t store_type;
- audio_svc_category_type_e audio_category;
- minfo_file_type visual_category;
- audio_svc_storage_type_e storage;
-
- if (category & MS_CATEGORY_VIDEO ||category & MS_CATEGORY_IMAGE) {
- visual_category = (category & MS_CATEGORY_IMAGE)
- ? MINFO_ITEM_IMAGE : MINFO_ITEM_VIDEO;
- err = minfo_add_media(handle, path, visual_category);
- if (err < 0) {
- MS_DBG(" minfo_add_media error %d", err);
- ret = MS_ERR_DB_INSERT_RECORD_FAIL;
- } else {
- char thumb_path[1024];
+ _ms_get_mime(path, mimetype);
+ storage_type = ms_get_store_type_by_full(path);
- err = thumbnail_request_from_db(path, thumb_path, sizeof(thumb_path));
- if (err < 0) {
- MS_DBG("thumbnail_request_from_db falied: %d", err);
- } else {
- MS_DBG("thumbnail_request_from_db success: %s", thumb_path);
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ if (!_ms_check_category(path, mimetype, lib_index)) {
+ ret = ((INSERT_ITEM)func_array[lib_index][eINSERT_BATCH])(handle, path, storage_type, mimetype, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ res = MS_ERR_DB_INSERT_RECORD_FAIL;
}
}
-
- MS_DBG("IMAGE");
}
- else if (category & MS_CATEGORY_SOUND || category & MS_CATEGORY_MUSIC) {
- store_type = ms_get_store_type_by_full(path);
-
- storage = (store_type == MS_MMC)
- ? AUDIO_SVC_STORAGE_MMC : AUDIO_SVC_STORAGE_PHONE;
- audio_category = (category & MS_CATEGORY_SOUND)
- ? AUDIO_SVC_CATEGORY_SOUND : AUDIO_SVC_CATEGORY_MUSIC;
- err = audio_svc_insert_item(handle, storage, path, audio_category);
- if (err < 0) {
- MS_DBG("mp_svc_insert_item fails error %d", err);
- ret = MS_ERR_DB_INSERT_RECORD_FAIL;
- }
- MS_DBG("SOUND");
+ if (drm_svc_is_drm_file(path) == DRM_TRUE) {
+ ret = _ms_drm_register(path);
+ res = ret;
}
MS_DBG_END();
- return ret;
+ return res;
}
-#endif
int
-ms_media_db_insert(MediaSvcHandle *handle, const char *path, int category, bool bulk)
+ms_insert_item(void *handle, const char *path)
{
MS_DBG_START();
MS_DBG("%s", path);
- int ret = MS_ERR_NONE;
- int err;
- ms_store_type_t store_type;
- audio_svc_category_type_e audio_category;
- minfo_file_type visual_category;
- audio_svc_storage_type_e storage;
-
- if (category & MS_CATEGORY_VIDEO ||category & MS_CATEGORY_IMAGE) {
- visual_category = (category & MS_CATEGORY_IMAGE)
- ? MINFO_ITEM_IMAGE : MINFO_ITEM_VIDEO;
- if(bulk)
- err = minfo_add_media_batch(handle, path, visual_category);
- else
- err = minfo_add_media(handle, path, visual_category);
- if (err < 0) {
- MS_DBG(" minfo_add_media error %d", err);
- ret = MS_ERR_DB_INSERT_RECORD_FAIL;
- }
-#ifndef THUMB_THREAD
- else {
- char thumb_path[1024];
-
- err = thumbnail_request_from_db(path, thumb_path, sizeof(thumb_path));
- if (err < 0) {
- MS_DBG("thumbnail_request_from_db falied: %d", err);
- } else {
- MS_DBG("thumbnail_request_from_db success: %s", thumb_path);
+ int lib_index;
+ int res = MS_ERR_NONE;
+ int ret;
+ char mimetype[255] = {0};
+ char *err_msg = NULL;
+ ms_store_type_t storage_type;
+
+ _ms_get_mime(path, mimetype);
+ storage_type = ms_get_store_type_by_full(path);
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ if (!_ms_check_category(path, mimetype, lib_index)) {
+ ret = ((INSERT_ITEM_IMMEDIATELY)func_array[lib_index][eINSERT])(handle, path, storage_type, mimetype, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ res = MS_ERR_DB_INSERT_RECORD_FAIL;
}
-#endif
- }
-
- MS_DBG("IMAGE");
- }
- else if (category & MS_CATEGORY_SOUND || category & MS_CATEGORY_MUSIC) {
- store_type = ms_get_store_type_by_full(path);
-
- storage = (store_type == MS_MMC)
- ? AUDIO_SVC_STORAGE_MMC : AUDIO_SVC_STORAGE_PHONE;
- audio_category = (category & MS_CATEGORY_SOUND)
- ? AUDIO_SVC_CATEGORY_SOUND : AUDIO_SVC_CATEGORY_MUSIC;
-
- err = audio_svc_insert_item(handle, storage, path, audio_category);
- if (err < 0) {
- MS_DBG("mp_svc_insert_item fails error %d", err);
- ret = MS_ERR_DB_INSERT_RECORD_FAIL;
}
- MS_DBG("SOUND");
}
MS_DBG_END();
- return ret;
-}
-
-
-
-int
-ms_check_file_exist_in_db(MediaSvcHandle *handle, const char *path)
-{
- int err;
- int category;
-
- /*get an item based on its url. */
- err = minfo_check_item_exist(handle, path);
- if (err != MS_ERR_NONE) {
- err = audio_svc_check_item_exist(handle, path);
- if (err != MS_ERR_NONE)
- category = MS_CATEGORY_UNKNOWN;
- else
- category = MS_CATEGORY_MUSIC;
- } else {
- category = MS_CATEGORY_IMAGE;
- }
-
- MS_DBG("Category : %d", category);
-
- return category;
+ return res;
}
int
-ms_media_db_delete(MediaSvcHandle *handle, const char *path)
+ms_delete_item(void *handle, const char *path)
{
MS_DBG_START();
- int ret = MS_ERR_NONE;
- int category;
- ms_ignore_file_info *ignore_file;
-
- category = ms_check_file_exist_in_db(handle, path);
- if (category & MS_CATEGORY_VIDEO || category & MS_CATEGORY_IMAGE) {
- ret = minfo_delete_media(handle, path);
- if (ret != MS_ERR_NONE) {
- MS_DBG("minfo_delete_media error : %d", ret);
- return ret;
- }
- MS_DBG("VIDEO or IMAGE");
- } else if (category & MS_CATEGORY_MUSIC || category & MS_CATEGORY_SOUND) {
- ret = audio_svc_delete_item_by_path(handle, path);
- if (ret != MS_ERR_NONE) {
- MS_DBG("audio_svc_delete_item_by_path error : %d", ret);
- return ret;
+ int lib_index;
+ int res = MS_ERR_NONE;
+ int ret;
+ char *err_msg = NULL;
+ ms_store_type_t storage_type;
+
+ storage_type = ms_get_store_type_by_full(path);
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((CHECK_ITEM_EXIST)func_array[lib_index][eEXIST])(handle, path, storage_type, &err_msg); /*dlopen*/
+ if (ret == 0) {
+ ret = ((DELETE_ITEM)func_array[lib_index][eDELETE])(handle, path, storage_type, &err_msg); /*dlopen*/
+ if (ret !=0 ) {
+ MS_DBG("delete fail");
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ res = MS_ERR_DB_DELETE_RECORD_FAIL;
+ }
+ } else {
+ MS_DBG("Item does not exist");
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ res = MS_ERR_DB_DELETE_RECORD_FAIL;
}
- MS_DBG("MUSIC or SOUND");
}
- drm_svc_unregister_file(path, false);
-
- ignore_file = ms_inoti_find_ignore_file(path);
- if (ignore_file != NULL)
- ms_inoti_delete_ignore_file(ignore_file);
+ _ms_drm_unregister(path);
MS_DBG_END();
- return ret;
+ return res;
}
int
-ms_media_db_move(MediaSvcHandle *handle,
+ms_move_item(void *handle,
ms_store_type_t src_store, ms_store_type_t dst_store,
const char *src_path, const char *dst_path)
{
MS_DBG_START();
-
- int category = MS_CATEGORY_UNKNOWN;
- minfo_file_type visual_category;
- audio_svc_storage_type_e dst_storage;
- audio_svc_storage_type_e src_storage;
- int ret = 0;
-
- ret = ms_get_category_from_mime(dst_path, &category);
- if (ret != MS_ERR_NONE) {
- MS_DBG("ms_get_category_from_mime error %d", ret);
- return ret;
- }
-
- MS_DBG("category = %d", category);
-
- if (category & MS_CATEGORY_IMAGE || category & MS_CATEGORY_VIDEO) {
- visual_category = (category & MS_CATEGORY_IMAGE) ? MINFO_ITEM_IMAGE : MINFO_ITEM_VIDEO;
- ret = minfo_move_media(handle, src_path, dst_path, visual_category);
- if (ret != MB_SVC_ERROR_NONE) {
- MS_DBG("minfo_move_media error : %d", ret);
- return ret;
- }
- MS_DBG("VISUAL");
- } else if (category & MS_CATEGORY_MUSIC || category & MS_CATEGORY_SOUND) {
- src_storage = (src_store == MS_MMC) ? AUDIO_SVC_STORAGE_MMC : AUDIO_SVC_STORAGE_PHONE;
- dst_storage = (dst_store == MS_MMC) ? AUDIO_SVC_STORAGE_MMC : AUDIO_SVC_STORAGE_PHONE;
-
- ret = audio_svc_move_item(handle, src_storage, src_path, dst_storage, dst_path);
- if (ret < 0) {
- MS_DBG("mp_svc_move_item error : %d", ret);
- if (ret == AUDIO_SVC_ERROR_DB_NO_RECORD) {
- MS_DBG(" This is a new file, Add DB");
- /*if source file does not exist in DB, it is new file. */
-
- ret = ms_register_file(handle, dst_path, NULL);
-
- if (ret != MS_ERR_NONE) {
- MS_DBG("ms_register_file error : %d", ret);
- return MS_ERR_DB_INSERT_RECORD_FAIL;
- }
+ int lib_index;
+ int res = MS_ERR_NONE;
+ int ret;
+ char mimetype[255];
+ char *err_msg = NULL;
+
+ _ms_get_mime(dst_path, mimetype);
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ if (!_ms_check_category(dst_path, mimetype, lib_index)) {
+ ret = ((MOVE_ITEM)func_array[lib_index][eMOVE])(handle, src_path, src_store,
+ dst_path, dst_store, mimetype, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ res = MS_ERR_DB_UPDATE_RECORD_FAIL;
}
-
- return ret;
}
- MS_DBG("AUDIO");
}
MS_DBG_END();
- return ret;
+ return res;
}
bool
-ms_delete_all_record(MediaSvcHandle *handle, ms_store_type_t store_type)
+ms_delete_all_items(void *handle, ms_store_type_t store_type)
{
MS_DBG_START();
- int err = 0;
- minfo_store_type visual_storage;
- audio_svc_storage_type_e audio_storage;
-
- visual_storage = (store_type == MS_PHONE) ? MINFO_PHONE : MINFO_MMC;
- audio_storage = (store_type == MS_PHONE) ? AUDIO_SVC_STORAGE_PHONE : AUDIO_SVC_STORAGE_MMC;
+ int lib_index;
+ int ret = 0;
+ char *err_msg = NULL;
/* To reset media db when differnet mmc is inserted. */
- err = audio_svc_delete_all(handle, audio_storage);
- if (err != AUDIO_SVC_ERROR_NONE) {
- MS_DBG("audio_svc_delete_all error : %d\n", err);
-#if 0 /*except temporary*/
- return false;
-#endif
- }
-
- err = minfo_delete_all_media_records(handle, visual_storage);
- if (err != MB_SVC_ERROR_NONE) {
- MS_DBG("minfo_delete_all_media_records error : %d\n", err);
- return false;
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((DELETE_ALL_ITEMS_IN_STORAGE)func_array[lib_index][eDELETE_ALL])(handle, store_type, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ return false;
+ }
}
-
MS_DBG_END();
-
return true;
}
-
bool
-ms_delete_invalid_records(MediaSvcHandle *handle, ms_store_type_t store_type)
+ms_delete_invalid_items(void *handle, ms_store_type_t store_type)
{
MS_DBG_START();
- int err;
-
- minfo_store_type visual_storage;
- audio_svc_storage_type_e audio_storage;
-
- visual_storage = (store_type == MS_PHONE) ? MINFO_PHONE : MINFO_MMC;
- audio_storage = (store_type == MS_PHONE) ? AUDIO_SVC_STORAGE_PHONE : AUDIO_SVC_STORAGE_MMC;
-
- err = audio_svc_delete_invalid_items(handle, audio_storage);
- if (err != AUDIO_SVC_ERROR_NONE) {
- MS_DBG("audio_svc_delete_invalid_items error : %d\n", err);
-#if 0 /*except temporary*/
- return false;
-#endif
- }
-
- err = minfo_delete_invalid_media_records(handle, visual_storage);
- if (err != MB_SVC_ERROR_NONE) {
- MS_DBG("minfo_delete_invalid_media_records error : %d\n", err);
- return false;
+ int lib_index;
+ int ret;
+ char *err_msg = NULL;
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((DELETE_ALL_INVALID_ITMES_IN_STORAGE)func_array[lib_index][eDELETE_INVALID_ITEMS])(handle, store_type, &err_msg); /*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ return false;
+ }
}
MS_DBG_END();
@@ -724,43 +798,97 @@ FOR BULK COMMIT
*****************************************************************************************************/
void
-ms_register_start(MediaSvcHandle *handle)
+ms_register_start(void *handle)
{
- minfo_add_media_start(handle, MS_REGISTER_COUNT);
- audio_svc_insert_item_start(handle, MS_REGISTER_COUNT);
+ int lib_index;
+ int ret = 0;
+ char *err_msg = NULL;
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((INSERT_ITEM_BEGIN)func_array[lib_index][eINSERT_BEGIN])(handle, MS_REGISTER_COUNT, &err_msg);/*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ }
+ }
}
void
-ms_register_end(MediaSvcHandle *handle)
+ms_register_end(void *handle)
{
- minfo_add_media_end(handle);
- audio_svc_insert_item_end(handle);
+ int lib_index;
+ int ret = 0;
+ char *err_msg = NULL;
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((INSERT_ITEM_END)func_array[lib_index][eINSERT_END])(handle, &err_msg);/*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ }
+ }
}
void
-ms_update_valid_type_start(MediaSvcHandle *handle)
+ms_validate_start(void *handle)
{
- audio_svc_set_item_valid_start(handle, MS_VALID_COUNT);
- minfo_set_item_valid_start(handle, MS_VALID_COUNT);
+ int lib_index;
+ int ret = 0;
+ char *err_msg = NULL;
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((SET_ITEM_VALIDITY_BEGIN)func_array[lib_index][eSET_VALIDITY_BEGIN])(handle, MS_VALID_COUNT, &err_msg);/*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ }
+ }
}
void
-ms_update_valid_type_end(MediaSvcHandle *handle)
+ms_validate_end(void *handle)
{
- audio_svc_set_item_valid_end(handle);
- minfo_set_item_valid_end(handle);
+ int lib_index;
+ int ret = 0;
+ char *err_msg = NULL;
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((SET_ITEM_VALIDITY_END)func_array[lib_index][eSET_VALIDITY_END])(handle, &err_msg);/*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ }
+ }
}
void
-ms_media_db_move_start(MediaSvcHandle *handle)
+ms_move_start(void *handle)
{
- audio_svc_move_item_start(handle, MS_MOVE_COUNT);
- minfo_move_media_start(handle, MS_MOVE_COUNT);
+ int lib_index;
+ int ret = 0;
+ char *err_msg = NULL;
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((MOVE_ITEM_BEGIN)func_array[lib_index][eMOVE_BEGIN])(handle, MS_MOVE_COUNT, &err_msg);/*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ }
+ }
}
void
-ms_media_db_move_end(MediaSvcHandle *handle)
+ms_move_end(void *handle)
{
- audio_svc_move_item_end(handle);
- minfo_move_media_end(handle);
+ int lib_index;
+ int ret = 0;
+ char *err_msg = NULL;
+
+ for (lib_index = 0; lib_index < lib_num; lib_index++) {
+ ret = ((MOVE_ITEM_END)func_array[lib_index][eMOVE_END])(handle, &err_msg);/*dlopen*/
+ if (ret != 0) {
+ MS_DBG("error : %s", g_array_index(so_array, char*, lib_index));
+ free(err_msg);
+ }
+ }
}
diff --git a/common/media-server-inotify.c b/common/media-server-inotify.c
index c2f495c..5a00039 100755
--- a/common/media-server-inotify.c
+++ b/common/media-server-inotify.c
@@ -36,7 +36,7 @@ extern int inoti_fd;
ms_dir_data *first_inoti_node;
ms_ignore_file_info *latest_ignore_file;
-int _ms_inoti_directory_scan_and_register_file(MediaSvcHandle *handle, char *dir_path)
+int _ms_inoti_directory_scan_and_register_file(void *handle, char *dir_path)
{
MS_DBG_START();
struct dirent ent;
@@ -89,7 +89,7 @@ int _ms_inoti_directory_scan_and_register_file(MediaSvcHandle *handle, char *dir
return 0;
}
-int _ms_inoti_scan_renamed_folder(MediaSvcHandle *handle, char *org_path, char *chg_path)
+int _ms_inoti_scan_renamed_folder(void *handle, char *org_path, char *chg_path)
{
if (org_path == NULL || chg_path == NULL) {
MS_DBG("Parameter is wrong");
@@ -148,7 +148,7 @@ int _ms_inoti_scan_renamed_folder(MediaSvcHandle *handle, char *org_path, char *
if ((src_storage != MS_ERR_INVALID_FILE_PATH)
&& (des_storage != MS_ERR_INVALID_FILE_PATH))
- ms_media_db_move(handle, src_storage, des_storage, path_from, path_to);
+ ms_move_item(handle, src_storage, des_storage, path_from, path_to);
else {
MS_DBG("ms_get_store_type_by_full error");
}
@@ -295,27 +295,36 @@ void ms_inoti_add_watch(char *path)
/*there is no same path. */
current_dir = malloc(sizeof(ms_dir_data));
- current_dir->name = strdup(path);
current_dir->wd = inotify_add_watch(inoti_fd, path,
IN_CLOSE_WRITE | IN_CREATE | IN_DELETE |
IN_MOVED_FROM | IN_MOVED_TO);
- current_dir->next = NULL;
- if (first_inoti_node == NULL) {
- first_inoti_node = current_dir;
+ if (current_dir->wd > 0) {
+ MS_DBG("wd : %d", current_dir->wd);
+
+ current_dir->name = strdup(path);
+ current_dir->next = NULL;
+
+ if (first_inoti_node == NULL) {
+ first_inoti_node = current_dir;
+ } else {
+ /*if next node of current node is NULL, it is the lastest node. */
+ MS_DBG("last_node : %s", prv_node->name);
+ prv_node->next = current_dir;
+ }
+
+ MS_DBG("add watch : %s", path);
} else {
- /*if next node of current node is NULL, it is the lastest node. */
- MS_DBG("last_node : %s", prv_node->name);
- prv_node->next = current_dir;
+ MS_DBG("wd : %d", current_dir->wd);
+ free(current_dir);
}
-
- MS_DBG("add watch : %s", path);
}
int ms_inoti_add_watch_with_node(ms_dir_scan_info * const node)
{
char full_path[MS_FILE_PATH_LEN_MAX] = { 0 };
ms_dir_data *current_dir = NULL;
+ ms_dir_data *prv_node = NULL;
ms_dir_data *last_node = NULL;
ms_get_full_path_from_node(node, full_path);
@@ -323,33 +332,39 @@ int ms_inoti_add_watch_with_node(ms_dir_scan_info * const node)
/*find same folder */
if (first_inoti_node != NULL) {
last_node = first_inoti_node;
- while (last_node->next != NULL) {
+ while (last_node != NULL) {
if (strcmp(full_path, last_node->name) == 0) {
MS_DBG("watch is already added: %s", full_path);
return MS_ERR_NONE;
}
+ prv_node = last_node;
last_node = last_node->next;
}
}
/*there is no same path. */
current_dir = malloc(sizeof(ms_dir_data));
- current_dir->name = strdup(full_path);
- current_dir->wd =
- inotify_add_watch(inoti_fd, full_path,
+ current_dir->wd = inotify_add_watch(inoti_fd, full_path,
IN_CLOSE_WRITE | IN_CREATE | IN_DELETE |
IN_MOVED_FROM | IN_MOVED_TO);
- current_dir->next = NULL;
- current_dir->db_updated = false;
-
- if (first_inoti_node == NULL) {
- first_inoti_node = current_dir;
+ if( current_dir->wd > 0) {
+ MS_DBG("wd : %d", current_dir->wd);
+ current_dir->name = strdup(full_path);
+ current_dir->next = NULL;
+ current_dir->db_updated = false;
+
+ if (first_inoti_node == NULL) {
+ first_inoti_node = current_dir;
+ } else {
+ /*if next node of current node is NULL, it is the lastest node. */
+ MS_DBG("last_node : %s", prv_node->name);
+ prv_node->next = current_dir;
+ }
+ MS_DBG("add watch : %s", full_path);
} else {
- /*if next node of current node is NULL, it is the lastest node. */
- MS_DBG("last_node : %s", last_node->name);
- last_node->next = current_dir;
+ MS_DBG("wd : %d", current_dir->wd);
+ free(current_dir);
}
- MS_DBG("add watch : %s", full_path);
return MS_ERR_NONE;
}
@@ -432,6 +447,7 @@ void ms_inoti_remove_watch(char *path)
void ms_inoti_modify_watch(char *path_from, char *path_to)
{
+ bool find = false;
ms_dir_data *mod_node;
if (strcmp(first_inoti_node->name, path_from) == 0) {
@@ -440,10 +456,23 @@ void ms_inoti_modify_watch(char *path_from, char *path_to)
/*find same folder */
if (first_inoti_node != NULL) {
mod_node = first_inoti_node;
- while (mod_node->next != NULL) {
- if (strcmp(path_from, mod_node->name) == 0) {
- MS_DBG("find change node: %s",
- mod_node->name);
+ while (mod_node != NULL) {
+ /*find previous directory*/
+ if (strcmp(path_from, mod_node->name) == 0) {
+ MS_DBG("find change node: %s", mod_node->name);
+ MS_DBG("new name : %s", path_to);
+ /*change path of directory*/
+ /*free previous name of node */
+ free(mod_node->name);
+ mod_node->name = NULL;
+
+ /*add new name */
+ mod_node->name = strdup(path_to);
+
+ /*active flush */
+ malloc_trim(0);
+
+ find = true;
break;
}
mod_node = mod_node->next;
@@ -451,18 +480,13 @@ void ms_inoti_modify_watch(char *path_from, char *path_to)
}
}
- /*free previous name of node */
- free(mod_node->name);
- mod_node->name = NULL;
-
- /*add new name */
- mod_node->name = strdup(path_to);
-
- /*active flush */
- malloc_trim(0);
+ /*this is new directory*/
+ if (find == false) {
+ MS_DBG("This is new directory");
+ ms_inoti_add_watch(path_to);
+ }
}
-
gboolean ms_inoti_thread(void *data)
{
uint32_t i;
@@ -476,11 +500,11 @@ gboolean ms_inoti_thread(void *data)
char buffer[INOTI_BUF_LEN] = { 0 };
char path[MS_FILE_PATH_LEN_MAX] = { 0 };
struct inotify_event *event;
- MediaSvcHandle *handle = NULL;
+ void *handle = NULL;
MS_DBG("START INOTIFY");
- err = ms_media_db_open(&handle);
+ err = ms_connect_db(&handle);
if (err != MS_ERR_NONE) {
MS_DBG(" INOTIFY : sqlite3_open: ret = %d", err);
return false;
@@ -504,7 +528,7 @@ gboolean ms_inoti_thread(void *data)
/*file operation is end*/
/* announce db is updated*/
ms_set_db_status(MS_DB_UPDATED);
- rmdir("/opt/media/_FILEOPERATION_END");
+ rmdir("/opt/data/file-manager-service/_FILEOPERATION_END");
goto NEXT_INOTI_EVENT;
} else if (event->name[0] == '.') {
/*event of hidden folder is ignored */
@@ -559,13 +583,13 @@ gboolean ms_inoti_thread(void *data)
goto NEXT_INOTI_EVENT;
}
/*enable bundle commit*/
- ms_media_db_move_start(handle);
+ ms_move_start(handle);
/*need update file information under renamed directory */
_ms_inoti_scan_renamed_folder(handle, full_path_from, path);
/*disable bundle commit*/
- ms_media_db_move_end(handle);
+ ms_move_end(handle);
prev_mask = prev_wd = 0; /*reset */
}
@@ -587,7 +611,7 @@ gboolean ms_inoti_thread(void *data)
if (event->mask & IN_MOVED_FROM) {
MS_DBG("MOVED_FROM");
- err = ms_media_db_delete(handle, path);
+ err = ms_delete_item(handle, path);
if (err != MS_ERR_NONE) {
MS_DBG("ms_media_db_delete fail error : %d", err);
}
@@ -608,7 +632,7 @@ gboolean ms_inoti_thread(void *data)
else if (event->mask & IN_DELETE) {
MS_DBG("DELETE");
- err = ms_media_db_delete(handle, path);
+ err = ms_delete_item(handle, path);
if (err != MS_ERR_NONE) {
MS_DBG("ms_media_db_delete error : %d", err);
}
@@ -635,7 +659,7 @@ gboolean ms_inoti_thread(void *data)
ignore_file = ms_inoti_find_ignore_file(path);
if (ignore_file == NULL) {
- err = ms_media_db_delete(handle, path);
+ err = ms_delete_item(handle, path);
if (err != MS_ERR_NONE) {
MS_DBG("ms_media_db_delete error : %d", err);
}
@@ -674,7 +698,7 @@ gboolean ms_inoti_thread(void *data)
close(inoti_fd);
- err = ms_media_db_close(handle);
+ err = ms_disconnect_db(handle);
if (err != MS_ERR_NONE) {
MS_DBG("ms_media_db_close error : %d", err);
return false;
diff --git a/common/media-server-main.c b/common/media-server-main.c
index b4c7f6e..78c3753 100755
--- a/common/media-server-main.c
+++ b/common/media-server-main.c
@@ -115,13 +115,13 @@ static bool _db_clear(void)
int db_status;
int usb_status;
bool need_db_create = false;
- MediaSvcHandle *handle = NULL;
+ void *handle = NULL;
/*connect to media db, if conneting is failed, db updating is stopped*/
- ms_media_db_open(&handle);
+ ms_connect_db(&handle);
/*update just valid type*/
- err = ms_change_valid_type(handle, MS_MMC, false);
+ err = ms_invalidate_all_items(handle, MS_MMC);
if (err != MS_ERR_NONE)
MS_DBG("ms_change_valid_type fail");
@@ -136,7 +136,7 @@ static bool _db_clear(void)
need_db_create = true;
- err = ms_change_valid_type(handle, MS_PHONE, false);
+ err = ms_invalidate_all_items(handle, MS_PHONE);
if (err != MS_ERR_NONE)
MS_DBG("ms_change_valid_type fail");
}
@@ -144,7 +144,7 @@ static bool _db_clear(void)
ms_set_db_status(MS_DB_UPDATED);
/*disconnect form media db*/
- ms_media_db_close(handle);
+ ms_disconnect_db(handle);
return need_db_create;
}
@@ -169,6 +169,8 @@ int main(int argc, char **argv)
if (check_result == false)
exit(0);
+ ms_load_functions();
+
if (!g_thread_supported()) {
g_thread_init(NULL);
}
@@ -267,6 +269,8 @@ int main(int argc, char **argv)
/*free all associated memory */
g_main_loop_unref(mainloop);
+ ms_unload_functions();
+
if (scan_queue)
g_async_queue_unref(scan_queue);
diff --git a/common/media-server-scan-internal.c b/common/media-server-scan-internal.c
index 0d49196..33d89fa 100755
--- a/common/media-server-scan-internal.c
+++ b/common/media-server-scan-internal.c
@@ -27,7 +27,6 @@
* @version 1.0
* @brief
*/
-
#include <vconf.h>
#include "media-server-utils.h"
@@ -244,9 +243,9 @@ FREE_RESOURCES:
}
#ifdef PROGRESS
-void _ms_dir_scan(MediaSvcHandle *handle, ms_scan_data_t * scan_data, struct quickpanel *ms_quickpanel)
+void _ms_dir_scan(void *handle, ms_scan_data_t * scan_data, struct quickpanel *ms_quickpanel)
#else
-void _ms_dir_scan(MediaSvcHandle *handle, ms_scan_data_t * scan_data)
+void _ms_dir_scan(void *handle, ms_scan_data_t * scan_data)
#endif
{
MS_DBG_START();
@@ -264,7 +263,7 @@ void _ms_dir_scan(MediaSvcHandle *handle, ms_scan_data_t * scan_data)
if (scan_data->db_type == MS_PHONE)
err = ms_strcopy(path, sizeof(path), "%s", MS_PHONE_ROOT_PATH);
else
- err = ms_strcopy(path, sizeof(path), "%s", MS_MMC_ROOT_PATH);
+ err = ms_strcopy(path, sizeof(path), "%s", MS_MMC_ROOT_PATH);
if (err < MS_ERR_NONE) {
MS_DBG("fail ms_strcopy");
@@ -300,7 +299,7 @@ void _ms_dir_scan(MediaSvcHandle *handle, ms_scan_data_t * scan_data)
#endif
if (scan_data->scan_type == MS_SCAN_PART) {
/*enable bundle commit*/
- ms_update_valid_type_start(handle);
+ ms_validate_start(handle);
}
while (node != NULL) {
@@ -350,9 +349,9 @@ void _ms_dir_scan(MediaSvcHandle *handle, ms_scan_data_t * scan_data)
}
if (scan_data->scan_type == MS_SCAN_PART)
- err = ms_update_valid_type(handle,path);
+ err = ms_validate_item(handle,path);
else
- err = ms_register_scanfile(handle, path);
+ err = ms_insert_item_batch(handle, path);
if (err < 0) {
MS_DBG("failed to update db : %d , %d\n", err, scan_data->scan_type);
@@ -379,9 +378,9 @@ void _ms_dir_scan(MediaSvcHandle *handle, ms_scan_data_t * scan_data)
if (scan_data->scan_type == MS_SCAN_PART) {
/*disable bundle commit*/
- ms_update_valid_type_end(handle);
+ ms_validate_end(handle);
- ms_delete_invalid_records(handle, scan_data->db_type);
+ ms_delete_invalid_items(handle, scan_data->db_type);
}
} else {
node = first_inoti_node;
diff --git a/common/media-server-scan.c b/common/media-server-scan.c
index 0795b51..7be42f8 100755
--- a/common/media-server-scan.c
+++ b/common/media-server-scan.c
@@ -28,7 +28,6 @@
* @brief
*/
#include <vconf.h>
-#include <media-svc-types.h>
#include "media-server-utils.h"
#include "media-server-db-svc.h"
@@ -86,7 +85,7 @@ gboolean ms_scan_thread(void *data)
bool res;
int length;
int err;
- MediaSvcHandle *handle = NULL;
+ void *handle = NULL;
#ifdef PROGRESS
struct quickpanel *ms_quickpanel = NULL;
@@ -119,7 +118,7 @@ gboolean ms_scan_thread(void *data)
if (scan_data->scan_type != MS_SCAN_VALID) {
/*connect to media db, if conneting is failed, db updating is stopped*/
- err = ms_media_db_open(&handle);
+ err = ms_connect_db(&handle);
if (err != MS_ERR_NONE)
continue;
@@ -143,7 +142,7 @@ gboolean ms_scan_thread(void *data)
}
if (scan_data->scan_type == MS_SCAN_ALL) {
- res = ms_delete_all_record(handle, scan_data->db_type);
+ res = ms_delete_all_items(handle, scan_data->db_type);
if (res != true) {
MS_DBG("ms_delete_all_record fails");
}
@@ -185,7 +184,7 @@ gboolean ms_scan_thread(void *data)
ms_set_db_status(MS_DB_UPDATED);
/*disconnect form media db*/
- ms_media_db_close(handle);
+ ms_disconnect_db(handle);
/*Active flush */
sqlite3_release_memory(-1);
@@ -195,19 +194,19 @@ gboolean ms_scan_thread(void *data)
}
} else {
/*connect to media db, if conneting is failed, db updating is stopped*/
- err = ms_media_db_open(&handle);
+ err = ms_connect_db(&handle);
if (err != MS_ERR_NONE)
continue;
/*update just valid type*/
- err = ms_change_valid_type(handle, scan_data->db_type, false);
+ err = ms_invalidate_all_items(handle, scan_data->db_type);
if (err != MS_ERR_NONE)
MS_DBG("ms_change_valid_type fail");
ms_set_db_status(MS_DB_UPDATED);
/*disconnect form media db*/
- ms_media_db_close(handle);
+ ms_disconnect_db(handle);
/*Active flush */
sqlite3_release_memory(-1);
diff --git a/common/media-server-socket.c b/common/media-server-socket.c
index fdfade8..5e041f3 100755
--- a/common/media-server-socket.c
+++ b/common/media-server-socket.c
@@ -31,13 +31,12 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <media-util-err.h>
-#include <media-svc.h>
#include "media-server-global.h"
#include "media-server-db-svc.h"
#include "media-server-socket.h"
-#define MINFO_REGISTER_PORT 1001
+#define MS_REGISTER_PORT 1001
GAsyncQueue* ret_queue;
@@ -47,9 +46,9 @@ gboolean ms_socket_thread(void *data)
int err;
int state;
int sockfd;
- int send_msg = MEDIA_INFO_ERROR_NONE;
+ int send_msg = MS_MEDIA_ERR_NONE;
int client_addr_size;
- MediaSvcHandle *handle = NULL;
+ void *handle = NULL;
struct sockaddr_in server_addr;
struct sockaddr_in client_addr;
@@ -67,7 +66,7 @@ gboolean ms_socket_thread(void *data)
memset(&server_addr, 0, sizeof(server_addr));
server_addr.sin_family = AF_INET;
- server_addr.sin_port = htons(MINFO_REGISTER_PORT);
+ server_addr.sin_port = htons(MS_REGISTER_PORT);
server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
state = bind(sockfd, (struct sockaddr*)&server_addr, sizeof(server_addr));
@@ -78,7 +77,7 @@ gboolean ms_socket_thread(void *data)
return MS_ERR_SOCKET_BIND;
}
- err = ms_media_db_open(&handle);
+ err = ms_connect_db(&handle);
if (err != MS_ERR_NONE) {
MS_DBG("SOCKET : sqlite3_open: ret = %d", err);
return false;
@@ -136,7 +135,7 @@ NEXT:
close(sockfd);
MS_DBG("END SOCKET THREAD");
- err = ms_media_db_close(handle);
+ err = ms_disconnect_db(handle);
if (err != MS_ERR_NONE) {
MS_DBG("ms_media_db_close error : %d", err);
return false;
diff --git a/common/media-server-utils.c b/common/media-server-utils.c
index 40d6424..12bacbc 100755
--- a/common/media-server-utils.c
+++ b/common/media-server-utils.c
@@ -34,8 +34,6 @@
#ifdef PROGRESS
#include <quickpanel.h>
#endif
-#include <aul/aul.h>
-#include <mmf/mm_file.h>
#include "media-server-inotify.h"
#include "media-server-utils.h"
@@ -468,129 +466,6 @@ ms_config_set_str(const char *key, const char *value)
return false;
}
-static int
-_ms_get_mime_by_drm_info(const char *path, char *mime)
-{
- int res;
- drm_content_info_t contentInfo = { 0 };
-
- if (path == NULL || mime == NULL)
- return MS_ERR_ARG_INVALID;
-
- res = drm_svc_get_content_info(path, &contentInfo);
- if (res != DRM_RESULT_SUCCESS) {
- MS_DBG("drm_svc_get_content_info() fails. ");
- return MS_ERR_DB_OPERATION_FAIL;
- }
-
- strncpy(mime, contentInfo.contentType, MS_DRM_CONTENT_TYPE_LENGTH);
- MS_DBG("DRM contentType : %s", contentInfo.contentType);
- MS_DBG("DRM mime : %s", mime);
-
- return MS_ERR_NONE;
-}
-
-int
-ms_get_category_from_mime(const char *path, int *category)
-{
- int i = 0;
- int err = 0;
- char mimetype[MIME_TYPE_LENGTH];
-
- if (path == NULL || category == NULL)
- return MS_ERR_ARG_INVALID;
-
- *category = MS_CATEGORY_UNKNOWN;
-
- /*get content type and mime type from file. */
- /*in case of drm file. */
- if (drm_svc_is_drm_file(path) == DRM_TRUE) {
- DRM_FILE_TYPE drm_type = DRM_FILE_TYPE_NONE;
- drm_type = drm_svc_get_drm_type(path);
- if (drm_type == DRM_FILE_TYPE_NONE) {
- *category = MS_CATEGORY_UNKNOWN;
- return err;
- }
- else {
- err = _ms_get_mime_by_drm_info(path, mimetype);
- if (err < 0) {
- *category = MS_CATEGORY_UNKNOWN;
- return err;
- }
- *category |= MS_CATEGORY_DRM;
- }
- }
- else {
- /*in case of normal files */
- if (aul_get_mime_from_file(path, mimetype, sizeof(mimetype)) < 0) {
- MS_DBG("aul_get_mime_from_file fail");
- *category = MS_CATEGORY_UNKNOWN;
- return MS_ERR_ARG_INVALID;
- }
- }
-
- MS_DBG("mime type : %s", mimetype);
-
- /*categorize from mimetype */
- for (i = 0; i < CONTENT_TYPE_NUM; i++) {
- if (strstr(mimetype, content_category[i].content_type) != NULL) {
- *category = (*category | content_category[i].category_by_mime);
- break;
- }
- }
-
- /*in application type, exitst sound file ex) x-smafs */
- if (*category & MS_CATEGORY_ETC) {
- int prefix_len = strlen(content_category[0].content_type);
-
- for (i = 0; i < SOUND_MIME_NUM; i++) {
- if (strstr(mimetype + prefix_len, sound_mime_table[i]) != NULL) {
- *category ^= MS_CATEGORY_ETC;
- *category |= MS_CATEGORY_SOUND;
- break;
- }
- }
- }
-
- /*check music file in soun files. */
- if (*category & MS_CATEGORY_SOUND) {
- int prefix_len = strlen(content_category[0].content_type) + 1;
-
- MS_DBG("mime_type : %s", mimetype + prefix_len);
-
- for (i = 0; i < MUSIC_MIME_NUM; i++) {
- if (strcmp(mimetype + prefix_len, music_mime_table[i]) == 0) {
- *category ^= MS_CATEGORY_SOUND;
- *category |= MS_CATEGORY_MUSIC;
- break;
- }
- }
- } else if (*category & MS_CATEGORY_VIDEO) {
- /*some video files don't have video stream. in this case it is categorize as music. */
- char *ext;
- /*"3gp" and "mp4" must check video stream and then categorize in directly. */
- ext = strrchr(path, '.');
- if (ext != NULL) {
- if ((strncasecmp(ext, _3GP_FILE, 4) == 0) || (strncasecmp(ext, _MP4_FILE, 5) == 0)) {
- int audio = 0;
- int video = 0;
-
- err = mm_file_get_stream_info(path, &audio, &video);
- if (err == 0) {
- if (audio > 0 && video == 0) {
- *category ^= MS_CATEGORY_VIDEO;
- *category |= MS_CATEGORY_MUSIC;
- }
- }
- }
- }
- }
-
- MS_DBG("category_from_ext : %d", *category);
-
- return err;
-}
-
void
ms_check_db_updating(void)
{
diff --git a/configure.ac b/configure.ac
index 5a57b2a..6a33169 100755
--- a/configure.ac
+++ b/configure.ac
@@ -64,10 +64,6 @@ PKG_CHECK_MODULES(DLOG, dlog)
AC_SUBST(DLOG_CFLAGS)
AC_SUBST(DLOG_LIBS)
-PKG_CHECK_MODULES(DB_UTIL, db-util)
-AC_SUBST(DB_UTIL_CFLAGS)
-AC_SUBST(DB_UTIL_LIBS)
-
PKG_CHECK_MODULES(DRM_SERVICE, drm-service)
AC_SUBST(DRM_SERVICE_CFLAGS)
AC_SUBST(DRM_SERVICE_LIBS)
@@ -76,23 +72,10 @@ PKG_CHECK_MODULES(PHONESTATUS, vconf)
AC_SUBST(PHONESTATUS_CFLAGS)
AC_SUBST(PHONESTATUS_LIBS)
-PKG_CHECK_MODULES(MM_FILEINFO, mm-fileinfo)
-AC_SUBST(MM_FILEINFO_CFLAGS)
-AC_SUBST(MM_FILEINFO_LIBS)
-
-PKG_CHECK_MODULES(MEDIA_INFO, libmedia-service)
-AC_SUBST(MEDIA_INFO_CFLAGS)
-AC_SUBST(MEDIA_INFO_LIBS)
-
PKG_CHECK_MODULES(AUL, aul)
AC_SUBST(AUL_CFLAGS)
AC_SUBST(AUL_LIBS)
-PKG_CHECK_MODULES(DBUS, dbus-1)
-AC_SUBST(DBUS_CFLAGS)
-AC_SUBST(DBUS_LIBS)
-
-# pm, replace libpmcontrol
PKG_CHECK_MODULES(LIBPMCONTROL, pmapi)
AC_SUBST(LIBPMCONTROL_CFLAGS)
AC_SUBST(LIBPMCONTROL_LIBS)
@@ -102,11 +85,6 @@ AC_SUBST(LIBPMCONTROL_LIBS)
#AC_SUBST(LIBQUICKPANEL_CFLAGS)
#AC_SUBST(LIBQUICKPANEL_LIBS)
-# thumb-gen library
-PKG_CHECK_MODULES(THUMB_GEN, media-thumbnail)
-AC_SUBST(THUMB_GEN_CFLAGS)
-AC_SUBST(THUMB_GEN_LIBS)
-
#Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
diff --git a/debian/changelog b/debian/changelog
index 39b4114..42153a5 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,35 @@
+media-server (0.1.66) unstable; urgency=low
+
+ * update latest code
+ * Git : pkgs/m/media-server
+ * Tag : media-server_0.1.66
+
+ -- Yong Yeon Kim <yy9875.kim@samsung.com> Fri, 13 Apr 2012 14:17:13 +0900
+
+media-server (0.1.65) unstable; urgency=low
+
+ * add Testcase of libmedia-utils
+ * Git : pkgs/m/media-server
+ * Tag : media-server_0.1.65
+
+ -- Yong Yeon Kim <yy9875.kim@samsung.com> Tue, 27 Mar 2012 14:05:03 +0900
+
+media-server (0.1.64) unstable; urgency=low
+
+ * update media-server.spec
+ * Git : pkgs/m/media-server
+ * Tag : media-server_0.1.64
+
+ -- Yong Yeon Kim <yy9875.kim@samsung.com> Fri, 23 Mar 2012 17:42:58 +0900
+
+media-server (0.1.54) unstable; urgency=low
+
+ * merge for 1.0 release
+ * Git : pkgs/m/media-server
+ * Tag : media-server_0.1.54
+
+ -- Yong Yeon Kim <yy9875.kim@samsung.com> Tue, 20 Mar 2012 09:53:27 +0900
+
media-server (0.1.53) unstable; urgency=low
* fix build error
diff --git a/debian/control b/debian/control
index 2979808..64f8e1d 100755
--- a/debian/control
+++ b/debian/control
@@ -6,14 +6,10 @@ Uploaders:
Build-Depends: debhelper (>= 5), autotools-dev,
libglib2.0-dev,
libslp-setting-dev,
- libmedia-service-dev,
dlog-dev,
drm-service-dev,
- libslp-db-util-dev,
- libmm-fileinfo-dev,
libaul-1-dev,
- libslp-pm-dev,
- libmedia-thumbnail-dev
+ libslp-pm-dev
Standards-Version: 0.1.0
Package: media-server
diff --git a/lib/include/media-util-noti.h b/lib/include/media-util-noti.h
index 6665e05..27535d8 100755
--- a/lib/include/media-util-noti.h
+++ b/lib/include/media-util-noti.h
@@ -72,7 +72,7 @@ extern "C" {
* @endcode
*/
-int ms_noti_db_update_complete(void);
+int ms_noti_update_complete(void);
/**
* @}
diff --git a/lib/include/media-util-register.h b/lib/include/media-util-register.h
index a5684b6..e61d19d 100755
--- a/lib/include/media-util-register.h
+++ b/lib/include/media-util-register.h
@@ -78,7 +78,7 @@ int main()
*/
int media_file_register(const char *file_full_path);
-typedef GArray* media_list;
+ typedef GArray* media_list;
int media_list_new(media_list *list);
diff --git a/lib/media-util-noti.c b/lib/media-util-noti.c
index f5de153..d647aa9 100755
--- a/lib/media-util-noti.c
+++ b/lib/media-util-noti.c
@@ -28,9 +28,12 @@
* @brief
*/
+#include <sys/errno.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <string.h>
+#include "media-util-dbg.h"
#include "media-util-err.h"
#include "media-util-internal.h"
#include "media-util-noti.h"
@@ -42,6 +45,7 @@
ret = mkdir(MS_MEDIA_UPDATE_NOTI_PATH, 0777);
if (ret != 0) {
+ MSAPI_DBG("%s", strerror(errno));
err = MS_MEDIA_ERR_OCCURRED;
}
diff --git a/lib/media-util-register.c b/lib/media-util-register.c
index d65b47f..7f0a24d 100755
--- a/lib/media-util-register.c
+++ b/lib/media-util-register.c
@@ -37,10 +37,6 @@
#include <string.h>
#include <stdbool.h>
-#include <media-svc.h>
-#include <audio-svc.h>
-#include <audio-svc-error.h>
-
#include "media-util-dbg.h"
#include "media-util-err.h"
#include "media-util-internal.h"
diff --git a/packaging/media-server.spec b/packaging/media-server.spec
index ef3e634..f15e26f 100644
--- a/packaging/media-server.spec
+++ b/packaging/media-server.spec
@@ -1,74 +1,79 @@
+#sbs-git:slp/pkgs/m/media-server media-server 0.1.60 e216f565fe5687a6f387f2b3ee2097b926225517
Name: media-server
-Summary: Media Server.
-Version: 0.1.53
+Summary: File manager service server.
+Version: 0.1.66
Release: 1
Group: Services
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
-Requires(post): /usr/bin/sqlite3
Requires(post): /usr/bin/vconftool
-
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(db-util)
BuildRequires: pkgconfig(drm-service)
-BuildRequires: pkgconfig(heynoti)
-BuildRequires: pkgconfig(mm-fileinfo)
BuildRequires: pkgconfig(aul)
-BuildRequires: pkgconfig(libmedia-service)
-BuildRequires: pkgconfig(media-thumbnail)
BuildRequires: pkgconfig(pmapi)
%description
-Media service server..
+Description: File manager service server
+
-%package devel
-Summary: Media server headers and libraries
-Group: utils
+%package -n libmedia-utils
+Summary: media server runtime library.
+Group: TO_BE/FILLED_IN
Requires: %{name} = %{version}-%{release}
-%description devel
-Media server headers and libraries (development)
+%description -n libmedia-utils
+Description : media server runtime library.
+
+
+%package -n libmedia-utils-devel
+Summary: media server development library.
+Group: Development/Libraries
+Requires: libmedia-utils = %{version}-%{release}
+
+%description -n libmedia-utils-devel
+Description: media server development library.
%prep
%setup -q
%build
-%autogen
-LDFLAGS="$LDFLAGS -Wl,--rpath=%{prefix}/lib -Wl,--hash-style=both -Wl,--as-needed "; export LDFLAGS
-%configure --prefix=/usr
+%autogen
+%configure --prefix=%{_prefix} --disable-static
make %{?jobs:-j%jobs}
%install
+rm -rf %{buildroot}
%make_install
-chmod +x %{buildroot}/etc/rc.d/init.d/mediasvr
-
-rm -rf %{buildroot}/etc/rc.d/rc3.d/S48mediasvr
-rm -rf %{buildroot}/etc/rc.d/rc5.d/S48mediasvr
%post
-
-ln -s ../init.d/mediasvr /etc/rc.d/rc3.d/S48mediasvr
-ln -s ../init.d/mediasvr /etc/rc.d/rc5.d/S48mediasvr
-
-
vconftool set -t int db/filemanager/dbupdate "1"
vconftool set -t int memory/filemanager/Mmc "0" -i
vconftool set -t int db/Apps/mediaserver/usbmode "0"
vconftool set -t string db/Apps/mediaserver/mmc_info ""
+
%files
+%defattr(-,root,root,-)
%{_bindir}/media-server
-/etc/rc.d/init.d/mediasvr
-/usr/lib/lib*.so.*
+%attr(755,-,-) %{_sysconfdir}/rc.d/init.d/mediasvr
+/etc/rc.d/rc3.d/S48mediasvr
+/etc/rc.d/rc5.d/S48mediasvr
+
+%files -n libmedia-utils
+%defattr(-,root,root,-)
+%{_libdir}/libmedia-utils.so
+%{_libdir}/libmedia-utils.so.0
+%{_libdir}/libmedia-utils.so.0.0.0
+
+%files -n libmedia-utils-devel
+%defattr(-,root,root,-)
+%{_libdir}/pkgconfig/libmedia-utils.pc
+%{_includedir}/media-utils/*.h
+
-%files devel
-/usr/include/media-utils/*.h
-/usr/lib/libmedia-utils.so
-/usr/lib/pkgconfig/libmedia-utils.pc