+++ /dev/null
-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-\r
- Apache License\r
- Version 2.0, January 2004\r
- http://www.apache.org/licenses/\r
-\r
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
- 1. Definitions.\r
-\r
- "License" shall mean the terms and conditions for use, reproduction,\r
- and distribution as defined by Sections 1 through 9 of this document.\r
-\r
- "Licensor" shall mean the copyright owner or entity authorized by\r
- the copyright owner that is granting the License.\r
-\r
- "Legal Entity" shall mean the union of the acting entity and all\r
- other entities that control, are controlled by, or are under common\r
- control with that entity. For the purposes of this definition,\r
- "control" means (i) the power, direct or indirect, to cause the\r
- direction or management of such entity, whether by contract or\r
- otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
- outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
- "You" (or "Your") shall mean an individual or Legal Entity\r
- exercising permissions granted by this License.\r
-\r
- "Source" form shall mean the preferred form for making modifications,\r
- including but not limited to software source code, documentation\r
- source, and configuration files.\r
-\r
- "Object" form shall mean any form resulting from mechanical\r
- transformation or translation of a Source form, including but\r
- not limited to compiled object code, generated documentation,\r
- and conversions to other media types.\r
-\r
- "Work" shall mean the work of authorship, whether in Source or\r
- Object form, made available under the License, as indicated by a\r
- copyright notice that is included in or attached to the work\r
- (an example is provided in the Appendix below).\r
-\r
- "Derivative Works" shall mean any work, whether in Source or Object\r
- form, that is based on (or derived from) the Work and for which the\r
- editorial revisions, annotations, elaborations, or other modifications\r
- represent, as a whole, an original work of authorship. For the purposes\r
- of this License, Derivative Works shall not include works that remain\r
- separable from, or merely link (or bind by name) to the interfaces of,\r
- the Work and Derivative Works thereof.\r
-\r
- "Contribution" shall mean any work of authorship, including\r
- the original version of the Work and any modifications or additions\r
- to that Work or Derivative Works thereof, that is intentionally\r
- submitted to Licensor for inclusion in the Work by the copyright owner\r
- or by an individual or Legal Entity authorized to submit on behalf of\r
- the copyright owner. For the purposes of this definition, "submitted"\r
- means any form of electronic, verbal, or written communication sent\r
- to the Licensor or its representatives, including but not limited to\r
- communication on electronic mailing lists, source code control systems,\r
- and issue tracking systems that are managed by, or on behalf of, the\r
- Licensor for the purpose of discussing and improving the Work, but\r
- excluding communication that is conspicuously marked or otherwise\r
- designated in writing by the copyright owner as "Not a Contribution."\r
-\r
- "Contributor" shall mean Licensor and any individual or Legal Entity\r
- on behalf of whom a Contribution has been received by Licensor and\r
- subsequently incorporated within the Work.\r
-\r
- 2. Grant of Copyright License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- copyright license to reproduce, prepare Derivative Works of,\r
- publicly display, publicly perform, sublicense, and distribute the\r
- Work and such Derivative Works in Source or Object form.\r
-\r
- 3. Grant of Patent License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- (except as stated in this section) patent license to make, have made,\r
- use, offer to sell, sell, import, and otherwise transfer the Work,\r
- where such license applies only to those patent claims licensable\r
- by such Contributor that are necessarily infringed by their\r
- Contribution(s) alone or by combination of their Contribution(s)\r
- with the Work to which such Contribution(s) was submitted. If You\r
- institute patent litigation against any entity (including a\r
- cross-claim or counterclaim in a lawsuit) alleging that the Work\r
- or a Contribution incorporated within the Work constitutes direct\r
- or contributory patent infringement, then any patent licenses\r
- granted to You under this License for that Work shall terminate\r
- as of the date such litigation is filed.\r
-\r
- 4. Redistribution. You may reproduce and distribute copies of the\r
- Work or Derivative Works thereof in any medium, with or without\r
- modifications, and in Source or Object form, provided that You\r
- meet the following conditions:\r
-\r
- (a) You must give any other recipients of the Work or\r
- Derivative Works a copy of this License; and\r
-\r
- (b) You must cause any modified files to carry prominent notices\r
- stating that You changed the files; and\r
-\r
- (c) You must retain, in the Source form of any Derivative Works\r
- that You distribute, all copyright, patent, trademark, and\r
- attribution notices from the Source form of the Work,\r
- excluding those notices that do not pertain to any part of\r
- the Derivative Works; and\r
-\r
- (d) If the Work includes a "NOTICE" text file as part of its\r
- distribution, then any Derivative Works that You distribute must\r
- include a readable copy of the attribution notices contained\r
- within such NOTICE file, excluding those notices that do not\r
- pertain to any part of the Derivative Works, in at least one\r
- of the following places: within a NOTICE text file distributed\r
- as part of the Derivative Works; within the Source form or\r
- documentation, if provided along with the Derivative Works; or,\r
- within a display generated by the Derivative Works, if and\r
- wherever such third-party notices normally appear. The contents\r
- of the NOTICE file are for informational purposes only and\r
- do not modify the License. You may add Your own attribution\r
- notices within Derivative Works that You distribute, alongside\r
- or as an addendum to the NOTICE text from the Work, provided\r
- that such additional attribution notices cannot be construed\r
- as modifying the License.\r
-\r
- You may add Your own copyright statement to Your modifications and\r
- may provide additional or different license terms and conditions\r
- for use, reproduction, or distribution of Your modifications, or\r
- for any such Derivative Works as a whole, provided Your use,\r
- reproduction, and distribution of the Work otherwise complies with\r
- the conditions stated in this License.\r
-\r
- 5. Submission of Contributions. Unless You explicitly state otherwise,\r
- any Contribution intentionally submitted for inclusion in the Work\r
- by You to the Licensor shall be under the terms and conditions of\r
- this License, without any additional terms or conditions.\r
- Notwithstanding the above, nothing herein shall supersede or modify\r
- the terms of any separate license agreement you may have executed\r
- with Licensor regarding such Contributions.\r
-\r
- 6. Trademarks. This License does not grant permission to use the trade\r
- names, trademarks, service marks, or product names of the Licensor,\r
- except as required for reasonable and customary use in describing the\r
- origin of the Work and reproducing the content of the NOTICE file.\r
-\r
- 7. Disclaimer of Warranty. Unless required by applicable law or\r
- agreed to in writing, Licensor provides the Work (and each\r
- Contributor provides its Contributions) on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
- implied, including, without limitation, any warranties or conditions\r
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
- PARTICULAR PURPOSE. You are solely responsible for determining the\r
- appropriateness of using or redistributing the Work and assume any\r
- risks associated with Your exercise of permissions under this License.\r
-\r
- 8. Limitation of Liability. In no event and under no legal theory,\r
- whether in tort (including negligence), contract, or otherwise,\r
- unless required by applicable law (such as deliberate and grossly\r
- negligent acts) or agreed to in writing, shall any Contributor be\r
- liable to You for damages, including any direct, indirect, special,\r
- incidental, or consequential damages of any character arising as a\r
- result of this License or out of the use or inability to use the\r
- Work (including but not limited to damages for loss of goodwill,\r
- work stoppage, computer failure or malfunction, or any and all\r
- other commercial damages or losses), even if such Contributor\r
- has been advised of the possibility of such damages.\r
-\r
- 9. Accepting Warranty or Additional Liability. While redistributing\r
- the Work or Derivative Works thereof, You may choose to offer,\r
- and charge a fee for, acceptance of support, warranty, indemnity,\r
- or other liability obligations and/or rights consistent with this\r
- License. However, in accepting such obligations, You may act only\r
- on Your own behalf and on Your sole responsibility, not on behalf\r
- of any other Contributor, and only if You agree to indemnify,\r
- defend, and hold each Contributor harmless for any liability\r
- incurred by, or claims asserted against, such Contributor by reason\r
- of your accepting any such warranty or additional liability.\r
-\r
- END OF TERMS AND CONDITIONS\r
-\r
- APPENDIX: How to apply the Apache License to your work.\r
-\r
- To apply the Apache License to your work, attach the following\r
- boilerplate notice, with the fields enclosed by brackets "[]"\r
- replaced with your own identifying information. (Don't include\r
- the brackets!) The text should be enclosed in the appropriate\r
- comment syntax for the file format. We also recommend that a\r
- file or class name and description of purpose be included on the\r
- same "printed page" as the copyright notice for easier\r
- identification within third-party archives.\r
-\r
- Copyright [yyyy] [name of copyright owner]\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-\r
-\r
+++ /dev/null
-lib_LTLIBRARIES = libmmfcommon.la
-
-includelibmmfcommondir = $(includedir)/mmf
-includelibmmfcommon_HEADERS = include/mm_attrs.h \
- include/mm_error.h \
- include/mm_message.h \
- include/mm_types.h \
- include/mm_debug.h \
- include/mm.h \
- include/mm_attrs_private.h
-
-# PG included
-includelibmmfcommon_HEADERS += include/SLP_MultimediaFW_PG.h
-
-
-libmmfcommon_la_SOURCES = mm_attrs.c \
- mm_attrs_private.c \
- mm_list_private.c
-
-libmmfcommon_la_CFLAGS = -I$(srcdir)/include \
- $(GLIB_CFLAGS)
-
-libmmfcommon_la_LIBADD = -lpthread \
- $(GLIB_LIBS)
-
-libmmfcommon_la_CFLAGS += $(MMLOG_CFLAGS) -DMMF_LOG_OWNER=0x200 -DMMF_DEBUG_PREFIX=\"MMF-COMMON\"
-libmmfcommon_la_LIBADD += $(MMLOG_LIBS)
-
-installspecdir = $(includedir)/mmf
-
-pcfiles = mm-common.pc
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(pcfiles)
-EXTRA_DIST = $(pcfiles)
+++ /dev/null
-aclocal
-libtoolize --copy -f
-autoheader
-autoconf
-automake --add-missing --copy --foreign
-#./configure --with-xo-machine=W1
+++ /dev/null
-# -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.61)
-AC_INIT([libmm-common], [0.0.1])
-AC_CONFIG_HEADER([config.h])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign])
-
-# Checks for programs.
-AC_PROG_CC
-AC_PROG_LIBTOOL
-
-# Checks for libraries.
-# FIXME: Replace `main' with a function in `-lpthread':
-AC_CHECK_LIB([pthread], [main])
-
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/time.h unistd.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_HEADER_STDBOOL
-AC_C_CONST
-AC_HEADER_TIME
-
-# Checks for library functions.
-AC_FUNC_MALLOC
-AC_FUNC_MMAP
-AC_CHECK_FUNCS([gettimeofday memset munmap strcasecmp strdup])
-
-PKG_CHECK_MODULES(GLIB, glib-2.0)
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-PKG_CHECK_MODULES(MMLOG,mm-log)
-AC_SUBST(MMLOG_CFLAGS)
-AC_SUBST(MMLOG_LIBS)
-
-AC_CONFIG_FILES([Makefile
- mm-common.pc
-])
-AC_OUTPUT
+++ /dev/null
-libmm-common (0.2.25-0) unstable; urgency=low
-
- * Add remained_time field in recording_status
- * Git : pkgs/l/libmm-common
- * Tag : libmm-common_0.2.25-0
-
- -- Jeongmo Yang <jm80.yang@samsung.com> Wed, 08 Feb 2012 10:00:25 +0900
-
-libmm-common (0.2.24-0) unstable; urgency=low
-
- * Add msg code for pcm message
- * Git : pkgs/l/libmm-common
- * Tag : libmm-common_0.2.24-0
-
- -- Seungbae Shin <seungbae.shin@samsung.com> Sun, 22 Jan 2012 20:06:42 +0900
-
-libmm-common (0.2.23-0) unstable; urgency=low
-
- * Add MM_ERROR_POLICY_RESTRICTED and messages for sound, remove MM_ERROR_CAMCORDER_FORBIDDEN_STATE
- * Git : pkgs/l/libmm-common
- * Tag : libmm-common_0.2.23-0
-
- -- Jeongmo Yang <jm80.yang@samsung.com> Tue, 17 Jan 2012 15:04:19 +0900
-
-libmm-common (0.2.22-0) unstable; urgency=low
-
- * Add MM_ERROR_IMAGE_NO_FREE_SPACE
- * Git : pkgs/l/libmm-common
- * Tag : libmm-common_0.2.22-0
-
- -- YoungHun Kim <yh8004.kim@samsung.com> Tue, 10 Jan 2012 17:54:00 +0900
-
-libmm-common (0.2.21-0) unstable; urgency=low
-
- * Add MM_MESSAGE_CAMCORDER_VIDEO_SNAPSHOT_CAPTURED
- * Git : pkgs/l/libmm-common
- * Tag : libmm-common_0.2.21-0
-
- -- Jeongmo Yang <jm80.yang@samsung.com> Thu, 29 Dec 2011 16:18:53 +0900
-
-libmm-common (0.2.20-0) unstable; urgency=low
-
- * Add MM_PIXEL_FORMAT_ITLV_JPEG_UYVY
- * Git : pkgs/l/libmm-common
- * Tag : libmm-common_0.2.20-0
-
- -- Jeongmo Yang <jm80.yang@samsung.com> Thu, 15 Dec 2011 15:02:36 +0900
-
-libmm-common (0.2.19-5) unstable; urgency=low
-
- * Initial Release
- * Git : pkgs/l/libmm-common
- * Tag : libmm-common_0.2.19-5
-
- -- Sangchul Lee <sc11.lee@samsung.com> Wen, 07 Dec 2011 17:26:48 +0900
+++ /dev/null
-Source: libmm-common
-Section: libs
-Priority: extra
-Maintainer: Shin Seung Bae <seungbae.shin@samsung.com>, JongHyuk Choi <jhchoi.choi@samsung.com>
-Uploaders: YoungHwan Ahn <younghwan_.an@samsung.com>, Cho Ye Jin <cho.yejin@samsung.com>, Kwanghui Cho <kwanghui.cho@samsung.com>, Wonhyung Cho <wh01.cho@samsung.com>, Jeongmo Yang <jm80.yang@samsung.com>, Sangchul Lee <sc11.lee@samsung.com>
-Build-Depends: debhelper (>= 5), autotools-dev, libmm-log-dev, libglib2.0-dev
-Standards-Version: 3.7.2
-Homepage: N/A
-
-Package: libmm-common
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libmm-log, libglib2.0-0
-Description: Multimedia Framework Common Library
-Version: limo-0.1-0
-
-Package: libmm-common-dev
-Section: libdevel
-Architecture: any
-Depends: libmm-common (= ${Source-Version}), libmm-log-sdk-dev, libglib2.0-dev
-Description: Multimedia Framework Common Library (DEV)
-Version: limo-0.1-0
-
-Package: libmm-common-internal-dev
-XB-Public-Package: no
-Section: libdevel
-Architecture: any
-Depends: libmm-common-dev
-Description: Multimedia Framework Common Library (inhouse)
-Version: limo-0.1-0
-
-Package: libmm-common-dbg
-Section: debug
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libmm-common (= ${Source-Version})
-Description: Multimedia Framework Common Library (unstripped)
+++ /dev/null
-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-
-Contact: Jonghyuk Choi <jhchoi.choi@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.
-
+++ /dev/null
-usr/bin
-usr/sbin
+++ /dev/null
-@PREFIX@/include/mmf/SLP_MultimediaFW_PG.h
-@PREFIX@/include/mmf/mm.h
-@PREFIX@/include/mmf/mm_message.h
-@PREFIX@/include/mmf/mm_types.h
-@PREFIX@/include/mmf/mm_error.h
-@PREFIX@/lib/*.a
-@PREFIX@/lib/*.la
-@PREFIX@/lib/pkgconfig/*
+++ /dev/null
-@PREFIX@/include/mmf/mm_attrs.h
-@PREFIX@/include/mmf/mm_attrs_private.h
-@PREFIX@/include/mmf/mm_debug.h
+++ /dev/null
-@PREFIX@/lib/*.so*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-CFLAGS += -Wall -g -fPIC
-LDFLAGS ?=
-PREFIX ?= /usr
-DATADIR ?= /opt
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--hash-style=both -Wl,--as-needed
-
-export MACHINE=protector
-
-config.status: configure
- dh_testdir
- # Add here commands to configure the package.
- ./autogen.sh
- CFLAGS="$(CFLAGS) -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" " LDFLAGS="$(LDFLAGS)" ./configure --prefix=$(PREFIX)
-
-build: build-stamp
-
-build-stamp: config.status
- dh_testdir
-
- # Add here commands to compile the package.
- $(MAKE)
- #docbook-to-man debian/mm-common.sgml > mm-common.1
-
- for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
- cat $$f > $${f%.in}; \
- sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
- sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
- done
-
- touch $@
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
-
- # Add here commands to clean up after the build process.
- -$(MAKE) distclean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
- cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
- cp -f /usr/share/misc/config.guess config.guess
-endif
-
- for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
- rm -f $${f%.in}; \
- done
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/mm-common.
- $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_install --sourcedir=debian/tmp
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_python
-# dh_installinit
-# dh_installcron
-# dh_installinfo
- dh_installman
- dh_link
- dh_strip --dbg-package=libmm-common-dbg
- dh_compress
- dh_fixperms
-# dh_perl
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+++ /dev/null
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2007-03-29.01
-
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
-# Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by `PROGRAMS ARGS'.
- object Object file output by `PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputing dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
-## that the space means something, we add a space to the output as
-## well.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
-
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
- # dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> $depfile
- echo >> $depfile
-
- # The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> $depfile
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$base.u
- tmpdepfile3=$dir.libs/$base.u
- "$@" -Wc,-M
- else
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$dir$base.u
- tmpdepfile3=$dir$base.u
- "$@" -M
- fi
- stat=$?
-
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-icc)
- # Intel's C compiler understands `-MD -MF file'. However on
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want:
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using \ :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
-
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
- sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add `dependent.h:' lines.
- sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # With Tru64 cc, shared objects can also be used to make a
- # static library. This mechanism is used in libtool 1.4 series to
- # handle both shared and static libraries in a single compilation.
- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
- #
- # With libtool 1.5 this exception was removed, and libtool now
- # generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
- tmpdepfile2=$dir$base.o.d # libtool 1.5
- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.o.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- tmpdepfile4=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for `:'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
- "$@" $dashmflag |
- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E |
- sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- "$@" || exit $?
- IFS=" "
- for arg
- do
- case "$arg" in
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-
-/**
- *
- * @ingroup SLP_PG
- * @defgroup MultiMediaPG MultiMedia Camcorder,Player,Sound and Radio
-@{
-<h1 class="pg">Introduction</h1>
-<h2 class="pg">Purpose</h2>
-
-The purpose of this document is to give the application developer detailed information on creating and configuring Multimedia applications using the Multimedia Framework API's.
-
-
-<h2 class="pg">Scope</h2>
-
-The scope of this document is limited to Samsung platform Multimedia Framework API usage.
-
-<h2 class="pg">Abbreviations</h2>
-
- <table>
- <tr>
- <td>
- API
- </td>
- <td>
- Application Programming Interface
- </td>
- </tr>
- <tr>
- <td>
- JPEG
- </td>
- <td>
- Joint Photographic Experts Group
- </td>
- </tr>
- <tr>
- <td>
- AAC
- </td>
- <td>
- Advanced Audio Coding
- </td>
- </tr>
- <tr>
- <td>
- RTP
- </td>
- <td>
- Realtime Transport Protocol
- </td>
- </tr>
- <tr>
- <td>
- MMFW
- </td>
- <td>
- Multimedia Framework
- </td>
- </tr>
- <tr>
- <td>
- PCM
- </td>
- <td>
- Pulse Code Modulation
- </td>
- </tr>
- </table>
-@}
-@defgroup MM_Feature 2.Feature
-@ingroup MultiMediaPG
-@{
-<h1 class="pg">Multimedia Framework Feature</h1>
-
-The Multimedia Framework is designed to provide easy to use services for developing multimedia applications based on an embedded Linux platform.
-
-
-<h2 class="pg">Features</h2>
-
-- Camcorder
- - Initialize Camcorder for Image capture
- - Initialize Camcorder for Video capture
- - Initialize Camcorder for Audio capture
- - Uninitialize camcorder
- - Capturing Picture
- - Record and Save a Audio/Video file or a Audio only file
- - Record and Cancel saving of a recording file
- - Record, Pause and resume recording
- - Get state of camcorder
- - Start and Stop focus
- - User defined filename for recording file
- - Set VideoStream Callback
- - Set VideoCapture Callback
- - Set Message Callback
-
-- Player
- - Play video/audio from local file, network stream, buffer and memory data
- - Pause and resume playback
- - Seeking the position during playing
- - Setting section repeat
- - Change volume
- - Display subtitle
-
-- Multimedia session
- - Determine application's multimedia functional policy.
-
-- Fileinfo
- - Extracting Media Property Information
- - Extracting Media Meta (Tag) data
- - Extracting Stream information
-
-- Sound
- - Play audio file with simple API (supports uncompressed wav/mp3 file only).
- - Playback or capture PCM with given memory buffer.
-
-- OpenAL
- - Cross platform 3D audio API appropriate for gaming applications.
- - OpenAL in SLP only supports playback function.
-
-- Radio
- - Listening to FM Radio
- - Scan the effective frequencies
- - Seek the frequency
- - Get/Set frequency
- - Get/Set relative volume
-
-- Utility
- - Image processing (Rotation, Resizing, and Color converting)
- - Jpeg encoding and decoding
-
-@}
-@defgroup MM_Architecture 1.Architecture
-@ingroup MultiMediaPG
-@{
-
-<h2 class="pg">Architecture diagram</h2>
-
-
-<b>Modules</b>
-
-- Camcorder
-
-The Camcorder Library is a module of the Multimedia framework of SLP. It is responsible for capturing various types of media data such as still image, audio frame, and video frame. According to its operating modes, the camcorder is able to 1) capture Still image, 2) record audio/video frame, and 3) record audio frame only. It provides many convenient functions to control itself. Users can select types of encoders, detailed specifications of video/audio data, and various effects that enhance the quality of the resulting file.
-(The current release of SDK might not support all of the camcorder library functions because the camera driver in SDK does not support many APIs should be supported.)
-
-
-- Player
-
-The Player Library provides various functions for a multimedia application to implement playback of media contents. An application can play different formats of audio and audio/video files. The Player Library provides an interface for playing different formats by hiding the creation/construction of various streaming elements from the application, which makes application coding simpler and faster.
-
-
-- Multimedia Session
-
-Session means timeline of multimedia resources are used.
-Application developer can determine applications' session type as "shared", "exclusive" or "replace".
-"Shared" type means the multimedia session is shared with other applications, if possible. The multimedia resources can be used by other applications.
-"Exclusive" type means using the multimedia session exclusively. Other applications are not allowed to use multimedia resources during this time.
-"Replace" type means this will make stop previous session but allows sharing session with following application.
-
-
-- Fileinfo
-
-The Fileinfo library provides APIs to extract media property information and meta data from media content. These values can be used to display detailed information of the media content without playing it.
-
-
-
-- Sound
-
-The Sound library provides fuctions to play audio files (uncompressed wav and mp3) with a very simple API and to control sound volume of predefined type.
-Also provides functions to playback raw PCM from a memory buffer and capture raw PCM to a memory buffer.
-
-
-
-
-- OpenAL
-
-OpenAL is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications. OpenAL in SLP only supports playback function.
-For further information, see official website : http://connect.creativelabs.com/openal/default.aspx
-
-
-
-- Radio
-
-The Radio Library provides various functions for implementing radio application. It supports the radio operations for HW radio chipset. This library can be only used when HW radio chipset is exist. Radio APIs provides the functionality for playing/stopping radio, changing the frequency, scanning and changing radio sound volumes.
-
-
-- Utility
-
-The Utility library provides simple functions for a multimedia application to process YUV image data and to handle jpeg data. The Utility library for processing image data supports the conversion of color format from YUV to RGB, rotation of images, and resizing the width and height of the picture. The library also saves and loads the image in the Jpeg format. This library includes simple utility features which are related to multimedia.
-
-
-@image html SLP_MultimediaFW_PG_image001.png
-
-@}
-@defgroup MM_Camcorder Camcorder
-@ingroup MultiMediaPG
-@{
-
- @brief <sub class="ref">Also see</sub> Use Cases of @ref Camcorder_UC
-<h2 class="pg">Camcorder</h2>
-
-This part describes the APIs of the Multimedia Camcorder Library. Camcorder Library is used for recording video from video/audio input devices, capturing still images from the video input device, and audio recording from the audio input device.
-
-Camcorder states can be changed by calling the functions shown in the following figure, "State of Camcorder".
-Between each state there is intermediate state, and whilst in this state, any function call which attempts to change the camcorder state will fail.
-Recording state and paused state exist when the camcorder is in video-capture mode. When in audio-capture mode, CAPTURING state will be replaced with RECORDING state.
-
-All of the functions which change the state of the camcorder are asynchronous. The function returns immediately and a successful confirmation of state change will be notified through the message callback function. If the state is changed successfully, a state message callback function will be received with the new state, if not an error message will be received.
-
-<b>Functions</b>
-@image html SLP_MultimediaFW_PG_image002.png
-
-<center>Figure. State of Camcorder</center>
-
-
-
-The following table specifies the state changes of the camcorder module.
-
- <table>
- <tr>
- <td>
- <center><b>FUNCTION</b></center>
- </td>
- <td>
- <center><b>PRE-STATE</b></center>
- </td>
- <td>
- <center><b>POST-STATE</b></center>
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_create()
- </td>
- <td>
- NONE
- </td>
- <td>
- NULL
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_destroy()
- </td>
- <td>
- NULL
- </td>
- <td>
- NONE
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_realize()
- </td>
- <td>
- NULL
- </td>
- <td>
- READY
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_unrealize()
- </td>
- <td>
- READY
- </td>
- <td>
- NULL
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_start()
- </td>
- <td>
- READY
- </td>
- <td>
- PREPARE
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_stop()
- </td>
- <td>
- PREPARE
- </td>
- <td>
- READY
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_capture_start()
- </td>
- <td>
- PREPARE
- </td>
- <td>
- CAPTURING
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_capture_stop()
- </td>
- <td>
- CAPTURING
- </td>
- <td>
- PREPARE
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_record()
- </td>
- <td>
- PREPARED/PAUSED
- </td>
- <td>
- RECORDING
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_pause()
- </td>
- <td>
- RECORDING
- </td>
- <td>
- PAUSED
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_commit()
- </td>
- <td>
- RECORDING/PAUSED
- </td>
- <td>
- PREPARE
- </td>
- </tr>
- <tr>
- <td>
- mm_camcorder_cancel()
- </td>
- <td>
- RECORDING/PAUSED
- </td>
- <td>
- PREPARE
- </td>
- </tr>
- </table>
-
-
-The followings are functions to manage camcorder module.
-
-- mm_camcorder_set_message_callback()
- - Set callback for receiving messages from camcorder. Through this callback function, camcorder sends various message including status changes, asynchronous errors, capturing, and limitations. One thing you have to know is that message callback is working on the main loop of application. So until releasing the main loop, message callback will not be called.
-
-- mm_camcorder_set_video_stream_callback()
- - Set callback for user defined video stream callback function. Users can retrieve video frame using registered callback.
-
-- mm_camcorder_set_video_capture_callback()
- - Set callback for user defined video capture callback function. (Image mode only)
-
-- mm_camcorder_get_state()
- - Get the current state of camcorder.
-
-- mm_camcorder_get_attributes()
- - Get attributes of camcorder with given attribute names. This function can get multiple attributes simultaneously. If one of attribute fails, this function will stop at that point. 'err_attr_name' let you know the name of the attribute.
-
-- mm_camcorder_set_attributes()
- - Set attributes of camcorder with given attribute names. This function can set multiple attributes simultaneously. If one of attribute fails, this function will stop at that point. 'err_attr_name' let you know the name of the attribute.
-
-- mm_camcorder_get_attribute_info()
- - Get detailed information of the attribute.
-
-- mm_camcorder_init_focusing()
- - Initialize auto focusing. If auto focusing is in progressing, stop auto focusing and adjust the camera lens to initial position.
-
-- mm_camcorder_start_focusing()
- - Start focusing. This function return immediately. However, focusing operation will continue until it gets results. After finishing operation, you can get 'MM_MESSAGE_CAMCORDER_FOCUS_CHANGED' message.
-
-- mm_camcorder_stop_focusing()
- - Stop focusing. This function halts focusing operation.
-
-
-<br><br>
-The followings are full proto types of camcorder functions.
-
-- int mm_camcorder_create( MMHandleType* camcorder, MMCamPreset* info );
-
-- int mm_camcorder_destroy(MMHandleType camcorder);
-
-- int mm_camcorder_realize(MMHandleType camcorder);
-
-- int mm_camcorder_unrealize(MMHandleType camcorder);
-
-- int mm_camcorder_start(MMHandleType camcorder);
-
-- int mm_camcorder_stop(MMHandleType camcorder);
-
-- int mm_camcorder_capture_start(MMHandleType camcorder);
-
-- int mm_camcorder_capture_stop(MMHandleType camcorder);
-
-- int mm_camcorder_record(MMHandleType camcorder);
-
-- int mm_camcorder_pause(MMHandleType camcorder);
-
-- int mm_camcorder_commit(MMHandleType camcorder);
-
-- int mm_camcorder_cancel(MMHandleType camcorder);
-
-- int mm_camcorder_set_message_callback(MMHandleType camcorder, MMMessageCallback callback, void *user_data);
-
-- int mm_camcorder_set_video_stream_callback( MMHandleType camcorder, mm_camcorder_video_stream_callback callback, void* user_data );
-
-- int mm_camcorder_set_video_capture_callback( MMHandleType camcorder, mm_camcorder_video_capture_callback callback, void* user_data );
-
-- int mm_camcorder_get_state(MMHandleType camcorder, MMCamcorderStateType* state);
-
-- int #mm_camcorder_get_attributes(MMHandleType camcorder, char **err_attr_name, const char *attribute_name, ...) G_GNUC_NULL_TERMINATED;
-
-- int #mm_camcorder_set_attributes(MMHandleType camcorder, char **err_attr_name, const char *attribute_name, ...) G_GNUC_NULL_TERMINATED;
-
-- int mm_camcorder_get_attribute_info(MMHandleType camcorder, const char *attribute_name, MMCamAttrsInfo *info);
-
-- int mm_camcorder_init_focusing( MMHandleType camcorder );
-
-- int mm_camcorder_start_focusing( MMHandleType camcorder );
-
-- int mm_camcorder_stop_focusing( MMHandleType camcorder );
-
-
-<b>Attributes</b>
-
-- Attribute system
- - Attribute system is an interface to operate camcorder. Depending on each attribute, camcorder behaves differently. Attribute system provides get/set functions. Setting proper attributes, a user can control camcorder as he wants (mm_camcorder_set_attributes()) Also, a user can retrieve the current status of the camcorder, calling getter function(mm_camcorder_get_attributes()). Beware, arguments of mm_camcorder_set_attributes() and mm_camcorder_get_attributes() should be finished with 'NULL'. This is a rule for the variable argument.
- - Besides its value, each Attribute also has 'type' and 'validity type'. 'type' describes variable type that the attribute can have. If you input a value that has wrong type, camcorder will not work properly or will crash. 'validity' describes array or range of values that can be set to the attribute. 'validity type' defines type of the 'validity'.
- - A user can retrieve these values using mm_camcorder_get_attribute_info().
-
-
-Followings are the attributes which should be set before initialization (mm_camcorder_realize):
- - For more detail information, please refer the doxygen document of Camcorder FW.
-
-
-
-<table>
- <tr>
- <td>
- <center><b>Attribute</b></center>
- </td>
- <td>
- <center><b>Description</b></center>
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_MODE
- </td>
- <td>
- Mode of camcorder ( still/video/audio )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_AUDIO_DEVICE
- </td>
- <td>
- Audio device ID for capturing audio stream
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_DEVICE
- </td>
- <td>
- Video device ID for capturing video stream
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_AUDIO_ENCODER
- </td>
- <td>
- Audio codec for encoding audio stream
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_VIDEO_ENCODER
- </td>
- <td>
- Video codec for encoding video stream
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_IMAGE_ENCODER
- </td>
- <td>
- Image codec for capturing still-image
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILE_FORMAT
- </td>
- <td>
- File format for recording media stream
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_AUDIO_SAMPLERATE
- </td>
- <td>
- Sampling rate of audio stream ( This is an integer field )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_AUDIO_FORMAT
- </td>
- <td>
- Audio format of each sample
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_AUDIO_CHANNEL
- </td>
- <td>
- Channels of each sample ( This is an integer field )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_AUDIO_INPUT_ROUTE
- </td>
- <td>
- Set audio input route
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_FORMAT
- </td>
- <td>
- Format of video stream. This is an integer field
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_FPS
- </td>
- <td>
- Frames per second ( This is an integer field )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_WIDTH
- </td>
- <td>
- Width of input video stream
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_HEIGHT
- </td>
- <td>
- Height of input video stream
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_FPS_AUTO
- </td>
- <td>
- FPS Auto. When you set true to this attribute, FPS will vary depending on the amount of the light.
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_HANDLE
- </td>
- <td>
- Pointer of display buffer or ID of xwindow
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_DEVICE
- </td>
- <td>
- Device ID of display
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_SOURCE_X
- </td>
- <td>
- X position of source rectangle. When you want to crop the source, you can set the area with this value.
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_SOURCE_Y
- </td>
- <td>
- Y position of source rectangle. When you want to crop the source, you can set the area with this value.
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_SOURCE_WIDTH
- </td>
- <td>
- Width of source rectangle. When you want to crop the source, you can set the area with this value.
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_SOURCE_HEIGHT
- </td>
- <td>
- Height of source rectangle. When you want to crop the source, you can set the area with this value.
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_ROTATION
- </td>
- <td>
- Rotation of display
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_VISIBLE
- </td>
- <td>
- Visible of display
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_SCALE
- </td>
- <td>
- A scale of displayed image
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_GEOMETRY_METHOD
- </td>
- <td>
- A method that describes a form of geometry for display
- </td>
- </tr>
-</table>
-<br>
-Followings are the attributes which should be set before recording (mm_camcorder_record()):
-<br>
-
-<table>
- <tr>
- <td>
- <center><b>Attribute</b></center>
- </td>
- <td>
- <center><b>Description</b></center>
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_AUDIO_ENCODER_BITRATE
- </td>
- <td>
- Bitrate of Audio Encoder
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_VIDEO_ENCODER_BITRATE
- </td>
- <td>
- Bitrate of Video Encoder
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TARGET_FILENAME
- </td>
- <td>
- Target filename. Only used in Audio/Video recording. This is not used for capturing.
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TARGET_MAX_SIZE
- </td>
- <td>
- Maximum size of recording file(Kbyte). If the size of file reaches this value.
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TARGET_TIME_LIMIT
- </td>
- <td>
- Time limit of recording file. If the elapsed time of recording reaches this value.
- </td>
- </tr>
-</table>
-<br>
-Followings are the attributes which should be set before capturing (mm_camcorder_capture_start()):
-<br>
-
-<table>
- <tr>
- <td>
- <center><b>Attribute</b></center>
- </td>
- <td>
- <center><b>Description</b></center>
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_IMAGE_ENCODER_QUALITY
- </td>
- <td>
- Encoding quality of Image codec
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAPTURE_FORMAT
- </td>
- <td>
- Pixel format that you want to capture
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAPTURE_WIDTH
- </td>
- <td>
- Width of the image that you want to capture
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAPTURE_HEIGHT
- </td>
- <td>
- Height of the image that you want to capture
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAPTURE_COUNT
- </td>
- <td>
- Total count of capturing
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAPTURE_INTERVAL
- </td>
- <td>
- Interval between each capturing on Multishot ( MMCAM_CAPTURE_COUNT > 1 )
- </td>
- </tr>
-</table>
-<br>
-Followings are the attributes which can be set anytime:
-<br>
-
-<table>
- <tr>
- <td>
- <center><b>Attribute</b></center>
- </td>
- <td>
- <center><b>Description</b></center>
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_AUDIO_VOLUME
- </td>
- <td>
- Input volume of audio source ( double value )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_DIGITAL_ZOOM
- </td>
- <td>
- Digital zoom level
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_OPTICAL_ZOOM
- </td>
- <td>
- Optical zoom level
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_FOCUS_MODE
- </td>
- <td>
- Focus mode
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_AF_SCAN_RANGE
- </td>
- <td>
- AF Scan range
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_AF_TOUCH_X
- </td>
- <td>
- X coordinate of touching position
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_AF_TOUCH_Y
- </td>
- <td>
- Y coordinate of touching position
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_AF_TOUCH_WIDTH
- </td>
- <td>
- Width of touching area
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_AF_TOUCH_HEIGHT
- </td>
- <td>
- Height of touching area
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_EXPOSURE_MODE
- </td>
- <td>
- Exposure mode
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_EXPOSURE_VALUE
- </td>
- <td>
- Exposure value
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_F_NUMBER
- </td>
- <td>
- f number of camera
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_SHUTTER_SPEED
- </td>
- <td>
- Shutter speed
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_ISO
- </td>
- <td>
- ISO of capturing image
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_WDR
- </td>
- <td>
- Wide dynamic range
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_ANTI_HANDSHAKE
- </td>
- <td>
- Anti Handshake
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAMERA_FOCAL_LENGTH
- </td>
- <td>
- Focal length of camera lens
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILTER_BRIGHTNESS
- </td>
- <td>
- Brightness level
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILTER_CONTRAST
- </td>
- <td>
- Contrast level
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILTER_WB
- </td>
- <td>
- White balance
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILTER_COLOR_TONE
- </td>
- <td>
- Color tone (Color effect)
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILTER_SCENE_MODE
- </td>
- <td>
- Scene mode (Program mode)
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILTER_SATURATION
- </td>
- <td>
- Saturation level
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILTER_HUE
- </td>
- <td>
- Hue level
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_FILTER_SHARPNESS
- </td>
- <td>
- Sharpness level
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_CAPTURE_BREAK_CONTINUOUS_SHOT
- </td>
- <td>
- Set this as true when you want to stop multishot immediately
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_RECT_X
- </td>
- <td>
- X position of display rectangle ( This is only available when MMCAM_DISPLAY_GEOMETRY_METHOD is MM_CAMCORDER_CUSTOM_ROI )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_RECT_Y
- </td>
- <td>
- Y position of display rectangle ( This is only available when MMCAM_DISPLAY_GEOMETRY_METHOD is MM_CAMCORDER_CUSTOM_ROI )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_RECT_WIDTH
- </td>
- <td>
- Width of display rectangle ( This is only available when MMCAM_DISPLAY_GEOMETRY_METHOD is MM_CAMCORDER_CUSTOM_ROI )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DISPLAY_RECT_HEIGHT
- </td>
- <td>
- Height of display rectangle ( This is only available when MMCAM_DISPLAY_GEOMETRY_METHOD is MM_CAMCORDER_CUSTOM_ROI )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TAG_ENABLE
- </td>
- <td>
- Enable to write tags ( If this value is FALSE, none of tag information will be written to captured file )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TAG_IMAGE_DESCRIPTION
- </td>
- <td>
- Image description
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TAG_ORIENTATION
- </td>
- <td>
- Orientation of captured image
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TAG_SOFTWARE
- </td>
- <td>
- software name and version
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TAG_LATITUDE
- </td>
- <td>
- Latitude of captured postion ( GPS information )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TAG_LONGITUDE
- </td>
- <td>
- Longitude of captured postion ( GPS information )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_TAG_ALTITUDE
- </td>
- <td>
- Altitude of captured postion ( GPS information )
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_STROBE_CONTROL
- </td>
- <td>
- Strobe control
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_STROBE_MODE
- </td>
- <td>
- Operation Mode of strobe
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DETECT_MODE
- </td>
- <td>
- Detection mode
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DETECT_NUMBER
- </td>
- <td>
- Total number of detected object
- </td>
- </tr>
- <tr>
- <td>
- #MMCAM_DETECT_FOCUS_SELECT
- </td>
- <td>
- Select one of detected objects
- </td>
- </tr>
-</table>
-@}
-@defgroup Camcorder_uc1 Initialize Camcorder for Image capture
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Initialize Camcorder for Image capture </h2>
-
-- Purpose
- - Start preview for capturing image
-
-
-
-The camcorder module is initialized for Image capture by using the following steps:
-
--# Create the camcorder handle using mm_camcorder_create().
--# Set message callback. Message callback is a handler for camcorder message. If camcorder is trying to deliever a certain signal that happens on runtime, it uses this method. For more detail information, refer "Set Message Callback"
--# Set video capture callback. Video capture callback is a handler for the captured image. This is the only method to deliever the image. (Do not use 'MMCAM_TARGET_FILENAME' for image capturing. It can't handle multishot.) For more detail information, refer "Set VideoCapture Callback"
--# Set various attributes using mm_camcorder_set_attributes(). You can set as many attributes as you want. If you don't set any attributes, it will operate with the default values. But as a minimum, you have to set 'MMCAM_DISPLAY_HANDLE'. This is the attribute to deliever display pointer or index, such as xid of x window. So if you don't set this, there is no way to display the image.
--# Allocate resources (memory, device node, etc) for camcorder handle using mm_camcorder_realize().
--# Start receiving input video stream (previewing) calling mm_camcorder_start().
-
-
-
-The following is a sample code:
-
-@code
-MMHandleType hcam = 0;
-
-struct appdata
-{
- ...
- int xid;
- ...
-};
-struct appdata ad;
-
-
-static gboolean initialize_image_capture()
-
-{
-
- int err;
-
- MMCamPreset cam_info;
-
- char *err_attr_name = NULL;
-
- void * hdisplay = NULL;
-
- int hsize = 0;
-
-
-
- cam_info.videodev_type = MM_VIDEO_DEVICE_CAMERA0;
-
- err = mm_camcorder_create(&hcam, &cam_info);
-
-
-
- if (err != MM_ERROR_NONE)
-
- {
-
- printf("Fail to call mm_camcorder_create = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- mm_camcorder_set_message_callback(hcam,(MMMessageCallback)msg_callback, (void*)hcam);
-
- mm_camcorder_set_video_capture_callback(hcam,(mm_camcorder_video_capture_callback)camcordertest_video_capture_cb, (void*)hcam);
-
-
-
- hdisplay = &ad.xid;
-
- hsize = sizeof(ad.xid);
-
-
-
- // camcorder attribute setting
-
- err = mm_camcorder_set_attributes((MMHandleType)hcam, &err_attr_name,
-
- MMCAM_MODE, MM_CAMCORDER_MODE_IMAGE,
-
- MMCAM_IMAGE_ENCODER, MM_IMAGE_CODEC_JPEG,
-
- MMCAM_CAMERA_WIDTH, 640,
-
- MMCAM_CAMERA_HEIGHT, 480,
-
- MMCAM_CAMERA_FORMAT, MM_PIXEL_FORMAT_YUYV,
-
- MMCAM_CAMERA_FPS, 30,
-
- MMCAM_DISPLAY_ROTATION, MM_DISPLAY_ROTATION_270,
-
- MMCAM_DISPLAY_HANDLE, (void*) hdisplay, hsize,
-
- MMCAM_CAPTURE_FORMAT, MM_PIXEL_FORMAT_ENCODED,
-
- MMCAM_CAPTURE_WIDTH, 640,
-
- MMCAM_CAPTURE_HEIGHT, 480,
-
- NULL);
-
-
-
- if (err < 0)
-
- {
-
- printf("Set attrs fail. (%s:%x)\n", err_attr_name, err);
-
- if (err_attr_name) {
-
- free(err_attr_name);
-
- err_attr_name = NULL;
-
- return FALSE;
-
- }
-
- }
-
-
-
- err = mm_camcorder_realize(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_realize = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- // start camcorder
-
- err = mm_camcorder_start(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_start = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- return TRUE;
-
-}
-
-@endcode
-
-Basically, you can check the return value to determine whether the function succeeded. But camcorder is composed of several thread context. So you have to check error code delievered by the message callback as well. It will notify you of errors that happened in other asynchronous contexts.
-
-@}
-@defgroup Camcorder_uc2 Initialize Camcorder for Video capture
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Initialize Camcorder for Video capture</h2>
-- Purpose
- - Start preview for video recording
-
-
-
-Everything is the same with "Initialize Camcorder for Image capture" except for two things:
-
--# You don't need to set 'mm_camcorder_set_video_capture_callback' because the function is for capturing image.
--# Set different attributes. For example, you have to specify types of encoder for audio and video, types of fileformat (this will define muxer). You should also define detail settings of video and audio input. Set proper filename to 'MMCAM_TARGET_FILENAME', too.
-
-
-
-
-
-The following is a sample code:
-
-@code
-MMHandleType hcam = 0;
-
-struct appdata
-{
- ...
- int xid;
- ...
-};
-struct appdata ad;
-
-
-static gboolean initialize_video_capture()
-
-{
-
- int err;
-
- MMCamPreset cam_info;
-
- char *err_attr_name = NULL;
-
- void * hdisplay = NULL;
-
- int hsize = 0;
-
-
-
- cam_info.videodev_type = MM_VIDEO_DEVICE_CAMERA0;
-
- err = mm_camcorder_create(&hcam, &cam_info);
-
- if (err != MM_ERROR_NONE)
- {
-
- printf("Fail to call mm_camcorder_create = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- mm_camcorder_set_message_callback(hcam,(MMMessageCallback)msg_callback, hcam);
-
-
-
- hdisplay = &ad.xid;
-
- hsize = sizeof(ad.xid);
-
-
-
- // camcorder attribute setting
-
- err = mm_camcorder_set_attributes((MMHandleType)hcam, &err_attr_name,
-
- MMCAM_MODE, MM_CAMCORDER_MODE_VIDEO,
-
- MMCAM_AUDIO_DEVICE, MM_AUDIO_DEVICE_MIC,
-
- MMCAM_AUDIO_ENCODER, MM_AUDIO_CODEC_AAC,
-
- MMCAM_VIDEO_ENCODER, MM_VIDEO_CODEC_MPEG4,
-
- MMCAM_FILE_FORMAT, MM_FILE_FORMAT_3GP,
-
- MMCAM_CAMERA_WIDTH, 1280,
-
- MMCAM_CAMERA_HEIGHT, 720,
-
- MMCAM_CAMERA_FORMAT, MM_PIXEL_FORMAT_NV12,
-
- MMCAM_CAMERA_FPS, 30,
-
- MMCAM_AUDIO_SAMPLERATE, 44100,
-
- MMCAM_AUDIO_FORMAT, MM_CAMCORDER_AUDIO_FORMAT_PCM_S16_LE,
-
- MMCAM_AUDIO_CHANNEL, 2,
-
- MMCAM_AUDIO_INPUT_ROUTE, MM_AUDIOROUTE_CAPTURE_NORMAL,
-
- MMCAM_DISPLAY_ROTATION, MM_DISPLAY_ROTATION_270,
-
- MMCAM_DISPLAY_HANDLE, (void*) hdisplay, hsize,
-
- MMCAM_TARGET_FILENAME, TARGET_FILENAME, strlen(TARGET_FILENAME),
-
- NULL);
-
-
-
- if (err < 0)
-
- {
-
- printf("Set attrs fail. (%s:%x)\n", err_attr_name, err);
-
- if (err_attr_name) {
-
- free(err_attr_name);
-
- err_attr_name = NULL;
-
- return FALSE;
-
- }
-
- }
-
-
-
- err = mm_camcorder_realize(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_realize = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- // start camcorder
-
- err = mm_camcorder_start(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_start = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- return TRUE;
-
-}
-@endcode
-
-@}
-@defgroup Camcorder_uc3 Initialize Camcorder for Audio capture
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Initialize Camcorder for Audio capture</h2>
-- Purpose
- - Prepare for audio recording
-
-Everything is the same with "Initialize Camcorder for Video capture" except for attributes settings:
--# In this case, you don't need to set video information.
-
-
-
-The following is a sample code:
-
-@code
-MMHandleType hcam = 0;
-
-struct appdata
-{
- ...
- int xid;
- ...
-};
-struct appdata ad;
-
-
-static gboolean initialize_audio_capture()
-
-{
-
- int err;
-
- MMCamPreset cam_info;
-
- char *err_attr_name = NULL;
-
- void * hdisplay = NULL;
-
- int hsize = 0;
-
-
-
- cam_info.videodev_type = MM_VIDEO_DEVICE_NONE;
-
-
-
- err = mm_camcorder_create(&hcam, &cam_info);
-
-
-
- if (err != MM_ERROR_NONE)
-
- {
-
- printf("Fail to call mm_camcorder_create = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- mm_camcorder_set_message_callback(hcam,(MMMessageCallback)msg_callback, (void*)hcam);
-
-
-
- hdisplay = &ad.xid;
-
- hsize = sizeof(ad.xid);
-
-
-
- // camcorder attribute setting
-
- err = mm_camcorder_set_attributes((MMHandleType)hcam, &err_attr_name,
-
- MMCAM_MODE, MM_CAMCORDER_MODE_AUDIO,
-
- MMCAM_AUDIO_DEVICE, MM_AUDIO_DEVICE_MIC,
-
- MMCAM_AUDIO_ENCODER, MM_AUDIO_CODEC_AAC,
-
- MMCAM_FILE_FORMAT, MM_FILE_FORMAT_3GP,
-
- MMCAM_AUDIO_SAMPLERATE, 44100,
-
- MMCAM_AUDIO_FORMAT, MM_CAMCORDER_AUDIO_FORMAT_PCM_S16_LE,
-
- MMCAM_AUDIO_CHANNEL, 2,
-
- MMCAM_AUDIO_INPUT_ROUTE, MM_AUDIOROUTE_CAPTURE_NORMAL,
-
- MMCAM_TARGET_FILENAME, TARGET_FILENAME, strlen(TARGET_FILENAME),
-
- MMCAM_TARGET_TIME_LIMIT, 360000,
-
- NULL);
-
-
-
- if (err < 0)
-
- {
-
- printf("Set attrs fail. (%s:%x)\n", err_attr_name, err);
-
- if (err_attr_name) {
-
- free(err_attr_name);
-
- err_attr_name = NULL;
-
- return FALSE;
-
- }
-
- }
-
-
-
- err = mm_camcorder_realize(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_realize = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- // start camcorder
-
- err = mm_camcorder_start(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_start = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- return TRUE;
-
-}
-@endcode
-
-@}
-@defgroup Camcorder_uc4 Uninitialize camcorder
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Uninitialize camcorder</h2>
-- Purpose
- - Destory camcorder handle and resources
-
-- Preliminary condition
- - Camcorder is lauched for Image capture, Video capture, or Audio capture.
-
-
-
-The initialized camcorder is uninitialized by using the following steps:
--# Stop receiving the video input stream using mm_camcorder_stop(). In audio capture mode, it will stop pipeline itself.
--# Free the allocated memory and release devices calling mm_camcorder_unrealize().
--# Destroy the camcorder handle instance using mm_camcorder_destroy().
-
-
-
-The following is a sample code:
-
-@code
-static gboolean uninitialize_camcorder()
-
-{
-
- int err;
-
-
-
- err = mm_camcorder_stop(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_stop = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- err = mm_camcorder_unrealize(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_unrealize = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- err = mm_camcorder_destroy(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_destroy = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- return TRUE;
-
-}
-@endcode
-@}
-@defgroup Camcorder_uc5 Capturing Picture
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Capturing Picture</h2>
-- Purpose
- - Capturing still image
-
-- Preliminary condition
- - Camcorder is launched for Image capture mode. Refer to "Initialize Camcorder for Image capture".
-
-Steps:
--# Initialize camcorder for image capture as explained in "Initialize Camcorder for Image capture".
--# Start capturing the still image using mm_camcorder_capture_start(). The status of the camcorder is changed to 'MM_CAMCORDER_STATE_CAPTURING' after success.
--# You can stop capturing the still image using mm_camcorder_capture_stop(). But do not call mm_camcorder_capture_stop(), just after calling mm_camcorder_capture_start(). Because captured image is retrieved asynchronously, you can call mm_camcorder_capture_stop() after receiving the 'MM_MESSAGE_CAMCORDER_CAPTURE' message.
--# Beware! Since message callback of camcorder is operated on main loop of the application, you shouldn't hold main loop when you are waiting for the message 'MM_MESSAGE_CAMCORDER_CAPTURED'.
--# Recommended implementation is
- -# Just call mm_camcorder_capture_start() and return
- -# Wait for capture callback that you registered (the callback function that you set to 'mm_camcorder_set_video_capture_callback')
- -# Wait for 'MM_MESSAGE_CAMCORDER_CAPTURED' message
- -# Then call mm_camcorder_capture_stop() in the context of the message or another idle callback.
--# Uninitialize camcorder as explained in "Uninitialize camcorder"
-
-
-
-The following is a sample code:
-
-@code
-static gboolean capturing_picture()
-
-{
-
- int err;
-
-
-
- err = mm_camcorder_capture_start(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_capture_start = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- // mm_camcorder_capture_stop should be called after getting the message
- // - MM_MESSAGE_CAMCORDER_CAPTURED message
-
-
- return TRUE;
-
-}
-@endcode
-
-
-Handling for captured message, please refer to the callback function of "Set Message Callback".
-
-@}
-@defgroup Camcorder_uc6 Record and Save a Audio/Video file or a Audio only file
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Record and Save a Audio/Video file or a Audio only file</h2>
-- Purpose
- - Start recording and save the file
-
-- Preliminary condition
- - Camcorder is launched for Video capture mode. (Refer "Initialize Camcorder for Video capture".)
- - Or Camcorder is launched for Audio capture mode. (Refer "Initialize Camcorder for Video capture".)
-
-
-
-A video is recorded and saved by camcorder by using the following steps:
--# Initialize camcorder for video capture or audio capture
--# Start audio/video recording using mm_camcorder_record().
--# Save the recorded Video file using mm_camcorder_commit().
--# Uninitialize camcorder. Refer "Uninitialize camcorder".
-
-The procedure of "Audio recording" and "Audio/Video recording" is just same except for settings for video related attributes.
-
-
-
-The following is a sample code:
-
-@code
-static gboolean record_and_save_video_file()
-
-{
-
- int err;
-
-
-
- // Start recording
-
- err = mm_camcorder_record(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_record = %x\n", err);
-
- return FALSE;
-
- }
-
-
- // Wait while recording
- // ...
-
-
- // Save file /
-
- err = mm_camcorder_commit(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_commit = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- return TRUE;
-
-}
-@endcode
-
-In the above example code, MMCamcorderRecord and MMCamcorderCommit will return immediately, but whether the video is captured and saved successfully or not is known through a callback function which is set using the API MMCamcorderSetMessageCallback.
-
-@}
-
-@defgroup Camcorder_uc7 Record and Cancel saving of a recording file
-@ingroup Camcorder_UC
-@{
-<h2 class="pg">Record and Cancel saving of a recording file</h2>
-- Purpose
- - Cancel the operation while recording.
-
-- Preliminary condition
- - Camcorder is launched for Video capture mode. (Refer "Initialize Camcorder for Video capture".)
- - Or Camcorder is launched for Audio capture mode. (Refer "Initialize Camcorder for Video capture".)
-
-
-
-A video is recorded and not saved by camcorder by using the following steps:
--# Initialize camcorder for video capture or audio capture
--# Start audio/video recording using mm_camcorder_record().
--# Cancel saving the recorded Video file using mm_camcorder_cancel().
--# Uninitialize camcorder. Refer "Uninitialize camcorder".
-
-
-
-The following is a sample code:
-
-@code
-
-static gboolean record_and_cancel_video_file()
-
-{
-
- int err;
-
-
-
- // Start recording
-
- err = mm_camcorder_record(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_record = %x\n", err);
-
- return FALSE;
-
- }
-
-
- // Wait while recording
- // ...
-
-
- // Cancel recording
-
- err = mm_camcorder_cancel(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_cancel = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- return TRUE;
-
-}
-@endcode
-@}
-
-@defgroup Camcorder_uc8 Record, Pause and resume recording
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Record, Pause and resume recording</h2>
-- Purpose
- - Pause and Resume operation while recording
-
-- Preliminary condition
- - Camcorder is launched for Video capture mode. (Refer "Initialize Camcorder for Video capture".)
- - Or Camcorder is launched for Audio capture mode. (Refer "Initialize Camcorder for Video capture".)
-
-
-Recording, pausing and resuming recording of a video file is accomplished by using the following steps:
--# Initialize camcorder for video capture or audio capture
--# Start recording calling mm_camcorder_record().
--# Pause recording. mm_camcorder_pause().
--# When you want to resume recording, call mm_camcorder_record again.
--# Save the recorded file. mm_camcorder_commit().
--# Uninitialize camcorder. Refer "Uninitialize camcorde".
-
-
-The following is a sample code:
-
-@code
-static gboolean record_pause_and_resume_recording()
-
-{
-
- int err;
-
-
-
- // Start recording
-
- err = mm_camcorder_record(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_record = %x\n", err);
-
- return FALSE;
-
- }
-
-
- // Wait while recording
- // ...
-
-
- // Pause
-
- err = mm_camcorder_pause(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_pause = %x\n", err);
-
- return FALSE;
-
- }
-
-
- // Pausing...
-
-
- // Resume
-
- err = mm_camcorder_record(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_record = %x\n", err);
-
- return FALSE;
-
- }
-
-
- // Wait while recording
- // ...
-
-
- // Save file
-
- err = mm_camcorder_commit(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_commit = %x\n", err);
-
- return FALSE;
-
- }
-
-
-
- return TRUE;
-
-}
-@endcode
-
-
-Even though recording is paused, preview is continuously displayed.
-
-@}
-@defgroup Camcorder_uc9 Get state of camcorder
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Get state of camcorder</h2>
-- Purpose
- - Get the current state of camcorder
-
-If handle is available, you can get the current status of camcorder using mm_camcorder_get_state()
-
-The following is a sample code:
-
-@code
-static gboolean get_state_of_camcorder()
-
-{
-
- MMCamcorderStateType state;
-
-
-
- mm_camcorder_get_state(hcam, &state);
-
- printf("Current status is %d\n", state);
-
-
-
- return TRUE;
-
-}
-@endcode
-
-@}
-@defgroup Camcorder_uc10 Start and Stop focus
-@ingroup Camcorder_UC
-@{
-
-
-<h2 class="pg">Start and Stop focus</h2>
-- Purpose
- - Adjust lens focus
-
-- Preliminary condition
- - Camcorder is launched for Image or Video capture mode. Refer "Initialize Camcorder for Image capture" and "Initialize Camcorder for Video capture".
-
-
-
-Starting and Stopping focus feature of camcorder:
--# Initialize camcorder for image or video capture as explained in "Initialize Camcorder for Video capture" or "Initialize Camcorder for Image capture".
--# Set proper focusing mode using attribute 'MMCAM_CAMERA_FOCUS_MODE' and 'MMCAM_CAMERA_AF_SCAN_RANGE'.
--# Initialize auto focus mode and adjust the camera lens to initial position using mm_camcorder_init_focusing().
--# Start focusing of camcorder using mm_camcorder_start_focusing().
--# Focusing state will be sent through message callback. (MM_MESSAGE_CAMCORDER_FOCUS_CHANGED)
--# If you want to stop focusing immediately, call mm_camcorder_stop_focusing().
--# But in general case, you don't need to call this. Just wait the message.
--# Uninitialize camcorder. Refer "Uninitialize camcorder".
-
-
-The following is a samsple code
-
-@code
-static gboolean start_autofocus()
-
-{
-
- int err;
-
- char * err_attr_name = NULL;
-
-
-
- // Set focus mode to 'AUTO' and scan range to 'AF Normal'
-
- err = mm_camcorder_set_attributes((MMHandleType)hcam, &err_attr_name,
-
- MMCAM_CAMERA_FOCUS_MODE, MM_CAMCORDER_FOCUS_MODE_AUTO,
-
- MMCAM_CAMERA_AF_SCAN_RANGE, MM_CAMCORDER_AUTO_FOCUS_NORMAL,
-
- NULL);
-
-
-
- if (err < 0)
-
- {
-
- printf("Set attrs fail. (%s:%x)\n", err_attr_name, err);
-
- if (err_attr_name) {
-
- free(err_attr_name);
-
- err_attr_name = NULL;
-
- return FALSE;
-
- }
-
- }
-
- mm_camcorder_init_focusing(hcam);
-
- mm_camcorder_start_focusing(hcam);
-
- printf("Waiting for adjusting focus\n");
-
-
-
- // Waiting for 'MM_MESSAGE_CAMCORDER_FOCUS_CHANGED'
- // ...
-
-
- return TRUE;
-
-}
-@endcode
-
-@}
-@defgroup Camcorder_uc11 User defined filename for recording file
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">User defined filename for recording file</h2>
-
-To Save an video or audio captured file with user defined name, you have to set an attribute named 'MMCAM_TARGET_FILENAM'.
-
-In image capture mode, there is no interface to set the name of captured file because camcorder gives you a captured buffer directly. You can create an image file with proper name in the application.
-
-
-The following is a samsple code
-
-@code
-static gboolean filename_setting()
-
-{
-
- int err;
-
- char * new_filename = "new_name.mp4";
-
-
-
- // camcorder attribute setting
-
- err = mm_camcorder_set_attributes((MMHandleType)hcam, NULL,
-
- MMCAM_TARGET_FILENAME, new_filename, strlen(new_filename),
-
- NULL);
-
-
-
- printf("New file name (%s)\n", new_filename);
-
-
- return TRUE;
-
-}
-@endcode
-
-@}
-@defgroup Camcorder_uc12 Set VideoStream Callback
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Set VideoStream Callback</h2>
-
-MMCamcorderSetVideoStreamCallback API is used to set callback for receiving video stream data (preview) from the camcorder.
-
-
-
-The following is a sample code:
-
-@code
-static gboolean set_video_stream_callback()
-
-{
-
- mm_camcorder_set_video_stream_callback(hcam, (mm_camcorder_video_stream_callback)camcordertest_video_stream_cb, (void*)hcam);
-
-
- return TRUE;
-
-}
-@endcode
-@code
-static int
-
-camcordertest_video_stream_cb(MMCamcorderVideoStreamDataType *stream, void *user_param)
-
-{
-
- int nret = 0;
-
-
-
- printf("stream cb is called(%p, %d, %d)\n", stream->data, stream->width, stream->height);
-
-
-
- return TRUE;
-
-}
-@endcode
-
-@}
-@defgroup Camcorder_uc13 Set VideoCapture Callback
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Set VideoCapture Callback</h2>
-
-mm_camcorder_set_video_capture_callback() is used to set callback for receiving still capture data from the camcorder. In here, you can handle the result data.
-
-
-The following is a sample code:
-
-@code
-mm_camcorder_set_video_capture_callback(hcam,(mm_camcorder_video_capture_callback)
-
-camcordertest_video_capture_cb, (void*)hcam);
-@endcode
-@code
-static int
-
-camcordertest_video_capture_cb(MMCamcorderCaptureDataType *src, MMCamcorderCaptureDataType *thumb, void *preview)
-
-{
-
- int nret = 0;
-
- char m_filename[MAX_STRING_LEN];
-
- FILE* fp=NULL;
-
-
-
- sprintf(m_filename, "%s%03d.jpg", "./stillshot_", stillshot_count++);
-
-
-
- printf("filename : %s\n", m_filename);
-
-
-
- fp=fopen(m_filename, "w+");
-
- if(fp==NULL)
-
- {
-
- printf("FileOPEN error!!\n");
-
- return FALSE;
-
- }
-
- else
-
- {
-
- printf("open success\n\n");
-
- if(fwrite(src->data, src->length, 1, fp )!=1)
-
- {
-
- printf("File write error!!\n");
-
- return FALSE;
-
- }
-
- printf("write success\n");
-
- }
-
- fclose(fp);
-
- printf("Capture done!\n");
-
-
-
- return TRUE;
-
-}
-@endcode
-
-@}
-@defgroup Camcorder_uc14 Set Message Callback
-@ingroup Camcorder_UC
-@{
-
-<h2 class="pg">Set Message Callback</h2>
-
-The following is a sample code:
-@code
-mm_camcorder_set_message_callback(hcam,(MMMessageCallback)msg_callback, (void*)hcam);
-@endcode
-
-The following code snippet explains the callback function for 'MMMessageCallback':
-- First argument gives the index of the message. You can handle each message with the value.
-- Second argument has a parameter structure that holds useful values for application. The original parameter type is 'MMMessageParamType'.
-- It has several fields for message including union structure. By checking 'union_type' field, you can determine which type of union is used. For the type of union, refer 'MMMessageUnionType' in 'mm_types.h'.
-- One message type only has one specific union in anycase. Please refer following table
-
-
-<table>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_STATE_CHANGED
- </td>
- <td>
- MM_MSG_UNION_STATE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM
- </td>
- <td>
- MM_MSG_UNION_STATE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_RECORDING_STATUS
- </td>
- <td>
- MM_MSG_UNION_RECORDING_STATUS
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_FIRMWARE_UPDATE
- </td>
- <td>
- MM_MSG_UNION_FIRMWARE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_TIME_LIMIT
- </td>
- <td>
- MM_MSG_UNION_CODE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_MAX_SIZE
- </td>
- <td>
- MM_MSG_UNION_CODE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_NO_FREE_SPACE
- </td>
- <td>
- MM_MSG_UNION_CODE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_ERROR
- </td>
- <td>
- MM_MSG_UNION_CODE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_FOCUS_CHANGED
- </td>
- <td>
- MM_MSG_UNION_CODE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_CURRENT_VOLUME
- </td>
- <td>
- MM_MSG_UNION_CODE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_CAMCORDER_CAPTURED
- </td>
- <td>
- MM_MSG_UNION_CODE
- </td>
- </tr>
- <tr>
- <td>
- MM_MESSAGE_READY_TO_RESUME
- </td>
- <td>
- MM_MSG_UNION_CODE
- </td>
- </tr>
-</table>
-
-- 'MM_MESSAGE_READY_TO_RESUME' is a message type that notifies that the camcorder is able to start again after being halting by internal session manager.
-
-@code
-static gboolean msg_callback(int message, void *msg_param, void *user_param)
-
-{
-
- MMHandleType hcamcorder = (MMHandleType)user_param;
-
- MMMessageParamType *param = (MMMessageParamType *) msg_param;
-
- int err = 0;
-
-
-
- switch (message) {
-
- case MM_MESSAGE_CAMCORDER_ERROR:
-
- printf("MM_MESSAGE_CAMCORDER_ERROR : code = %x\n", param->code);
-
- break;
-
- case MM_MESSAGE_CAMCORDER_STATE_CHANGED:
-
- g_current_state = param->state.current;
-
- break;
-
-
-
- case MM_MESSAGE_CAMCORDER_CAPTURED:
-
- {
-
- //Get mode of camcorder
-
- int mode = 0;
-
- err = mm_camcorder_get_attributes(hcamcorder, NULL,
-
- MMCAM_MODE, &mode,
-
- NULL);
-
-
-
- if (mode == MM_CAMCORDER_MODE_IMAGE)
-
- {
-
- printf("Stillshot Captured!!(number=%d)\n", param->code);
-
-
-
- err = mm_camcorder_capture_stop(hcam);
-
- if (err < 0)
-
- {
-
- printf("Fail to call mm_camcorder_capture_start= %x\n", err);
-
- return FALSE;
-
- }
-
- }
-
- else
-
- {
-
- //Audio/Video recording
-
- MMCamRecordingReport* report ;
-
-
-
- if (param)
-
- report = (MMCamRecordingReport*)(param->data);
-
- else
-
- return FALSE;
-
-
-
- printf("Recording Complete(filename=%s)\n", report->recording_filename);
-
-
-
- if (report->recording_filename)
-
- free(report->recording_filename);
-
-
-
- if (report)
-
- free(report);
-
- }
-
- }
-
- break;
-
- case MM_MESSAGE_CAMCORDER_RECORDING_STATUS:
-
- {
-
- unsigned int elapsed;
-
- elapsed = param->recording_status.elapsed / 1000;
-
- if (elapsed_time != elapsed) {
-
- unsigned int temp_time;
-
- int hour, minute, second;
-
- elapsed_time = elapsed;
-
- temp_time = elapsed;
-
- hour = temp_time / 3600;
-
- temp_time = elapsed % 3600;
-
- minute = temp_time / 60;
-
- second = temp_time % 60;
-
- printf("Current Time - %d:%d:%d\n", hour, minute, second);
-
- }
-
- }
-
- break;
-
- case MM_MESSAGE_CAMCORDER_MAX_SIZE:
-
- {
-
- printf("Reach Size limitation.\n");
-
-
-
- // After reaching max size, Camcorder starts to drop all buffers that
-
- it receives. You have to call mm_camcorder_commit() to finish recording.
-
- err = mm_camcorder_commit(hcamcorder);
-
-
-
- if (err < 0)
-
- {
-
- printf("Save recording mm_camcorder_commit = %x\n", err);
-
- }
-
- }
-
- break;
-
- case MM_MESSAGE_CAMCORDER_NO_FREE_SPACE:
-
- {
-
- printf("There is no space in storage.\n");
-
-
-
- // If there is no free space to save recording frame, Camcorder starts to
-
- drop all buffers that it receives.
-
- You have to call mm_camcorder_commit() to finish recording.
-
- err = mm_camcorder_commit(hcamcorder);
-
-
-
- if (err < 0)
-
- {
-
- printf("Save recording mm_camcorder_commit = %x\n", err);
-
- }
-
- }
-
- break;
-
- case MM_MESSAGE_CAMCORDER_TIME_LIMIT:
-
- {
-
- printf("Reach time limitation.\n");
-
-
-
- // After reaching time limit, Camcorder starts to drop all buffers that it
-
- receives. You have to call mm_camcorder_commit() to finish recording.
-
- err = mm_camcorder_commit(hcamcorder);
-
-
-
- if (err < 0)
-
- {
-
- printf("Save recording mm_camcorder_commit = %x\n", err);
-
- }
-
- }
-
- break;
-
- case MM_MESSAGE_CAMCORDER_FOCUS_CHANGED:
-
- {
-
- printf( "Focus State changed. State:[%d]\n", param->code );
-
- }
-
- break;
-
- default:
-
- break;
-
- }
-
-
-
- return TRUE;
-
-}
-@endcode
-
-@}
-
-@defgroup MM_Player Player
-@ingroup MultiMediaPG
-@{
-
-<h2 class="pg">Player</h2>
- @brief <sub class="ref">Also see</sub> Use Cases of @ref Player_UC
-
-This section describes APIs used for playback of multimedia contents.
-
-
-
-Player can have 5 states, and each state can be changed by calling the following functions as described in "State of mm_player" diagram.
-
- <table>
-
- <tr>
- <td>
- <b>FUNCTION</b>
- <td>
- <b>PRE-STATE</b><b></b>
- <td>
- <b>POST-STATE</b><b></b>
- <td>
- <b>SYNC TYPE</b>
- <tr>
- <td>
- <p>mm_player_create()
- <td>
- NONE
- <td>
- NULL
- <td>
- SYNC
- <tr>
- <td>
- <p>mm_player_destroy()
- <td>
- NULL
- <td>
- NONE
- <td>
- SYNC
- <tr>
- <td>
- <p>mm_player_realize()
- <td>
- NULL
- <td>
- READY
- <td>
- SYNC
- <tr>
- <td>
- <p>mm_player_unrealize()
- <td>
- READY
- <td>
- NULL
- <td>
- SYNC
- <tr>
- <td>
- <p>mm_player_start()
- <td>
- READY
- <td>
- PLAYING
- <td>
- ASYNC
- <tr>
- <td>
- <p>mm_player_stop()
- <td>
- PLAYING
- <td>
- READY
- <td>
- SYNC
- <tr>
- <td>
- <p>mm_player_pause()
- <td>
- PLAYING
- <td>
- PAUSED
- <td>
- ASYNC
- <tr>
- <td>
- <p>mm_player_resume()
- <td>
- PAUSED
- <td>
- PLAYING
- <td>
- ASYNC
- </table>
-
-
-@image html SLP_MultimediaFW_PG_image003.png
-Figure. State of MMPlayer
-
-
-
-Most of functions which change player state work as synchronous . But, mm_player_start() should be used asynchronously. Both mm_player_pause() and mm_player_resume() should also be used asynchronously in the case of streaming data. So, application has to confirm the result through message callback function.
-
-
-
-Note: "None" and "Null" state could be reached from any state by calling mm_player_destroy() and mm_player_unrealize().
-
-
-The following are supported functions in the player module.
- - int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume)
- - int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume)
- - int mm_player_get_mute(MMHandleType player, int *mute)
- - int mm_player_set_mute(MMHandleType player, int mute)
- - int mm_player_set_position(MMHandleType player, MMPlayerPosFormatType format, int pos)
- - int mm_player_get_position(MMHandleType player, MMPlayerPosFormatType format, int *pos)
- - int mm_player_activate_section_repeat(MMHandleType player)
- - int mm_player_deactivate_section_repeat(MMHandleType player, int start, int end)
- - int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param)
- - int mm_player_set_subtitle_silent(MMHandleType player, int slient)
- - int mm_player_get_subtitle_silent(MMHandleType player, int *slient)
- - int mm_player_set_attribute(MMHandleType player, char **err_attr_name, const char *first_attribute_name, ...)
- - int mm_player_get_attribute(MMHandleType player, char **err_attr_name, const char *first_attribute_name, ...)
- - int mm_player_get_attribute_info(MMHandleType player, const char *attribute_name, MMPlayerAttrsInfo *info)
-
-
-
-Application can set/get some values into player library for applying its properties using attributes.
-
-
-
-The following are supported attributes list of player library.
-
- - For more detail information, please refer the doxygen document of player framework.
-
- <table>
-
- <tr>
- <td><b>Attribute Name</b>
- <td>
-<b>Type</b>
- <td>
-<b>Validity Type</b>
- <td>
-<b>Default Value</b>
- <tr>
- <td>
-"profile_uri" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"profile_user_param" <td>
-data <td>
-N/A <td>
-NULL <tr>
- <td>
-"profile_play_count" <td>
-int <td>
-range <td>
-1 <tr>
- <td>
-"streaming_type" <td>
-int <td>
-range <td>
-STREAMING_SERVICE_NONE <tr>
- <td>
-"streaming_udp_timeout" <td>
-int <td>
-range <td>
-1000msec <tr>
- <td>
-"streaming_user_agent" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"streaming_wap_profile" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"streaming_network_bandwidth" <td>
-int <td>
-range <td>
-128000Hz <tr>
- <td>
-"streaming_cookie" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"streaming_proxy_ip" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"streaming_proxy_port" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"display_overlay" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"display_rotation" <td>
-int <td>
-range <td>
-MM_DISPLAY_ROTATION_270 <tr>
- <td>
-"subtitle_uri" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"content_duration" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"content_video_codec" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"content_video_bitrate" <td>
-int <td>
-array <td>
-0 <tr>
- <td>
-"content_video_fps" <td>
-int <td>
-array <td>
-0 <tr>
- <td>
-"content_video_width" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"content_video_height" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"content_video_track_id" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"content_video_track_num" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"content_audio_codec" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"content_audio_bitrate" <td>
-int <td>
-array <td>
-0 <tr>
- <td>
-"content_audio_channels" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"content_audio_samplerate" <td>
-int <td>
-array <td>
-0 <tr>
- <td>
-"content_audio_track_id" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"content_audio_track_num" <td>
-int <td>
-range <td>
-0 <tr>
- <td>
-"tag_artist" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"tag_title" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"tag_album" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"tag_genre" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"tag_author" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"tag_copyright" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"tag_date" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"tag_description" <td>
-string <td>
-N/A <td>
-NULL <tr>
- <td>
-"tag_track_num" <td>
-int <td>
-range <td>
-0
- </table>
-
-
-@}
-@defgroup Player_uc1 Create and initialize Player
-@ingroup Player_UC
-@{
-<h2 class="pg">Create and initialize Player</h2>
- - Applications can create the player handle using mm_player_create().
- - And then, attributes for the player such as the url can be set through mm_player_set_attribute() .
- - Fundamentally, one url should be set to play both audio and video contents.
- - The created window id should be set to display video using the "display_overlay" attribute.
- - All messages are sent through message callback functions to the application from the player.
- - So, callback functions should be set to receive messages like error, BOS(Begin Of Stream) and EOS(End Of Stream)
- - Player is a pipelined architecture and basic pipeline is made when mm_player_realize() is called.
- - The following is a sample code to create, realize player and set the url and display id.
-
-@code
-MMHandleType g_player = 0;
-char **g_err_attr_name;
-struct appdata ad;
-
-int ret = MM_ERROR_NONE;
-
-int initialize_video_player(char *filename)
-{
- if (mm_player_create(&g_player) != MM_ERROR_NONE)
- {
- printf("failed to create player\n");
- }
-
- if (mm_player_set_attribute(g_player,
- g_err_attr_name,
- "profile_uri", filename, strlen(filename),
- "display_overlay", (void*)&ad.xid, sizeof(ad.xid),
- NULL) != MM_ERROR_NONE)
- {
- printf("failed to set %s attribute\n", *g_err_attr_name);
- free(g_err_attr_name);
- }
-
- mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
-
- if (mm_player_realize(g_player) != MM_ERROR_NONE)
- {
- printf("failed to realize player\n");
- }
-}
-
-int msg_callback(int message, MMMessageParamType *param, void *user_param)
-{
- switch (message)
- {
- case MM_MESSAGE_ERROR:
- // Do something
- break;
-
- case MM_MESSAGE_END_OF_STREAM:
- // Do something
- break;
-
- case MM_MESSAGE_STATE_CHANGED:
- // Do something
- break;
-
- case MM_MESSAGE_BEGIN_OF_STREAM:
- // Do something
- break;
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-@endcode
-
-
-Set message callback
-
- - The application must confirm some information or player status from messages of callback. It must be registered before beginning playback.
-
- - The Followings messages are typically used
-
- <table>
-
- <tr> <td> MM_MESSAGE_ERROR </td> </tr>
- <tr> <td> MM_MESSAGE_STATE_CHANGED </td> </tr>
- <tr> <td>MM_MESSAGE_BEGIN_OF_STREAM </td> </tr>
- <tr> <td>MM_MESSAGE_END_OF_STREAM </td> </tr>
- <tr> <td>MM_MESSAGE_UPDATE_SUBTITLE </td> </tr>
- <tr> <td>MM_MESSAGE_BUFFERING </td> </tr>
-
- </table>
-
-
-
- - In the case of MM_MESSAGE_ERROR, application can determine the specific error case from the code value of message parameter.
-
- - The Followings error codes are typically used.
-
-
- <table>
-
- <tr> <td>MM_ERROR_PLAYER_INTERNAL </td> </tr>
- <tr> <td>MM_ERROR_PLAYER_CODEC_NOT_FOUND </td> </tr>
- <tr> <td>MM_ERROR_PLAYER_NOT_SUPPORTED_FORMAT </td> </tr>
- <tr> <td>MM_ERROR_PLAYER_NOT_INITIALIZED </td> </tr>
- <tr> <td>MM_ERROR_PLAYER_FILE_NOT_FOUND </td> </tr>
-
- </table>
-
- - Refer to the appendix for more message and error details
-
- - The following is a sample code of message callback implementation.
-
-@code
-void video_player_message_callback(int message, void *param, void *user_param)
-{
- struct appdata *ad = (struct appdata *)user_param;
- MMMessageParamType* msg_param = (MMMessageParamType*)param;
-
- switch(message)
- {
- case MM_MESSAGE_ERROR:
- parse_video_player_error_code(msg_param->code, ad);
- break;
-
- case MM_MESSAGE_BEGIN_OF_STREAM:
- // can update video player UI
- break;
-
- case MM_MESSAGE_END_OF_STREAM:
- // can close and destroy the player
- ecore_idler_add(video_player_close_handler, ad);
- break;
-
- //...
- default:
- break;
-
- }
-}
-
-void parse_video_player_error_code(int error_code, struct appdata *app_data)
-{
- switch(error_code)
- {
- case MM_ERROR_PLAYER_CODEC_NOT_FOUND:
- // can show up error popup
- break;
-
- case MM_ERROR_PLAYER_INTERNAL:
- // can show up error popup and close player
- ecore_idler_add(video_player_close_handler, app_data);
- break;
-
- //...
-
- default:
- break;
- }
-}
-
-int video_player_close_handler (void *data)
-{
- struct appdata *ad = (struct appdata *)data;
-
- close_video_player (ad);
- return 0;
-}
-
-bool close_video_player (void *data)
-{
- struct appdata *ad = (struct appdata *)data;
-
- video_player_mgr_unrealize(ad);
- video_player_mgr_destroy(ad);
-}
-
-bool video_player_mgr_unrealize (void *data)
-{
- struct appdata *ad = (struct appdata *)data;
-
- if (mm_player_unrealize(ad->player_handle) != MM_ERROR_NONE)
- return FALSE;
-
- return TRUE;
-}
-
-bool video_player_mgr_destroy (void *data)
-{
- struct appdata *ad = (struct appdata *)data;
-
- if (mm_player_destroy(ad-> player_handle) != MM_ERROR_NONE)
- return FALSE;
-
- return TRUE;
-}
-@endcode
-@}
-@defgroup Player_uc2 Get and set attributes
-@ingroup Player_UC
-@{
-
-<h2 class="pg">Get and set attributes</h2>
-
- - There are many useful attributes in the player which the Application can set or get to control the player.
- - Those are constructed when the player is created and handled by string id.
- - Supported types are int, double, string and data. And, there is variable parameter in related APIs.
- - In the case of the int and double types, a name/value pair should be set. For the string and data types, the name/value pair should be followed by the size.
- - Finally, application can get the information of each attribute using mm_player_get_attribute_info().
- - The following is a sample code.
-
-@code
-/***********************
-// get content duration
-/***********************
-
-
-
-int duration = 0;
-char **g_err_attr_name;
-
-if (mm_player_get_attribute(g_player, &g_err_attr_name, "content_duration", &duration, NULL) != MM_ERROR_NONE)
-{
- printf("failed to set %s attribute\n", *g_err_attr_name);
- free(g_err_attr_name);
-
-}
-
-pirntf("file duration is = %d\n", duration);
-
-
-
-/***********************
-// set content duration
-/***********************
-
-int duration = 0;
-char **g_err_attr_name;
-
-if (mm_player_get_attribute(g_player, &g_err_attr_name, "content_duration", &duration, NULL) != MM_ERROR_NONE)
-{
- printf("failed to set %s attribute\n", g_err_attr_name);
- free(g_err_attr_name);
-}
-
-pirntf("duration is = %d\n", duration);
-
-/***********************
-// get attribute info
-/***********************
-
-int method = 0;
-
-MMPlayerAttrsInfo method_info = { 0, };
-
-if (mm_player_get_attribute_info (g_player, "display_method", &method_info, NULL) != MM_ERROR_NONE)
-{
- printf("failed to get info \n");
-}
-
-printf("type:%d \n", method_info.type); // int, double
-printf("flag:%d \n", method_info.flag); // readable, writable..
-printf("validity type:%d \n", method_info.validity_type);//range, array..
-
-if (method_info. validity_type == MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE)
-{
- printf("range min=%d\n", method_info.int_range.min );
- printf("range max=%\n", method_info.int_range.max );
-}
-@endcode
-
-@}
-@defgroup Player_uc3 Unrealize and play next file
-@ingroup Player_UC
-@{
-
-<h2 class="pg">Unrealize and play next file</h2>
- - Player should be unrealized first in order to play another file.
- - If player is unrealized, all the related variables and codecs are removed.
- - So, it is necessary to set new attributes and reconstruct the player.
- - The following is a sample code to play another mp3 file.
-@code
-void play_next_audio_file(char *next_filename)
-{
- if (mm_player_unrealize(g_player) != MM_ERROR_NONE)
- {
- printf("failed to unrealize\n");
- exit(1);
- }
-
- if (mm_player_set_attribute(g_player,
- &g_err_attr_name,
- "profile_uri", next_filename, strlen(filename),
- NULL) != MM_ERROR_NONE)
- {
- printf("failed to set %s attribute\n", g_err_attr_name);
- free(g_err_attr_name);
- }
-
- if (mm_player_realize(g_player) != MM_ERROR_NONE)
- {
- printf("failed to destroy\n");
- exit(1);
- }
-
- if (mm_player_start(g_player) != MM_ERROR_NONE)
- {
- printf("failed to destroy\n");
- exit(1);
- }
-}
-@endcode
-
-
-@}
-@defgroup Player_uc4 Destroy player
-@ingroup Player_UC
-@{
-
-<h2 class="pg">Destroy player</h2>
-
- - The created player should be destroyed when application is closed.
- - So, if mm_player_destroy() is called, all allocated resources and the player handle are released.
-@}
-@defgroup Player_uc5 Play and end of playback
-@ingroup Player_UC
-@{
-
-<h2 class="pg">Play and end of playback</h2>
-
- - Applications can play music or video using the mm_player_start() function when player is in the ready state. After starting, the appropriate codecs will be generated internally to play it.
- - The result of the start function is returned asynchronously through the message callback which was previously registered.
- - Playback is confirmed to the application with the MM_BEGIN_OF_STREAM(BOS) message.
- - The MM_MESSAGE_END_OF_STREAM(EOS) is sent at the end of contents playback.
-@}
-@defgroup Player_uc6 Pause and resume
-@ingroup Player_UC
-@{
-
-<h2 class="pg">Pause and resume</h2>
-
- - Player can be paused during playing video or audio contents. It can also be resumed again.
- - The result of the pause or resume functions are returned asynchronously. So the result is confirmed to the application by the MM_MESSAGE_STATE_CHANGED message in the message callback.
- - Both apis may be used synchronously in the case of local playback.
- - The following is a sample code for when the player is paused and the result is checked for streaming data.
-
-@code
-void pause_video_player()
-{
- if (mm_player_pause(g_player) != MM_ERROR_NONE)
- {
- printf("failed to pause\n");
- }
-}
-
-int msg_callback(int message, MMMessageParamType *param, void *user_param)
-{
- switch (message)
- {
- case MM_MESSAGE_ERROR:
- // Do something
- break;
-
- case MM_MESSAGE_STATE_CHANGED:
- if (param->state.current == MM_PLAYER_STATE_PAUSED)
- printf("player is paused. So, application can resume it again.\n");
- break;
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-@endcode
-@}
-@defgroup Player_uc7 Change the volume during playback
-@ingroup Player_UC
-@{
-
-<h3 class="pg">Change the volume during playback</h3>
-
- - The range of volume level is from 0 to 9. Each macro is MM_VOLUME_LEVEL_MIN and MM_VOLUME_LEVEL_MAX. The default volume level is 7.
- - Volume can be controlled during playback but, if volume is set before playing, it can be saved and applied at running time.
- - The following is a sample code to set MM_VOLUME_LEVEL_MAX volume and get it.
-
-@code
-int change_video_player_volume()
-{
- MMPlayerVolumeType volume;
- int i = 0;
-
- for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
- volume.level[i] = MM_VOLUME_LEVEL_MAX;
-
- if (mm_player_set_volume(g_player, &volume) != MM_ERROR_NONE)
- {
- printf("failed to set volume\n");
- return FALSE;
- }
-
- if (mm_player_get_volume(g_player, format, &pos) != MM_ERROR_NONE)
- {
- printf("failed to get volume\n");
- return FALSE;
- }
-
- for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
- printf("channel[%d] = %d \n", i, volume.level[i]);
-}
-@endcode
-@}
-@defgroup Player_uc8 Seeking position
-@ingroup Player_UC
-@{
-
-<h3 class="pg">Seeking position</h3>
-
- - Player supports time and percent format to get or set position of stream.
- - The position unit is in milliseconds.
- - The following is a sample code to get and set the player position.
-
-@code
-gboolean change_video_player_position()
-{
- int format = MM_PLAYER_POS_FORMAT_TIME;
- int pos = 15000; // 15sec
-
- if (mm_player_set_position(g_player, format, pos) != MM_ERROR_NONE)
- {
- return FALSE;
- }
-
- if (mm_player_get_position(g_player, format, &pos) != MM_ERROR_NONE)
- {
- return FALSE;
- }
- printf("current pos = %d (msec)\n", pos);
-
- return TRUE;
-}
-@endcode
-
-@}
-@defgroup Player_uc9 Show subtitle
-@ingroup Player_UC
-@{
-
-<h3 class="pg">Show subtitle</h3>
-
- - Player framework can support a separate subtitle file. The filepath of subtitle should be sent through mm_player_set_attribute() before realizing the player.
-
-@code
-
-if (mm_player_set_attribute(g_player,
- &g_err_name,
- "subtitle_uri",subtitle_path,strlen(subtitle_path),
- NULL) != MM_ERROR_NONE)
-{
- printf("failed to set %s\n", *g_err_name);
- free(g_err_name);
-}
-@endcode
-
- - Application shall select the option of whether to show the subtitle or not.
-
-@code
-if (mm_player_set_subtitle_silent(g_player, TRUE) != MM_ERROR_NONE)
- printf("failed to set subtitle silent\n");
-@endcode
-
-
- - Finally, application should get the parsed text data from message of callback function.
-
-
-@code
-void video_player_message_callback(int message, void *param, void *user_param)
-{
- struct appdata *ad = (struct appdata *)user_param;
- MMMessageParamType* msg_param = (MMMessageParamType*)param;
-
- switch(message)
- {
- case MM_MESSAGE_SUBTITLE:
- if (msg_param->data != NULL)
- {
- ad->subtitle_duration = msg_param->subtitle.duration/1000;
- strcpy(ad->subtitle, msg_param->data);
- show_video_player_subtitle(ad);
- }
- break;
-
-
- default:
- break;
-
- }
-}
-@endcode
-
-@}
-@defgroup MMsession Multimedia session
-@ingroup MultiMediaPG
-@{
- @brief <sub class="ref">Also see</sub> Use Cases of @ref MMsession_UC
-
-<h2 class="pg">Multimedia session</h2>
-
-Role of Multimedia Session is to manage "operation policy" between multimedia applications in multi-tasking scenario
-
-Multimedia Session provides functions to determine type of application's policy.
-
-Application developer can define applications' session type as "shared", "exclusive" or "replace".
-
-"Shared" type means the audio session is shared with other applications, if possible. The audio resources can be used by other applications.
-
-"Exclusive" type means using the audio session exclusively. Other applications are not allowed to use multimedia resources during this time.
-
-"Replace" type means this will make stop previous session but allows sharing session with following application.
-
-
-The following are supported functions :
-
- - int mm_session_init(int sessiontype)
-
- - int mm_session_finish(void)
-
-@}
-@defgroup MMsession_uc1 Initializing Session
-@ingroup MMsession_UC
-@{
-
-
-Initializing Session
-
- - To define current application's multimedia session policy.
-
- - Policy can be one of SHARE, EXCLUSIVE or REPLACE.
-
- - The following is a sample code
-
-
-@code
-int err;
-
-
-
-// Init session policy to SHARE
-
-err = mm_session_init (MM_SESSION_TYPE_SHARE);
-
-
-
-if (err != MM_ERROR_NONE)
-
- return;
-
-
-
-// Multimedia API manipulation (player, camcorder, etc.)
-@endcode
-
-@}
-@defgroup MMsession_uc2 Finisihing Session
-@ingroup MMsession_UC
-@{
-
-Finisihing Session
-
- - To finish current application's multimedia session policy
-
- - This API is not mandatory except internal call application.
-
- - This API can be also useful when application's multimedia session should be changed at runtime.
-
- - The following is a sample code
-
-@code
-int err;
-
-
-
-// Init session policy to SHARE
-
-err = mm_session_init (MM_SESSION_TYPE_SHARE);
-
-
-
-if (err != MM_ERROR_NONE)
-
- return;
-
-
-
-// Do something
-
-
-
-// Change policy to EXCLUSIVE
-
-err = mm_session_finish();
-
-
-
-// Init session policy to EXCLUSIVE
-
-err = mm_session_init (MM_SESSION_TYPE_EXCLUSIVE);
-
-
-
-// Do something else
-@endcode
-
-@}
-@defgroup MM_Fileinfo Fileinfo
-@ingroup MultiMediaPG
-@{
-<h2 class="pg">Fileinfo</h2>
- @brief <sub class="ref">Also see</sub> Use Cases of @ref Fileinfo_UC
-
-Fileinfo module provides APIs to extract media property information and meta data from media content. These values can be used to display detailed information of the media content without playing it.
-
-
-
-For convenience, the file module provides an additional two APIs (mm_file_get_content_attr_from_memory, mm_file_get_tag_attr_from_memory) which manipulate the source data from memory instead of the file. They act the same as normal APIs (mm_file_get_content_attr, mm_file_get_tag_attr).
-
-
-
-For performance, the file module provides an additional two APIs (mm_file_get_stream_info, mm_file_get_content_attr_simple) which extract the audio/video track count without time consuming operations.
-
-
-
-The following are supported functions
- - int mm_file_get_content_attr (MMHandleType *attrs, const char *filename)
-
- - int mm_file_get_content_attr_from_memory (MMHandleType *attrs, const void *data, unsigned int size, int format)
-
- - int mm_file_get_content_attr_simple (MMHandleType *attrs, const char *filename)
-
- - int mm_file_free_content_attr (MMHandleType attrs)
-
- - int mm_file_get_tag_attr ((MMHandleType *attrs, const char *filename)
-
- - int mm_file_get_tag_attr_from_memory ((MMHandleType *attrs, const void *data, unsigned int size, int format)
-
- - int mm_file_free_tag_attr ((MMHandleType attrs)
-
- - int mm_file_get_stream_info (const char *filename, int *audio_stream_num, int *video_stream_num)
-
-
-
-@}
-@defgroup Fileinfo_uc1 Extracting Media Property Information
-@ingroup Fileinfo_UC
-@{
-
-<h3 class="pg">Extracting Media Property Information </h3>
-
-Media property information can be extracted using the following steps:
-
- - Get attributes handle containing media information using mm_file_get_content_attr API
-
- - Use attributes functions with handle to get value
-
- - Free allocated media information using mm_file_free_content_attr API
-
-
-
-The following is a sample code
-
-@code
-MMHandleType attrs;
-
-int err;
-
-
-
-err = mm_file_get_content_attr(&attrs, filename);
-
-if (err != MM_ERROR_NONE)
-
-{
-
- printf("error occurred to extract media information\n");
-
- exit(1);
-
-}
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_DURATION, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("duration: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_VIDEO_CODEC, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("video codec id: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_VIDEO_BITRATE, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("video bitrate: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_VIDEO_FPS, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("fps: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_VIDEO_WIDTH, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("width: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_VIDEO_HEIGHT, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("height: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_VIDEO_THUMBNAIL, &data, &size);
-
-if (err == MM_ERROR_NONE)
-
- printf("thumbnail: %p, %d bytes\n", data, size);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_VIDEO_TRACK_ID, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("video track id: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_VIDEO_TRACK_NUM, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("video tracks: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_AUDIO_CODEC, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("audio codec id: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_AUDIO_BITRATE, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("audio bitrate: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_AUDIO_CHANNELS, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("channels: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_AUDIO_SAMPLERATE, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("sampling rate: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_AUDIO_TRACK_ID, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("audio track id: %d\n", val);
-
-
-
-err = mm_attrs_get_int(attrs, MM_FILE_CONTENT_AUDIO_TRACK_NUM, &val);
-
-if (err == MM_ERROR_NONE)
-
- printf("audio tracks: %d\n", val);
-
-
-
-err = mm_file_free_content_attr (attr);
-@endcode
-@}
-@defgroup Fileinfo_uc2 Extracting Media Meta(Tag) data
-@ingroup Fileinfo_UC
-@{
-
-<h3 class="pg">Extracting Media Meta(Tag) data</h3>
-
-Media meta data can be extracted using the following steps:
-
- - Get attributes handle containing meta data using mm_file_get_tag_attr API
-
- - Use attributes functions with handle to get value
-
- - Free allocated meta data using mm_file_free_tag_attr API
-
-
-
-The following is a sample code
-@code
-MMHandleType attrs;
-
-int err, val, size;
-
-char *str;
-
-void *data;
-
-double fval;
-
-
-
-err = mm_file_get_tag_attr (&attrs, filename);
-
-if (err != MM_ERROR_NONE)
-
-{
-
- printf("error occurred to extract meta data\n");
-
- exit(1);
-
-}
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_ARTIST, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("artist: %s\n", str);
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_TITLE, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("title: %s\n", str);
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_ALBUM, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("album: %s\n", str);
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_COPYRIGHT, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("copyright: %s\n", str);
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_DATE, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("date: %s\n", str);
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_DESCRIPTION, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("description: %s\n", str);
-
-
-
-err = mm_attrs_get_data(attrs, MM_FILE_TAG_ARTWORK, &data, &size);
-
-err |= mm_attrs_get_int(attrs, MM_FILE_TAG_ARTWORK_SIZE, &size);
-
-if (err == MM_ERROR_NONE && data && size > 0)
-
- printf("artwork: %p, %d\n", data, size);
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_TRACK_NUM, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("track: %s\n", str);
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_CLASSIFICATION, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("classification: %s\n", str);
-
-
-
-err = mm_attrs_get_string(attrs, MM_FILE_TAG_RATING, &str, &size);
-
-if (err == MM_ERROR_NONE && str)
-
- printf("rating: %s\n", str);
-
-
-
-err = mm_attrs_get_double(attrs, MM_FILE_TAG_LONGITUDE, &fval);
-
-if (err == MM_ERROR_NONE)
-
- printf("longitude: %4.4f\n", fval);
-
-
-
-err = mm_attrs_get_double(attrs, MM_FILE_TAG_LATIDUE, &fval);
-
-if (err == MM_ERROR_NONE)
-
- printf("latidue: %4.4f\n", fval);
-
-
-
-err = mm_attrs_get_double(attrs, MM_FILE_TAG_ALTIDUE, &fval);
-
-if (err == MM_ERROR_NONE)
-
- printf("altidue: %4.4f\n", fval);
-
-
-
-err = mm_file_free_tag_attr (attr);
-@endcode
-
-@}
-@defgroup Fileinfo_uc3 Extracting Stream information
-@ingroup Fileinfo_UC
-@{
-
-<h3 class="pg">Extracting Stream information</h3>
-
-Number of streams can be extracted using the following steps:
-
- - Get the number of streams using mm_file_get_stream_info API
-
- - Detect as video file if number of video streams is more than one.
-
-
-
-The following is a sample code
-
-@code
-int err;
-
-int audio_num;
-
-int video_num;
-
-
-
-err = mm_file_get_stream_info (filename, &audio_num, &video_num);
-
-if (err != MM_ERROR_NONE)
-
-{
-
- printf("error occurred to extract stream information\n");
-
- exit(1);
-
-}
-
-
-
-printf("content has %d audio streams\n", audio_num);
-
-printf("content has %d video streams\n", video_num);
-@endcode
-@}
-@defgroup MM_Sound Sound
-@ingroup MultiMediaPG
-@{
-
-<h2 class="pg">Sound</h2>
- @brief <sub class="ref">Also see</sub> Use Cases of @ref Sound_UC
-
-The Sound module has the following features:
-
-Play or capture PCM data with given memory buffer
-
-Play audio file with simple API ( uncompressed WAV file only)
-
-Control volume and audio routing information
-
-The following are supported functions :
-
- - int mm_sound_pcm_capture_close (MMSoundPcmHandle_t handle)
-
- - int mm_sound_pcm_capture_open (MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format)
-
- - int mm_sound_pcm_capture_read (MMSoundPcmHandle_t handle, void *buffer, const unsigned int length)
-
- - int mm_sound_pcm_play_close (MMSoundPcmHandle_t handle)
-
- - int mm_sound_pcm_play_open (MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format, const volume_type_t volume)
-
- - int mm_sound_pcm_play_write (MMSoundPcmHandle_t handle, void *ptr, unsigned int length_byte)
-
- - int mm_sound_play_dtmf (MMSoundDtmf_t num, const volume_type_t vol_type, const sound_time_msec_t time)
-
- - int mm_sound_play_sound (const char *filename, const volume_type_t volume, mm_sound_stop_callback_func callback, void *data, int *handle)
-
- - int mm_sound_stop_sound (int handle)
-
- - int mm_sound_volume_add_callback (volume_type_t type, volume_callback_fn func, void *user_data)
-
- - int mm_sound_volume_get_current_playing_type (volume_type_t *type)
-
- - int mm_sound_volume_get_step (volume_type_t type, int *step)
-
- - int mm_sound_volume_get_value (volume_type_t type, unsigned int *value)
-
- - int mm_sound_volume_primary_type_clear ()
-
- - int mm_sound_volume_primary_type_set (volume_type_t type)
-
- - int mm_sound_volume_remove_callback (volume_type_t type)
-
- - int mm_sound_volume_set_value (volume_type_t type, const unsigned int value)
-
- - int mm_sound_route_add_change_callback (audio_route_policy_changed_callback_fn func, void *user_data)
-
- - int mm_sound_route_get_system_policy (system_audio_route_t *route)
-
- - int mm_sound_route_is_a2dp_on (char **bt_name)
-
- - int mm_sound_route_remove_change_callback (void)
-
- - int mm_sound_route_set_system_policy (system_audio_route_t route)
-
-@}
-@defgroup Sound_uc1 Capture PCM data
-@ingroup Sound_UC
-@{
-
-<h3 class="pg">Capture PCM data</h3>
-
- - Application can capture PCM data
-
- - The following is a sample code
-
-
-@code
-
-bool g_stop_pcm_capturing = FALSE;
-int capture_pcm_data()
-{
- char *buffer = NULL;
- int ret = 0;
- int size = 0;
- int count = 0;
- MMSoundPcmHandle_t handle;
-
- size = mm_sound_pcm_capture_open(&handle, 44100, MMSOUND_PCM_MONO, MMSOUND_PCM_S16_LE);
- if(size < 0)
- {
- printf("Can not open capture handle\n");
- return -2;
- }
-
- buffer = alloca(size);
- while(1)
- {
- ret = mm_sound_pcm_capture_read(handle, (void*)buffer, size);
- if(ret < 0)
- {
- printf("read fail\n");
- break;
- }
- if( g_stop_pcm_capturing ) {
- break;
- }
- }
- mm_sound_pcm_capture_close(handle);
-
- return TRUE;
-}
-
-@endcode
-
-
-@}
-@defgroup Sound_uc2 Play sound file
-@ingroup Sound_UC
-@{
-
-<h3 class="pg">Play sound file</h3>
-
- - Start playing sound file
- - Stop playing sound file
- - Uncompressed WAV file only
-
-@code
-
-
-void sound_stop_cb(void* data)
-{
- struct appdata* ad = (appdata*) data;
- printf("Stop callback\n");
- ad->snd_handle = -1;
-}
-
-int play_file(void* data)
-{
- struct appdata* ad = (struct appdata*) data;
- char filename[] ="/opt/media/Sound/testfile.wav";
- volume_type_t volume = VOLUME_TYPE_SYSTEM;
- int ret = 0;
- int *snd_handle = NULL;
-
- snd_handle = &ad->snd_handle;
-
- ret = mm_sound_play_sound(filename, volume, sound_stop_cb, (void*)ad, snd_handle);
- if(ret < 0)
- {
- printf("play file failed\n");
- return -1;
- }
- else
- {
- printf("play file success\n");
- return 0;
- }
-}
-
-
-int stop_file(void* data)
-{
- int ret = 0;
- struct appdata* ad = (struct appdata*) data;
-
- if(ad->snd_handle != -1)
- {
- ret = mm_sound_stop_sound(ad->snd_handle);
- if(ret < 0)
- {
- printf("Stop sound failed\n");
- return -1;
- }
- else
- {
- printf("Stop sound success\n");
- return -1;
- }
- }
-}
-@endcode
-@}
-@defgroup Sound_uc3 Control Volume
-@ingroup Sound_UC
-@{
-
-
-<h3 class="pg">Control Volume</h3>
-
-Basically volume of SLP system is controlled by System process.
-But in some case, application should control volume by itself.
- - If application does not want to be hidden by System Volume UI.
- - If application want to use Volume H/W key for special purpose.
-
-Sample code to control Media type volume
-
-
-@code
-
-Eina_Bool volume_key_cb(void *data, int type, void *event_info)
-{
- struct appdata* ad = (struct appdata*)data;
- Ecore_Event_Key *kd = (Ecore_Event_Key*) event_info;
- int cur_vol = 0;
- int ret = 0;
-
- if(0 == strcmp(kd->keyname, KEY_VOLUMEUP))
- {
- ret = mm_sound_volume_get_value(ad->vol_type, &cur_vol);
- if(ret < 0)
- {
- printf("Can not get volume value\n");
- }
- else
- {
- if(cur_vol == ad->max_vol)
- {
- printf("Skip\n");
- }
- else
- {
- ret = mm_sound_volume_set_value(ad->vol_type, ++cur_vol);
- if(ret < 0)
- {
- printf("Can not set volume value\n");
- }
- }
- }
- }
- else if(0 == strcmp(kd->keyname, KEY_VOLUMEDOWN))
- {
- ret = mm_sound_volume_get_value(ad->vol_type, &cur_vol);
- if(ret < 0)
- {
- printf("Can not get volume value\n");
- }
- else
- {
- if(0 == ad->max_vol)
- {
- printf("Skip\n");
- }
- else
- {
- ret = mm_sound_volume_set_value(ad->vol_type, --cur_vol);
- if(ret < 0)
- {
- printf("Can not set volume value\n");
- }
- }
- }
- }
- else
- {
- printf("Skip\n");
- }
- return EINA_FALSE;
-}
-
-int do_key_grab(void* data)
-{
- struct appdata* ad = (struct appdata*)data;
- int ret = 0;
- int vol_max = 0;
-
- // grab key and add event handler
- if( utilx_grab_key(ad->disp, ad->win, KEY_VOLUMEUP, TOP_POSITION_GRAB) < 0)
- {
- printf("grab Volume up key fail\n");
- return -1;
- }
- if( utilx_grab_key(ad->disp, ad->win, KEY_VOLUMEDOWN, TOP_POSITION_GRAB) < 0)
- {
- printf("grab Volume down key fail\n");
- return -1;
- }
-
- ad->key_down = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, volume_key_cb, ad);
-
- //get max volume of type
- ad->vol_type = VOLUME_TYPE_MEDIA;
- ret = mm_sound_volume_get_step(ad->vol_type, &vol_max);
- if(ret < 0)
- {
- printf("Volume get step fail\n");
- return -1;
- }
-
- ad->vol_max = vol_max;
-
- return 0;
-}
-
-@endcode
-
-@}
-@defgroup MM_OpenAL OpenAL
-@ingroup MultiMediaPG
-@{
-
-
-<h2 class="pg">OpenAL</h2>
-
-OpenAL is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications. OpenAL in SLP only supports playback fucntion.
-
-
-
-OpenAL is opensource and if you need further information, see official website : http://connect.creativelabs.com/openal/default.aspx
-
-
-Specification and Reference
-
- - http://connect.creativelabs.com/openal/Documentation/Forms/AllItems.aspx
-
-@}
-@defgroup MM_Radio Radio
-@ingroup MultiMediaPG
-@{
-
-<h2 class="pg">Radio</h2>
- @brief <sub class="ref">Also see</sub> Use Cases of @ref Radio_UC
-
-This section describes APIs of the Multimedia FM radio library. Radio library is used for listening to FM radio, scanning all possible frequencies and seeking one frequency from current state, controling relative volume and frequency.
-
-
-
-Radio can have 5 states, and each state can be changed by calling the following functions as described.
-
- <table>
-
- <tr>
- <td>
-<b>FUNCTION</b>
- <td>
-<b>PRE-STATE</b>
- <td>
-<b>POST-STATE</b>
- <td>
-<b>SYNC TYPE</b>
- <tr>
- <td>
-mm_radio_create() <td>
-NONE <td>
-NULL <td>
-SYNC <tr>
- <td>
-mm_radio _destroy() <td>
-NULL <td>
-NONE <td>
-SYNC <tr>
- <td>
-mm_radio_realize() <td>
-NULL <td>
-READY <td>
-SYNC <tr>
- <td>
-mm_radio_unrealize() <td>
-READY <td>
-NULL <td>
-SYNC <tr>
- <td>
-mm_radio_start() <td>
-READY <td>
-PLAYING <td>
-SYNC <tr>
- <td>
-mm_radio_stop() <td>
-PLAYING <td>
-READY <td>
-SYNC <tr>
- <td>
-mm_radio_scan_start() <td>
-READY <td>
-SCANNING <td>
-ASYNC <tr>
- <td>
-mm_radio_scan_stop() <td>
-SCANNING <td>
-READY <td>
-ASYNC <tr>
- <td>
-Mm_radio_seek() <td>
-PLAYING <td>
-PLAYING <td>
-ASYNC
- </table>
-
-@image html SLP_MultimediaFW_PG_image004.png
-
-The following are supported functions in the radio module.
-
- - int mm_radio_get_state(MMHandleType hradio, MMRadioStateType *state)
-
- - int mm_radio_set_frequency(MMHandleType hradio, int freq)
-
- - int mm_radio_get_frequency(MMHandleType hradio, int *pFreq)
-
- - int mm_radio_set_sound_path(MMHandleType hradio, MMRadioOuputType path)
-
- - int mm_radio_get_sound_path (MMHandleType hrado, MMRadioOuputType *pPath)
-
- - int mm_radio_set_message_callback(MMHandleType radio, MMMessageCallback callback, void *user_param)
-
-@}
-@defgroup Radio_uc1 Create and initialize radio
-@ingroup Radio_UC
-@{
-
-<h3 class="pg">Create and initialize radio</h3>
-
- - Application can create the radio handle using mm_radio_create().
-
- - And, callback function must be set to get messages from radio engine using mm_radio_set_message_callback().
-
- - The followings messages are used.
- <table>
-
- <tr>
- <td> <b>MESSAGE TYPE</b> </td>
- <td> <b>DESCRIPTION</b> </td>
- <tr>
- <td> MM_MESSAGE_RADIO_SCAN_START
- <td> Radio frequency scanning initiated
- <tr>
- <td> MM_MESSAGE_RADIO_SCAN_INFO
- <td> Founded radio frequency report. check message parameters
- <tr>
- <td> MM_MESSAGE_RADIO_SCAN_FINISH
- <td> Radio frequency scanning has finished
- <tr>
- <td> MM_MESSAGE_RADIO_SCAN_STOP
- <td> Radio frequency scanning has stopped
- <tr>
- <td> MM_MESSAGE_RADIO_SEEK_START
- <td> Radio seeking has established
- <tr>
- <td> MM_MESSAGE_RADIO_SEEK_FINISH
- <td> Radio seeking has finished
-
- </table>
-
-
- - The resources can be allocated by mm_radio_realize(). And, radio device is opened.
-
-@code
-MMHandleType g_radio = 0;
-
-static int __msg_callback(int message, void *pParam, void *user_param)
-{
- MMMessageParamType* param = (MMMessageParamType*)pParam;
- MMHandleType radio = (MMHandleType *) user_param;
-
- int ret = 0;
-
- printf("incomming message : %d\n", message);
-
- switch(message)
- {
- case MM_MESSAGE_STATE_CHANGED:
- printf("MM_MESSAGE_STATE_CHANGED: current : %d old : %d\n"
- , param->state.current, param->state.previous);
- break;
-
- case MM_MESSAGE_RADIO_SCAN_START:
- printf("MM_MESSAGE_RADIO_SCAN_START\n");
- break;
-
- case MM_MESSAGE_RADIO_SCAN_INFO:
- printf("MM_MESSAGE_RADIO_SCAN_INFO : freq : %d\n", param->radio_scan.frequency);
- break;
-
- case MM_MESSAGE_RADIO_SCAN_STOP:
- printf("MM_MESSAGE_RADIO_SCAN_STOP\n");
- break;
-
- case MM_MESSAGE_RADIO_SCAN_FINISH:
- printf("MM_MESSAGE_RADIO_SCAN_FINISHED\n");
- break;
-
- case MM_MESSAGE_RADIO_SEEK_START:
- printf("MM_MESSAGE_RADIO_SEEK_START\n");
- break;
-
- case MM_MESSAGE_RADIO_SEEK_FINISH:
- printf("MM_MESSAGE_RADIO_SEEK_FINISHED : freq : %d\n", param->radio_scan.frequency);
- break;
-
- default:
- printf("ERROR : unknown message received!\n");
- break;
- }
- return true;
-}
-
-
-
-int init_radio(void)
-{
- int ret = MM_ERROR_NONE;
-
- mm_radio_create(&g_radio);
- mm_radio_set_message_callback( radio, (MMMessageCallback)__msg_callback,(void*) g_radio);
- mm_radio_realize(g_radio);
- mm_radio_unrealize(g_radio);
- mm_radio_destroy(g_radio);
-
- return ret;
-}
-@endcode
-@}
-@defgroup Radio_uc2 Destroy and close
-@ingroup Radio_UC
-@{
-
-<h3 class="pg">Destroy and close</h3>
-
- - The created radio should be destroyed when application is closed.
-
- - So, if mm_radio_unrealize() is called, radio device would be closed.
-
- - And, all allocated resources and the player handle are released by mm_radio_destroy().
-
-@code
-gboolean release_radio(void)
-{
- if (mm_radio_unrealize(g_radio) != MM_ERROR_NONE)
- {
- printf("failed to unrealize\n");
- return FALSE;
- }
-
- if (mm_radio_ destroy (g_radio) != MM_ERROR_NONE)
- {
- printf("failed to destroy\n");
- return FALSE;
- }
- return TRUE;
-}
-@endcode
-
-
-
-
-<b>Start and stop</b>
-
- - Application can start radio with mm_radio_start() and stop it with mm_radio_stop().
-
- - And, the frequency should be set before calling start.
-
-
-@code
-gboolean start_radio(void)
-{
- if (mm_radio_ set_frequency (g_radio, 1077) != MM_ERROR_NONE)
- {
- printf("failed to set freq\n");
-
- return FALSE;
- }
-
- if (mm_radio_start(g_radio) != MM_ERROR_NONE)
- {
- printf("failed to start\n");
-
- return FALSE;
- }
- return TRUE;
-}
-
-
-
-gboolean stop_radio(void)
-{
- if (mm_radio_stop(g_radio) != MM_ERROR_NONE)
- {
- printf("failed to stop\n");
-
- return FALSE;
- }
- return TRUE;
-}
-@endcode
-@}
-@defgroup Radio_uc3 Seek frequency
-@ingroup Radio_UC
-@{
-
-<h3 class="pg">Seek frequency</h3>
-
- - Application can seek the effective frequency of radio in playing state by mm_radio_seek().
-
- - After calling it, application have to check the state with MM_MESSAGE_RADIO_SEEK_START and MM_MESSAGE_RADIO_SEEK_FINISH which are sent through message callback.
-
- - And, if seek is finished, the frequency is sent through message parameter of callback function when MM_MESSAGE_RADIO_SEEK_FINISH is posted.
-
-
-@code
-gboolean seek_radio_frequency(void)
-{
- if (mm_radio_seek (g_radio) != MM_ERROR_NONE)
- {
- printf("failed to seek\n");
-
- return FALSE;
- }
- return TRUE;
-}
-@endcode
-@}
-@defgroup Radio_uc4 Scan frequencies
-@ingroup Radio_UC
-@{
-
-<h3 class="pg">Scan frequencies</h3>
-
- - Application can scan the effective frequency of radio in playing state by mm_radio_scan_start().
-
- - After calling it, application have to check the state with MM_MESSAGE_RADIO_SCAN_START , MM_MESSAGE_RADIO_SCAN_INFO, MM_MESSAGE_RADIO_SCAN_FINISH which are sent through message callback.
-
- - And, if frequency is found, it's sent through message parameter of callback function when . MM_MESSAGE_RADIO_SCAN_INFO is posted.
-
- - Finally, scanning can be stopped by mm_radio_scan_stop(). So, MM_MESSAGE_RADIO_SCAN_STOP will be sent.
-
-
-
-
-
-
-@}
-@defgroup Radio_uc5 Set/Get sound path
-@ingroup Radio_UC
-@{
-
-
-<h3 class="pg">Set/Get sound path</h3>
-
- - Applications can set/get sound path by mm_radio_set_sound_path() and mm_radio_get_sound_path().
-
- - The sound path type is followings .
-
-
- <table>
- <tr> <td>SOUND PATH TYPE </td> <td>DESCRIPTION </td> </tr>
- <tr> <td>MM_RADIO_OUTPUT_AUTO </td> <td>Automatic output mode, but not used yet </td> </tr>
- <tr> <td>MM_RADIO_OUTPUT_SPEAKER </td> <td> </td> </tr>
- <tr> <td> </td> <td> </td> </tr>
- </table>
-
-@}
-*/
-/**
- * @defgroup MultiMediaPG MultiMedia Camcorder,Player,Sound and Radio
- @{
- * @defgroup
- * @defgroup MM_UC Use Cases
- @{
- * @defgroup Camcorder_UC Camcorder
- * @defgroup Player_UC Player
- * @defgroup Sound_UC Sound
- * @defgroup MMsession_UC Multimedia session
- @brief <sub class="ref">Also see</sub> Feature description of @ref MMsession
- * @defgroup Fileinfo_UC Fileinfo
- @brief <sub class="ref">Also see</sub> Feature description of @ref Fileinfo
- * @defgroup Radio_UC Radio
- @brief <sub class="ref">Also see</sub> Feature description of @ref Radio
- @}
- @}
-*/
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-
-#ifndef __MM_H__
-#define __MM_H__
-
-#include <stdbool.h>
-
-#include <mm_types.h>
-#include <mm_error.h>
-#include <mm_message.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- @addtogroup COMMON
- @{
- * @file mm.h
- * @author
- * @version 1.0
- * @brief This file includes all the necessary header files of multimediaframework.
-
- @mainpage Multimedia Framework
-
- @par
- This document provides necessary information for developers who are going
- to implement multimedia application such as media player, voice recorder,
- and camera application and so on. Before entering into the detailed
- information, this also has described the overview, architecture design and
- each component of multimedia framework for the purpose of helping
- developers to understand concept or basic knowledge in relation to API for
- themselves.
-
- @par
- Here is outline as below.
-
- @par
- - @ref OVERVIEW
- - @ref ARCHITECTURE
- - @ref COMPONENT
- - @ref CONCEPT
-
- @section OVERVIEW Overview
-
- @par
- Multimedia Framework is designed to provide easy to use services for
- developing multimedia applications based on an embedded Linux platform.
-
- @par
- Multimedia framework API reference has defined APIs to support functions
- as below;
-
- @par
- - Playback of multimedia contents.
- - Playing system sounds.
- - Controlling volume information.
- - Controlling direction of sound input / output path.
- - Recording video stream from video input device such as camera
- - Recording audio stream from audio input device such as microphone
- - Capturing still image from video input device
- - Extract meta data information from file
-
- @par
- This document will describe architecture of multimedia framework, basic
- concept of design of application programming, and explain how to use this
- framework
-
- @section ARCHITECTURE Architecture Design
-
- @par
- The multimedia framework can be divided into three parts as follows;
-
- @par
- - Application Layer that provide high-level APIs to multimedia applications.
- - Internal Layer of Multimedia Framework.
- - Hardware/Platform Dependent Layer.
-
- @par
- Libraries which provide high-level APIs can be divided into five components
- again; Player, Sound, File, Image, and Camcorder. Basically each component
- can be loaded to memory independently to decrease memory foot print.
-
- @par
- The internal library is a library which is responsible for encoding /
- decoding multimedia stream. Application layer library uses this library
- for playback, or recording.
-
- @par
- Hardware / Platform dependent layer has dependency on hardware or platform.
- If hardware or platform has been changed, this layer library must be ported
- to that environment. So this can be called as Porting Layer.
-
- @par
- This architecture diagram below is a high-level diagram of multimedia
- framework and then also shows how multimedia framework works as well as its
- components.
-
- @image html architecture.png "Architecture Diagram" width=12cm
- @image latex architecture.png "Architecture Diagram" width=12cm
-
- @par
- Each components will be describes in more detail on Component Description
- section.
-
- @section COMPONENT Component Description
-
- @par
- As mentioned previous section, Multimedia Framework can be divided into
- 3 layers. Components for each layer of Multimedia Framework are as below;
-
- @par
- Application Export Layer
-
- @par
- - @ref MMFW ATTRS LIBRARY
- - @ref MMFW PLAYER LIBRARY
- - @ref MMFW CAMCORDER LIBRARY
- - @ref MMFW SOUND LIBRARY
- - @ref MMFW FILE LIBRARY
-
- @par
- Internal (Not exported) Layer
-
- @par
- - Multimedia Codec (Encoder / Decoder)
-
- @par
- Hardware/Platform Dependent Layer
-
- @par
- - MHAL (Multimedia Hardware Abstraction Layer)
- - AV System (Audio Video Input / Output System)
-
- @par
- Please refer to link for the further detailed description of each component.
-
- @section CONCEPT Basic Concept
-
- @par
- Basic design concept of Multimedia Framework API will be described in this
- section.
-
- @par
- 1. Naming Convention
-
- @par
- - Multimedia Framework APIs have a prefix with "MM" (stands for
- <B>M</B>ulti<B>M</B>edia <B>F</B>ramework). After this prefix, module name
- is followed by such as "MMPlayer_, MMSnd_, MMCam_".
-
- @par
- 2. Controlled by handle
-
- @par
- - Basically Multimedia Framework manipulates each instance by handle.
- Camcorder Library, Attributes Library belongs to this case. Sound Library
- does not have instance because it applies attributes directly to system.
-
- @par
- 3. Understand Attributes
-
- @par
- - Attributes are set of properties which each instance are configured.
- Basic understand is required for manipulating attributes. Please refer to
- @ref MMFW ATTRS LIBRARY "Attribute Library Description" to know how to use.
-
- @par
- 4. Messages
-
- @par
- - Application can be notified that change of state, error occurs, how much
- time has been elapsed after playing or recording through message callback.
- Message callback will be called as deferred, so any API can be called in
- this callback function.
-
- @par
- 5. Errors
-
- @par
- - Basically all Multimedia Framework API returns error code as return value.
- It returns zero (MM_ERROR_NONE) on success, or returns error code which is
- negative value. Each error code and range is defined in <mm_error.h> file.
-
- @par
- 6. How to build
-
- @par
- - Each library for offering high level API will provide Package Config file
- to support pkg-config command. Be sure to that it will be installed on your
- platform SDK directory. If you want to use player library, you just append
- "pkg-config" line to your build script. For example, just append
- "pkg-config --libs --cflags mmplayer" to your build script if you want to
- use player library. The dependency with respect of MMPlayer is already
- described within package config file. Therefore, all of developers have to
- do is just use it by themselves.
-*/
-
-#ifdef __cplusplus
-}
-#endif
-/**
- @}
- */
-#endif /* __MM_H__ */
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-
-
-#ifndef __MM_ATTRS_H__
-#define __MM_ATTRS_H__
-
-#include <stdarg.h>
-#include <mm_types.h>
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
-/**
- @addtogroup COMMON
- @{
-
- * @file mm_attrs.h
- * @version 1.0
- * @brief This file declares data structures and functions of attribute library.
-
- @par
- This part describes the APIs with respect to Multimedia Attribute Library.
- The Attribute Library is a set of attribute. An attribute contains a value,
- access flags and it's validation information. This document explains how to
- manipulate an attribute in the Attribute Library.
-
- */
-
-/**
- * Enumeration for attribute values types.
- */
-typedef enum{
- MM_ATTRS_TYPE_INVALID = -1, /**< Type is invalid */
- MM_ATTRS_TYPE_INT, /**< Integer type attribute */
- MM_ATTRS_TYPE_DOUBLE, /**< Double type attribute */
- MM_ATTRS_TYPE_STRING, /**< UTF-8 String type attribute */
- MM_ATTRS_TYPE_DATA, /**< Pointer type attribute */
- MM_ATTRS_TYPE_ARRAY, /**< Array type attribute */
- MM_ATTRS_TYPE_RANGE, /**< Range type attribute */
- MM_ATTRS_TYPE_NUM, /**< Number of attribute type */
-}MMAttrsType;
-
-/**
- * Enumeration for attribute validation type.
- */
-typedef enum {
- MM_ATTRS_VALID_TYPE_INVALID = -1, /**< Invalid validation type */
- MM_ATTRS_VALID_TYPE_NONE, /**< Do not check validity */
- MM_ATTRS_VALID_TYPE_INT_ARRAY, /**< validity checking type of integer array */
- MM_ATTRS_VALID_TYPE_INT_RANGE, /**< validity checking type of integer range */
- MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY, /**< validity checking type of double array */
- MM_ATTRS_VALID_TYPE_DOUBLE_RANGE, /**< validity checking type of double range */
-} MMAttrsValidType;
-
-/**
- * Enumeration for attribute access flag.
- */
-typedef enum {
- MM_ATTRS_FLAG_NONE = 0, /**< None flag is set */
- MM_ATTRS_FLAG_READABLE = 1 << 0, /**< Readable */
- MM_ATTRS_FLAG_WRITABLE = 1 << 1, /**< Writable */
- MM_ATTRS_FLAG_MODIFIED = 1 << 2, /**< Modified */
-
- MM_ATTRS_FLAG_RW = MM_ATTRS_FLAG_READABLE | MM_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
-} MMAttrsFlag;
-
-
-/**
- * Validity structure
- */
-typedef struct {
- MMAttrsType type;
- MMAttrsFlag flag;
- MMAttrsValidType validity_type;
-
- /**
- * a union that describes validity of the attribute.
- * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
- * the attribute can have validity.
- */
- union {
- /**
- * Validity structure for integer array.
- */
- struct {
- int * array; /**< a pointer of array */
- int count; /**< size of array */
- } int_array;
-
- /**
- * Validity structure for integer range.
- */
- struct {
- int min; /**< minimum range */
- int max; /**< maximum range */
- } int_range;
-
- /**
- * Validity structure for double array.
- */
- struct {
- double * array; /**< a pointer of array */
- int count; /**< size of array */
- } double_array;
-
- /**
- * Validity structure for double range.
- */
- struct {
- double min; /**< minimum range */
- double max; /**< maximum range */
- } double_range;
- };
-} MMAttrsInfo;
-
-
-#if __GNUC__ >= 4
-#define __NULL_TERMINATED __attribute__((__sentinel__))
-#else
-#define __NULL_TERMINATED
-#endif
-
-/**
- * This function is to set the integer value to the attribute by name.
- * @param attrs [in] MMAttrs handle
- * @param attr_name [in] attribute name
- * @param val [in] integer value to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- */
-int mm_attrs_set_int_by_name(MMHandleType attrs, const char *attr_name, int val);
-
-
-/**
- * This function is to get the number of attribute in the MMAttrs.
- * @param attrs [in] Handle of attributes list
- * @param size [out] Number of attributes
- * @return This function returns the number of attributes in the attribute list.
- */
-int mm_attrs_get_size(MMHandleType attrs, int *size);
-
-
-/**
- * This function is to get the name of attribute at the given index.
- * @param attrs [in] Handle of attributes list
- * @param index [in] Index of the attribute
- * @param name [out] Name of attribute
- * @return This function returns the name of attribute on success, or NULL
- * on failure.
- */
-int mm_attrs_get_name(MMHandleType attrs, int index, char **name);
-
-
-/**
- * This function is to get the index of attribute at the given name.
- * @param attrs [in] Handle of attributes list
- * @param attr_name [in] Name of attribute
- * @param index [out] Index of attribute
- * @return This function returns the index of the attribute on success,
- * or negative value on failure.
- */
-int mm_attrs_get_index(MMHandleType attrs, const char *attr_name, int *index);
-
-
-/**
- * This function is to get the integer value from the attribute by name.
- * @param attrs [in] Handle of attributes list
- * @param attr_name [in] Name of attribute
- * @param val [out] Value of attribute
- * @return This function returns attribute value
- */
-int mm_attrs_get_int_by_name(MMHandleType attrs, const char *attr_name, int *val);
-
-
-/**
- * This function is to set the string to attribute by name.
- * @param attrs [in] MMAttrs handle
- * @param attr_name [in] attribute name
- * @param string [in] string value to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- */
-int mm_attrs_set_string_by_name(MMHandleType attrs, const char *attr_name, const char *string);
-
-
-/**
- * This function is to get the string from the attribute by name.
- * @param attrs [in] Handle of attributes list
- * @param attr_name [in] Name of attribute
- * @param val [out] Value of attribute
- * @return This function returns the string value of attribute on success,
- * or NULL on failure
- */
-int mm_attrs_get_string_by_name(MMHandleType attrs, const char *attr_name, char **val);
-
-
-/**
- * This function is to set the data to the attribute by name.
- * @param attrs [in] MMAttrs handle
- * @param attr_name [in] attribute name
- * @param data [in] data pointer to set
- * @param size [in] data size to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- */
-int mm_attrs_set_data_by_name(MMHandleType attrs, const char *attr_name, void *data, int size);
-
-/**
- * This function is to get the data from the attribute by name.
- * @param attrs [in] Handle of attributes list
- * @param attr_name [in] Name of attribute
- * @param data [out] data pointer to set
- * @return This function returns user defined value on success, or NULL
- * on failure
- */
-int mm_attrs_get_data_by_name(MMHandleType attrs, const char *attr_name, void **data);
-
-
-/**
- * This function is to retrieve type of attribute.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param attrtype [out] On return contains type of attribute
- * @return This function returns MM_ERROR_NONE.
- * @see MMAttrsType
- */
-int mm_attrs_get_type(MMHandleType attrs, int id, MMAttrsType *attrtype);
-
-
-/**
- * This function is to get flags of attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param flags [out] On return contains flags of attribute.
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @see MMAttrsFlag
- */
-int mm_attrs_get_flags(MMHandleType attrs, int id, int *flags);
-
-
-/**
- * This function is to get valid value type of attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param type [out] On return contains valid value type of attribute
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @see MMAttrsType
- */
-int mm_attrs_get_valid_type(MMHandleType attrs, int id, int *type);
-
-
-/**
- * This function is to get valid range of attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param min [out] minimum value of the valid range.
- * @param max [out] maximum value of the valid range.
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- */
-int mm_attrs_get_valid_range(MMHandleType attrs, int id, int *min, int *max);
-
-
-/**
- * This function is to get valid array of attribute with given id.
- * @param attrs [in] list of attributes
- * @param id [in] ID of attribute
- * @param count [out] number of array
- * @param array [out] on return contains valid array of attribute
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- */
-int mm_attrs_get_valid_array(MMHandleType attrs, int id, int *count, int **array);
-
-
-/**
- * This function is to get valid double type range of attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param min [out] minimum value of the valid range.
- * @param max [out] maximum value of the valid range.
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- */
-int mm_attrs_get_valid_double_range(MMHandleType h, int idx, double *min, double *max);
-
-
-/**
- * This function is to get valid double type array of attribute with given id.
- * @param attrs [in] list of attributes
- * @param id [in] ID of attribute
- * @param count [out] number of array
- * @param array [out] on return contains valid array of attribute
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- */
-int mm_attrs_get_valid_double_array(MMHandleType h, int idx, int *count, double **array);
-
-
-/**
- * This function is to set integer value to attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param val [in] integer value to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @see mm_attrs_get_int
- */
-int mm_attrs_set_int(MMHandleType attrs, int id, int val);
-
-
-/**
- * This function is to get integer value to attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param val [out] On return contains integer value of attribute
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks If type of attributes is not an integer type, the value which is returned by this function is meaningless.
- * @see mm_attrs_get_int
- */
-int mm_attrs_get_int(MMHandleType attrs, int id, int *val);
-
-
-/**
- * This function is to set double value to attribute with given id.
- *
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param val [in] Integer value to set
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @see mm_attrs_get_double
- */
-int mm_attrs_set_double(MMHandleType attrs, int id, double val);
-
-
-/**
- * This function is to set the double value to the attribute by name.
- *
- * @param attrs [in] Handle of attributes list
- * @param attr_name [in] Name of attribute
- * @param val [in] Integer value to set
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- */
-int mm_attrs_set_double_by_name(MMHandleType attrs, const char *attr_name, double val);
-
-
-/**
- * This function is to get double value to attribute with given id.
- *
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param attrval [out] On return contains double value of attribute on success, or invalid value.
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @see mm_attrs_set_double
- */
-int mm_attrs_get_double(MMHandleType attrs, int id, double *attrval);
-
-
-/**
- * This function is to get the double value from the attribute by name.
- *
- * @param attrs [in] Handle of attributes list
- * @param attr_name [in] Name of attribute
- * @param val [out] Double value to set
- *
- * @return This function returns attribute value
- */
-int mm_attrs_get_double_by_name(MMHandleType attrs, const char *attr_name, double *val);
-
-
-/**
- * This function is to set string to attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param string [in] String to set
- * @param size [in] length of string to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @see mm_attrs_get_string
- */
-int mm_attrs_set_string(MMHandleType attrs, int id, const char *string, int size);
-
-
-/**
- * This function is to get string to attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param sval [in] Placeholder to output string buffer
- * @param size [in] The field contains number of characters filled in the buffer
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Application would be responsible for managing/releasing the string
- * @see mm_attrs_set_string
- */
-int mm_attrs_get_string(MMHandleType attrs, int id,char **sval, int *size);
-
-
-/**
- * This function is to set pointer to attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param data [in] data to set
- * @param size [in] Length of input data
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Data type is the reference to memory which is allocated by user. The allocated memory must be freed by user.
- * @see mm_attrs_get_data
- */
-int mm_attrs_set_data(MMHandleType attrs, int id, void *data, int size);
-
-/**
- * This function is to get pointer to attribute with given id.
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param data [out] Placeholder to output data buffer
- * @param size [out] The field contains number of bytes filled in the buffer
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Application would be responsible for managing/releasing data
- * @see mm_attrs_set_data
- */
-int mm_attrs_get_data(MMHandleType attrs, int id, void **data, int *size);
-
-/**
- * This function is to set range of attribute with given id.
- *
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param min [in] Minimum value of range
- * @param max [in] Maximum value of range
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @see mm_attrs_get_range
- */
-int mm_attrs_set_range(MMHandleType attrs, int id, int min, int max);
-
-/**
- * This function is to get range of attribute with given id.
- *
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param min [out] Minimum value of range
- * @param max [out] Maximum value of range
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @see mm_attrs_set_range
- */
-int mm_attrs_get_range(MMHandleType attrs, int id, int *min, int *max);
-
-/**
- * This function is to set array of attribute with given id.
- *
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param array [in] Array of integer values
- * @param count [in] Count of array
- *
- * @return This function returns the array of attribute on success, or NULL pointer on failure.
- * @see mm_attrs_get_array
- */
-int mm_attrs_set_array(MMHandleType attrs, int id, int *array, int count);
-
-/**
- * This function is to get array of attribute with given id.
- *
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param array [out] Contains the array of attribute on success,
- * or NULL pointer on failure.
- * @param count [out] Count of array
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Application would be responsible for managing/releasing the array
- * @see mm_attrs_set_array
- */
-int mm_attrs_get_array(MMHandleType attrs, int id, int **array, int *count );
-
-
-/**
- * A function to get information of the attribute
- *
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param array [out] Contains the array of attribute on success,
- * or NULL pointer on failure.
- * @param count [out] Count of array
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Application would be responsible for managing/releasing the array
- * @see mm_attrs_set_info
- */
-int mm_attrs_get_info(MMHandleType h, int idx, MMAttrsInfo *info);
-
-
-/**
- * This function is to get array of attribute with given id.
- *
- * @param attrs [in] List of attributes
- * @param id [in] ID of attribute
- * @param array [out] Contains the array of attribute on success,
- * or NULL pointer on failure.
- * @param count [out] Count of array
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Application would be responsible for managing/releasing the array
- * @see mm_attrs_set_array
- */
-int mm_attrs_get_info_by_name(MMHandleType h, const char *attr_name, MMAttrsInfo *info);
-
-/**
- * Sets properties on an object.
-
- * @param attrs [in] List of attributes
- * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
- * @param attribute_name [in] name of the first property to set
- * @param ... [in] value for the first property, followed optionally by more
- * name/value pairs, followed by %NULL
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Multiple setter of attribute
- * @see mm_attrs_set_int, mm_attrs_set_string, ...
- */
-int mm_attrs_multiple_set(MMHandleType handle, char **err_attr_name, const char *attribute_name, ...) __NULL_TERMINATED;
-
-
-/**
- * Gets properties on an object.
-
- * @param attrs [in] List of attributes
- * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
- * @param attribute_name [in] name of the first property to set
- * @param ... [in] value for the first property, followed optionally by more
- * name/value pairs, followed by %NULL
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Multiple setter of attribute
- * @see mm_attrs_set_int, mm_attrs_set_string, ...
- */
-int mm_attrs_multiple_get(MMHandleType handle, char **err_attr_name, const char *attribute_name, ...) __NULL_TERMINATED;
-
-
-/**
- * Sets properties on an object with va_list param.
-
- * @param attrs [in] List of attributes
- * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
- * @param attribute_name [in] name of the first property to set
- * @param var_args [in] variable arguments
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Multiple setter of attribute
- * @see mm_attrs_multiple_set
- */
-int mm_attrs_set_valist (MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args);
-
-
-/**
- * Gets properties on an object with va_list param.
-
- * @param attrs [in] List of attributes
- * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
- * @param attribute_name [in] name of the first property to set
- * @param var_args [in] variable arguments
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Multiple setter of attribute
- * @see mm_attrs_multiple_get
- */
-int mm_attrs_get_valist (MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* __MM_ATTRS_H__ */
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-#ifndef MMF_ATTRS_PRIVATE_H_
-#define MMF_ATTRS_PRIVATE_H_
-
-#include <stdbool.h>
-#include <mm_types.h>
-#include <mm_attrs.h>
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define MMF_IS_VALUE_TYPE(t) ((t) == MMF_VALUE_TYPE_INT || \
- (t) == MMF_VALUE_TYPE_DOUBLE || \
- (t) == MMF_VALUE_TYPE_STRING || \
- (t) == MMF_VALUE_TYPE_DATA)
-
-#define MMF_IS_VALUE_SPEC_TYPE(t) ((t) == MMF_VALUE_SPEC_NONE || \
- (t) == MMF_VALUE_SPEC_INT_ARRAY || \
- (t) == MMF_VALUE_SPEC_INT_RANGE) || \
- (t) == MMF_VALUE_SPEC_DOUBLE_ARRAY || \
- (t) == MMF_VALUE_SPEC_DOUBLE_RANGE)
-
-enum mmf_value_type {
- MMF_VALUE_TYPE_INT = MM_ATTRS_TYPE_INT,
- MMF_VALUE_TYPE_DOUBLE=MM_ATTRS_TYPE_DOUBLE,
- MMF_VALUE_TYPE_STRING = MM_ATTRS_TYPE_STRING,
- MMF_VALUE_TYPE_DATA = MM_ATTRS_TYPE_DATA,
-};
-
-enum mmf_value_spec_type {
- MMF_VALUE_SPEC_NONE = MM_ATTRS_VALID_TYPE_NONE,
- MMF_VALUE_SPEC_INT_ARRAY = MM_ATTRS_VALID_TYPE_INT_ARRAY,
- MMF_VALUE_SPEC_INT_RANGE = MM_ATTRS_VALID_TYPE_INT_RANGE,
- MMF_VALUE_SPEC_DOUBLE_ARRAY = MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY,
- MMF_VALUE_SPEC_DOUBLE_RANGE = MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
-};
-
-typedef struct mmf_value mmf_value_t;
-typedef struct mmf_value_spec mmf_value_spec_t;
-typedef struct mmf_attribute mmf_attribute_t;
-typedef struct mmf_attrs mmf_attrs_t;
-typedef struct mmf_attrs_list mmf_attrs_list_t;
-typedef struct mmf_attribute_construct_info mmf_attrs_construct_info_t;
-
-typedef bool (*mmf_attrs_commit_func_t)(int attr_idx,
- const char* attr_name,
- const mmf_value_t *value,
- void *commit_param);
-
-struct mmf_value {
- int type;
- int size;
- union {
- int i_val;
- double d_val;
- char *s_val;
- void *p_val;
- } value;
-};
-
-struct mmf_value_spec {
- int type;
- union {
- union {
- struct {
- int *array;
- int count;
- } array;
- struct {
- int min;
- int max;
- } range;
- } int_spec;
- union {
- struct {
- double *array;
- int count;
- } array;
- struct {
- double min;
- double max;
- } range;
- } double_spec;
- struct {
- int max_length;
- } string_spec;
- } spec;
-};
-
-struct mmf_attribute {
- char *name;
- int flags;
- mmf_value_t value;
- mmf_value_t tmpval;
- mmf_value_spec_t value_spec;
-};
-
-struct mmf_attrs {
- char *name;
- int count;
- mmf_attribute_t *items;
- mmf_attrs_commit_func_t commit_func;
- void *commit_param;
-};
-
-struct mmf_attrs_list {
- MMHandleType attrs;
- mmf_attrs_list_t *next;
-};
-
-struct mmf_attribute_construct_info {
- char *name;
- int value_type;
- int flags;
- void *default_value;
-};
-
-int mmf_value_init(mmf_value_t *value, int type);
-
-int mmf_value_copy(mmf_value_t *dest, const mmf_value_t *src);
-
-int mmf_value_set_int(mmf_value_t *v, int ival);
-
-int mmf_value_get_int(const mmf_value_t *v);
-
-int mmf_value_set_double(mmf_value_t *v, double dval);
-
-double mmf_value_get_double(mmf_value_t *v);
-
-int mmf_value_set_string(mmf_value_t *v, const char *sval, int size);
-
-const char* mmf_value_get_string(const mmf_value_t *v, int *size);
-
-int mmf_value_set_data(mmf_value_t *v, void *data, int size);
-
-void* mmf_value_get_data(const mmf_value_t *v, int *size);
-
-void mmf_value_dump(const mmf_value_t *value);
-
-int mmf_value_clear(mmf_value_t *value);
-
-int mmf_value_spec_init(mmf_value_spec_t *vs, int vs_type);
-
-int mmf_value_spec_set_int_range(mmf_value_spec_t *vs, int min, int max);
-
-int mmf_value_spec_get_int_range(mmf_value_spec_t *vs, int *min, int *max);
-
-int mmf_value_spec_set_int_array(mmf_value_spec_t *vs, const int *array, int count);
-
-int mmf_value_spec_get_int_array(mmf_value_spec_t *vs, int **array, int *count);
-
-int mmf_value_spec_set_double_range(mmf_value_spec_t *vs, double min, double max);
-
-int mmf_value_spec_get_double_range(mmf_value_spec_t *vs, double *min, double *max);
-
-int mmf_value_spec_set_double_array(mmf_value_spec_t *vs, const double *array, int count);
-
-int mmf_value_spec_get_double_array(mmf_value_spec_t *vs, double **array, int *count);
-
-int mmf_value_spec_clear(mmf_value_spec_t *vs);
-
-int mmf_attribute_init(mmf_attribute_t *item, const char *name, int value_type, int flags);
-
-bool mmf_attribute_check_flags(mmf_attribute_t *item, int flags);
-
-bool mmf_attribute_validate_int(mmf_attribute_t *item, int val);
-
-bool mmf_attribute_validate_double(mmf_attribute_t *item, double val);
-
-void mmf_attribute_clear(mmf_attribute_t *item);
-
-bool mmf_attribute_is_modified(mmf_attribute_t *item);
-
-void mmf_attribute_set_modified(mmf_attribute_t *item);
-
-void mmf_attribute_set_readonly(mmf_attribute_t *item);
-
-void mmf_attribute_set_disabled(mmf_attribute_t *item);
-
-void mmf_attribute_commit(mmf_attribute_t *item);
-
-int mmf_attribute_set_int(mmf_attribute_t *item, int val);
-
-int mmf_attribute_set_double(mmf_attribute_t *item, double val);
-
-int mmf_attribute_set_string(mmf_attribute_t *item, const char *string, int size);
-
-int mmf_attribute_set_data(mmf_attribute_t *item, void *data, int size);
-
-/* --- Create, Destroy and Initialize MmfAttrs --- */
-
-MMHandleType mmf_attrs_new(int count);
-
-MMHandleType mmf_attrs_new_from_data(const char *name,
- mmf_attrs_construct_info_t *info,
- int count,
- mmf_attrs_commit_func_t commit_func,
- void *commit_param);
-
-void mmf_attrs_free(MMHandleType attrs);
-
-int mmf_attrs_init(MMHandleType h, mmf_attrs_construct_info_t *info, int count);
-
-int mmf_attrs_commit(MMHandleType h);
-
-int mmf_attrs_commit_err(MMHandleType h, char **err_attr_name);
-
-int mmf_attrs_set_valid_type(MMHandleType h, int idx, int v_type);
-
-int mmf_attrs_set_valid_range(MMHandleType h, int idx, int min, int max);
-
-int mmf_attrs_set_valid_array(MMHandleType h, int idx, const int *array, int count);
-
-int mmf_attrs_set_valid_double_range(MMHandleType h, int idx, double min, double max);
-
-int mmf_attrs_set_valid_double_array(MMHandleType h, int idx, const double *array, int count);
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /*MMF_ATTRS_PRIVATE_H_*/
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-
-
-/* ===========================================================================================
-EDIT HISTORY FOR MODULE
-
- This section contains comments describing changes made to the module.
- Notice that changes are listed in reverse chronological order.
-
-when who what, where, why
---------- -------------------- ----------------------------------------------------------
-09/28/07 jhchoi.choi@samsung.com Created
-10/03/30 seungbae.shin@samsung.com Revised (remove some ifdefs)
-
-=========================================================================================== */
-#ifndef __MMF_DEBUG_H__
-#define __MMF_DEBUG_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-enum {
- MMF_DEBUG_LEVEL_0,
- MMF_DEBUG_LEVEL_1,
- MMF_DEBUG_LEVEL_2,
- MMF_DEBUG_LEVEL_3,
- MMF_DEBUG_LEVEL_4,
- MMF_DEBUG_LEVEL_5,
- MMF_DEBUG_LEVEL_ALL,
-
- MMF_DEBUG_CRITICAL = MMF_DEBUG_LEVEL_0,
- MMF_DEBUG_ERROR = MMF_DEBUG_LEVEL_1,
- MMF_DEBUG_WARNING = MMF_DEBUG_LEVEL_2,
- MMF_DEBUG_LOG = MMF_DEBUG_LEVEL_3,
- MMF_DEBUG_VERBOSE = MMF_DEBUG_LEVEL_4,
-
- MMF_DEBUG_PROFILE = MMF_DEBUG_LEVEL_0,
-};
-
-enum {
- MMF_DEBUG_COLOR_DEFAULT = 0,
- MMF_DEBUG_COLOR_BLACK = 30,
- MMF_DEBUG_COLOR_RED = 31,
- MMF_DEBUG_COLOR_GREEN = 32,
- MMF_DEBUG_COLOR_YELLOW = 33,
- MMF_DEBUG_COLOR_BLUE = 34,
- MMF_DEBUG_COLOR_MAGENTA = 35,
- MMF_DEBUG_COLOR_CYAN = 36,
- MMF_DEBUG_COLOR_WHITE = 37,
-};
-
-/******************************************************************************
- *
- * DEBUG CONFIGURATION
- *
- *****************************************************************************/
-#ifndef MMF_LOG_OWNER
-#define MMF_LOG_OWNER LOG_NONE
-#endif
-
-#ifndef MMF_DEBUG_LEVEL
-#define MMF_DEBUG_LEVEL 4
-#endif
-
-#ifndef MMF_DEBUG_PREFIX
-#define MMF_DEBUG_PREFIX "MMF"
-#endif
-
-#ifndef MMF_DEBUG_FILE
-#define MMF_DEBUG_FILE "/var/log/mmf-log"
-#endif
-
-#ifndef MMF_DEBUG_COLOR
-#define MMF_DEBUG_COLOR 0
-#endif
-
-/******************************************************************************
- * DEBUG OUTPUT:
- * 0 = None
- * 1 = Log Manager
- * 2 = Debug System
- * 3 = Console
- * 4 = File
- *****************************************************************************/
-#ifndef MMF_DEBUG_OUTPUT
-#define MMF_DEBUG_OUTPUT 1
-#endif
-
-#if (MMF_DEBUG_OUTPUT == 1)
-/*
- * LOG MANAGER
- */
-#include <mm_log.h>
-
-#define mmf_debug(type, fmt, arg...) \
- { \
- switch (type) { \
- case MMF_DEBUG_VERBOSE: \
- log_print_rel(MMF_LOG_OWNER, LOG_CLASS_INFO, fmt, ##arg); \
- break; \
- case MMF_DEBUG_LOG: \
- log_print_rel(MMF_LOG_OWNER, LOG_CLASS_INFO, fmt, ##arg); \
- break; \
- case MMF_DEBUG_WARNING: \
- log_print_rel(MMF_LOG_OWNER, LOG_CLASS_WARNING, fmt, ##arg); \
- break; \
- case MMF_DEBUG_ERROR: \
- log_print_rel(MMF_LOG_OWNER, LOG_CLASS_ERR, fmt, ##arg); \
- break; \
- case MMF_DEBUG_CRITICAL: \
- log_print_rel(MMF_LOG_OWNER, LOG_CLASS_CRITICAL, fmt, ##arg); \
- break; \
- } \
- }
-
-#elif (MMF_DEBUG_OUTPUT == 2)
-/*
- * DEBUG MESSAGE SYSTEM
- */
-#include <mid-map.h>
-#include <message-framework-mid.h>
-#include <debug-message.h>
-
-#define mmf_debug(type, fmt, arg...) \
- do { \
- if (type < MMF_DEBUG_LEVEL) \
- debug_message(MID_FMULTIMEDIA, DEBUG_VERBOSE, fmt, ##arg); \
- } while(0)
-
-#elif (MMF_DEBUG_OUTPUT == 3)
-/*
- * CONSOLE
- */
-#include <stdio.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-
-#define mmf_debug(type, fmt, arg...) \
- do { \
- if (type < MMF_DEBUG_LEVEL && type < MMF_DEBUG_LEVEL_ALL) { \
- fprintf(stderr, "[%-10.10s] ", MMF_DEBUG_PREFIX); \
- fprintf(stderr, fmt, ##arg); \
- } \
- } while(0)
-
-#define mmf_debug_color(type, color, fmt, arg...) \
- do { \
- if (type < MMF_DEBUG_LEVEL && type < MMF_DEBUG_LEVEL_ALL) { \
- fprintf(stderr, "\033[%dm", color); \
- fprintf(stderr, "[%-10.10s] ", MMF_DEBUG_PREFIX); \
- fprintf(stderr, fmt, ##arg); \
- fprintf(stderr, "\033[%dm", MMF_DEBUG_COLOR_DEFAULT); \
- } \
- } while(0)
-
-#elif (MMF_DEBUG_OUTPUT == 4)
-/*
- * FILE
- */
-#include <stdio.h>
-#include <stdlib.h>
-
-#define mmf_debug(type, fmt, arg...) \
- do { \
- FILE *fp;
-
- if (type < MMF_DEBUG_LEVEL) { \
- fp = fopen(MMF_DEBUG_FILE, "a"); \
- fprintf(stderr, "[%-10.10s] ", MMF_DEBUG_PREFIX); \
- fprintf(fp, fmt, ##arg); \
- fclose(fp); \
- } \
- } while (0)
-
-#else
-/*
- * NO DEBUG MESSAGE
- */
-#define mmf_debug(type, fmd, arg...)
-
-#endif /* MMF_DEBUG_OUTPUT */
-
-/******************************************************************************
- *
- * DEBUG FUNCTION MACROS
- *
- *****************************************************************************/
-#if (MMF_DEBUG_COLOR == 1 && MMF_DEBUG_OUTPUT == 3)
-#define debug_verbose(fmt, arg...) mmf_debug_color(MMF_DEBUG_VERBOSE, MMF_DEBUG_COLOR_WHITE, "<VERBS> [%-24.24s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_log(fmt, arg...) mmf_debug_color(MMF_DEBUG_VERBOSE, MMF_DEBUG_COLOR_YELLOW, "<VERBS> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_msg(fmt, arg...) mmf_debug_color(MMF_DEBUG_LOG, MMF_DEBUG_COLOR_DEFAULT, "<DEBUG> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_warning(fmt, arg...) mmf_debug_color(MMF_DEBUG_WARNING, MMF_DEBUG_COLOR_MAGENTA, "<WARNI> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_error(fmt, arg...) mmf_debug_color(MMF_DEBUG_ERROR, MMF_DEBUG_COLOR_RED, "<ERROR> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_critical(fmt, arg...) mmf_debug_color(MMF_DEBUG_CRITICAL, MMF_DEBUG_COLOR_RED, "<FATAL> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_profile(fmt, arg...) mmf_debug_color(MMF_DEBUG_PROFILE, MMF_DEBUG_COLOR_CYAN, "<TIMER> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_fenter() mmf_debug_color(MMF_DEBUG_LOG, MMF_DEBUG_COLOR_GREEN, "<ENTER> [%s]\n", __FUNCTION__)
-#define debug_fleave() mmf_debug_color(MMF_DEBUG_LOG, MMF_DEBUG_COLOR_GREEN, "<LEAVE> [%s]\n", __FUNCTION__)
-#define debug_enter(fmt, arg...) mmf_debug_color(MMF_DEBUG_LOG, MMF_DEBUG_COLOR_GREEN, "<ENTER> [%-24.24s:<---] " fmt, __FUNCTION__, ##arg)
-#define debug_leave(fmt, arg...) mmf_debug_color(MMF_DEBUG_LOG, MMF_DEBUG_COLOR_CYAN, "<LEAVE> [%-24.24s:--->] " fmt, __FUNCTION__, ##arg)
-#else
-#define debug_verbose(fmt, arg...) mmf_debug(MMF_DEBUG_VERBOSE, "<VERBS> [%-24.24s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_log(fmt, arg...) mmf_debug(MMF_DEBUG_VERBOSE, "<DEBUG> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_msg(fmt, arg...) mmf_debug(MMF_DEBUG_LOG, "<DEBUG> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_warning(fmt, arg...) mmf_debug(MMF_DEBUG_WARNING, "<WARNI> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_error(fmt, arg...) mmf_debug(MMF_DEBUG_ERROR, "<ERROR> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_critical(fmt, arg...) mmf_debug(MMF_DEBUG_CRITICAL, "<FATAL> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_profile(fmt, arg...) mmf_debug(MMF_DEBUG_PROFILE, "<TIMER> [%-20.20s:%4d] " fmt, __FUNCTION__, __LINE__, ##arg)
-#define debug_fenter() mmf_debug(MMF_DEBUG_LOG, "<ENTER> [%s]\n", __FUNCTION__)
-#define debug_fleave() mmf_debug(MMF_DEBUG_LOG, "<LEAVE> [%s]\n", __FUNCTION__)
-#define debug_enter(fmt, arg...) mmf_debug(MMF_DEBUG_LOG, "<ENTER> [%-24.24s:<---] " fmt, __FUNCTION__, ##arg)
-#define debug_leave(fmt, arg...) mmf_debug(MMF_DEBUG_LOG, "<LEAVE> [%-24.24s:--->] " fmt, __FUNCTION__, ##arg)
-#endif /* MMF_DEBUG_COLOR */
-
-/* will be deprecated */
-#define err_msg(fmt, arg...) mmf_debug(MMF_DEBUG_ERROR, "[%s:%d] ERROR " fmt "\n",__FUNCTION__,__LINE__,##arg)
-#define info_msg(fmt, arg...) mmf_debug(MMF_DEBUG_LOG, "[%s]: " fmt "\n",__FUNCTION__, ##arg)
-#define warn_msg(fmt, arg...) mmf_debug(MMF_DEBUG_WARNING, "[%s] WARNING: " fmt "\n",__FUNCTION__, ##arg)
-
-#define return_if_fail(expr) \
- if(!(expr)) { \
- debug_warning("failed [%s]\n", #expr); \
- return; \
- }
-
-#define return_val_if_fail(expr, val) \
- if (!(expr)) { \
- debug_warning("failed [%s]\n", #expr); \
- return val; \
- }
-
-#define assert_not_reached() \
-{ \
- debug_error("assert_not_reached()"); \
- assert(0); \
-}
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* __MMF_DEBUG_H__ */
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-
-
-#ifndef __MM_ERROR_H__
-#define __MM_ERROR_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
-/**
- @addtogroup COMMON
- @{
- * @file mm_error.h
- * @brief This file defines error codes for multimedia framework.
- * @version 1.0
- *
- * This file defines error codes for multimedia framework.
-*/
-
-#define MM_ERROR_NONE 0x00000000 /**< No Error */
-#define MM_ERROR_CLASS 0x80000000 /**< Definition of number describing error group */
-#define MM_ERROR_COMMON_CLASS 0x80000100 /**< Category for describing common error group */
-#define MM_ERROR_SOUND_CLASS 0x80000200 /**< Category for describing sound error group */
-#define MM_ERROR_RADIO_CLASS 0x80000300 /**< Category for describing radio error group */
-#define MM_ERROR_PLAYER_CLASS 0x80000400 /**< Category for describing player error group */
-#define MM_ERROR_FILE_CLASS 0x80000600 /**< Category for describing file error group */
-#define MM_ERROR_CAMCORDER_CLASS 0x80000800 /**< Category for describing camcorder error group */
-#define MM_ERROR_IMAGE_CLASS 0x80000a00 /**< Category for describing image error group */
-#define MM_ERROR_MGR_CLASS 0x80000c00 /**< Category for describing message error group */
-#define MM_ERROR_POLICY_CLASS 0x80000b00 /**< Category for Policy */
-#define MM_ERROR_NOT_IMPLEMENTED 0x80000d00 /**< Error message for not implemented functions */
-
-/*
- MM_ERROR_CLASS
-*/
-#define MM_ERROR_UNKNOWN (MM_ERROR_CLASS | 0x00) /**< Unclassified error */
-#define MM_ERROR_INVALID_ARGUMENT (MM_ERROR_CLASS | 0x01) /**< Invalid argument */
-#define MM_ERROR_OUT_OF_MEMORY (MM_ERROR_CLASS | 0x02) /**< Out of memory */
-#define MM_ERROR_OUT_OF_STORAGE (MM_ERROR_CLASS | 0x03) /**< Out of storage */
-#define MM_ERROR_INVALID_HANDLE (MM_ERROR_CLASS | 0x04) /**< Invalid handle */
-#define MM_ERROR_FILE_NOT_FOUND (MM_ERROR_CLASS | 0x05) /**< Cannot find file */
-#define MM_ERROR_FILE_READ (MM_ERROR_CLASS | 0x06) /**< Fail to read data from file */
-#define MM_ERROR_FILE_WRITE (MM_ERROR_CLASS | 0x07) /**< Fail to write data to file */
-#define MM_ERROR_END_OF_FILE (MM_ERROR_CLASS | 0x08) /**< End of file */
-#define MM_ERROR_NOT_SUPPORT_API (MM_ERROR_CLASS | 0x09) /**< Not supported API*/
-
-
-/*
- MM_ERROR_COMMON_CLASS
-*/
-#define MM_ERROR_COMMON_INVALID_ARGUMENT (MM_ERROR_COMMON_CLASS | 1) /**< Invalid argument */
-#define MM_ERROR_COMMON_NO_FREE_SPACE (MM_ERROR_COMMON_CLASS | 2) /**< Out of storage */
-#define MM_ERROR_COMMON_OUT_OF_MEMORY (MM_ERROR_COMMON_CLASS | 3) /**< Out of memory */
-#define MM_ERROR_COMMON_UNKNOWN (MM_ERROR_COMMON_CLASS | 4) /**< Unknown error */
-#define MM_ERROR_COMMON_INVALID_ATTRTYPE (MM_ERROR_COMMON_CLASS | 5) /**< Invalid argument */
-#define MM_ERROR_COMMON_INVALID_PERMISSION (MM_ERROR_COMMON_CLASS | 6) /**< Invalid permission */
-#define MM_ERROR_COMMON_OUT_OF_ARRAY (MM_ERROR_COMMON_CLASS | 7) /**< Out of array */
-#define MM_ERROR_COMMON_OUT_OF_RANGE (MM_ERROR_COMMON_CLASS | 8) /**< Out of value range*/
-#define MM_ERROR_COMMON_ATTR_NOT_EXIST (MM_ERROR_COMMON_CLASS | 9) /**< Attribute doesn't exist. */
-
-/*
- * MM_ERROR_SOUND_CLASS
- */
-#define MM_ERROR_SOUND_NOT_INITIALIZED (MM_ERROR_SOUND_CLASS | 0x01) /**< Not initialized player */
-#define MM_ERROR_SOUND_CODEC_NOT_FOUND (MM_ERROR_SOUND_CLASS | 0x02) /**< Not supported format */
-#define MM_ERROR_SOUND_DECODE (MM_ERROR_SOUND_CLASS | 0x03) /**< Error while decoding data */
-#define MM_ERROR_SOUND_NO_FREE_SPACE (MM_ERROR_SOUND_CLASS | 0x04) /**< Out of storage */
-#define MM_ERROR_SOUND_FILE_NOT_FOUND (MM_ERROR_SOUND_CLASS | 0x05) /**< Cannot find file */
-#define MM_ERROR_SOUND_STREAM_NOT_FOUND (MM_ERROR_SOUND_CLASS | 0x06) /**< Cannot find stream */
-#define MM_ERROR_SOUND_END_OF_STREAM (MM_ERROR_SOUND_CLASS | 0x07) /**< End of stream */
-#define MM_ERROR_SOUND_SEEK (MM_ERROR_SOUND_CLASS | 0x08) /**< Seek related errors */
-#define MM_ERROR_SOUND_INVALID_POINTER (MM_ERROR_SOUND_CLASS | 0x09) /**< Invalid pointer */
-#define MM_ERROR_SOUND_NOT_SUPPORTED_OPERATION (MM_ERROR_SOUND_CLASS | 0x10) /**< Not supported operation */
-
-#define MM_ERROR_SOUND_INVALID_FILE (MM_ERROR_SOUND_CLASS | 0x21) /**< Invalid file */
-#define MM_ERROR_SOUND_INVALID_PATH (MM_ERROR_SOUND_CLASS | 0x22) /**< Invalid path */
-#define MM_ERROR_SOUND_INVALID_VOLUME (MM_ERROR_SOUND_CLASS | 0x23) /**< Invalid volume */
-#define MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE (MM_ERROR_SOUND_CLASS | 0x24) /**< Invalid media type */
-#define MM_ERROR_SOUND_INTERNAL (MM_ERROR_SOUND_CLASS | 0x25) /**< Internal errors */
-#define MM_ERROR_SOUND_INVALID_STATE (MM_ERROR_SOUND_CLASS | 0x26) /**< Invalid state */
-
-#define MM_ERROR_SOUND_VOLUME_NO_INSTANCE (MM_ERROR_SOUND_CLASS | 0x31) /**< No active instance */
-#define MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY (MM_ERROR_SOUND_CLASS | 0x32) /**< Capture instance only */
-
-#define MM_ERROR_SOUND_DEVICE_NOT_OPENED (MM_ERROR_SOUND_CLASS | 0x41) /**< Cannot open sound device */
-#define MM_ERROR_SOUND_DEVICE_INVALID_FORMAT (MM_ERROR_SOUND_CLASS | 0x42) /**< Invalid file format */
-#define MM_ERROR_SOUND_DEVICE_INVALID_CHANNEL (MM_ERROR_SOUND_CLASS | 0x43) /**< Invalid channel type */
-#define MM_ERROR_SOUND_DEVICE_INVALID_SAMPLERATE (MM_ERROR_SOUND_CLASS | 0x44) /**< Invalid samplerate */
-#define MM_ERROR_SOUND_DEVICE_INVALID_MODE (MM_ERROR_SOUND_CLASS | 0x45) /**< Invalid mode */
-#define MM_ERROR_SOUND_DEVICE_INVALID_VOLUME (MM_ERROR_SOUND_CLASS | 0x46) /**< Invalid volume */
-
-#define MM_ERROR_SOUND_UNSUPPORTED_FORMAT MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE /**< Not supported media format */
-
-
-/*
- MM_ERROR_RADIO_CLASS
- */
-#define MM_ERROR_RADIO_NOT_INITIALIZED (MM_ERROR_RADIO_CLASS | 0x01) /**< Radio instance is not initialized */
-#define MM_ERROR_RADIO_NO_FREE_SPACE (MM_ERROR_RADIO_CLASS | 0x02) /**< Not enough memory */
-#define MM_ERROR_RADIO_INTERNAL (MM_ERROR_RADIO_CLASS | 0x03) /**< Radio internal error */
-#define MM_ERROR_RADIO_RESPONSE_TIMEOUT (MM_ERROR_RADIO_CLASS | 0x04) /**< Response timeout error */
-#define MM_ERROR_RADIO_INVALID_STATE (MM_ERROR_RADIO_CLASS | 0x05) /**< Radio is in invalid state */
-#define MM_ERROR_RADIO_NO_OP (MM_ERROR_RADIO_CLASS | 0x06) /**< Radio is in desired state */
-#define MM_ERROR_RADIO_DEVICE_NOT_OPENED (MM_ERROR_RADIO_CLASS | 0x07) /**< Failed to opne radio devide */
-#define MM_ERROR_RADIO_DEVICE_NOT_FOUND (MM_ERROR_RADIO_CLASS | 0x08) /**< Failed to find radio devide */
-#define MM_ERROR_RADIO_PERMISSION_DENIED (MM_ERROR_RADIO_CLASS | 0x08) /**< not supported permission */
-
-
-/*
- MM_ERROR_PLAYER_CLASS
-*/
-#define MM_ERROR_PLAYER_NOT_INITIALIZED (MM_ERROR_PLAYER_CLASS | 0x01) /**< Not initialized player */
-#define MM_ERROR_PLAYER_CODEC_NOT_FOUND (MM_ERROR_PLAYER_CLASS | 0x02) /**< Not supported format */
-#define MM_ERROR_PLAYER_DECODE (MM_ERROR_PLAYER_CLASS | 0x03) /**< Error while decoding data */
-#define MM_ERROR_PLAYER_NO_FREE_SPACE (MM_ERROR_PLAYER_CLASS | 0x04) /**< Out of storage */
-#define MM_ERROR_PLAYER_FILE_NOT_FOUND (MM_ERROR_PLAYER_CLASS | 0x05) /**< Cannot find file */
-#define MM_ERROR_PLAYER_STREAM_NOT_FOUND (MM_ERROR_PLAYER_CLASS | 0x06) /**< Cannot find stream */
-#define MM_ERROR_PLAYER_END_OF_STREAM (MM_ERROR_PLAYER_CLASS | 0x07) /**< End of stream */
-#define MM_ERROR_PLAYER_SEEK (MM_ERROR_PLAYER_CLASS | 0x08) /**< Seek related errors */
-#define MM_ERROR_PLAYER_INTERNAL (MM_ERROR_PLAYER_CLASS | 0x09) /**< Internal errors */
-#define MM_ERROR_PLAYER_INVALID_STATE (MM_ERROR_PLAYER_CLASS | 0x0a) /**< Invalid state */
-#define MM_ERROR_PLAYER_AUDIO_NOT_OPENED (MM_ERROR_PLAYER_CLASS | 0x0b) /**< Cannot open audio */
-#define MM_ERROR_PLAYER_INVALID_VOLUME (MM_ERROR_PLAYER_CLASS | 0x0c) /**< Invalid volume */
-#define MM_ERROR_PLAYER_INVALID_URI (MM_ERROR_PLAYER_CLASS | 0x0d) /**< Invalid URI */
-#define MM_ERROR_PLAYER_INVALID_POSITION (MM_ERROR_PLAYER_CLASS | 0x0e) /**< Invalid position */
-#define MM_ERROR_PLAYER_NO_OP (MM_ERROR_PLAYER_CLASS | 0x0f) /**< No operation */
-#define MM_ERROR_PLAYER_BT_CONNECTION (MM_ERROR_PLAYER_CLASS | 0x10) /**< bt connection error */
-#define MM_ERROR_PLAYER_BT_WRITE (MM_ERROR_PLAYER_CLASS | 0x11) /**< bt connection error */
-#define MM_ERROR_PLAYER_NOT_SUPPORTED_FORMAT (MM_ERROR_PLAYER_CLASS | 0x12) /**< Not supported format */
-#define MM_ERROR_PLAYER_AUDIO_CODEC_NOT_FOUND (MM_ERROR_PLAYER_CLASS | 0x13) /**< Not supported audio codec */
-#define MM_ERROR_PLAYER_VIDEO_CODEC_NOT_FOUND (MM_ERROR_PLAYER_CLASS | 0x14) /**< Not supported video codec */
-#define MM_ERROR_PLAYER_STREAMING_FAIL (MM_ERROR_PLAYER_CLASS | 0x15) /**< Fail to play streaming */
-#define MM_ERROR_PLAYER_DSP_CRASHED (MM_ERROR_PLAYER_CLASS | 0x16) /**< Dsp is crashed */
-#define MM_ERROR_PLAYER_INVALID_STREAM (MM_ERROR_PLAYER_CLASS | 0x17) /**< Invalid stream */
-#define MM_ERROR_PLAYER_DOING_SEEK (MM_ERROR_PLAYER_CLASS | 0x18) /**< Still seeking */
-
-#define MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_AUDIO (MM_ERROR_PLAYER_CLASS | 0x22) /**< Unsupported audio */
-#define MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_VIDEO (MM_ERROR_PLAYER_CLASS | 0x23) /**< Unsupported video */
-#define MM_ERROR_PLAYER_STREAMING_CONNECTION_FAIL (MM_ERROR_PLAYER_CLASS | 0x24) /**< Fail to connect to streaming server */
-#define MM_ERROR_PLAYER_STREAMING_DNS_FAIL (MM_ERROR_PLAYER_CLASS | 0x25) /**< Fail to get host using DNS */
-#define MM_ERROR_PLAYER_STREAMING_SERVER_DISCONNECTED (MM_ERROR_PLAYER_CLASS | 0x26) /**< Streaming server is disconnected */
-#define MM_ERROR_PLAYER_STREAMING_BAD_SERVER (MM_ERROR_PLAYER_CLASS | 0x27) /**< Streaming server's bad beahvior */
-#define MM_ERROR_PLAYER_STREAMING_INVALID_PROTOCOL (MM_ERROR_PLAYER_CLASS | 0x28) /**< Invalid protocol */
-#define MM_ERROR_PLAYER_STREAMING_INVALID_URL (MM_ERROR_PLAYER_CLASS | 0x29) /**< Invalid URL */
-#define MM_ERROR_PLAYER_STREAMING_UNEXPECTED_MSG (MM_ERROR_PLAYER_CLASS | 0x2a) /**< Unexpected message from streaming server */
-#define MM_ERROR_PLAYER_STREAMING_OUT_OF_MEMORIES (MM_ERROR_PLAYER_CLASS | 0x2b) /**< Out of memories */
-#define MM_ERROR_PLAYER_STREAMING_RTSP_TIMEOUT (MM_ERROR_PLAYER_CLASS | 0x2c) /**< RTSP timed out */
-#define MM_ERROR_PLAYER_STREAMING_BAD_REQUEST (MM_ERROR_PLAYER_CLASS | 0x2d) /**< Bad request */
-#define MM_ERROR_PLAYER_STREAMING_NOT_AUTHORIZED (MM_ERROR_PLAYER_CLASS | 0x2e) /**< Not authorized */
-#define MM_ERROR_PLAYER_STREAMING_PAYMENT_REQUIRED (MM_ERROR_PLAYER_CLASS | 0x2f) /**< Payment required */
-#define MM_ERROR_PLAYER_STREAMING_FORBIDDEN (MM_ERROR_PLAYER_CLASS | 0x30) /**< Forbidden by streaming server */
-#define MM_ERROR_PLAYER_STREAMING_CONTENT_NOT_FOUND (MM_ERROR_PLAYER_CLASS | 0x31) /**< Content could not be found */
-#define MM_ERROR_PLAYER_STREAMING_METHOD_NOT_ALLOWED (MM_ERROR_PLAYER_CLASS | 0x32) /**< Not allowed method by streaming server */
-#define MM_ERROR_PLAYER_STREAMING_NOT_ACCEPTABLE (MM_ERROR_PLAYER_CLASS | 0x33) /**< Not accepted by streaming server */
-#define MM_ERROR_PLAYER_STREAMING_PROXY_AUTHENTICATION_REQUIRED (MM_ERROR_PLAYER_CLASS | 0x34) /**< Proxy authentication is required */
-#define MM_ERROR_PLAYER_STREAMING_SERVER_TIMEOUT (MM_ERROR_PLAYER_CLASS | 0x35) /**< Streaming server timed out */
-#define MM_ERROR_PLAYER_STREAMING_GONE (MM_ERROR_PLAYER_CLASS | 0x36) /**< Gone */
-#define MM_ERROR_PLAYER_STREAMING_LENGTH_REQUIRED (MM_ERROR_PLAYER_CLASS | 0x37) /**< Length required */
-#define MM_ERROR_PLAYER_STREAMING_PRECONDITION_FAILED (MM_ERROR_PLAYER_CLASS | 0x38) /**< Precondition is failed */
-#define MM_ERROR_PLAYER_STREAMING_REQUEST_ENTITY_TOO_LARGE (MM_ERROR_PLAYER_CLASS | 0x39) /**< Request entity is too large */
-#define MM_ERROR_PLAYER_STREAMING_REQUEST_URI_TOO_LARGE (MM_ERROR_PLAYER_CLASS | 0x3a) /**< Request URL is too large */
-#define MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_MEDIA_TYPE (MM_ERROR_PLAYER_CLASS | 0x3b) /**< Unsupported media type */
-#define MM_ERROR_PLAYER_STREAMING_PARAMETER_NOT_UNDERSTOOD (MM_ERROR_PLAYER_CLASS | 0x3c) /**< Parameter could not bu understood */
-#define MM_ERROR_PLAYER_STREAMING_CONFERENCE_NOT_FOUND (MM_ERROR_PLAYER_CLASS | 0x3d) /**< Conference could not be found */
-#define MM_ERROR_PLAYER_STREAMING_NOT_ENOUGH_BANDWIDTH (MM_ERROR_PLAYER_CLASS | 0x3e) /**< Bandwidth is not enough */
-#define MM_ERROR_PLAYER_STREAMING_NO_SESSION_ID (MM_ERROR_PLAYER_CLASS | 0x3f) /**< No session ID */
-#define MM_ERROR_PLAYER_STREAMING_METHOD_NOT_VALID_IN_THIS_STATE (MM_ERROR_PLAYER_CLASS | 0x40) /**< Method is not valid in this state */
-#define MM_ERROR_PLAYER_STREAMING_HEADER_FIELD_NOT_VALID_FOR_SOURCE (MM_ERROR_PLAYER_CLASS | 0x41) /**< Header field is not valid for source */
-#define MM_ERROR_PLAYER_STREAMING_INVALID_RANGE (MM_ERROR_PLAYER_CLASS | 0x42) /**< Invalid range */
-#define MM_ERROR_PLAYER_STREAMING_PARAMETER_IS_READONLY (MM_ERROR_PLAYER_CLASS | 0x43) /**< Parameter is read only */
-#define MM_ERROR_PLAYER_STREAMING_AGGREGATE_OP_NOT_ALLOWED (MM_ERROR_PLAYER_CLASS | 0x44) /**< Aggregation option is not allowed */
-#define MM_ERROR_PLAYER_STREAMING_ONLY_AGGREGATE_OP_ALLOWED (MM_ERROR_PLAYER_CLASS | 0x45) /**< Only aggregation option is allowed */
-#define MM_ERROR_PLAYER_STREAMING_BAD_TRANSPORT (MM_ERROR_PLAYER_CLASS | 0x46) /**< Bad transport */
-#define MM_ERROR_PLAYER_STREAMING_DESTINATION_UNREACHABLE (MM_ERROR_PLAYER_CLASS | 0x47) /**< Destination could not be reached */
-#define MM_ERROR_PLAYER_STREAMING_INTERNAL_SERVER_ERROR (MM_ERROR_PLAYER_CLASS | 0x48) /**< Internal server error */
-#define MM_ERROR_PLAYER_STREAMING_NOT_IMPLEMENTED (MM_ERROR_PLAYER_CLASS | 0x49) /**< Not implemented */
-#define MM_ERROR_PLAYER_STREAMING_BAD_GATEWAY (MM_ERROR_PLAYER_CLASS | 0x4a) /**< Bad gateway */
-#define MM_ERROR_PLAYER_STREAMING_SERVICE_UNAVAILABLE (MM_ERROR_PLAYER_CLASS | 0x4b) /**< Service is unavailable */
-#define MM_ERROR_PLAYER_STREAMING_GATEWAY_TIME_OUT (MM_ERROR_PLAYER_CLASS | 0x4c) /**< Gateway timed out */
-#define MM_ERROR_PLAYER_STREAMING_RTSP_VERSION_NOT_SUPPORTED (MM_ERROR_PLAYER_CLASS | 0x4d) /**< RTSP version is not supported */
-#define MM_ERROR_PLAYER_STREAMING_OPTION_NOT_SUPPORTED (MM_ERROR_PLAYER_CLASS | 0x4e) /**< Not supported option */
-
-
-/*
- MM_CAMCORDER_ERROR_CLASS
-*/
-#define MM_ERROR_CAMCORDER_DEVICE (MM_ERROR_CAMCORDER_CLASS | 0x01) /**< General error of camera device */
-#define MM_ERROR_CAMCORDER_DEVICE_NOT_FOUND (MM_ERROR_CAMCORDER_CLASS | 0x02) /**< Cannot find camera device */
-#define MM_ERROR_CAMCORDER_DEVICE_BUSY (MM_ERROR_CAMCORDER_CLASS | 0x03) /**< Busy camera device */
-#define MM_ERROR_CAMCORDER_DEVICE_OPEN (MM_ERROR_CAMCORDER_CLASS | 0x04) /**< Fail to open camera device */
-#define MM_ERROR_CAMCORDER_DEVICE_IO (MM_ERROR_CAMCORDER_CLASS | 0x05) /**< Fail to control camera device */
-#define MM_ERROR_CAMCORDER_DEVICE_TIMEOUT (MM_ERROR_CAMCORDER_CLASS | 0x06) /**< Device Timeout */
-#define MM_ERROR_CAMCORDER_DEVICE_REG_TROUBLE (MM_ERROR_CAMCORDER_CLASS | 0x07) /**< Register trouble of camear device */
-#define MM_ERROR_CAMCORDER_DEVICE_WRONG_JPEG (MM_ERROR_CAMCORDER_CLASS | 0x08) /**< Captured data is abnormal */
-#define MM_ERROR_CAMCORDER_DEVICE_LACK_BUFFER (MM_ERROR_CAMCORDER_CLASS | 0x09) /**< Buffer of device is not sufficient */
-
-#define MM_ERROR_CAMCORDER_GST_CORE (MM_ERROR_CAMCORDER_CLASS | 0x0a) /**< Gst Core error */
-#define MM_ERROR_CAMCORDER_GST_LIBRARY (MM_ERROR_CAMCORDER_CLASS | 0x0b) /**< Gst library error */
-#define MM_ERROR_CAMCORDER_GST_RESOURCE (MM_ERROR_CAMCORDER_CLASS | 0x0c) /**< Gst resource error */
-#define MM_ERROR_CAMCORDER_GST_STREAM (MM_ERROR_CAMCORDER_CLASS | 0x0d) /**< Gst stream error */
-#define MM_ERROR_CAMCORDER_GST_STATECHANGE (MM_ERROR_CAMCORDER_CLASS | 0x0e) /**< Gst state change failed */
-#define MM_ERROR_CAMCORDER_GST_NEGOTIATION (MM_ERROR_CAMCORDER_CLASS | 0x0f) /**< Gst negotiation failed */
-#define MM_ERROR_CAMCORDER_GST_LINK (MM_ERROR_CAMCORDER_CLASS | 0x10) /**< Gst linking failed */
-#define MM_ERROR_CAMCORDER_GST_FLOW_ERROR (MM_ERROR_CAMCORDER_CLASS | 0x11) /**< Gst linking failed */
-
-#define MM_ERROR_CAMCORDER_ENCODER (MM_ERROR_CAMCORDER_CLASS | 0x12) /**< General error of Encoder */
-#define MM_ERROR_CAMCORDER_ENCODER_BUFFER (MM_ERROR_CAMCORDER_CLASS | 0x13) /**< Encoder buffer error */
-#define MM_ERROR_CAMCORDER_ENCODER_WRONG_TYPE (MM_ERROR_CAMCORDER_CLASS | 0x14) /**< Encoder wrong type (format or param) */
-#define MM_ERROR_CAMCORDER_ENCODER_WORKING (MM_ERROR_CAMCORDER_CLASS | 0x15) /**< Encoding fail */
-
-#define MM_ERROR_CAMCORDER_INVALID_CONDITION (MM_ERROR_CAMCORDER_CLASS | 0x16) /**< Invalid pre-condition */
-#define MM_ERROR_CAMCORDER_INVALID_STATE (MM_ERROR_CAMCORDER_CLASS | 0x17) /**< Invalid state */
-#define MM_ERROR_CAMCORDER_INVALID_ARGUMENT (MM_ERROR_CAMCORDER_CLASS | 0x18) /**< Invalid Argument */
-
-#define MM_ERROR_CAMCORDER_INTERNAL (MM_ERROR_CAMCORDER_CLASS | 0x19) /**< Internal error */
-#define MM_ERROR_CAMCORDER_NOT_SUPPORTED (MM_ERROR_CAMCORDER_CLASS | 0x1a) /**< Not supported by camera device */
-#define MM_ERROR_CAMCORDER_RESPONSE_TIMEOUT (MM_ERROR_CAMCORDER_CLASS | 0x1b) /**< Not responsed in time */
-#define MM_ERROR_CAMCORDER_NOT_INITIALIZED (MM_ERROR_CAMCORDER_CLASS | 0x1c) /**< Not initialized camcorder */
-#define MM_ERROR_CAMCORDER_LOW_MEMORY (MM_ERROR_CAMCORDER_CLASS | 0x1d) /**< Memory alloc failed */
-#define MM_ERROR_CAMCORDER_RESOURCE_CREATION (MM_ERROR_CAMCORDER_CLASS | 0x1e) /**< Creating resource of camcorder failed */
-#define MM_ERROR_CAMCORDER_CMD_IS_RUNNING (MM_ERROR_CAMCORDER_CLASS | 0x1f) /**< Command is running now */
-#define MM_ERROR_CAMCORDER_DSP_FAIL (MM_ERROR_CAMCORDER_CLASS | 0x20) /**< DSP fail */
-#define MM_ERROR_CAMCORDER_AUDIO_EMPTY (MM_ERROR_CAMCORDER_CLASS | 0x21) /**< Audio data is empty */
-#define MM_ERROR_CAMCORDER_CREATE_CONFIGURE (MM_ERROR_CAMCORDER_CLASS | 0x22) /**< Failed to create configure structure */
-#define MM_ERROR_CAMCORDER_FILE_SIZE_OVER (MM_ERROR_CAMCORDER_CLASS | 0x23) /**< File size is greater than max size */
-#define MM_ERROR_CAMCORDER_DISPLAY_DEVICE_OFF (MM_ERROR_CAMCORDER_CLASS | 0x24) /**< Display device is off. Requests could be ignored */
-
-#define MM_ERROR_CAMCORDER_MNOTE_CREATION (MM_ERROR_CAMCORDER_CLASS | 0x26) /**< Exif makernote data construction failed */
-#define MM_ERROR_CAMCORDER_MNOTE_MALLOC (MM_ERROR_CAMCORDER_CLASS | 0x27) /**< Memory allocation for makernote entries failed */
-#define MM_ERROR_CAMCORDER_MNOTE_ADD_ENTRY (MM_ERROR_CAMCORDER_CLASS | 0x28) /**< Adding a makernote entry to list failed */
-
-
-/*
- MM_IMAGE_ERROR_CLASS
-*/
-#define MM_ERROR_IMAGE_FILEOPEN (MM_ERROR_IMAGE_CLASS | 1) /**< Cannot open file */
-#define MM_ERROR_IMAGE_INTERNAL (MM_ERROR_IMAGE_CLASS | 2) /**< Image module internal error */
-#define MM_ERROR_IMAGEHANDLE_NOT_INITIALIZED (MM_ERROR_IMAGE_CLASS | 3) /**< Fail to open camera device */
-#define MM_ERROR_NO_DECODED_DATA (MM_ERROR_IMAGE_CLASS | 4) /**< Fail to control camera device */
-#define MM_ERROR_IMAGE_NO_FREE_SPACE (MM_ERROR_IMAGE_CLASS | 5) /**< Not enough memory */
-#define MM_ERROR_IMAGE_INVALID_VALUE (MM_ERROR_IMAGE_CLASS | 0x22) /**< Invalid value */
-#define MM_ERROR_IMAGE_NOT_SUPPORT_FORMAT (MM_ERROR_IMAGE_CLASS | 0x23) /**< Not supported image format */
-#define MM_ERROR_IMAGE_DEVICE_NOT_SUPPORT (MM_ERROR_IMAGE_CLASS | 0x24) /**< Not supported image device */
-
-
-/*
- * MM_ERROR_FILE_CLASS
- */
-#define MM_ERROR_FILE_INTERNAL (MM_ERROR_FILE_CLASS | 0x01) /**< Internal error */
-#define MM_ERROR_FILE_UNKNOWN_FORMAT (MM_ERROR_FILE_CLASS | 0x02) /**< Unknown file format */
-
-
-/*
- MM_MGR_ERROR_CLASS
-*/
-#define MM_ERROR_MGR_NOT_INITIALIZED (MM_ERROR_MGR_CLASS | 1) /**< Not initialized MGR */
-#define MM_ERROR_MGR_CODEC_NOT_FOUND (MM_ERROR_MGR_CLASS | 2) /**< Not supported format */
-#define MM_ERROR_MGR_DECODE (MM_ERROR_MGR_CLASS | 3) /**< Error while decoding data */
-#define MM_ERROR_MGR_FILE_NOT_FOUND (MM_ERROR_MGR_CLASS | 5) /**< Cannot find file */
-#define MM_ERROR_MGR_STREAM_NOT_FOUND (MM_ERROR_MGR_CLASS | 6) /**< Cannot find stream */
-#define MM_ERROR_MGR_END_OF_STREAM (MM_ERROR_MGR_CLASS | 7) /**< End of stream */
-#define MM_ERROR_MGR_SEEK (MM_ERROR_MGR_CLASS | 8) /**< Seek related errors */
-#define MM_ERROR_MGR_INTERNAL (MM_ERROR_MGR_CLASS | 9) /**< Internal errors */
-#define MM_ERROR_MGR_INVALID_STATE (MM_ERROR_MGR_CLASS | 10) /**< Invalid state */
-#define MM_ERROR_MGR_OPERATION_NOT_PERMITTED (MM_ERROR_MGR_CLASS | 0xA) /**< Not allowed operation*/
-#define MM_ERROR_MGR_CAMERA_DEVICE_NOT_FOUND (MM_ERROR_MGR_CLASS | 0xB) /**< Cannot find camera device */
-#define MM_ERROR_MGR_CAMERA_DEVICE_BUSY (MM_ERROR_MGR_CLASS | 0xC) /**< Busy camera device */
-#define MM_ERROR_MGR_CAMERA_DEVICE_OPEN (MM_ERROR_MGR_CLASS | 0xD) /**< Fail to open camera device */
-#define MM_ERROR_MGR_CAMERA_DEVICE_IO (MM_ERROR_MGR_CLASS | 0xE) /**< Fail to control camera device */
-#define MM_ERROR_MGR_CAMERA_NOT_SUPPORTED (MM_ERROR_MGR_CLASS | 0xF) /**< Not supported by camera device */
-#define MM_ERROR_MGR_CAMERA_RESPONSE_TIMEOUT (MM_ERROR_MGR_CLASS | 0x11) /**< Not responsed in time */
-#define MM_ERROR_MGR_CAMERA_INTERNAL (MM_ERROR_MGR_CLASS | 0x12) /**< Camera internal error */
-#define MM_ERROR_MGR_CAMERA_INVALID_CONDITION (MM_ERROR_MGR_CLASS | 0x13) /**< Invalid pre-condition */
-#define MM_ERROR_MGR_MGR_IN_STATE_TRANSITION (MM_ERROR_MGR_CLASS | 0x14) /**< State transition from one state to another */
-#define MM_ERROR_MGR_RESPONSE_TIMEOUT (MM_ERROR_MGR_CLASS | 0x16) /**< Response timeout error */
-
-
-/*
- MM_ERROR_POLICY_CLASS
- */
-#define MM_ERROR_POLICY_BLOCKED (MM_ERROR_POLICY_CLASS | 0x01) /**< Blocked by Audio system policy */
-#define MM_ERROR_POLICY_INTERRUPTED (MM_ERROR_POLICY_CLASS | 0x02) /**< Interrupted by Audio system policy */
-#define MM_ERROR_POLICY_INTERNAL (MM_ERROR_POLICY_CLASS | 0x03) /**< Internal errors */
-#define MM_ERROR_POLICY_DUPLICATED (MM_ERROR_POLICY_CLASS | 0x04) /**< Duplicated Policy Instance */
-#define MM_ERROR_POLICY_RESTRICTED (MM_ERROR_POLICY_CLASS | 0x05) /**< Restricted by security system policy */
-/**
- @}
-*/
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* __MM_ERROR_H__ */
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-
-/**
- * This file declares data structures and functions of managing list.
- *
- * @file mmf_list_private.h
- * @author
- * @version 1.0
- * @brief This file declares data structures and functions of managing list.
- */
-
-#ifndef __MMF_LIST_PRIVATE_H__
-#define __MMF_LIST_PRIVATE_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
-/**
- * Append item to list
- *
- * @return
- * @remark
- * @see
- */
-int mmf_list_append(void *data);
-
-
-/**
- * Remove item from list
- *
- * @return
- * @remark
- * @see
- */
-int mmf_list_remove(int id);
-
-
-/**
- * Find data with its id
- *
- * @return
- * @remark
- * @see
- */
-void *mmf_list_find(int id);
-
-/**
- * Find id with its data
- *
- * @return
- * @remark
- * @see
- */
-int mmf_list_find_by_data(void *data);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* __MMF_LIST_PRIVATE_H__ */
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-
-#ifndef __MM_MESSAGE_H__
-#define __MM_MESSAGE_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
-/**
- * @addtogroup COMMON
- * @{
- * @file mm_message.h
- * @brief This file declares the messages type of Multimedia framework.
- * @version 1.0
- *
- * This file declares the messages type of Multimedia framework.
- */
-
-/**
- * Enumerations of messages type.
-*/
-enum MMMessageType {
- /* COMMON */
- MM_MESSAGE_UNKNOWN = 0x00, /**< Unknown message type */
- MM_MESSAGE_ERROR, /**< Error message type */
- MM_MESSAGE_WARNING, /**< Warning message type */
- MM_MESSAGE_STATE_CHANGED, /**< State change message type */
- MM_MESSAGE_STATE_INTERRUPTED, /**< State change by interrupt */
- MM_MESSAGE_READY_TO_RESUME, /**< Ready to resume message type */
-
- /* PLAYER */
- MM_MESSAGE_CONNECTING = 0x100, /**< Connecting message type */
- MM_MESSAGE_CONNECTED, /**< Rtspsrc has successed to connecting to server */
- MM_MESSAGE_CONNECTION_TIMEOUT, /**< Connection timeout message type */
- MM_MESSAGE_BUFFERING, /**< Buffering message type */
- MM_MESSAGE_BEGIN_OF_STREAM, /**< Streaming begin message type */
- MM_MESSAGE_END_OF_STREAM, /**< End of stream message type */
- MM_MESSAGE_BLUETOOTH_ON, /**< Bluetooth A2DP Connection ON */
- MM_MESSAGE_BLUETOOTH_OFF, /**< Bluetooth A2DP Connection OFF */
- MM_MESSAGE_RESUMED_BY_REW, /**< Resumed by fast rewind message type */
- MM_MESSAGE_UPDATE_SUBTITLE, /**< Update subtitle type */
- MM_MESSAGE_RTP_SENDER_REPORT, /**< RTP sender report */
- MM_MESSAGE_RTP_RECEIVER_REPORT, /**< RTP receiver report */
- MM_MESSAGE_RTP_SESSION_STATUS, /**< RTP session status */
- MM_MESSAGE_SENDER_STATE, /**< Sender state */
- MM_MESSAGE_RECEIVER_STATE, /**< Receiver state */
- MM_MESSAGE_FILE_NOT_SUPPORTED, /**< Not supported file */
- MM_MESSAGE_FILE_NOT_FOUND, /**< Not founded file */
- MM_MESSAGE_DRM_NOT_AUTHORIZED, /**< Not authorized to play the content */
- MM_MESSAGE_VIDEO_CAPTURED, /**< Video frame has been captured */
- MM_MESSAGE_VIDEO_NOT_CAPTURED, /**< video capture failed */
- MM_MESSAGE_SEEK_COMPLETED, /**< Seek completed */
-
- /* CAMCORDER */
- MM_MESSAGE_CAMCORDER_STATE_CHANGED = 0x200, /**< State changed.*/
- MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM, /**< State change by audio session manager message type */
- MM_MESSAGE_CAMCORDER_MAX_SIZE, /**< Maximum size, camcorder waits for user's order (cam_commit/cancel).*/
- MM_MESSAGE_CAMCORDER_NO_FREE_SPACE, /**< No free space, camcorder waits for user's order (cam_commit/cancel).*/
- MM_MESSAGE_CAMCORDER_TIME_LIMIT, /**< Time limit, camcorder waits for user's order (cam_commit/cancel)*/
- MM_MESSAGE_CAMCORDER_CAPTURED, /**< Image/audio/video captured.*/
- MM_MESSAGE_CAMCORDER_ERROR, /**< Error occurred.*/
- MM_MESSAGE_CAMCORDER_FOCUS_CHANGED, /**< Focus changed */
- MM_MESSAGE_CAMCORDER_CURRENT_VOLUME, /**< Current volume level of real input stream */
- MM_MESSAGE_CAMCORDER_FIRMWARE_UPDATE, /**< Firmware update */
- MM_MESSAGE_CAMCORDER_RECORDING_STATUS, /**< Recording status. (Elapsed time, total time, file size(KB))*/
- MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_SECURITY, /**< State change by system security(ex:MDM) message type */
- MM_MESSAGE_CAMCORDER_VIDEO_SNAPSHOT_CAPTURED, /**< Image captured while video recording */
-
- /* RADIO */
- MM_MESSAGE_RADIO_SCAN_START = 0x300, /**< Radio frequency scanning initiated */
- MM_MESSAGE_RADIO_SCAN_INFO, /**< Founded radio frequency report. check message parameters */
- MM_MESSAGE_RADIO_SCAN_FINISH, /**< Radio frequency scanning has finished */
- MM_MESSAGE_RADIO_SCAN_STOP, /**< Radio frequency scanning has stopped */
- MM_MESSAGE_RADIO_SEEK_START, /**< Radio seeking has established */
- MM_MESSAGE_RADIO_SEEK_FINISH, /**< Radio seeking has finished */
-
- /* MEDIA CALL */
- MM_MESSAGE_MEDIACALL_RESERVED = 0x400, /**< Reserved message for Media Call */
-
- /* IMAGE */
- MM_MESSAGE_IMAGE_RESERVED = 0x500, /**< Reserved message for Image */
-
- /* SOUND */
- MM_MESSAGE_SOUND_PCM_CAPTURE_RESTRICTED = 0x600, /**< Sound pcm capture is restricted by system */
- MM_MESSAGE_SOUND_PCM_INTERRUPTED, /**< Sound pcm is interrupted by audio system */
-
- /* FILE INFO */
- MM_MESSAGE_FILEINFO_RESERVED = 0x700, /**< Reserved message for File Info */
-
- MM_MESSAGE_NUM, /**< The number of the messages */
-};
-
-
-/**
- * Union type of 'MMMessageParamType' structure. Please add type when you make new union type of MMMessageParamType
- */
-enum MMMessageUnionType {
- MM_MSG_UNION_CODE, /**< Default */
- MM_MSG_UNION_STATE,
- MM_MSG_UNION_TIME,
- MM_MSG_UNION_CONNECTION,
- MM_MSG_UNION_FIRMWARE,
- MM_MSG_UNION_RTPSENDER_REPORT,
- MM_MSG_UNION_RTPRECEIVER_REPORT,
- MM_MSG_UNION_RTPSESSION_STATUS,
- MM_MSG_UNION_SUBTITLE,
- MM_MSG_UNION_RADIO_SCAN,
- MM_MSG_UNION_RECORDING_STATUS,
- MM_MSG_UNION_REC_VOLUME_DB,
-};
-
-/*
- * Enumerations of code for MM_MESSAGE_STATE_INTERRUPTED messages type.
- */
-enum MMMessageInterruptedCode {
- MM_MSG_CODE_INTERRUPTED_BY_OTHER_APP = 0,
- MM_MSG_CODE_INTERRUPTED_BY_CALL_START,
- MM_MSG_CODE_INTERRUPTED_BY_CALL_END,
- MM_MSG_CODE_INTERRUPTED_BY_EARJACK_UNPLUG,
- MM_MSG_CODE_INTERRUPTED_BY_RESOURCE_CONFLICT,
- MM_MSG_CODE_INTERRUPTED_BY_ALARM_START,
- MM_MSG_CODE_INTERRUPTED_BY_ALARM_END,
-};
-
-/*
- * Enumerations of code for MM_MESSAGE_SOUND_PCM_CAPTURE_RESTRICTED messages type.
- */
-enum MMMessagePcmCaptureCode {
- MM_MSG_CODE_PCM_CAPTURE_RESTRICTED = 0,
- MM_MSG_CODE_PCM_CAPTURE_ALLOWED,
-};
-
-/**
- * Message callback function type.
- */
-typedef int (*MMMessageCallback) (int id, void *param, void *user_param);
-
-/**
- * Message Parameter.
- */
-typedef struct {
- void *data; /**< Allocated data */
-
-/**
- * union.
- */
- int union_type; /**< Type of union. Please refer MMMessageUnionType */
-
- union {
- int code; /**< Error or warning code */
-/**
- * state.
- */
- struct {
- int previous; /**< Previous state */
- int current; /**< Current state */
- int code; /**< Error or warning code */
- } state;
-/**
- * time.
- */
- struct {
- unsigned int elapsed; /**< Elapsed time */
- unsigned int total; /**< Total time */
- } time;
-/**
- * connection.
- */
- struct {
- unsigned int buffering; /**< Buffering percent */
- } connection;
-
-/**
- * firmware.
- */
- struct {
- int state; /**< Update state*/
- int progress; /**< Update progress percentage */
- } firmware;
-/**
- * RTPSenderReport.
- */
- struct {
- unsigned char is_valid; /**< Structure is valid or not */
- //int64 ntptime; /**< The NTP timestamp indicates the point of time measured in wall clock time when this report was sent. */ unsigned int rtptime; /**< The RTP timestamp resembles the same time as the NTP timestamp ,but is measured in the same units and with the same random offset as the RTP timestamps in data packets */
- unsigned long long ntptime; /**< The NTP timestamp indicates the point of time measured in wall clock time when this report was sent. */ unsigned int rtptime; /**< The RTP timestamp resembles the same time as the NTP timestamp ,but is measured in the same units and with the same random offset as the RTP timestamps in data packets */
- unsigned int packet_count; /**< The sender's packet count totals up the number of RTP data packets transmitted by the sender since joining the RTP session */
- unsigned int octet_count; /**< The total number of payload octets (i.e., not including the header or any padding) transmitted in RTP data packets by the sender since starting up transmission */
- } RTPSenderReport; /**< RTPSenderReport message parameter structure. */
-/**
- * RTPReceiverReport.
- */
- struct {
- unsigned char is_valid; /**< Structure is valid or not */
- unsigned int ssrc; /**< The SSRC identifier of the sender whose reception is reported in this block . who the report is from */
- unsigned char fractionlost; /**< The sender of the receiver report estimates the fraction of the RTP data packets from source SSRC_n that it assumes to be lost since it sent the previous SR or RR packet.*/
- unsigned int packetslost; /**< The sender of a receiver report blocks also tries to estimate the total number of RTP data packets from source SSRC_n that have been lost since the beginning of reception. Packets that arrive late are not counted as lost, and the loss may be negative if there are duplicates. */
- unsigned int exthighestseq; /**< The low 16 bits of the extended highest sequence number contain the highest sequence number received in an RTP data packet from source SSRC_n, and the most significant 16 bits extend that sequence number with the corresponding count of sequence number cycles. */
- unsigned int jitter; /**< An estimate of the statistical variance of the RTP data packet inter-arrival time, measured in timestamp units and expressed as an unsigned intege */
- unsigned int lsr; /**< Last SR Timestamp */
- unsigned int dlsr; /**< Delay since last SR Timestamp */
- } RTPReceiverReport; /**< RTPReceiverReport message parameter structure. */
-/**
- * RTPSessionStatus.
- */
- struct {
- double bandwidth; /**< Bandwidth Modifier*/
- double sender_fraction; /**< Fraction of packet loss by sender*/
- double receiver_fraction; /**< Fraction of packet loss from Receiver*/
- double rtcp_bandwidth; /**< The total bandwidth that will be used for RTCP packets by all members of this session, in octets per second */
- double min_interval; /**< Minimum Interval */
- unsigned int sender_sources; /**< Identifies the synchronization source from sender*/
- unsigned int active_sources; /**< Identifies the Active source from sender*/
- unsigned int avg_rtcp_packet_size; /**< Average RTCP packet size */
- unsigned int bye_members; /**< BYE Packet members */
- } RTPSessionStatus; /**< RTPSessionStatus message parameter structure. */
-/**
- * subtitle
- */
- struct {
- unsigned long duration; /**< duration */
- } subtitle;
-
-/**
- * Radio Scan Info
- */
- struct {
- int frequency; /**< detected active frequency with MM_MESSAGE_RADIO_SCAN_INFO */
- } radio_scan;
-/**
- * Recording status
- */
- struct {
- unsigned int elapsed; /**< Elapsed time (ms) */
- unsigned int total; /**< Total time */
- unsigned int filesize; /**< Recording File size (KB). An approximate value. */
- unsigned int remained_time; /**< Remained time (ms).
- This is available if time limit is not set or
- time limit is bigger than estimated remained time. */
- } recording_status;
-
-/**
- * Recording volume level - dB
- */
- float rec_volume_dB;
- };
-
- int size; /**< Allocated size of 'data' */
-
- int reserved; /**< reserved field for future use */
-} MMMessageParamType;
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
- }
-#endif
-
-
-#endif /* __MM_MESSAGE_H__ */
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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.
- *
- */
-
-/**
- * This file declares common data structure of multimedia framework.
- *
- * @file mm_types.h
- * @author
- * @version 1.0
- * @brief This file declares common data structure of multimedia framework.
- */
-
-/**
- @addtogroup COMMON
- @{
- */
-
-#ifndef __MM_TYPES_H__
-#define __MM_TYPES_H__
-
-#include <stdbool.h>
-
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
-#define MM_MAX_FILENAME_LEN 256 /**< Maximum length of the file name */
-#define MM_MAX_URL_LEN 2048 /**< Maximum length of the maximum URL */
-
-/**
- * @def Defines range of logical volume factor.
- * It's for logical volume control in player.
- * So, don't use this one for media volume.
- * range : 0 ~ 1.0 (1.0 = 100%)
- */
-#define MM_VOLUME_LEVEL_MIN 0 /**< Minimum factor of volume */
-#define MM_VOLUME_LEVEL_MAX 1.0 /**< Maximum factor of volume */
-
-/**
- * Multimedia Framework handle type.
- */
-typedef int MMHandleType; /**< Handle type */
-
-
-/**
- * Enumerations of video capture devices.
- */
-enum MMVideoDeviceType {
- MM_VIDEO_DEVICE_NONE = -1, /**< No camera */
- MM_VIDEO_DEVICE_CAMERA0, /**< Primary camera */
- MM_VIDEO_DEVICE_CAMERA1, /**< Secondary camera */
- MM_VIDEO_DEVICE_NUM, /**< Number of video capture devices */
-};
-
-/**
- * Enumerations of audio capture devices.
- */
-enum MMAudioDeviceType {
- MM_AUDIO_DEVICE_MIC, /**< Mic device */
- MM_AUDIO_DEVICE_MODEM, /**< Modem */
- MM_AUDIO_DEVICE_NUM, /**< Number of audio capture devices */
-};
-
-/**
- * Enumerations of display surfaces.
- */
-enum MMDisplaySurfaceType {
- MM_DISPLAY_SURFACE_X, /**< X surface - default */
- MM_DISPLAY_SURFACE_EVAS, /**< Evas object surface */
- MM_DISPLAY_SURFACE_GL, /**< GL surface */
- MM_DISPLAY_SURFACE_NULL, /**< This just disposes of buffers */
- MM_DISPLAY_SURFACE_NUM, /**< number of enum */
-};
-
-/**
- * Enumerations of display devices.
- */
-enum MMDisplayDeviceType {
- MM_DISPLAY_DEVICE_MAINLCD, /**< Main LCD - default */
- MM_DISPLAY_DEVICE_SUBLCD, /**< Sub LCD */
- MM_DISPLAY_DEVICE_TVOUT, /**< TV out */
- MM_DISPLAY_DEVICE_MAINLCD_AND_SUBLCD, /**< Main LCD and Sub LCD */
- MM_DISPLAY_DEVICE_MAINLCD_AND_TVOUT, /**< Main LCD and TV */
- MM_DISPLAY_DEVICE_NUM, /**< number of enum */
-};
-
-/**
- * Enumerations of display scales.
- */
-enum MMDisplayScaleType {
- MM_DISPLAY_SCALE_DEFAULT, /**< Default size */
- MM_DISPLAY_SCALE_DOUBLE_LENGTH, /**< Expand width, height to double size */
- MM_DISPLAY_SCALE_TRIPLE_LENGTH, /**< Expand width, height to triple size */
- MM_DISPLAY_SCALE_NUM, /**< Number of display scales */
-};
-
-/**
- * Enumerations of storage.
- */
-enum MMStorageType {
- MM_STORAGE_INTERNAL, /**< Internal storage */
- MM_STORAGE_EXTERNAL, /**< External storage such as memory card */
- MM_STORAGE_NUM, /**< Number of storage type */
-};
-
-/**
- * Enumerations for quality.
- */
-enum MMQualityType {
- MM_QUALITY_LOW, /**< Low quality */
- MM_QUALITY_HIGH, /**< High quality */
- MM_QUALITY_NUM, /**< Number of quality type */
-};
-
-/**
- * Enumerations of channel type.
- */
-enum MMVolumeChannelType {
- MM_VOLUME_CHANNEL_LEFT, /**< Left channel */
- MM_VOLUME_CHANNEL_RIGHT, /**< Right channel */
- MM_VOLUME_CHANNEL_NUM, /**< Numbers of channels */
- MM_CHANNEL_LEFT = MM_VOLUME_CHANNEL_LEFT, /**< Left channel */
- MM_CHANNEL_RIGHT = MM_VOLUME_CHANNEL_RIGHT, /**< Right channel */
- MM_CHANNEL_NUM = MM_VOLUME_CHANNEL_NUM, /**< Numbers of channels */
-};
-
-/*
- * Enumerations of SW Volume Table Type.
- */
-enum MMSoftwareVolumeTableType {
- MM_SOUND_VOLUME_TYPE_SYSTEM, /**< Volume table for System */
- MM_SOUND_VOLUME_TYPE_NOTIFICATION, /**< Volume table for Notification */
- MM_SOUND_VOLUME_TYPE_ALARM, /**< Volume table for Alarm */
- MM_SOUND_VOLUME_TYPE_RINGTONE, /**< Volume table for Ringtone */
- MM_SOUND_VOLUME_TYPE_MEDIA, /**< Volume table for Multimedia */
- MM_SOUND_VOLUME_TYPE_CALL, /**< Volume table for Call */
- MM_SOUND_VOLUME_TYPE_NUM,
- MM_SOUND_VOLUME_TABLE_NUM = MM_SOUND_VOLUME_TYPE_NUM,
-};
-
-#define MM_SOUND_PRIORITY_ALLOW_MIX (0x80) /**< This define has deprecated */
-/*
- * Enumerations of Sound Priority.
- */
-enum MMSoundPriorityType {
- MM_SOUND_PRIORITY_0, /**< This enum has deprecated */
- MM_SOUND_PRIORITY_1, /**< This enum has deprecated */
- MM_SOUND_PRIORITY_2, /**< This enum has deprecated */
- MM_SOUND_PRIORITY_3, /**< This enum has deprecated */
- MM_SOUND_PRIORITY_4, /**< This enum has deprecated */
- MM_SOUND_PRIORITY_5, /**< This enum has deprecated */
- MM_SOUND_PRIORITY_NUM,
-};
-
-/**
- * Enumerations of video codec.
- */
-enum MMVideoCodecType {
- MM_VIDEO_CODEC_INVALID = -1, /**< Invalid codec type */
- MM_VIDEO_CODEC_NONE, /**< None (will be deprecated) */
- MM_VIDEO_CODEC_H263, /**< H263 codec */
- MM_VIDEO_CODEC_H264, /**< H264 codec */
- MM_VIDEO_CODEC_H26L, /**< H26L codec */
- MM_VIDEO_CODEC_MPEG4, /**< MPEG4 codec */
- MM_VIDEO_CODEC_MPEG1, /**< MPEG1 codec */
- MM_VIDEO_CODEC_WMV, /**< WMV codec */
- MM_VIDEO_CODEC_DIVX, /**< DIVX codec */
- MM_VIDEO_CODEC_XVID, /**< XVID codec */
- MM_VIDEO_CODEC_H261, /**< H261 codec */
- MM_VIDEO_CODEC_H262, /**< H262/MPEG2-part2 codec */
- MM_VIDEO_CODEC_H263V2, /**< H263v2 codec */
- MM_VIDEO_CODEC_H263V3, /**< H263v3 codec */
- MM_VIDEO_CODEC_MJPEG, /**< Motion JPEG Video codec */
- MM_VIDEO_CODEC_MPEG2, /**< MPEG2 codec */
- MM_VIDEO_CODEC_MPEG4_SIMPLE, /**< MPEG4 part-2 Simple profile codec */
- MM_VIDEO_CODEC_MPEG4_ADV_SIMPLE, /**< MPEG4 part-2 Advanced Simple profile codec */
- MM_VIDEO_CODEC_MPEG4_MAIN, /**< MPEG4 part-2 Main profile codec */
- MM_VIDEO_CODEC_MPEG4_CORE, /**< MPEG4 part-2 Core profile codec */
- MM_VIDEO_CODEC_MPEG4_ACE, /**< MPEG4 part-2 Adv Coding Eff profile codec */
- MM_VIDEO_CODEC_MPEG4_ARTS, /**< MPEG4 part-2 Adv RealTime Simple profile codec */
- MM_VIDEO_CODEC_MPEG4_AVC, /**< MPEG4 part-10 (h.264) codec */
- MM_VIDEO_CODEC_REAL, /**< Real video */
- MM_VIDEO_CODEC_VC1, /**< VC-1 video */
- MM_VIDEO_CODEC_AVS, /**< AVS video */
- MM_VIDEO_CODEC_CINEPAK, /**< Cinepak video codec */
- MM_VIDEO_CODEC_INDEO, /**< Indeo video codec */
- MM_VIDEO_CODEC_THEORA, /**< Theora video codec */
- MM_VIDEO_CODEC_NUM, /**< Number of video codec type */
-};
-
-/**
- * Enumerations of audio codec.
- */
-enum MMAudioCodecType {
- MM_AUDIO_CODEC_INVALID = -1, /**< Invalid codec type */
- MM_AUDIO_CODEC_AMR, /**< AMR codec */
- MM_AUDIO_CODEC_G723_1, /**< G723.1 codec */
- MM_AUDIO_CODEC_MP3, /**< MP3 codec */
- MM_AUDIO_CODEC_OGG, /**< OGG codec */
- MM_AUDIO_CODEC_AAC, /**< AAC codec */
- MM_AUDIO_CODEC_WMA, /**< WMA codec */
- MM_AUDIO_CODEC_MMF, /**< MMF codec */
- MM_AUDIO_CODEC_ADPCM, /**< ADPCM codec */
- MM_AUDIO_CODEC_WAVE, /**< WAVE codec */
- MM_AUDIO_CODEC_WAVE_NEW, /**< WAVE codec */
- MM_AUDIO_CODEC_MIDI, /**< MIDI codec */
- MM_AUDIO_CODEC_IMELODY, /**< IMELODY codec */
- MM_AUDIO_CODEC_MXMF,
- MM_AUDIO_CODEC_MPA, /**< MPEG1-Layer1 codec */
- MM_AUDIO_CODEC_MP2, /**< MPEG1-Layer2 codec */
- MM_AUDIO_CODEC_G711, /**< G711 codec */
- MM_AUDIO_CODEC_G722, /**< G722 wideband speech codec */
- MM_AUDIO_CODEC_G722_1, /**< G722.1 codec */
- MM_AUDIO_CODEC_G722_2, /**< G722.2 (AMR-WB) codec */
- MM_AUDIO_CODEC_G723, /**< G723 wideband speech codec */
- MM_AUDIO_CODEC_G726, /**< G726 (ADPCM) codec */
- MM_AUDIO_CODEC_G728, /**< G728 speech codec */
- MM_AUDIO_CODEC_G729, /**< G729 codec */
- MM_AUDIO_CODEC_G729A, /**< G729a codec */
- MM_AUDIO_CODEC_G729_1, /**< G729.1 codec */
- MM_AUDIO_CODEC_REAL, /**< Real audio */
- MM_AUDIO_CODEC_AAC_LC, /**< AAC-Low complexity codec */
- MM_AUDIO_CODEC_AAC_MAIN, /**< AAC-Main profile codec */
- MM_AUDIO_CODEC_AAC_SRS, /**< AAC-Scalable sample rate codec */
- MM_AUDIO_CODEC_AAC_LTP, /**< AAC-Long term prediction codec */
- MM_AUDIO_CODEC_AAC_HE_V1, /**< AAC-High Efficiency v1 codec */
- MM_AUDIO_CODEC_AAC_HE_V2, /**< AAC-High efficiency v2 codec */
- MM_AUDIO_CODEC_AC3, /**< DolbyDigital codec */
- MM_AUDIO_CODEC_ALAC, /**< Apple Lossless audio codec */
- MM_AUDIO_CODEC_ATRAC, /**< Sony proprietary audio codec */
- MM_AUDIO_CODEC_SPEEX, /**< SPEEX audio codec */
- MM_AUDIO_CODEC_VORBIS, /**< Vorbis audio codec */
- MM_AUDIO_CODEC_AIFF, /**< AIFF codec */
- MM_AUDIO_CODEC_AU, /**< AU codec */
- MM_AUDIO_CODEC_NONE, /**< None (will be deprecated) */
- MM_AUDIO_CODEC_PCM, /**< PCM codec */
- MM_AUDIO_CODEC_ALAW, /**< ALAW codec */
- MM_AUDIO_CODEC_MULAW, /**< MULAW codec */
- MM_AUDIO_CODEC_MS_ADPCM, /**< MS ADPCM codec */
- MM_AUDIO_CODEC_NUM, /**< Number of audio codec type */
-};
-
-/**
- * Enumerations of image codec.
- */
-enum MMImageCodecType {
- MM_IMAGE_CODEC_INVALID = -1,/**< Invalid codec type */
- MM_IMAGE_CODEC_JPEG, /**< JPEG codec */
- MM_IMAGE_CODEC_PNG, /**< PNG codec */
- MM_IMAGE_CODEC_BMP, /**< BMP codec */
- MM_IMAGE_CODEC_WBMP, /**< WBMP codec */
- MM_IMAGE_CODEC_TIFF, /**< TIFF codec */
- MM_IMAGE_CODEC_PCX, /**< PCX codec */
- MM_IMAGE_CODEC_GIF, /**< GIF codec */
- MM_IMAGE_CODEC_ICO, /**< ICO codec */
- MM_IMAGE_CODEC_RAS, /**< RAS codec */
- MM_IMAGE_CODEC_TGA, /**< TGA codec */
- MM_IMAGE_CODEC_XBM, /**< XBM codec */
- MM_IMAGE_CODEC_XPM, /**< XPM codec */
- MM_IMAGE_CODEC_SRW, /**< SRW (Samsung standard RAW) */
- MM_IMAGE_CODEC_JPEG_SRW, /**< JPEG + SRW */
- MM_IMAGE_CODEC_NUM, /**< Number of image codecs */
-};
-
-/**
- * Enumerations of file container format.
- */
-enum MMFileFormatType {
- MM_FILE_FORMAT_INVALID = -1,/**< Invalid file format */
- MM_FILE_FORMAT_3GP, /**< 3GP file format */
- MM_FILE_FORMAT_ASF, /**< Advanced Systems File file format */
- MM_FILE_FORMAT_AVI, /**< Audio Video Interleaved file format */
- MM_FILE_FORMAT_MATROSKA, /**< MATROSAK file format */
- MM_FILE_FORMAT_MP4, /**< MP4 file format */
- MM_FILE_FORMAT_OGG, /**< OGG file format */
- MM_FILE_FORMAT_NUT, /**< NUT file format */
- MM_FILE_FORMAT_QT, /**< MOV file format */
- MM_FILE_FORMAT_REAL, /**< RealMedia file format */
- MM_FILE_FORMAT_AMR, /**< AMR file format */
- MM_FILE_FORMAT_AAC, /**< AAC file format */
- MM_FILE_FORMAT_MP3, /**< MP3 file format */
- MM_FILE_FORMAT_AIFF, /**< AIFF file format */
- MM_FILE_FORMAT_AU, /**< Audio file format */
- MM_FILE_FORMAT_WAV, /**< WAV file format */
- MM_FILE_FORMAT_MID, /**< MID file format */
- MM_FILE_FORMAT_MMF, /**< MMF file format */
- MM_FILE_FORMAT_DIVX, /**< DivX file format */
- MM_FILE_FORMAT_FLV, /**< Flash video file format */
- MM_FILE_FORMAT_VOB, /**< DVD-Video Object file format */
- MM_FILE_FORMAT_IMELODY, /**< IMelody file format */
- MM_FILE_FORMAT_WMA, /**< WMA file format */
- MM_FILE_FORMAT_WMV, /**< WMV file format */
- MM_FILE_FORMAT_JPG, /**< JPEG file format */
- MM_FILE_FORMAT_NUM, /**< Number of file format type */
-};
-
-/**
- * Enumerations of display layers.
- */
-typedef enum {
- MM_VIDEO_LAYER_PRIMARY, /**< Primary of the video layer */
- MM_VIDEO_LAYER_OVERLAY, /**< Overlay of the video layer */
- MM_VIDEO_LAYER_NUM /**< Number of the video layer */
-} MMVideoLayerType;
-
-/**
- * Enumerations of Pixel formats
- */
-typedef enum {
- MM_PIXEL_FORMAT_INVALID = -1, /**< Invalid pixel format */
- MM_PIXEL_FORMAT_NV12, /**< NV12 pixel format */
- MM_PIXEL_FORMAT_NV12T, /**< NV12 Tiled pixel format */
- MM_PIXEL_FORMAT_NV16, /**< NV16 pixel format */
- MM_PIXEL_FORMAT_NV21, /**< NV21 pixel format */
- MM_PIXEL_FORMAT_YUYV, /**< YUYV(YUY2) pixel format */
- MM_PIXEL_FORMAT_UYVY, /**< UYVY pixel format */
- MM_PIXEL_FORMAT_422P, /**< YUV422(Y:U:V) planar pixel format */
- MM_PIXEL_FORMAT_I420, /**< I420 pixel format */
- MM_PIXEL_FORMAT_YV12, /**< YV12 pixel format */
- MM_PIXEL_FORMAT_RGB565, /**< RGB565 pixel format */
- MM_PIXEL_FORMAT_RGB888, /**< RGB888 pixel format */
- MM_PIXEL_FORMAT_RGBA, /**< RGBA pixel format */
- MM_PIXEL_FORMAT_ARGB, /**< ARGB pixel format */
- MM_PIXEL_FORMAT_ENCODED, /**< Encoded pixel format */
- MM_PIXEL_FORMAT_ITLV_JPEG_UYVY, /**< FIXME: JPEG+UYVY Interleaved format */
- MM_PIXEL_FORMAT_NUM /**< Number of the pixel format */
-} MMPixelFormatType;
-
-/**
- * Enumerations of video input rotation type.
- */
-typedef enum {
- MM_VIDEO_INPUT_ROTATION_NONE, /**< No rotation of the display */
- MM_VIDEO_INPUT_ROTATION_90, /**< 90 degree rotation */
- MM_VIDEO_INPUT_ROTATION_180, /**< 180 degree rotation */
- MM_VIDEO_INPUT_ROTATION_270, /**< 270 degree rotation */
- MM_VIDEO_INPUT_ROTATION_FLIP_HORZ, /**< flip horizontally */
- MM_VIDEO_INPUT_ROTATION_FLIP_VERT, /**< flip vertically */
- MM_VIDEO_INPUT_ROTATION_NUM /**< Number of the rotation */
-} MMVideoInputRotationType;
-
-/**
- * Enumerations of display rotation type.
- */
-typedef enum {
- MM_DISPLAY_ROTATION_NONE, /**< No rotation of the display */
- MM_DISPLAY_ROTATION_90, /**< 90 degree rotation */
- MM_DISPLAY_ROTATION_180, /**< 180 degree rotation */
- MM_DISPLAY_ROTATION_270, /**< 270 degree rotation */
- MM_DISPLAY_ROTATION_FLIP_HORZ, /**< flip horizontally */
- MM_DISPLAY_ROTATION_FLIP_VERT, /**< flip vertically */
- MM_DISPLAY_ROTATION_NUM /**< Number of the rotation */
-} MMDisplayRotationType;
-
-/**
- * Enumerations of streaming type.
- */
-typedef enum {
- STREAMING_SERVICE_VOD, /**< Streaming is vod */
- STREAMING_SERVICE_LIVE, /**< Streaming is live stream */
- STREAMING_SERVICE_NONE, /**< Not an streaming */
- STREAMING_SERVICE_NUM, /**< Number of the streaming type */
-} MMStreamingType;
-
-/**
- * Resolution
- */
-typedef struct {
- int width; /**< width */
- int height; /**< height */
-} MMResolutionType;
-
-/**
- * Type definition of rectangle.
- * This will be deprecated.
- */
-typedef struct {
- unsigned int x; /**< Start x point */
- unsigned int y; /**< Start y point */
- unsigned int width; /**< width */
- unsigned int height; /**< Height */
-} MMRectType;
-
-#define BT_ADDR_LEN 18 /**< Length of BT address */
-/**
- * bluetooth information.
- */
-typedef struct {
- int mode; /**< BT enable/disable */
- char addr[BT_ADDR_LEN]; /**< BT device address */
-} MMBluetoothType;
-
-
-/**
- * Enumerations of bluetooth mode
- */
-enum MMBluetoothMode {
- MM_BLUETOOTH_DISABLE = 0,
- MM_BLUETOOTH_ENABLE
-};
-
-/*
- * Enumerations of sound path policy
- */
-enum MMAudioRoutePolicy {
- MM_AUDIOROUTE_USE_EXTERNAL_SETTING = -1,
- MM_AUDIOROUTE_PLAYBACK_NORMAL,
- MM_AUDIOROUTE_PLAYBACK_ALERT,
- MM_AUDIOROUTE_PLAYBACK_HEADSET_ONLY,
- MM_AUDIOROUTE_CAPTURE_NORMAL = 0,
- MM_AUDIOROUTE_CAPTURE_MAINMIC_ONLY,
- MM_AUDIOROUTE_CAPTURE_STEREOMIC_ONLY,
-};
-
-/*
- * Enumerations of display geometry method
- */
-typedef enum {
- MM_DISPLAY_METHOD_LETTER_BOX = 0,
- MM_DISPLAY_METHOD_ORIGIN_SIZE,
- MM_DISPLAY_METHOD_FULL_SCREEN,
- MM_DISPLAY_METHOD_CROPPED_FULL,
- MM_DISPLAY_METHOD_CUSTOM_ROI,
-}MMDisplayGeometryMethod;
-
-#ifdef __cplusplus
- }
-#endif
-
-
-#endif /* __MM_TYPES_H__ */
+++ /dev/null
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2006-12-25.00
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" "" $nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
- --help display this help and exit.
- --version display version info and exit.
-
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) ;;
-
- -C) copy_on_change=true;;
-
- -d) dir_arg=true;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
-
- -o) chowncmd="$chownprog $2"
- shift;;
-
- -s) stripcmd=$stripprog;;
-
- -t) dst_arg=$2
- shift;;
-
- -T) no_target_directory=true;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
- shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- done
-fi
-
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call `install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-if test -z "$dir_arg"; then
- trap '(exit $?); exit' 1 2 13 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
-for src
-do
- # Protect names starting with `-'.
- case $src in
- -*) src=./$src;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dst_arg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
-
- dst=$dst_arg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst;;
- esac
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix='/';;
- -*) prefix='./';;
- *) prefix='';;
- esac
-
- eval "$initialize_posix_glob"
-
- oIFS=$IFS
- IFS=/
- $posix_glob set -f
- set fnord $dstdir
- shift
- $posix_glob set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test -z "$d" && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
- trap '' 0
- fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
+++ /dev/null
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-
-scriptversion=2006-05-10.23
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
-fi
-
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
-case $1 in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- autom4te touch the output file, or create a stub one
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).
-case $1 in
- lex|yacc)
- # Not GNU programs, they don't have --version.
- ;;
-
- tar)
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- exit 1
- fi
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $1 in
- aclocal*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case $f in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te)
- echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison|yacc)
- echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if test $# -ne 1; then
- eval LASTARG="\${$#}"
- case $LASTARG in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if test ! -f y.tab.h; then
- echo >y.tab.h
- fi
- if test ! -f y.tab.c; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex|flex)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if test $# -ne 1; then
- eval LASTARG="\${$#}"
- case $LASTARG in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if test ! -f lex.yy.c; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit 1
- fi
- ;;
-
- makeinfo)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- # The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -z "$file"; then
- # ... or it is the one specified with @setfilename ...
- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '
- /^@setfilename/{
- s/.* \([^ ]*\) *$/\1/
- p
- q
- }' $infile`
- # ... or it is derived from the source name (dir/f.texi becomes f.info)
- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
- fi
- # If the file does not exist, the user really needs makeinfo;
- # let's fail without touching anything.
- test -f $file || exit 1
- touch $file
- ;;
-
- tar)
- shift
-
- # We have already tried tar in the generic part.
- # Look for gnutar/gtar before invocation to avoid ugly error
- # messages.
- if (gnutar --version > /dev/null 2>&1); then
- gnutar "$@" && exit 0
- fi
- if (gtar --version > /dev/null 2>&1); then
- gtar "$@" && exit 0
- fi
- firstarg="$1"
- if shift; then
- case $firstarg in
- *o*)
- firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- case $firstarg in
- *h*)
- firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- fi
-
- echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
- You may want to install GNU tar or Free paxutils, or check the
- command line arguments."
- exit 1
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
+++ /dev/null
-prefix = @prefix@
-exec_prefix=@exec_prefix@
-libdir = @libdir@
-includedir = @includedir@
-
-Name : mm-common
-Description : Multimedia Framework Common Library
-Requires : glib-2.0 mm-log
-Version : @VERSION@
-Libs : -L${libdir} -lmmfcommon -lpthread
-Cflags : -I${includedir}/mmf
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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 <stdio.h>
-#include <stdbool.h>
-#include <malloc.h>
-#include <string.h>
-#include <assert.h>
-#include "mm_debug.h"
-#include "mm_attrs.h"
-#include "mm_attrs_private.h"
-#include "mm_error.h"
-
-int mm_attrs_get_type(MMHandleType h, int idx, MMAttrsType *attrtype)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(h && idx >= 0 && idx < attrs->count && attrtype, MM_ERROR_COMMON_INVALID_ARGUMENT);
- *attrtype=attrs->items[idx].value.type;
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_get_flags(MMHandleType h, int idx, int *flags)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && flags, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- *flags=attrs->items[idx].flags;
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_get_valid_type(MMHandleType h, int idx, int *type)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && type, MM_ERROR_COMMON_INVALID_ARGUMENT);
- *type=attrs->items[idx].value_spec.type;
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_get_valid_range(MMHandleType h, int idx, int *min, int *max)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && min && max, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (min) {
- *min = attrs->items[idx].value_spec.spec.int_spec.range.min;
- }
- if (max) {
- *max = attrs->items[idx].value_spec.spec.int_spec.range.max;
- }
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_get_valid_array(MMHandleType h, int idx, int *count, int **array)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- if (count)
- *count = 0;
- return_val_if_fail(attrs && count && idx >= 0 && idx < attrs->count && array, MM_ERROR_COMMON_INVALID_ARGUMENT);
- if (count)
- *count = attrs->items[idx].value_spec.spec.int_spec.array.count;
- *array=attrs->items[idx].value_spec.spec.int_spec.array.array;
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_get_size(MMHandleType h, int *size)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(h && size, MM_ERROR_COMMON_INVALID_ARGUMENT);
- *size = attrs->count;
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_get_name(MMHandleType h, int idx, char **name)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && name, MM_ERROR_COMMON_INVALID_ARGUMENT);
- *name = attrs->items[idx].name;
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_get_index(MMHandleType h, const char *attrname, int *index)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- int i;
-
- return_val_if_fail(h && attrname && index, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- for (i = 0; i < attrs->count; i++) {
- if (0 == strcmp(attrs->items[i].name, attrname)) {
- *index = i;
- return MM_ERROR_NONE;
- }
- }
- return MM_ERROR_COMMON_OUT_OF_ARRAY;
-}
-
-
-int mm_attrs_set_int(MMHandleType h, int idx, int val)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mmf_attribute_t *item = &attrs->items[idx];
- return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (!mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE))
- {
- return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
-
- if (mmf_attribute_validate_int(item, val))
- {
- int ret = 0;
- ret = mmf_attribute_set_int(item, val);
-
- if (ret == 0)
- return MM_ERROR_NONE;
- else
- return MM_ERROR_COMMON_INVALID_ATTRTYPE;
- }
-
- if (item->value_spec.type == MMF_VALUE_SPEC_INT_RANGE)
- return MM_ERROR_COMMON_OUT_OF_RANGE;
- else if (item->value_spec.type == MMF_VALUE_SPEC_INT_ARRAY)
- return MM_ERROR_COMMON_OUT_OF_ARRAY;
- else
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
-}
-
-
-int mm_attrs_get_int(MMHandleType h, int idx, int *val)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && val, MM_ERROR_COMMON_INVALID_ARGUMENT);
- mmf_attribute_t *item = &attrs->items[idx];
- return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_READABLE))
- {
- *val=mmf_value_get_int(&attrs->items[idx].value);
- return MM_ERROR_NONE;
- }
-
- return MM_ERROR_COMMON_INVALID_PERMISSION;
-}
-
-
-int mm_attrs_set_double(MMHandleType h, int idx, double val)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mmf_attribute_t *item = &attrs->items[idx];
- return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (!mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE))
- {
- return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
-
- if (mmf_attribute_validate_double(item, val))
- {
- int ret = 0;
- ret = mmf_attribute_set_double(item, val);
-
- if (ret == 0)
- return MM_ERROR_NONE;
- else
- return MM_ERROR_COMMON_INVALID_ATTRTYPE;
- }
-
- if (item->value_spec.type == MMF_VALUE_SPEC_DOUBLE_RANGE)
- return MM_ERROR_COMMON_OUT_OF_RANGE;
- else if (item->value_spec.type == MMF_VALUE_SPEC_DOUBLE_ARRAY)
- return MM_ERROR_COMMON_OUT_OF_ARRAY;
- else
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
-}
-
-
-int mm_attrs_get_double(MMHandleType h, int idx, double *val)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && val, MM_ERROR_COMMON_INVALID_ARGUMENT);
- mmf_attribute_t *item = &attrs->items[idx];
- return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_READABLE))
- {
- *val=mmf_value_get_double(&attrs->items[idx].value);
- return MM_ERROR_NONE;
- }
-
- return MM_ERROR_COMMON_INVALID_PERMISSION;
-}
-
-
-int mm_attrs_set_string(MMHandleType h, int idx, const char *string, int size)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mmf_attribute_t *item = &attrs->items[idx];
-
- return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
-
- if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE))
- {
- int ret = 0;
- ret = mmf_attribute_set_string(item, string, size);
-
- if (ret == 0)
- return MM_ERROR_NONE;
- else
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- return MM_ERROR_COMMON_INVALID_PERMISSION;
-}
-
-
-int mm_attrs_get_string(MMHandleType h, int idx,char **sval, int *size)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && sval, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (!(attrs->items[idx].flags & MM_ATTRS_FLAG_READABLE)) {
- mmf_debug(MMF_DEBUG_LOG, "Access denied.\n");
- return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
-
- *sval = mmf_value_get_string(&attrs->items[idx].value,size);
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_set_data(MMHandleType h, int idx, void *data, int size)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && data, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mmf_attribute_t *item = &attrs->items[idx];
- return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE))
- {
- int ret = 0;
- ret = mmf_attribute_set_data(item, data, size);
-
- if (ret == 0)
- return MM_ERROR_NONE;
- else
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
-}
-
-
-int mm_attrs_get_data(MMHandleType h, int idx,void **data, int *size)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && data, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (!(attrs->items[idx].flags & MM_ATTRS_FLAG_READABLE)) {
- mmf_debug(MMF_DEBUG_LOG, "Access denied.\n");
- return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
- *data=mmf_value_get_data(&attrs->items[idx].value,size);
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_set_int_by_name(MMHandleType attrs, const char *name, int val)
-{
- return_val_if_fail(attrs && name, -1);
- int idx = 0;
- mm_attrs_get_index(attrs, name, &idx);
- if (idx >= 0) {
- return mm_attrs_set_int(attrs, idx, val);
- }
- return -1;
-}
-
-
-int mm_attrs_get_int_by_name(MMHandleType attrs, const char *name, int *val)
-{
- int idx = -1;
- return_val_if_fail(attrs && name && val, MM_ERROR_COMMON_INVALID_ARGUMENT);
- mm_attrs_get_index(attrs, name, &idx);
- if (idx >= 0) {
- return mm_attrs_get_int(attrs, idx, val);
- }
- return MM_ERROR_COMMON_INVALID_ATTRTYPE;
-}
-
-
-int mm_attrs_set_string_by_name(MMHandleType attrs, const char *name, const char *string)
-{
- return_val_if_fail(attrs && name, -1);
-
- int size;
- int idx = 0;
- mm_attrs_get_index(attrs, name, &idx);
- if (idx >= 0) {
- if (string) {
- size = strlen(string);
- }
- else {
- string = NULL;
- size = 0;
- }
-
- return mm_attrs_set_string(attrs, idx, string, size);
- }
- return -1;
-}
-
-
-int mm_attrs_get_string_by_name(MMHandleType attrs, const char *name, char **string)
-{
- int idx = -1;
- int len = 0;
- return_val_if_fail(attrs && name && string, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mm_attrs_get_index(attrs, name, &idx);
- if (idx >= 0) {
- return mm_attrs_get_string(attrs, idx, string, &len);
- }
- return MM_ERROR_COMMON_INVALID_ATTRTYPE;
-}
-
-
-int mm_attrs_set_data_by_name(MMHandleType attrs, const char *name, void *data, int size)
-{
- return_val_if_fail(attrs && name, -1);
- int idx = 0;
- mm_attrs_get_index(attrs, name, &idx);
-
- if (idx >= 0) {
- return mm_attrs_set_data(attrs, idx, data, size);
- }
- return -1;
-}
-
-
-int mm_attrs_get_data_by_name(MMHandleType attrs, const char *name, void **data)
-{
- int idx = -1;
- int len = 0;
-
- return_val_if_fail(attrs && name, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mm_attrs_get_index(attrs, name, &idx);
- if (idx >= 0) {
- return mm_attrs_get_data(attrs, idx, data, &len);
- }
- return MM_ERROR_COMMON_INVALID_ATTRTYPE;
-}
-
-
-int mm_attrs_set_array(MMHandleType h, int id, int *array, int count)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
-
-
- if(attrs == NULL)
- {
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- if(array == NULL)
- {
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- if (!(attrs->items[id].flags & MM_ATTRS_FLAG_WRITABLE)) {
- return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
- if (mmf_value_spec_set_int_array(&attrs->items[id].value_spec, array, count) == 0) {
- attrs->items[id].flags |= MM_ATTRS_FLAG_MODIFIED;
- return MM_ERROR_NONE;
- }
-
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
-}
-
-
-int mm_attrs_get_array(MMHandleType h, int id, int **array, int *count )
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
-
- if(attrs == NULL)
- {
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- if((array == NULL) || (count == NULL))
- {
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
-
- if (!(attrs->items[id].flags & MM_ATTRS_FLAG_READABLE)) {
- return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
-
- mmf_value_spec_get_int_array(&attrs->items[id].value_spec, array, count);
-
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_set_range(MMHandleType h, int id, int min, int max)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
-
- if(attrs == NULL || id >= attrs->count || id < 0)
- {
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- if (!(attrs->items[id].flags & MM_ATTRS_FLAG_WRITABLE)) {
- return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
- if (mmf_value_spec_set_int_range(&attrs->items[id].value_spec, min, max) == 0) {
- attrs->items[id].flags |= MM_ATTRS_FLAG_MODIFIED;
- return MM_ERROR_NONE;
- }
-
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
-
-}
-
-
-int mm_attrs_get_range(MMHandleType h, int id, int *min, int *max)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
-
-
- if(attrs == NULL || id >= attrs->count || id < 0)
- {
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- if((min == NULL) || (max == NULL))
- {
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
-
- if (!(attrs->items[id].flags & MM_ATTRS_FLAG_READABLE)) {
- return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
-
- mmf_value_spec_get_int_range(&attrs->items[id].value_spec, min, max);
-
-
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_set_double_by_name(MMHandleType attrs, const char *name, double val)
-{
- int idx = -1;
- return_val_if_fail(attrs && name, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mm_attrs_get_index(attrs, name, &idx);
- if (idx >= 0) {
- return mm_attrs_set_double(attrs, idx, val);
- }
- return MM_ERROR_COMMON_INVALID_ATTRTYPE;
-}
-
-
-int mm_attrs_get_double_by_name(MMHandleType attrs, const char *name, double *val)
-{
- int idx = -1;
- return_val_if_fail(attrs && name && val, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mm_attrs_get_index(attrs, name, &idx);
- if (idx >= 0) {
- *val = mm_attrs_get_double(attrs, idx, val);
- return 0;
- }
- return MM_ERROR_COMMON_INVALID_ATTRTYPE;
-}
-
-
-int mm_attrs_set_valist (MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args)
-{
- const char *name = NULL;
- int ret = MM_ERROR_NONE;
-
- return_val_if_fail(attrs, MM_ERROR_COMMON_INVALID_ARGUMENT);
-// return_val_if_fail(err_attr_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
- return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (err_attr_name)
- *err_attr_name = NULL;
- name = attribute_name;
-
- while (name)
- {
- int idx = -1;
- MMAttrsType attr_type = MM_ATTRS_TYPE_INVALID;
-
- //name check
- if ((ret = mm_attrs_get_index(attrs, name, &idx)) != MM_ERROR_NONE)
- {
- if (err_attr_name)
- *err_attr_name = strdup(name);
-
- if (ret == MM_ERROR_COMMON_OUT_OF_ARRAY) //to avoid confusing
- return MM_ERROR_COMMON_ATTR_NOT_EXIST;
- else
- return ret;
- }
-
- //type check
- if ((ret = mm_attrs_get_type(attrs, idx, &attr_type)) != MM_ERROR_NONE)
- return ret;
-
- //cast and set
- switch (attr_type)
- {
- case MM_ATTRS_TYPE_INT:
- {
- int val = va_arg ((var_args), int);
- mmf_debug(MMF_DEBUG_LOG, "(%s: %d)\n", name, val);
- ret = mm_attrs_set_int(attrs, idx, val);
- break;
- }
- case MM_ATTRS_TYPE_DOUBLE:
- {
- double val = va_arg ((var_args), double);
- mmf_debug(MMF_DEBUG_LOG, "(%s: %f)\n", name, val);
- ret = mm_attrs_set_double(attrs, idx, val);
- break;
- }
- case MM_ATTRS_TYPE_STRING:
- {
- char * val = va_arg ((var_args), char*);
- int size = va_arg ((var_args), int);
- mmf_debug(MMF_DEBUG_LOG, "(%s: \'%s\', size: %d)\n", name, val, size);
- ret = mm_attrs_set_string(attrs, idx, (const char*)val, size);
- break;
- }
- case MM_ATTRS_TYPE_DATA:
- {
- void * val = va_arg ((var_args), void*);
- int size = va_arg ((var_args), int);
- mmf_debug(MMF_DEBUG_LOG, "(%s: %p, size: %d)\n", name, val, size);
- ret = mm_attrs_set_data(attrs, idx, val, size);
- break;
- }
- case MM_ATTRS_TYPE_ARRAY:
- {
- void * array = va_arg ((var_args), void*);
- int count = va_arg ((var_args), int);
- mmf_debug(MMF_DEBUG_LOG, "(%s: %p, count: %d)\n", name, array, count);
- ret = mm_attrs_set_array(attrs, idx, array, count);
- break;
- }
- case MM_ATTRS_TYPE_RANGE:
- {
- int min = va_arg ((var_args), int);
- int max = va_arg ((var_args), int);
- mmf_debug(MMF_DEBUG_LOG, "(%s: %d ~ %d)\n", name, min, max);
- ret = mm_attrs_set_range(attrs, idx, min, max);
- break;
- }
- case MM_ATTRS_TYPE_INVALID:
- default:
- mmf_debug(MMF_DEBUG_ERROR, "This function doesn't support attribute type(%d, name:%s)\n", attr_type, name);
- if (err_attr_name)
- *err_attr_name = strdup(name);
- ret = MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- if (ret != MM_ERROR_NONE)
- {
- if (err_attr_name)
- *err_attr_name = strdup(name);
- mmf_debug(MMF_DEBUG_ERROR, "Setting failure.(name:%s)\n", name);
- return ret;
- }
-
- //next name
- name = va_arg (var_args, char*);
- }
-
- if (mmf_attrs_commit_err(attrs, err_attr_name) == -1)
- return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
- else
- return MM_ERROR_NONE;
-
- return ret;
-}
-
-
-int mm_attrs_get_valist (MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args)
-{
- const char *name = NULL;
- int ret = MM_ERROR_NONE;
-
- return_val_if_fail(attrs, MM_ERROR_COMMON_INVALID_ARGUMENT);
-// return_val_if_fail(err_attr_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
- return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- if (err_attr_name)
- *err_attr_name = NULL;
- name = attribute_name;
-
- while (name)
- {
- int idx = -1;
- MMAttrsType attr_type = MM_ATTRS_TYPE_INVALID;
-
- //name check
- if ((ret = mm_attrs_get_index(attrs, name, &idx)) != MM_ERROR_NONE)
- {
- if (err_attr_name)
- *err_attr_name = strdup(name);
-
- if (ret == MM_ERROR_COMMON_OUT_OF_ARRAY) //to avoid confusing
- return MM_ERROR_COMMON_ATTR_NOT_EXIST;
- else
- return ret;
- }
-
- //type check
- if ((ret = mm_attrs_get_type(attrs, idx, &attr_type)) != MM_ERROR_NONE)
- return ret;
-
- //cast and set
- switch (attr_type)
- {
- case MM_ATTRS_TYPE_INT:
- {
- int * val = va_arg ((var_args), int*);
-// mmf_debug(MMF_DEBUG_LOG, "(%s: %p)\n", name, val);
- ret = mm_attrs_get_int(attrs, idx, val);
- break;
- }
- case MM_ATTRS_TYPE_DOUBLE:
- {
- double * val = va_arg ((var_args), double*);
-// mmf_debug(MMF_DEBUG_LOG, "(%s: %p)\n", name, val);
- ret = mm_attrs_get_double(attrs, idx, val);
- break;
- }
- case MM_ATTRS_TYPE_STRING:
- {
- char ** val = va_arg ((var_args), char**);
- int * size = va_arg ((var_args), int*);
-// mmf_debug(MMF_DEBUG_LOG, "(%s: %p, size: %p)\n", name, val, size);
- ret = mm_attrs_get_string(attrs, idx, (char**)val, size);
- break;
- }
- case MM_ATTRS_TYPE_DATA:
- {
- void ** val = va_arg ((var_args), void**);
- int * size = va_arg ((var_args), int*);
-// mmf_debug(MMF_DEBUG_LOG, "(%s: %p, size: %p)\n", name, val, size);
- ret = mm_attrs_get_data(attrs, idx, val, size);
- break;
- }
- case MM_ATTRS_TYPE_ARRAY:
- {
- int ** array = va_arg ((var_args), int**);
- int * count = va_arg ((var_args), int*);
-// mmf_debug(MMF_DEBUG_LOG, "(%s: %p, size: %p)\n", name, array, count);
- ret = mm_attrs_get_array(attrs, idx, array, count);
- break;
- }
- case MM_ATTRS_TYPE_RANGE:
- {
- int *min = va_arg ((var_args), int*);
- int *max = va_arg ((var_args), int*);
-// mmf_debug(MMF_DEBUG_LOG, "(%s: %p ~ %p)\n", name, min, max);
- ret = mm_attrs_get_range(attrs, idx, min, max);
- break;
- }
- case MM_ATTRS_TYPE_INVALID:
- default:
-// mmf_debug(MMF_DEBUG_ERROR, "This function doesn't support attribute type(%d, name:%s)\n", attr_type, name);
- if (err_attr_name)
- *err_attr_name = strdup(name);
- ret = MM_ERROR_COMMON_INVALID_ARGUMENT;
- }
-
- if (ret != MM_ERROR_NONE)
- {
- if (err_attr_name)
- *err_attr_name = strdup(name);
- mmf_debug(MMF_DEBUG_ERROR, "Setting failure.(name:%s)\n", name);
- return ret;
- }
-
- //next name
- name = va_arg (var_args, char*);
- }
-
- return ret;
-}
-
-
-int mm_attrs_multiple_set(MMHandleType handle, char **err_attr_name, const char *attribute_name, ...)
-{
- va_list var_args;
- int ret = MM_ERROR_NONE;
-
- return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- va_start (var_args, attribute_name);
- ret = mm_attrs_set_valist (handle, err_attr_name, attribute_name, var_args);
- va_end (var_args);
-
- return ret;
-}
-
-
-int mm_attrs_multiple_get(MMHandleType handle, char **err_attr_name, const char *attribute_name, ...)
-{
- va_list var_args;
- int ret = MM_ERROR_NONE;
-
- return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- va_start (var_args, attribute_name);
- ret = mm_attrs_get_valist (handle, err_attr_name, attribute_name, var_args);
- va_end (var_args);
-
- return ret;
-}
-
-
-int mm_attrs_get_info(MMHandleType h, int idx, MMAttrsInfo *info)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
-
- return_val_if_fail(h, MM_ERROR_COMMON_INVALID_ARGUMENT);
- return_val_if_fail(info, MM_ERROR_COMMON_INVALID_ARGUMENT);
- return_val_if_fail( 0 <= idx && idx < attrs->count, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- memset(info, 0x00, sizeof(MMAttrsInfo));
-
- info->type = attrs->items[idx].value.type;
- info->flag = attrs->items[idx].flags;
- info->validity_type = attrs->items[idx].value_spec.type;
-
- switch (info->validity_type)
- {
- case MM_ATTRS_VALID_TYPE_INT_ARRAY:
- info->int_array.array = attrs->items[idx].value_spec.spec.int_spec.array.array;
- info->int_array.count = attrs->items[idx].value_spec.spec.int_spec.array.count;
- break;
- case MM_ATTRS_VALID_TYPE_INT_RANGE:
- info->int_range.min = attrs->items[idx].value_spec.spec.int_spec.range.min;
- info->int_range.max = attrs->items[idx].value_spec.spec.int_spec.range.max;
- break;
- case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
- info->double_array.array = attrs->items[idx].value_spec.spec.double_spec.array.array;
- info->double_array.count = attrs->items[idx].value_spec.spec.double_spec.array.count;
- break;
- case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
- info->double_range.min = attrs->items[idx].value_spec.spec.double_spec.range.min;
- info->double_range.max = attrs->items[idx].value_spec.spec.double_spec.range.max;
- break;
- case MM_ATTRS_VALID_TYPE_NONE:
- mmf_debug(MMF_DEBUG_LOG, "Valid type none.\n");
- break;
- case MM_ATTRS_VALID_TYPE_INVALID:
- default:
- break;
- }
-
- return MM_ERROR_NONE;
-}
-
-
-int mm_attrs_get_info_by_name(MMHandleType h, const char *attr_name, MMAttrsInfo *info)
-{
- int idx = -1;
- int ret = MM_ERROR_NONE;
-
- return_val_if_fail(h, MM_ERROR_COMMON_INVALID_ARGUMENT);
- return_val_if_fail(info, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- mmf_debug(MMF_DEBUG_LOG, "(attr_name:%s)\n", attr_name);
-
- mm_attrs_get_index(h, attr_name, &idx);
-
- return_val_if_fail(idx >= 0, MM_ERROR_COMMON_INVALID_ARGUMENT);
-
- ret = mm_attrs_get_info(h, idx, info);
-
- return ret;
-}
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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 <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <assert.h>
-#include <stdbool.h>
-#include "mm_debug.h"
-#include "mm_attrs_private.h"
-
-int mmf_value_init(mmf_value_t *value, int type)
-{
- return_val_if_fail(value, -1);
- return_val_if_fail(MMF_IS_VALUE_TYPE(type), -1);
- memset(value, 0, sizeof(*value));
- value->type = type;
- return 0;
-}
-
-int mmf_value_copy(mmf_value_t *dest, const mmf_value_t *src)
-{
- return_val_if_fail(dest && src && src->type == dest->type, -1);
- switch (src->type) {
- case MM_ATTRS_TYPE_INT:
- dest->value.i_val = src->value.i_val;
- break;
- case MM_ATTRS_TYPE_DOUBLE:
- dest->value.d_val = src->value.d_val;
- break;
- case MM_ATTRS_TYPE_STRING:
- dest->value.s_val = strdup(src->value.s_val);
- dest->size = src->size;
- break;
- case MM_ATTRS_TYPE_DATA:
- dest->value.p_val = src->value.p_val;
- dest->size = src->size;
- break;
- default:
- break;
- }
- return 0;
-}
-
-int mmf_value_set_int(mmf_value_t *v, int ival)
-{
- return_val_if_fail(v && v->type == MMF_VALUE_TYPE_INT, -1);
- v->value.i_val = ival;
- return 0;
-}
-
-int mmf_value_get_int(const mmf_value_t *v)
-{
- return_val_if_fail(v && v->type == MMF_VALUE_TYPE_INT, -1);
- return v->value.i_val;
-}
-
-int mmf_value_set_double(mmf_value_t *v, double dval)
-{
- return_val_if_fail(v && v->type == MMF_VALUE_TYPE_DOUBLE, -1);
- v->value.d_val = dval;
- return 0;
-}
-
-double mmf_value_get_double(mmf_value_t *v)
-{
- return_val_if_fail(v->type == MMF_VALUE_TYPE_DOUBLE, -1);
- return v->value.d_val;
-}
-
-int mmf_value_set_string(mmf_value_t *v, const char *sval,int size)
-{
- return_val_if_fail(v && v->type == MMF_VALUE_TYPE_STRING, -1);
- if (v->value.s_val != NULL) {
- free(v->value.s_val);
- v->value.s_val = NULL;
- v->size = 0;
- }
- if (sval){
- v->value.s_val = strdup(sval);
- v->size = size;
- }
- else{
- v->value.s_val = NULL;
- v->size = 0;
- }
- return 0;
-}
-
-const char* mmf_value_get_string(const mmf_value_t *v, int *size)
-{
- return_val_if_fail(v && v->type == MMF_VALUE_TYPE_STRING, NULL);
- *size=v->size;
- return v->value.s_val;
-}
-
-int mmf_value_set_data(mmf_value_t *v, void *data,int size)
-{
- return_val_if_fail(v && v->type == MMF_VALUE_TYPE_DATA, -1);
- v->value.p_val = data;
- v->size=size;
- return 0;
-}
-
-void* mmf_value_get_data(const mmf_value_t *v,int *size)
-{
- return_val_if_fail(v && v->type == MMF_VALUE_TYPE_DATA, NULL);
- *size=v->size;
- return v->value.p_val;
-}
-
-void mmf_value_dump(const mmf_value_t *value)
-{
- return_if_fail(value);
- switch (value->type) {
- case MMF_VALUE_TYPE_INT:
- mmf_debug(MMF_DEBUG_LOG, "value[int]: %d\n", value->value.i_val);
- break;
- case MMF_VALUE_TYPE_DOUBLE:
- mmf_debug(MMF_DEBUG_LOG, "value[double]: %f\n", value->value.d_val);
- break;
- case MMF_VALUE_TYPE_STRING:
- mmf_debug(MMF_DEBUG_LOG, "value[string]: %s\n", value->value.s_val);
- break;
- case MMF_VALUE_TYPE_DATA:
- mmf_debug(MMF_DEBUG_LOG, "value[data]: %p\n", value->value.p_val);
- break;
- default:
- mmf_debug(MMF_DEBUG_LOG, "value invalid!!\n");
- break;
- }
-}
-
-int mmf_value_clear(mmf_value_t *value)
-{
- return_val_if_fail(value, -1);
- if (value->type == MMF_VALUE_TYPE_STRING) {
- if (value->value.s_val) {
- free(value->value.s_val);
- value->value.s_val = NULL;
- value->size = 0;
- }
- }
- return 0;
-}
-
-int mmf_value_spec_init(mmf_value_spec_t *vs, int vs_type)
-{
- return_val_if_fail(vs, -1);
- memset(vs, 0, sizeof(*vs));
- vs->type = vs_type;
- return 0;
-}
-
-int mmf_value_spec_set_int_range(mmf_value_spec_t *vs, int min, int max)
-{
- return_val_if_fail(vs && vs->type == MMF_VALUE_SPEC_INT_RANGE, -1);
- vs->spec.int_spec.range.min = min;
- vs->spec.int_spec.range.max = max;
- return 0;
-}
-
-int mmf_value_spec_get_int_range(mmf_value_spec_t *vs, int *min, int *max)
-{
- return_val_if_fail(vs->type == MMF_VALUE_SPEC_INT_RANGE,0);
-
- *min = vs->spec.int_spec.range.min;
- *max = vs->spec.int_spec.range.max;
-
- return 0;
-}
-
-int mmf_value_spec_set_int_array(mmf_value_spec_t *vs, const int *array, int count)
-{
- return_val_if_fail(vs &&
- vs->type == MMF_VALUE_SPEC_INT_ARRAY &&
- count > 0, -1);
-
- int *array_copy;
- array_copy = (int *) malloc(sizeof(int) * count);
- memcpy(array_copy, array, sizeof(int) * count);
- vs->spec.int_spec.array.array = array_copy;
- vs->spec.int_spec.array.count = count;
- return 0;
-}
-
-int mmf_value_spec_get_int_array(mmf_value_spec_t *vs, int **array, int *count)
-{
- return_val_if_fail(vs->type == MMF_VALUE_SPEC_INT_ARRAY,0);
-
- *array = vs->spec.int_spec.array.array;
- *count = vs->spec.int_spec.array.count;
-
- return 0;
-}
-
-int mmf_value_spec_set_double_range(mmf_value_spec_t *vs, double min, double max)
-{
- return_val_if_fail(vs && vs->type == MMF_VALUE_SPEC_DOUBLE_RANGE, -1);
-
- vs->spec.double_spec.range.min = min;
- vs->spec.double_spec.range.max = max;
- return 0;
-}
-
-int mmf_value_spec_get_double_range(mmf_value_spec_t *vs, double *min, double *max)
-{
- return_val_if_fail(vs->type == MMF_VALUE_SPEC_DOUBLE_RANGE,0);
-
- *min = vs->spec.double_spec.range.min;
- *max = vs->spec.double_spec.range.max;
- return 0;
-}
-
-int mmf_value_spec_set_double_array(mmf_value_spec_t *vs, const double *array, int count)
-{
- return_val_if_fail(vs &&
- vs->type == MMF_VALUE_SPEC_DOUBLE_ARRAY &&
- count > 0, -1);
-
- double *array_copy;
-
- array_copy = (double *) malloc(sizeof(double) * count);
- memcpy(array_copy, array, sizeof(double) * count);
- vs->spec.double_spec.array.array = array_copy;
- vs->spec.double_spec.array.count = count;
- return 0;
-}
-
-int mmf_value_spec_get_double_array(mmf_value_spec_t *vs, double **array, int *count)
-{
- return_val_if_fail(vs->type == MMF_VALUE_SPEC_DOUBLE_ARRAY,0);
-
- *array = vs->spec.double_spec.array.array;
- *count = vs->spec.double_spec.array.count;
- return 0;
-
-}
-
-int mmf_value_spec_clear(mmf_value_spec_t *vs)
-{
- return_val_if_fail(vs, -1);
- switch(vs->type) {
- case MMF_VALUE_SPEC_INT_ARRAY:
- if (vs->spec.int_spec.array.array) {
- free(vs->spec.int_spec.array.array);
- vs->spec.int_spec.array.array = NULL;
- vs->spec.int_spec.array.count = 0;
- }
- break;
- case MMF_VALUE_SPEC_DOUBLE_ARRAY:
- if (vs->spec.double_spec.array.array) {
- free(vs->spec.double_spec.array.array);
- vs->spec.double_spec.array.array = NULL;
- vs->spec.double_spec.array.count = 0;
- }
- break;
-
- default:
- break;
- }
- return 0;
-}
-
-int mmf_attribute_init(mmf_attribute_t *item, const char *name, int value_type, int flags)
-{
- return_val_if_fail(item && name, -1);
- item->name = strdup(name);
- item->flags = flags;
- mmf_value_spec_init(&item->value_spec, MMF_VALUE_SPEC_NONE);
- mmf_value_init(&item->value, value_type);
- mmf_value_init(&item->tmpval, value_type);
- return 0;
-}
-
-bool mmf_attribute_check_flags(mmf_attribute_t *item, int flags)
-{
- return_val_if_fail(item, false);
- return item->flags & flags;
-}
-
-bool mmf_attribute_validate_int(mmf_attribute_t *item, int val)
-{
- return_val_if_fail(item, false);
- return_val_if_fail(item->value.type == MMF_VALUE_TYPE_INT, false);
-
- bool valid = true;
- int i = 0;
-
- switch (item->value_spec.type) {
- case MMF_VALUE_SPEC_INT_RANGE:
- if (val < item->value_spec.spec.int_spec.range.min ||
- val > item->value_spec.spec.int_spec.range.max) {
- valid = false;
- mmf_debug(MMF_DEBUG_LOG, "[mmf_attribute:%s] out of range\n", item->name);
- }
- break;
- case MMF_VALUE_SPEC_INT_ARRAY:
- valid = false;
- for (i = 0; i < item->value_spec.spec.int_spec.array.count; i++) {
- if (val == item->value_spec.spec.int_spec.array.array[i]) {
- valid = true;
- break;
- }
- }
- if (!valid) {
- mmf_debug(MMF_DEBUG_LOG, "[mmf_attribute:%s] out of array\n", item->name);
- }
- break;
- default:
- break;
- }
-
- return valid;
-}
-
-bool mmf_attribute_validate_double(mmf_attribute_t *item, double val)
-{
- return_val_if_fail(item, false);
- return_val_if_fail(item->value.type == MMF_VALUE_TYPE_DOUBLE, false);
-
- bool valid = true;
- int i = 0;
-
- switch (item->value_spec.type) {
- case MMF_VALUE_SPEC_DOUBLE_RANGE:
- if (val < item->value_spec.spec.double_spec.range.min ||
- val > item->value_spec.spec.double_spec.range.max) {
- valid = false;
- mmf_debug(MMF_DEBUG_LOG, "[mmf_attribute:%s] out of range\n", item->name);
- }
- break;
- case MMF_VALUE_SPEC_DOUBLE_ARRAY:
- valid = false;
- for (i = 0; i < item->value_spec.spec.double_spec.array.count; i++) {
- if (val == item->value_spec.spec.double_spec.array.array[i]) {
- valid = true;
- break;
- }
- }
- if (!valid) {
- mmf_debug(MMF_DEBUG_LOG, "[mmf_attribute:%s] out of array\n", item->name);
- }
- break;
- default:
- break;
- }
-
- return valid;
-}
-
-void mmf_attribute_clear(mmf_attribute_t *item)
-{
- assert(item);
- if (item->name) {
- free(item->name);
- item->name = NULL;
- }
-
- mmf_value_clear(&item->tmpval);
- mmf_value_clear(&item->value);
- mmf_value_spec_clear(&item->value_spec);
-}
-
-bool mmf_attribute_is_modified(mmf_attribute_t *item)
-{
- return_val_if_fail(item, false);
- return (item->flags & MM_ATTRS_FLAG_MODIFIED);
-}
-
-void mmf_attribute_set_modified(mmf_attribute_t *item)
-{
- return_if_fail(item);
- if (!(item->flags & MM_ATTRS_FLAG_MODIFIED)) {
- mmf_value_copy(&item->tmpval, &item->value);
- item->flags |= MM_ATTRS_FLAG_MODIFIED;
- }
-}
-
-void mmf_attribute_set_readonly(mmf_attribute_t *item)
-{
- return_if_fail(item);
- if (item->flags & MM_ATTRS_FLAG_WRITABLE)
- item->flags -= MM_ATTRS_FLAG_WRITABLE;
-}
-
-void mmf_attribute_set_disabled(mmf_attribute_t *item)
-{
- return_if_fail(item);
- if (item->flags & MM_ATTRS_FLAG_WRITABLE)
- item->flags -= MM_ATTRS_FLAG_WRITABLE;
- if (item->flags & MM_ATTRS_FLAG_READABLE)
- item->flags -= MM_ATTRS_FLAG_READABLE;
- if (item->flags & MM_ATTRS_FLAG_MODIFIED)
- item->flags -= MM_ATTRS_FLAG_MODIFIED;
-}
-
-void mmf_attribute_commit(mmf_attribute_t *item)
-{
- return_if_fail(item);
- if (item->flags & MM_ATTRS_FLAG_MODIFIED) {
- mmf_value_copy(&item->value, &item->tmpval);
- mmf_value_clear(&item->tmpval);
- item->flags ^= MM_ATTRS_FLAG_MODIFIED;
- }
-}
-
-int mmf_attribute_set_int(mmf_attribute_t *item, int val)
-{
- return_val_if_fail(item, -1);
- if (mmf_value_set_int(&item->tmpval, val) == 0) {
- item->flags |= MM_ATTRS_FLAG_MODIFIED;
- return 0;
- }
- return -1;
-}
-
-int mmf_attribute_set_double(mmf_attribute_t *item, double val)
-{
- return_val_if_fail(item, -1);
- if (mmf_value_set_double(&item->tmpval, val) == 0) {
- item->flags |= MM_ATTRS_FLAG_MODIFIED;
- return 0;
- }
- return -1;
-}
-
-int mmf_attribute_set_string(mmf_attribute_t *item, const char *string, int size)
-{
- return_val_if_fail(item, -1);
-
- if (mmf_value_set_string(&item->tmpval, string,size) == 0) {
- if (string)
- item->flags |= MM_ATTRS_FLAG_MODIFIED;
-
- return 0;
- }
- return -1;
-}
-
-int mmf_attribute_set_data(mmf_attribute_t *item, void *data, int size)
-{
- return_val_if_fail(item, -1);
-
- if (mmf_value_set_data(&item->tmpval, data,size) == 0) {
- item->flags |= MM_ATTRS_FLAG_MODIFIED;
- return 0;
- }
- return -1;
-}
-
-MMHandleType mmf_attrs_new(int count)
-{
- return_val_if_fail(count > 0, 0);
- mmf_attrs_t *attrs;
- attrs = (mmf_attrs_t *) malloc (sizeof(mmf_attrs_t));
- attrs->count = count;
- attrs->items = (mmf_attribute_t *) malloc (sizeof(mmf_attribute_t) * count);
- memset(attrs->items, 0, sizeof(sizeof(mmf_attribute_t) * count));
- return (MMHandleType) attrs;
-}
-
-MMHandleType mmf_attrs_new_from_data(const char *name,
- mmf_attrs_construct_info_t *info,
- int count,
- mmf_attrs_commit_func_t commit_func,
- void *commit_param)
-{
- return_val_if_fail(info && count > 0, 0);
- MMHandleType h;
- mmf_attrs_t *attrs;
-
- h = mmf_attrs_new(count);
- mmf_attrs_init(h, info, count);
- attrs = (mmf_attrs_t *) h;
- attrs->name = NULL;
- if (name)
- attrs->name = strdup(name);
- attrs->commit_func = commit_func;
- attrs->commit_param = commit_param;
- return h;
-}
-
-void mmf_attrs_free(MMHandleType h)
-{
- return_if_fail(h);
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- if (attrs) {
- if (attrs->name) {
- free(attrs->name);
- attrs->name = NULL;
- }
- if (attrs->items) {
- int i;
- for (i = 0; i < attrs->count; i++) {
- mmf_attribute_clear(&attrs->items[i]);
- }
- free(attrs->items);
- attrs->items = NULL;
- }
- free(attrs);
- }
-}
-
-int mmf_attrs_init(MMHandleType h, mmf_attrs_construct_info_t *info, int count)
-{
- return_val_if_fail(h && info && count > 0, -1);
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- int i;
- int size = 0;
- for (i = 0; i < count; i++) {
-
- mmf_attribute_init(&attrs->items[i], info[i].name, info[i].value_type,
- info[i].flags);
-
- switch (info[i].value_type) {
- case MMF_VALUE_TYPE_INT:
- assert(attrs->items[i].value.value.i_val == 0);
- mmf_value_set_int(&attrs->items[i].value,
- (int) info[i].default_value);
- break;
- case MMF_VALUE_TYPE_DOUBLE:
- {
- int i_val = (int)info[i].default_value;
- double d_val = (double) i_val;
- assert(attrs->items[i].value.value.d_val == 0);
- mmf_value_set_double(&attrs->items[i].value,
- d_val);
- break;
- }
- case MMF_VALUE_TYPE_STRING:
- assert(attrs->items[i].value.value.s_val == NULL);
- if(info[i].default_value)
- size = strlen(info[i].default_value)+1;
- mmf_value_set_string(&attrs->items[i].value,
- (const char *)info[i].default_value,size);
- break;
- case MMF_VALUE_TYPE_DATA:
- assert(attrs->items[i].value.value.p_val == NULL);
-
- size = sizeof(info[i].default_value)+1;
-
- mmf_value_set_data(&attrs->items[i].value, info[i].default_value,size);
- break;
- default:
- mmf_debug(MMF_DEBUG_LOG, "ERROR: Invalid MMF_VALUE_TYPE\n");
- assert(0);
- break;
- }
- }
-
- return 0;
-}
-
-int mmf_attrs_commit(MMHandleType h)
-{
- return_val_if_fail(h, -1);
-
- mmf_attrs_t *attrs = (mmf_attrs_t * )h;
- int i;
- int ret = 0;
-
- for (i = 0; i < attrs->count; ++i) {
- if (mmf_attribute_is_modified(&attrs->items[i])) {
- if (attrs->commit_func) {
- if (attrs->commit_func(i, attrs->items[i].name,
- &attrs->items[i].tmpval,
- attrs->commit_param)) {
- mmf_attribute_commit(&attrs->items[i]);
- } else {
- /* without this, there is no way to solve modify when commit_func failed. */
- if (attrs->items[i].flags & MM_ATTRS_FLAG_MODIFIED)
- attrs->items[i].flags ^= MM_ATTRS_FLAG_MODIFIED;
- ret = -1;
- }
- } else {
- mmf_attribute_commit(&attrs->items[i]);
- }
- }
- }
- return ret;
-}
-
-int mmf_attrs_commit_err(MMHandleType h, char **err_attr_name)
-{
- mmf_attrs_t *attrs = (mmf_attrs_t * )h;
- int i;
- int ret = 0;
-
- return_val_if_fail(h, -1);
-
- for (i = 0; i < attrs->count; ++i) {
- if (mmf_attribute_is_modified(&attrs->items[i])) {
- if (attrs->commit_func) {
- if (attrs->commit_func(i, attrs->items[i].name,
- &attrs->items[i].tmpval,
- attrs->commit_param)) {
- mmf_attribute_commit(&attrs->items[i]);
- } else {
- /* without this, there is no way to solve modify when commit_func failed. */
- if (attrs->items[i].flags & MM_ATTRS_FLAG_MODIFIED)
- attrs->items[i].flags ^= MM_ATTRS_FLAG_MODIFIED;
- ret = -1;
-
- /* Set Error information */
- if (err_attr_name)
- *err_attr_name = strdup(attrs->items[i].name);
-
- break;
- }
- } else {
- mmf_attribute_commit(&attrs->items[i]);
- }
- }
- }
- return ret;
-}
-
-int mmf_attrs_set_valid_type(MMHandleType h, int idx, int v_type)
-{
- return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- return mmf_value_spec_init(&attrs->items[idx].value_spec, v_type);
-}
-
-int mmf_attrs_set_valid_range(MMHandleType h, int idx, int min, int max)
-{
- return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- mmf_value_spec_clear(&attrs->items[idx].value_spec);
- assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_INT_RANGE);
- return mmf_value_spec_set_int_range(&attrs->items[idx].value_spec, min, max);
-}
-
-int mmf_attrs_set_valid_array(MMHandleType h, int idx, const int *array, int count)
-{
- return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- mmf_value_spec_clear(&attrs->items[idx].value_spec);
- assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_INT_ARRAY);
- return mmf_value_spec_set_int_array(&attrs->items[idx].value_spec, array, count);
-}
-
-int mmf_attrs_set_valid_double_range(MMHandleType h, int idx, double min, double max)
-{
- return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- mmf_value_spec_clear(&attrs->items[idx].value_spec);
- assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_DOUBLE_RANGE);
- return mmf_value_spec_set_double_range(&attrs->items[idx].value_spec, min, max);
-}
-
-int mmf_attrs_set_valid_double_array(MMHandleType h, int idx, const double *array, int count)
-{
- return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
- mmf_attrs_t *attrs = (mmf_attrs_t *) h;
- mmf_value_spec_clear(&attrs->items[idx].value_spec);
- assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_DOUBLE_ARRAY);
- return mmf_value_spec_set_double_array(&attrs->items[idx].value_spec, array, count);
-}
-
+++ /dev/null
-/*
- * libmm-common
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jonghyuk Choi <jhchoi.choi@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 <stdlib.h>
-#include <string.h>
-
-#include <mm_error.h>
-
-#include <mm_debug.h>
-#include <mm_list_private.h>
-
-/**
- * Definition of list item
- */
-typedef struct {
- int id;
- void *data;
- void *next;
-} mmf_list_t;
-
-/**
- * Globals
- */
-static mmf_list_t *g_list = NULL;
-static int g_list_id = 0;
-
-EXPORT_API
-int mmf_list_append(void *data)
-{
- mmf_list_t *item;
- mmf_list_t *list;
-
- item = (mmf_list_t *) malloc(sizeof(mmf_list_t));
-
- if (item == NULL) {
- debug_error("memory allocation error\n");
- return MM_ERROR_OUT_OF_MEMORY;
- }
-
- /* set new list information */
- memset(item, 0, sizeof(mmf_list_t));
-
- item->id = g_list_id++;
- item->data = data;
- list = g_list;
-
- if (list == NULL) {
- /* first item */
- g_list = item;
- }
- else {
- list = g_list;
-
- /* move to last */
- while (list->next) {
- list = (mmf_list_t *) list->next;
- }
- list->next = item;
- }
-
- return item->id;
-}
-
-EXPORT_API
-int mmf_list_remove(int handle)
-{
- mmf_list_t *list;
- mmf_list_t *prev;
-
- list = g_list;
- prev = NULL;
-
- while (list) {
- if (list->id == handle) {
- /* remove handle */
- if (prev) {
- prev->next = list->next;
- }
- else {
- g_list = list->next;
- }
-
- free(list);
-
- return MM_ERROR_NONE;
- }
-
- prev = list;
- list = (mmf_list_t *) list->next;
- }
-
- debug_error("handle not found\n");
-
- return MM_ERROR_INVALID_ARGUMENT;
-}
-
-EXPORT_API
-void *mmf_list_find(int handle)
-{
- mmf_list_t *list;
-
- list = g_list;
-
- while (list) {
- if (list->id == handle) {
- return list->data;
- }
-
- list = (mmf_list_t *) list->next;
- }
-
- debug_error("handle not found\n");
-
- return NULL;
-}
-
-EXPORT_API
-int mmf_list_find_by_data(void *data)
-{
- mmf_list_t *list;
-
- list = g_list;
-
- while (list) {
- if (list->data == data) {
- return list->id;
- }
-
- list = (mmf_list_t *) list->next;
- }
-
- debug_error("handle not found\n");
-
- return -1;
-}
-
+++ /dev/null
-Name: libmm-common
-Summary: Multimedia Framework Common Lib
-Version: 0.2.25
-Release: 1.1
-Group: TO_BE/FILLED_IN
-License: Apache-2.0
-Source0: libmm-common-%{version}.tar.gz
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(mm-log)
-
-
-%description
-Multimedia Framework Common Library
-
-
-
-%package devel
-Summary: Multimedia Framework Common Lib (devel)
-Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
-
-%description devel
-Multimedia Framework Common Library (devel)
-
-%prep
-%setup -q
-
-./autogen.sh
-CFLAGS="%{optflags} -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" " ./configure --prefix=%{_prefix} ; export CFLAGS
-
-%build
-
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-%make_install
-
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root,-)
-%{_libdir}/libmmfcommon.so.*
-
-
-%files devel
-%defattr(-,root,root,-)
-%{_includedir}/mmf/SLP_MultimediaFW_PG.h
-%{_includedir}/mmf/mm_types.h
-%{_includedir}/mmf/mm_error.h
-%{_includedir}/mmf/mm_message.h
-%{_includedir}/mmf/mm_attrs.h
-%{_includedir}/mmf/mm_attrs_private.h
-%{_includedir}/mmf/mm_debug.h
-%{_includedir}/mmf/mm.h
-%{_libdir}/pkgconfig/mm-common.pc
-%{_libdir}/libmmfcommon.so