start new branch (wrs-cdk-android-libmix-20100129)

from: Ho-Eun, Ryu
base branch: intel-cdk-moblin-libmix-20100129
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..d0deed6
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,11 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+VENDORS_INTEL_MRST_LIBMIX_ROOT := $(LOCAL_PATH)
+
+GLIB_TOP := external/glib
+
+include $(VENDORS_INTEL_MRST_LIBMIX_ROOT)/mix_common/src/Android.mk
+include $(VENDORS_INTEL_MRST_LIBMIX_ROOT)/mix_audio/src/Android.mk
+include $(VENDORS_INTEL_MRST_LIBMIX_ROOT)/mix_video/src/Android.mk
+include $(VENDORS_INTEL_MRST_LIBMIX_ROOT)/mix_vbp/Android.mk
diff --git a/mix_audio/src/Android.mk b/mix_audio/src/Android.mk
new file mode 100644
index 0000000..c108526
--- /dev/null
+++ b/mix_audio/src/Android.mk
@@ -0,0 +1,45 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES :=	\
+	mixaip.c	\
+	mixacp.c	\
+	mixacpmp3.c	\
+	mixacpwma.c	\
+	mixacpaac.c	\
+	mixaudio.c	\
+	sst_proxy.c
+
+LOCAL_C_INCLUDES :=		\
+	$(LOCAL_PATH)		\
+	$(GLIB_TOP)		\
+	$(GLIB_TOP)/android	\
+	$(GLIB_TOP)/glib	\
+	$(GLIB_TOP)/gobject	\
+	$(TARGET_OUT_HEADERS)/libmixcommon
+
+LOCAL_SHARED_LIBRARIES :=	\
+	libglib-2.0		\
+	libgobject-2.0		\
+	libgthread-2.0		\
+	libgmodule-2.0		\
+	libmixcommon
+
+LOCAL_COPY_HEADERS_TO := libmixaudio
+
+LOCAL_COPY_HEADERS :=		\
+	amhelper.h		\
+	intel_sst_ioctl.h	\
+	mixacp.h		\
+	mixacpaac.h		\
+	mixacpmp3.h		\
+	mixacpwma.h		\
+	mixaip.h		\
+	mixaudio.h		\
+	mixaudiotypes.h		\
+	pvt.h			\
+	sst_proxy.h
+
+LOCAL_MODULE := libmixaudio
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/mix_audio/src/mixacp.c b/mix_audio/src/mixacp.c
index e7ce507..d66ee3c 100644
--- a/mix_audio/src/mixacp.c
+++ b/mix_audio/src/mixacp.c
@@ -197,8 +197,7 @@
             (acp1->sample_freq == acp2->sample_freq) &&
             (acp1->bits_per_sample == acp2->bits_per_sample) &&
             (acp1->op_align == acp2->op_align) && 
-            (!g_strcmp0(acp1->stream_name, acp2->stream_name));
-            //g_strcmp0 handles NULL gracefully
+            (!strcmp(acp1->stream_name, acp2->stream_name));
   }
 
   return ret;
diff --git a/mix_audio/src/mixaudio.c b/mix_audio/src/mixaudio.c
index 6d41350..196a0b0 100644
--- a/mix_audio/src/mixaudio.c
+++ b/mix_audio/src/mixaudio.c
@@ -89,7 +89,7 @@
  * 
  * LPE Device location.
  */
-static const char* LPE_DEVICE="/dev/lpe";
+static const char* LPE_DEVICE="/dev/sst";
 /* #define LPE_DEVICE "/dev/lpe" */
 
 #define _LOCK(obj) g_static_rec_mutex_lock(obj);
@@ -858,7 +858,11 @@
   }
   // now configure stream.
 
+#ifdef AUDIO_MANAGER
   ret = mix_audio_am_unregister(mix, audioconfigparams);
+#else
+  ret = MIX_RESULT_SUCCESS;
+#endif
 
   if (MIX_SUCCEEDED(ret))
   {
@@ -867,7 +871,11 @@
 
   if (MIX_SUCCEEDED(ret))
   {
+#ifdef AUDIO_MANAGER
     ret = mix_audio_am_register(mix, audioconfigparams);
+#else
+  ret = MIX_RESULT_SUCCESS;
+#endif
   }
 
   if (MIX_SUCCEEDED(ret))
@@ -953,9 +961,10 @@
   return ret;
 }
 
