mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalstrminfoitftests.cpp
changeset 53 eabc8c503852
parent 25 6f7ceef7b1d1
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalstrminfoitftests.cpp	Fri Sep 03 19:34:12 2010 -0500
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalstrminfoitftests.cpp	Tue Sep 21 11:38:43 2010 -0500
@@ -19,6 +19,7 @@
 #include <e32svr.h>
 #include <StifParser.h>
 #include <StifTestInterface.h>
+#include <StifTestEventInterface.h>
 #include "openmaxaltestmodule.h"
 
 // EXTERNAL DATA STRUCTURES
@@ -201,10 +202,23 @@
     return status;       
     }
 
-TInt COpenMAXALTestModule::al_strminfoitf_RegisterStreamChangeCallback( CStifItemParser& /*aItem*/ )
+TInt COpenMAXALTestModule::al_strminfoitf_RegisterStreamChangeCallback( CStifItemParser& aItem )
     {
     TInt status(KErrNone);
     XAresult res;
+		
+		TInt expectedIndex = -1;
+    status = aItem.GetNextInt(expectedIndex);
+    if(status==KErrNone)
+    {
+    	iStreamInfoItfIndex = expectedIndex; //reset expected event
+    }
+    else
+    {
+    	iStreamInfoItfIndex = -1;
+    	status = KErrNone;
+    }
+
     if(m_StrInfoItf)
         {
         res = (*m_StrInfoItf)->RegisterStreamChangeCallback(m_StrInfoItf,StreamEventChangeCallback,(void*)this);
@@ -286,6 +300,36 @@
     return status;          
     }
 
+void COpenMAXALTestModule::HandleStreamInfoItfCallback( XAStreamInformationItf /*caller*/, XAuint32 event, XAuint32 streamIndex )
+{
+    switch (event)
+    {
+        case XA_STREAMCBEVENT_PROPERTYCHANGE:
+        {
+        		if((iStreamInfoItfIndex == -1) || (iStreamInfoItfIndex == streamIndex))
+        		{
+            	TEventIf event( TEventIf::ESetEvent, _L("Event_XA_STREAMCBEVENT_PROPERTYCHANGE") );
+            	TestModuleIf().Event( event );
+        		}
+        }
+        break;
+       
+        default:
+            break;
+    }
+}
+
+TInt COpenMAXALTestModule::al_strminfoitf_SetStreamInfoIndex(CStifItemParser& aItem)
+{
+		TInt status(KErrNone);
+    TInt streamindex(0);
+ 
+    status = aItem.GetNextInt(streamindex);
+    RET_ERR_IF_ERR(status);
+		iStreamInfoItfIndex = streamindex;
+		return status;
+}
+
 void StreamEventChangeCallback (
         XAStreamInformationItf caller,
         XAuint32 eventId,
@@ -293,6 +337,9 @@
         void * pEventData,
         void * pContext
 )
+{
+    if (pContext)
     {
-    
+    	((COpenMAXALTestModule*)pContext)->HandleStreamInfoItfCallback(caller, eventId, streamIndex);
     }
+}