+#ifdef AUDIO_MANAGER
 gboolean mix_audio_AM_Change(MixAudioConfigParams *oldparams, MixAudioConfigParams *newparams) 
 {
-  if (g_strcmp0(oldparams->stream_name, newparams->stream_name) == 0) {
+  if (strcmp(oldparams->stream_name, newparams->stream_name) == 0) {
     return FALSE;
   }
 
@@ -1025,6 +1034,7 @@
 
   return ret;
 }
+#endif /* AUDIO_MANAGER */
 
 MIX_RESULT mix_audio_capture_encode_default(MixAudio *mix, MixIOVec *iovout, gint iovoutcnt)
 {
diff --git a/mix_common/src/Android.mk b/mix_common/src/Android.mk
new file mode 100644
index 0000000..7f2bc52
--- /dev/null
+++ b/mix_common/src/Android.mk
@@ -0,0 +1,32 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES :=		\
+	mixlog.c		\
+	mixparams.c		\
+	mixdrmparams.c		\
+
+LOCAL_C_INCLUDES :=		\
+	$(LOCAL_PATH)		\
+	$(GLIB_TOP)		\
+	$(GLIB_TOP)/android	\
+	$(GLIB_TOP)/glib 	\
+	$(GLIB_TOP)/gobject
+
+LOCAL_SHARED_LIBRARIES := 	\
+	libglib-2.0		\
+	libgobject-2.0		\
+	libgthread-2.0		\
+	libgmodule-2.0
+
+LOCAL_COPY_HEADERS_TO := libmixcommon
+
+LOCAL_COPY_HEADERS :=		\
+	mixlog.h		\
+	mixresult.h		\
+	mixparams.h		\
+	mixdrmparams.h
+
+LOCAL_MODULE := libmixcommon
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/mix_vbp/Android.mk b/mix_vbp/Android.mk
new file mode 100644
index 0000000..9f286ec
--- /dev/null
+++ b/mix_vbp/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+VENDORS_INTEL_MRST_MIXVBP_ROOT := $(LOCAL_PATH)
+
+include $(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/parser/Android.mk
+include $(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/codecs/h264/parser/Android.mk
diff --git a/mix_vbp/viddec_fw/fw/codecs/h264/parser/Android.mk b/mix_vbp/viddec_fw/fw/codecs/h264/parser/Android.mk
new file mode 100644
index 0000000..37dfdcf
--- /dev/null
+++ b/mix_vbp/viddec_fw/fw/codecs/h264/parser/Android.mk
@@ -0,0 +1,40 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES :=			\
+	h264parse.c			\
+	h264parse_bsd.c			\
+	h264parse_math.c		\
+	h264parse_mem.c			\
+	h264parse_sei.c			\
+	h264parse_sh.c			\
+	h264parse_pps.c			\
+	h264parse_sps.c			\
+	h264parse_dpb.c			\
+	viddec_h264_parse.c		\
+	mix_vbp_h264_stubs.c
+
+LOCAL_CFLAGS := -DVBP -DHOST_ONLY
+
+LOCAL_C_INCLUDES :=			\
+	$(GLIB_TOP)			\
+	$(GLIB_TOP)/android		\
+	$(GLIB_TOP)/glib		\
+	$(GLIB_TOP)/gobject		\
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/include		   \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/include		   \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/parser/include	   \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/codecs/h264/include \
+	$(TARGET_OUT_HEADERS)/libmixcommon
+
+LOCAL_MODULE := libmixvbp_h264
+
+LOCAL_SHARED_LIBRARIES :=		\
+	libglib-2.0			\
+	libgobject-2.0			\
+	libgthread-2.0			\
+	libgmodule-2.0			\
+	libmixvbp
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/mix_vbp/viddec_fw/fw/include/stdint.h b/mix_vbp/viddec_fw/fw/include/stdint.h
index 885cfe1..cf23208 100644
--- a/mix_vbp/viddec_fw/fw/include/stdint.h
+++ b/mix_vbp/viddec_fw/fw/include/stdint.h
@@ -1,6 +1,8 @@
 #ifndef __STDINT_H
 #define __STDINT_H
 
+#ifndef ANDROID
+
 typedef unsigned char uint8_t;
 typedef unsigned short uint16_t;
 typedef unsigned int uint32_t;
@@ -13,6 +15,8 @@
 typedef signed long long int64_t;
 //#endif
 
+#endif
+
 #ifndef NULL
 #define NULL (void*)0x0
 #endif
diff --git a/mix_vbp/viddec_fw/fw/parser/Android.mk b/mix_vbp/viddec_fw/fw/parser/Android.mk
new file mode 100644
index 0000000..1cdf50d
--- /dev/null
+++ b/mix_vbp/viddec_fw/fw/parser/Android.mk
@@ -0,0 +1,54 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES :=			\
+	vbp_h264_parser.c		\
+	vbp_vc1_parser.c		\
+	vbp_loader.c			\
+	vbp_mp42_parser.c		\
+	vbp_utils.c			\
+	viddec_emit.c			\
+	viddec_parse_sc.c		\
+	viddec_parse_sc_stub.c		\
+	viddec_pm.c			\
+	viddec_pm_parser_ops.c		\
+	viddec_pm_stubs.c		\
+	viddec_pm_tags.c		\
+	viddec_pm_utils_bstream.c	\
+	viddec_pm_utils_list.c
+
+LOCAL_CFLAGS := -DVBP -DHOST_ONLY
+
+LOCAL_C_INCLUDES +=			\
+	$(GLIB_TOP)			\
+	$(GLIB_TOP)/glib		\
+	$(GLIB_TOP)/android		\
+	$(GLIB_TOP)/gobject		\
+	$(LOCAL_PATH)/include		\
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/include		   \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/include		   \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/codecs/h264/include \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/codecs/mp2/include  \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/codecs/mp4/include  \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/codecs/vc1/include  \
+	$(VENDORS_INTEL_MRST_MIXVBP_ROOT)/viddec_fw/fw/codecs/vc1/parser   \
+	$(TARGET_OUT_HEADERS)/libmixcommon				   \
+	$(TARGET_OUT_HEADERS)/libva
+
+LOCAL_COPY_HEADERS_TO := libmixvbp
+
+LOCAL_COPY_HEADERS :=	\
+	vbp_loader.h
+
+LOCAL_MODULE := libmixvbp
+
+LOCAL_SHARED_LIBRARIES :=		\
+	libdl				\
+	libcutils			\
+	libglib-2.0			\
+	libgobject-2.0			\
+	libgthread-2.0			\
+	libgmodule-2.0
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/mix_vbp/viddec_fw/fw/parser/include/viddec_emitter.h b/mix_vbp/viddec_fw/fw/parser/include/viddec_emitter.h
index bb96bab..d887501 100644
--- a/mix_vbp/viddec_fw/fw/parser/include/viddec_emitter.h
+++ b/mix_vbp/viddec_fw/fw/parser/include/viddec_emitter.h
@@ -1,7 +1,7 @@
 #ifndef VIDDEC_EMITTER_H
 #define VIDDEC_EMITTER_H
 
-#include <stdint.h>
+#include "../../include/stdint.h"
 #ifndef HOST_ONLY
 #define DDR_MEM_MASK 0x80000000
 #else
diff --git a/mix_vbp/viddec_fw/fw/parser/vbp_h264_parser.c b/mix_vbp/viddec_fw/fw/parser/vbp_h264_parser.c
index 033f6b6..7a056df 100644
--- a/mix_vbp/viddec_fw/fw/parser/vbp_h264_parser.c
+++ b/mix_vbp/viddec_fw/fw/parser/vbp_h264_parser.c
@@ -1436,10 +1436,16 @@
 
   	size_left = cubby->size;
 
+#ifndef ANDROID
   	while (size_left >= NAL_length_size)
   	{
     	NAL_length = vbp_get_NAL_length_h264(cubby->buf + size_parsed);    	
     	  
+#else
+	while (size_left > 0)
+	{
+		NAL_length = size_left;
+#endif
     	size_parsed += NAL_length_size;
     	cxt->list.data[cxt->list.num_items].stpos = size_parsed;
     	size_parsed += NAL_length; /* skip NAL bytes */
diff --git a/mix_vbp/viddec_fw/fw/parser/vbp_loader.h b/mix_vbp/viddec_fw/fw/parser/vbp_loader.h
index 66169dd..b57821c 100644
--- a/mix_vbp/viddec_fw/fw/parser/vbp_loader.h
+++ b/mix_vbp/viddec_fw/fw/parser/vbp_loader.h
@@ -29,9 +29,11 @@
 #ifndef uint32
 typedef unsigned int uint32;
 #endif
+#ifndef ANDROID
 #ifndef bool
 typedef int bool;
 #endif
+#endif
 
 typedef void *Handle;
 
diff --git a/mix_vbp/viddec_fw/fw/parser/vbp_utils.c b/mix_vbp/viddec_fw/fw/parser/vbp_utils.c
index 651b801..c350342 100644
--- a/mix_vbp/viddec_fw/fw/parser/vbp_utils.c
+++ b/mix_vbp/viddec_fw/fw/parser/vbp_utils.c
@@ -66,7 +66,11 @@
 	switch (pcontext->parser_type)
 	{
 		case VBP_VC1:
+#ifndef ANDROID
 		parser_name = "libmixvbp_vc1.so.0";
+#else
+		parser_name = "libmixvbp_vc1.so";
+#endif
 		break;
 
 		/* MPEG-2 parser is not supported. */
@@ -76,11 +80,19 @@
 		break;*/
 
 		case VBP_MPEG4:
+#ifndef ANDROID
 		parser_name = "libmixvbp_mpeg4.so.0";
+#else
+		parser_name = "libmixvbp_mpeg4.so";
+#endif
 		break;
 
 		case VBP_H264:
+#ifndef ANDROID
 		parser_name = "libmixvbp_h264.so.0";
+#else
+		parser_name = "libmixvbp_h264.so";
+#endif
 		break;
 
 		default:
diff --git a/mix_video/src/Android.mk b/mix_video/src/Android.mk
new file mode 100644
index 0000000..614ac4b
--- /dev/null
+++ b/mix_video/src/Android.mk
@@ -0,0 +1,107 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := 			\
+	mixbuffer.c			\
+	mixbufferpool.c			\
+	mixdisplay.c			\
+	mixdisplayx11.c			\
+	mixdrmparams.c			\
+	mixframemanager.c		\
+	mixsurfacepool.c		\
+	mixvideo.c			\
+	mixvideocaps.c			\
+	mixvideoconfigparams.c		\
+	mixvideoconfigparamsdec.c	\
+	mixvideoconfigparamsdec_h264.c	\
+	mixvideoconfigparamsdec_mp42.c	\
+	mixvideoconfigparamsdec_vc1.c	\
+	mixvideoconfigparamsenc.c	\
+	mixvideoconfigparamsenc_h264.c	\
+	mixvideoconfigparamsenc_mpeg4.c	\
+	mixvideoconfigparamsenc_preview.c \
+	mixvideodecodeparams.c		\
+	mixvideoencodeparams.c		\
+	mixvideoformat.c		\
+	mixvideoformat_h264.c		\
+	mixvideoformat_mp42.c		\
+	mixvideoformat_vc1.c		\
+	mixvideoformatenc.c		\
+	mixvideoformatenc_h264.c	\
+	mixvideoformatenc_mpeg4.c	\
+	mixvideoformatenc_preview.c	\
+	mixvideoframe.c			\
+	mixvideoinitparams.c		\
+	mixvideorenderparams.c
+
+LOCAL_CFLAGS :=			\
+	-DMIXVIDEO_AGE=1	\
+	-DMIXVIDEO_CURRENT=1	\
+	-DMIXVIDEO_MAJOR=0	\
+	-DMIXVIDEO_MINOR=1	\
+	-DMIXVIDEO_REVISION=8
+
+LOCAL_C_INCLUDES :=				\
+	$(LOCAL_PATH)				\
+	$(GLIB_TOP)				\
+	$(GLIB_TOP)/android			\
+	$(GLIB_TOP)/glib			\
+	$(GLIB_TOP)/gobject			\
+	$(TARGET_OUT_HEADERS)/libmixcommon	\
+	$(TARGET_OUT_HEADERS)/libmixvbp		\
+	$(TARGET_OUT_HEADERS)/libva
+
+LOCAL_SHARED_LIBRARIES :=	\
+	libcutils		\
+	libglib-2.0		\
+	libgobject-2.0		\
+	libgthread-2.0		\
+	libgmodule-2.0		\
+	libmixcommon		\
+	libmixvbp		\
+	libva
+
+LOCAL_COPY_HEADERS_TO := libmixvideo
+
+LOCAL_COPY_HEADERS :=			\
+	mixbuffer.h			\
+	mixbuffer_private.h		\
+	mixbufferpool.h			\
+	mixdisplay.h			\
+	mixdisplayx11.h			\
+	mixdrmparams.h			\
+	mixframemanager.h		\
+	mixsurfacepool.h		\
+	mixvideo.h			\
+	mixvideodef.h			\
+	mixvideo_private.h		\
+	mixvideocaps.h			\
+	mixvideoconfigparams.h		\
+	mixvideoconfigparamsdec.h	\
+	mixvideoconfigparamsdec_h264.h	\
+	mixvideoconfigparamsdec_mp42.h	\
+	mixvideoconfigparamsdec_vc1.h	\
+	mixvideoconfigparamsenc.h	\
+	mixvideoconfigparamsenc_h264.h	\
+	mixvideoconfigparamsenc_mpeg4.h	\
+	mixvideoconfigparamsenc_preview.h \
+	mixvideodecodeparams.h		\
+	mixvideoencodeparams.h		\
+	mixvideoformat.h		\
+	mixvideoformat_h264.h		\
+	mixvideoformat_mp42.h		\
+	mixvideoformat_vc1.h		\
+	mixvideoformatenc.h		\
+	mixvideoformatenc_h264.h	\
+	mixvideoformatenc_mpeg4.h	\
+	mixvideoformatenc_preview.h	\
+	mixvideoformatqueue.h		\
+	mixvideoframe.h			\
+	mixvideoframe_private.h		\
+	mixvideoinitparams.h		\
+	mixvideorenderparams.h		\
+	mixvideorenderparams_internal.h
+
+LOCAL_MODULE := libmixvideo
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/mix_video/src/mixdisplayx11.c b/mix_video/src/mixdisplayx11.c
index 60eb3e4..467bde2 100644
--- a/mix_video/src/mixdisplayx11.c
+++ b/mix_video/src/mixdisplayx11.c
@@ -22,6 +22,12 @@
 
 #define _do_init { _mix_displayx11_type = g_define_type_id; }
 
+#ifdef ANDROID
+int XSync(Display* display, Bool bvalue) {
+    return 0;
+}
+#endif
+
 gboolean mix_displayx11_copy(MixDisplay * target, const MixDisplay * src);
 MixDisplay *mix_displayx11_dup(const MixDisplay * obj);
 gboolean mix_displayx11_equal(MixDisplay * first, MixDisplay * second);
diff --git a/mix_video/src/mixdisplayx11.h b/mix_video/src/mixdisplayx11.h
index 4a14c9f..d6db5bd 100644
--- a/mix_video/src/mixdisplayx11.h
+++ b/mix_video/src/mixdisplayx11.h
@@ -11,7 +11,16 @@
 
 #include "mixdisplay.h"
 #include "mixvideodef.h"
+#ifndef ANDROID
 #include <X11/Xlib.h>
+#else
+#define Display unsigned int
+#define Drawable unsigned int
+#define Bool int
+#define True 1
+#define False 0
+int XSync(Display* display, Bool bvalue);
+#endif
 
 /**
 * MIX_TYPE_DISPLAYX11:
diff --git a/mix_video/src/mixvideo.c b/mix_video/src/mixvideo.c
index e9cba0a..ef74184 100644
--- a/mix_video/src/mixvideo.c
+++ b/mix_video/src/mixvideo.c
@@ -7,7 +7,9 @@
  */
 
 #include <va/va.h>             /* libVA */
+#ifndef ANDROID
 #include <X11/Xlib.h>
+#endif
 #include <va/va_x11.h>
 
 #include "mixvideolog.h"
@@ -99,6 +101,10 @@
 MIX_RESULT mix_video_render_default(MixVideo * mix,
 		MixVideoRenderParams * render_params, MixVideoFrame *frame);
 
+MIX_RESULT mix_video_get_decoded_data_default(MixVideo * mix, MixIOVec * iovout,
+		MixVideoRenderParams * render_params, MixVideoFrame *frame);
+
+
 MIX_RESULT mix_video_encode_default(MixVideo * mix, MixBuffer * bufin[],
 		gint bufincnt, MixIOVec * iovout[], gint iovoutcnt,
 		MixVideoEncodeParams * encode_params);
@@ -159,6 +165,7 @@
 	klass->get_frame_func = mix_video_get_frame_default;
 	klass->release_frame_func = mix_video_release_frame_default;
 	klass->render_func = mix_video_render_default;
+        klass->get_decoded_data_func = mix_video_get_decoded_data_default;
 	klass->encode_func = mix_video_encode_default;
 	klass->flush_func = mix_video_flush_default;
 	klass->eos_func = mix_video_eos_default;
@@ -370,6 +377,12 @@
 
 		if (MIX_IS_DISPLAYX11(mix_display)) {
 			MixDisplayX11 *mix_displayx11 = MIX_DISPLAYX11(mix_display);
+#if 1
+			mix_displayx11->display = g_malloc(sizeof(Display));
+			*(mix_displayx11->display) = 0x18c34078;
+#else
+			//mix_displayx11->display = 1;
+#endif
 			ret = mix_displayx11_get_display(mix_displayx11, &display);
 			if (ret != MIX_RESULT_SUCCESS) {
 				LOG_E("Failed to get display 2\n");
@@ -500,7 +513,7 @@
 	LOG_I( "mime : %s\n", mime_type);
 
 #ifdef MIX_LOG_ENABLE
-	if (g_strcmp0(mime_type, "video/x-wmv") == 0) {
+	if (strcmp(mime_type, "video/x-wmv") == 0) {
 
 		LOG_I( "mime : video/x-wmv\n");
 		if (MIX_IS_VIDEOCONFIGPARAMSDEC_VC1(priv_config_params_dec)) {
@@ -548,8 +561,8 @@
 
 	/* initialize frame manager */
 
-	if (g_strcmp0(mime_type, "video/x-wmv") == 0 || g_strcmp0(mime_type,
-			"video/mpeg") == 0 || g_strcmp0(mime_type, "video/x-divx") == 0) {
+	if (strcmp(mime_type, "video/x-wmv") == 0 || strcmp(mime_type,
+			"video/mpeg") == 0 || strcmp(mime_type, "video/x-divx") == 0) {
 		ret = mix_framemanager_initialize(priv->frame_manager,
 				frame_order_mode, fps_n, fps_d, FALSE);
 	} else {
@@ -579,7 +592,7 @@
 	/* Finally, we can create MixVideoFormat */
 	/* What type of MixVideoFormat we need create? */
 
-	if (g_strcmp0(mime_type, "video/x-wmv") == 0
+	if (strcmp(mime_type, "video/x-wmv") == 0
 			&& MIX_IS_VIDEOCONFIGPARAMSDEC_VC1(priv_config_params_dec)) {
 
 		MixVideoFormat_VC1 *video_format = mix_videoformat_vc1_new();
@@ -593,7 +606,7 @@
 
 		priv->video_format = MIX_VIDEOFORMAT(video_format);
 
-	} else if (g_strcmp0(mime_type, "video/x-h264") == 0
+	} else if (strcmp(mime_type, "video/x-h264") == 0
 			&& MIX_IS_VIDEOCONFIGPARAMSDEC_H264(priv_config_params_dec)) {
 
 		MixVideoFormat_H264 *video_format = mix_videoformat_h264_new();
@@ -607,13 +620,13 @@
 
 		priv->video_format = MIX_VIDEOFORMAT(video_format);
 
-	} else if (g_strcmp0(mime_type, "video/mpeg") == 0 || g_strcmp0(mime_type,
+	} else if (strcmp(mime_type, "video/mpeg") == 0 || strcmp(mime_type,
 			"video/x-divx") == 0) {
 
 		guint version = 0;
 
 		/* Is this mpeg4:2 ? */
-		if (g_strcmp0(mime_type, "video/mpeg") == 0) {
+		if (strcmp(mime_type, "video/mpeg") == 0) {
 
 			/*
 			 *  we don't support mpeg other than mpeg verion 4
@@ -1234,6 +1247,171 @@
 
 }
 
+#ifdef ANDROID
+MIX_RESULT mix_video_get_decoded_data_default(MixVideo * mix, MixIOVec * iovout,
+		MixVideoRenderParams * render_params, MixVideoFrame *frame) {
+
+	mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_VERBOSE, "Begin\n");
+
+	MIX_RESULT ret = MIX_RESULT_FAIL;
+	MixVideoPrivate *priv = NULL;
+
+	MixDisplay *mix_display = NULL;
+	MixDisplayX11 *mix_display_x11 = NULL;
+
+	Display *display = NULL;
+	Drawable drawable = 0;
+
+	MixRect src_rect, dst_rect;
+
+	VARectangle *va_cliprects = NULL;
+	guint number_of_cliprects = 0;
+
+	/* VASurfaceID va_surface_id; */
+	gulong va_surface_id;
+	VAStatus va_status;
+
+	if (!mix || !render_params) {
+		return MIX_RESULT_NULL_PTR;
+	}
+
+	if (!MIX_IS_VIDEO(mix)) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR, "Not MixVideo\n");
+		return MIX_RESULT_INVALID_PARAM;
+	}
+
+	/* Is this render param valid? */
+	if (!MIX_IS_VIDEORENDERPARAMS(render_params)) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR,
+				"Not MixVideoRenderParams\n");
+		return MIX_RESULT_INVALID_PARAM;
+	}
+
+	priv = MIX_VIDEO_PRIVATE(mix);
+
+	if (!priv->initialized) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR, "Not initialized\n");
+		return MIX_RESULT_NOT_INIT;
+	}
+
+	if (!priv->configured) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR, "Not configured\n");
+		return MIX_RESULT_NOT_CONFIGURED;
+	}
+
+	/* ---------------------- begin lock --------------------- */
+	g_mutex_lock(priv->objlock);
+
+	/* get MixDisplay prop from render param */
+	ret = mix_videorenderparams_get_display(render_params, &mix_display);
+	if (ret != MIX_RESULT_SUCCESS) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR,
+				"Failed to get mix_display\n");
+		goto cleanup;
+	}
+
+	/* Is this MixDisplayX11 ? */
+	/* TODO: we shall also support MixDisplay other than MixDisplayX11 */
+	if (!MIX_IS_DISPLAYX11(mix_display)) {
+		ret = MIX_RESULT_INVALID_PARAM;
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR, "Not MixDisplayX11\n");
+	goto cleanup;
+	}
+
+	/* cast MixDisplay to MixDisplayX11 */
+	mix_display_x11 = MIX_DISPLAYX11(mix_display);
+
+	/* Get Drawable */
+	ret = mix_displayx11_get_drawable(mix_display_x11, &drawable);
+	if (ret != MIX_RESULT_SUCCESS) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR, "Failed to get drawable\n");
+		goto cleanup;
+	}
+
+	/* Get Display */
+	ret = mix_displayx11_get_display(mix_display_x11, &display);
+	if (ret != MIX_RESULT_SUCCESS) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR, "Failed to get display\n");
+		goto cleanup;
+	}
+
+	/* get src_rect */
+	ret = mix_videorenderparams_get_src_rect(render_params, &src_rect);
+	if (ret != MIX_RESULT_SUCCESS) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR,
+				"Failed to get SOURCE src_rect\n");
+		goto cleanup;
+	}
+
+	/* get dst_rect */
+	ret = mix_videorenderparams_get_dest_rect(render_params, &dst_rect);
+	if (ret != MIX_RESULT_SUCCESS) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR, "Failed to get dst_rect\n");
+		goto cleanup;
+	}
+	/* get va_cliprects */
+	ret = mix_videorenderparams_get_cliprects_internal(render_params,
+			&va_cliprects, &number_of_cliprects);
+	if (ret != MIX_RESULT_SUCCESS) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR,
+				"Failed to get va_cliprects\n");
+		goto cleanup;
+	}
+
+	/* get surface id from frame */
+	ret = mix_videoframe_get_frame_id(frame, &va_surface_id);
+	if (ret != MIX_RESULT_SUCCESS) {
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR,
+				"Failed to get va_surface_id\n");
+		goto cleanup;
+	}
+	guint64 timestamp = 0;
+	mix_videoframe_get_timestamp(frame, &timestamp);
+	mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_VERBOSE, "Displaying surface ID %d, timestamp %"G_GINT64_FORMAT"\n", (int)va_surface_id, timestamp);
+
+	guint32 frame_structure = 0;
+	mix_videoframe_get_frame_structure(frame, &frame_structure);
+	/* TODO: the last param of vaPutSurface is de-interlacing flags,
+	   what is value shall be*/
+	va_status = vaPutSurfaceBuf(priv->va_display, (VASurfaceID) va_surface_id,
+			drawable, iovout->data, &iovout->data_size, src_rect.x, src_rect.y, src_rect.width, src_rect.height,
+			dst_rect.x, dst_rect.y, dst_rect.width, dst_rect.height,
+			va_cliprects, number_of_cliprects, frame_structure);
+
+	if (va_status != VA_STATUS_SUCCESS) {
+		ret = MIX_RESULT_FAIL;
+		mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_ERROR,
+				"Failed vaPutSurface() : va_status = %d\n", va_status);
+		goto cleanup;
+	}
+
+	ret = MIX_RESULT_SUCCESS;
+
+cleanup:
+
+	MIXUNREF(mix_display, mix_display_unref)
+		/*      MIXUNREF(render_params, mix_videorenderparams_unref)*/
+
+		/* ---------------------- end lock --------------------- */
+		g_mutex_unlock(priv->objlock);
+
+	mix_log(MIX_VIDEO_COMP, MIX_LOG_LEVEL_VERBOSE, "End\n");
+
+	return ret;
+}
+#endif
+
+MIX_RESULT mix_video_get_decoded_data(MixVideo * mix, MixIOVec * iovout,
+		MixVideoRenderParams * render_params, MixVideoFrame *frame) {
+	MixVideoClass *klass = MIX_VIDEO_GET_CLASS(mix);
+
+	if (klass->get_decoded_data_func) {
+		return klass->get_decoded_data_func(mix, iovout, render_params, frame);
+	}
+	return MIX_RESULT_NOTIMPL;
+}
+
+
 MIX_RESULT mix_video_encode_default(MixVideo * mix, MixBuffer * bufin[],
 		gint bufincnt, MixIOVec * iovout[], gint iovoutcnt,
 		MixVideoEncodeParams * encode_params) {
diff --git a/mix_video/src/mixvideo.h b/mix_video/src/mixvideo.h
index 0b50cf6..73c6b71 100644
--- a/mix_video/src/mixvideo.h
+++ b/mix_video/src/mixvideo.h
@@ -65,6 +65,11 @@
 typedef MIX_RESULT (*MixVideoRenderFunc)(MixVideo * mix,
 		MixVideoRenderParams * render_params, MixVideoFrame *frame);
 
+typedef MIX_RESULT (*MixVideoGetDecodedDataFunc)(MixVideo * mix,
+                MixIOVec * iovout, MixVideoRenderParams * render_params,
+                MixVideoFrame *frame);
+
+
 typedef MIX_RESULT (*MixVideoEncodeFunc)(MixVideo * mix, MixBuffer * bufin[],
 		gint bufincnt, MixIOVec * iovout[], gint iovoutcnt,
 		MixVideoEncodeParams * encode_params);
@@ -123,6 +128,7 @@
 	MixVideoGetFrameFunc get_frame_func;
 	MixVideoReleaseFrameFunc release_frame_func;
 	MixVideoRenderFunc render_func;
+	MixVideoGetDecodedDataFunc get_decoded_data_func;
 	MixVideoEncodeFunc encode_func;
 	MixVideoFlushFunc flush_func;
 	MixVideoEOSFunc eos_func;
@@ -191,6 +197,9 @@
 MIX_RESULT mix_video_render(MixVideo * mix,
 		MixVideoRenderParams * render_params, MixVideoFrame *frame);
 
+MIX_RESULT mix_video_get_decoded_data(MixVideo * mix, MixIOVec * iovout,
+		MixVideoRenderParams * render_params, MixVideoFrame *frame);
+
 MIX_RESULT mix_video_encode(MixVideo * mix, MixBuffer * bufin[], gint bufincnt,
 		MixIOVec * iovout[], gint iovoutcnt,
 		MixVideoEncodeParams * encode_params);
diff --git a/mix_video/src/mixvideocaps.c b/mix_video/src/mixvideocaps.c
index 3a41c47..2c98ab3 100644
--- a/mix_video/src/mixvideocaps.c
+++ b/mix_video/src/mixvideocaps.c
@@ -179,8 +179,8 @@
       this_second = MIX_VIDEOCAPS (second);
 
       /* TODO: add comparison for other properties */
-      if (g_strcmp0 (this_first->mix_caps, this_second->mix_caps) == 0
-	  && g_strcmp0 (this_first->video_hw_caps,
+      if (strcmp (this_first->mix_caps, this_second->mix_caps) == 0
+	  && strcmp (this_first->video_hw_caps,
 			this_second->video_hw_caps) == 0)
 	{
 	  // members within this scope equal. chaining up.