OSDN Git Service

RIO-8519: Add a 2way engine unit test for when buffers are provided by MIO.
authorPacketVideo CM <engbuild@pv.com>
Sat, 27 Mar 2010 02:09:11 +0000 (19:09 -0700)
committerPacketVideo CM <engbuild@pv.com>
Sat, 27 Mar 2010 02:09:11 +0000 (19:09 -0700)
Change-Id: I2fe013efc44d0858ee908d07e8a6041b8b85da9c

23 files changed:
engines/2way/include/pv_2way_test_extension_interface.h
engines/2way/sample_app/pv2waysample/src/pv_2way_media_output_mio_node_factory.cpp
engines/2way/src/pv_2way_engine.cpp
engines/2way/src/pv_2way_engine.h
engines/2way/src/pv_2way_sdkinfo.h
engines/2way/test/Android.mk
engines/2way/test/build/make/local.mk
engines/2way/test/include/av_using_test_extension.h [new file with mode: 0644]
engines/2way/test/include/negotiated_formats_test.h
engines/2way/test/include/test_codecs.h
engines/2way/test/include/turn_on_test_buffer_alloc.h [new file with mode: 0644]
engines/2way/test/src/av_using_test_extension.cpp [new file with mode: 0644]
engines/2way/test/src/negotiated_formats_test.cpp
engines/2way/test/src/test_engine.cpp
engines/2way/test/src/turn_on_test_buffer_alloc.cpp [new file with mode: 0644]
engines/author/src/pv_author_sdkinfo.h
engines/player/src/pv_player_sdkinfo.h
nodes/pvomxaudiodecnode/src/pvmf_omx_audiodec_node.cpp
nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp
pvmi/media_io/pvmi_mio_fileinput/include/pvmi_mio_fileinput_factory.h
pvmi/media_io/pvmiofileoutput/include/pvmi_media_io_fileoutput.h
pvmi/media_io/pvmiofileoutput/src/pvmi_media_io_fileoutput.cpp
pvmi/pvmf/include/pvmf_return_codes.h

index a91f1ad..ca82f69 100644 (file)
@@ -1,5 +1,5 @@
 /* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -65,6 +65,9 @@ class PV2WayTestExtensionInterface : public PVInterface
             Oscl_Vector<FormatCapabilityInfo, OsclMemAllocator>& iInVidFormatCapability,
             Oscl_Vector<FormatCapabilityInfo, OsclMemAllocator>& iOutVidFormatCapability) = 0;
 
+        virtual bool UsingExternalVideoDecBuffers() = 0;
+        virtual bool UsingExternalAudioDecBuffers() = 0;
+
 
 };
 #endif
index 88777a4..0691f2e 100644 (file)
@@ -49,7 +49,7 @@ int PV2WayMediaOutputMIONodeFactory::CreateMedia(PvmiMIOFileInputSettings& aFile
     }
 
     PVRefFileOutput* apRefFileOutput = OSCL_NEW(PVRefFileOutput,
-                                       (aFileSettings.iFileName.get_cstr(), mio_media_type, compressed));
+                                       (aFileSettings.iFileName.get_cstr(), mio_media_type, compressed, aFileSettings.iTestBufferAlloc));
     apRefFileOutput->setUserClockExtnInterface(compressed);
     iMediaControl =  OSCL_REINTERPRET_CAST(PvmiMIOControl*, apRefFileOutput);
     return PVMFSuccess;
index 5a84ffe..2ea34a3 100644 (file)
@@ -263,7 +263,9 @@ CPV324m2Way::CPV324m2Way() :
         iPendingTscReset(-1),
         iPendingAudioEncReset(-1),
         iPendingVideoEncReset(-1),
-        iReferenceCount(1)
+        iReferenceCount(1),
+        iUsingExternalVideoDecBuffers(false),
+        iUsingExternalAudioDecBuffers(false)
 {
     iLogger = PVLogger::GetLoggerObject("2wayEngine");
     iSyncControlPVUuid = PvmfNodesSyncControlUuid;
@@ -3564,6 +3566,22 @@ void CPV324m2Way::HandleNodeInformationalEvent(const PVMFAsyncEvent& aEvent)
     {
         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO,
                         (0, "CPV324m2Way::HandleNodeInformationalEvent video dec node\n"));
+        if (PVMFPvmiBufferAllocatorNotAcquired == aEvent.GetEventType())
+        {
+            // do something
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING,
+                            (0, "CPV324m2Way::HandleNodeInformationalEvent using local buffer for video decoder\n"));
+            // now let app know somehow
+            iUsingExternalVideoDecBuffers = false;
+        }
+        if (PVMFPvmiBufferAlloctorAcquired == aEvent.GetEventType())
+        {
+            // do something
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO,
+                            (0, "CPV324m2Way::HandleNodeInformationalEvent using *External* buffer for video decoder\n"));
+            // now let app know somehow
+            iUsingExternalVideoDecBuffers = true;
+        }
     }
     else if (aEvent.GetContext() == iVideoEncNode)
     {
@@ -3599,6 +3617,22 @@ void CPV324m2Way::HandleNodeInformationalEvent(const PVMFAsyncEvent& aEvent)
                 iTSC324mInterface->SetLogicalChannelPause(iAudioDecDatapath->GetChannelId(), INCOMING, pause);
             }
         }
+        else if (event == PVMFPvmiBufferAllocatorNotAcquired)
+        {
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING,
+                            (0, "CPV324m2Way::HandleNodeInformationalEvent using local buffer for audio decoder\n"));
+            // now let app know somehow
+            iUsingExternalAudioDecBuffers = false;
+        }
+        else if (event == PVMFPvmiBufferAlloctorAcquired)
+        {
+            // do something
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO,
+                            (0, "CPV324m2Way::HandleNodeInformationalEvent using *External* buffer for audio decoder\n"));
+            // now let app know somehow
+            iUsingExternalAudioDecBuffers = true;
+        }
+
     }
     else if ((iVideoEncDatapath != NULL) &&
              (iVideoEncDatapath->IsNodeInDatapath((PVMFNodeInterface *) aEvent.GetContext())))
index 5474a64..1db8ef0 100644 (file)
@@ -770,6 +770,15 @@ class CPV324m2Way : OsclActiveObject,
         void addRef();
         void removeRef();
         bool queryInterface(const PVUuid& uuid, PVInterface*& iface);
+        bool UsingExternalVideoDecBuffers()
+        {
+            return iUsingExternalVideoDecBuffers;
+        }
+        bool UsingExternalAudioDecBuffers()
+        {
+            return iUsingExternalAudioDecBuffers;
+        }
+
 
     private:
         CPV324m2Way();
@@ -1154,6 +1163,9 @@ class CPV324m2Way : OsclActiveObject,
         // interface for omx enc node capability and config
         PvmiCapabilityAndConfig* ipEncNodeCapabilityAndConfig;
         PVInterface* ipEncNodeCapConfigInterface;
+        bool iUsingExternalVideoDecBuffers;
+        bool iUsingExternalAudioDecBuffers;
+
 };
 
 #endif
index 8090419..2c3a598 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PV2WAY_ENGINE_SDKINFO_LABEL "1326673"
+#define PV2WAY_ENGINE_SDKINFO_LABEL "1326727"
 #define PV2WAY_ENGINE_SDKINFO_DATE 0x20100316
 
 #endif //PV_2WAY_SDKINFO_H_INCLUDED
index 21ed249..3073189 100644 (file)
@@ -11,8 +11,10 @@ LOCAL_SRC_FILES := \
        src/test_base.cpp \
        src/../../../../protocols/systems/tools/general/common/src/test_utility.cpp \
        src/av_test.cpp \
+       src/av_using_test_extension.cpp \
        src/acceptable_formats_test.cpp \
        src/negotiated_formats_test.cpp \
+       src/turn_on_test_buffer_alloc.cpp \
        src/connect_cancel_test.cpp \
        src/connect_test.cpp \
        src/audio_only_test.cpp \
index 4ba1c12..53b6afa 100644 (file)
@@ -33,8 +33,10 @@ SRCS := alloc_dealloc_test.cpp \
        test_base.cpp \
        ../../../../protocols/systems/tools/general/common/src/test_utility.cpp  
 SRCS_324 = av_test.cpp \
+    av_using_test_extension.cpp \
        acceptable_formats_test.cpp \
        negotiated_formats_test.cpp \
+    turn_on_test_buffer_alloc.cpp \
        connect_cancel_test.cpp \
        connect_test.cpp \
        audio_only_test.cpp \
diff --git a/engines/2way/test/include/av_using_test_extension.h b/engines/2way/test/include/av_using_test_extension.h
new file mode 100644 (file)
index 0000000..b89b47d
--- /dev/null
@@ -0,0 +1,59 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2010 PacketVideo
+ *
+ * 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 AV_USING_TEST_EXTENSION_H_INCLUDED
+#define AV_USING_TEST_EXTENSION_H_INCLUDED
+#include "av_test.h"
+
+
+#include "pv_2way_test_extension_interface.h"
+
+class av_using_test_extension : public av_test
+{
+    public:
+        av_using_test_extension(bool aUseProxy = false,
+                                uint32 aTimeConnection = TEST_DURATION,
+                                uint32 aMaxTestDuration = MAX_TEST_DURATION)
+                : av_test(aUseProxy, aTimeConnection, aMaxTestDuration),
+                iTestConfigInterface(NULL),
+                iQueryTestInterfaceCmdId(0),
+                iTempTestConfigInterface(NULL)
+        {
+            iTestName = _STRLIT_CHAR("negotiated formats");
+        }
+
+        ~av_using_test_extension()
+        {
+        }
+
+
+    protected:
+        void AllNodesAdded();
+        PV2WayTestExtensionInterface* iTestConfigInterface;
+
+    private:
+        void CommandCompleted(const PVCmdResponse& aResponse);
+        void CreateParts();
+        PVCommandId iQueryTestInterfaceCmdId;
+        PVInterface* iTempTestConfigInterface;
+
+};
+
+
+#endif
+
+
index 446c110..ceafd96 100644 (file)
@@ -1,5 +1,5 @@
 /* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
  */
 #ifndef NEGOTIATED_FORMATS_TEST_H_INCLUDED
 #define NEGOTIATED_FORMATS_TEST_H_INCLUDED
-#include "av_test.h"
+#include "av_using_test_extension.h"
 
 #ifndef PV_2WAY_MIO_H_INCLUDED
 #include "pv_2way_mio.h"
 
 #include "pv_2way_test_extension_interface.h"
 
-class negotiated_formats_test : public av_test
+class negotiated_formats_test : public av_using_test_extension
 {
     public:
         negotiated_formats_test(bool aUseProxy = false,
                                 uint32 aTimeConnection = TEST_DURATION,
                                 uint32 aMaxTestDuration = MAX_TEST_DURATION)
-                : av_test(aUseProxy, aTimeConnection, aMaxTestDuration),
-                iQueryTestInterfaceCmdId(0),
-                iTempTestConfigInterface(NULL),
-                iTestConfigInterface(NULL)
+                : av_using_test_extension(aUseProxy, aTimeConnection, aMaxTestDuration)
         {
             iTestName = _STRLIT_CHAR("negotiated formats");
         }
@@ -47,18 +44,11 @@ class negotiated_formats_test : public av_test
         void AddExpectedFormat(TPVDirection aDir, PV2WayMediaType aType, const char* const aFormat);
 
     protected:
-        void AllNodesAdded();
 
     private:
 
         void FinishTimerCallback();
 
-        void CommandCompleted(const PVCmdResponse& aResponse);
-        void CreateParts();
-        PVCommandId iQueryTestInterfaceCmdId;
-        PVInterface* iTempTestConfigInterface;
-        PV2WayTestExtensionInterface* iTestConfigInterface;
-
         Oscl_Vector<FormatCapabilityInfo, OsclMemAllocator> iInAudFormatCapability;
         Oscl_Vector<FormatCapabilityInfo, OsclMemAllocator> iOutAudFormatCapability;
         Oscl_Vector<FormatCapabilityInfo, OsclMemAllocator> iInVidFormatCapability;
index 672aaed..0f53f7c 100644 (file)
@@ -1,5 +1,5 @@
 /* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -104,6 +104,11 @@ class TestCodecs
             iAudioSinkFileSettings.iFileName = AUDIO_SINK_FILENAME;
             iAudioSinkFileSettings.iMediaFormat = PVMF_MIME_AMR_IF2;
 
+            iAudioSinkBufferAllocatorFileSettings.iTestBufferAlloc = true;
+            iAudioSinkBufferAllocatorFileSettings.iFileName = AUDIO_SINK_FILENAME;
+            iAudioSinkBufferAllocatorFileSettings.iMediaFormat = PVMF_MIME_AMR_IF2;
+
+
             iAudioSinkRawFileSettings.iFileName = AUDIO_SINK_RAW_FILENAME;
             iAudioSinkRawFileSettings.iMediaFormat = PVMF_MIME_PCM16;
 
@@ -163,6 +168,10 @@ class TestCodecs
 
             iVideoSinkM4VFileSettings.iFileName = VIDEO_SINK_M4V_FILENAME;
             iVideoSinkM4VFileSettings.iMediaFormat = PVMF_MIME_M4V;
+
+            iVideoSinkBufferAllocatorFileSettings.iTestBufferAlloc = true;
+            iVideoSinkBufferAllocatorFileSettings.iFileName = VIDEO_SINK_YUV_FILENAME;
+            iVideoSinkBufferAllocatorFileSettings.iMediaFormat = PVMF_MIME_YUV420;
             return true;
         };
 
@@ -191,10 +200,14 @@ class TestCodecs
         PvmiMIOFileInputSettings iAudioSinkRawFileSettings;
         PvmiMIOFileInputSettings iAudioSink2FileSettings;
         PvmiMIOFileInputSettings iAudioSinkFileSettings;
+        PvmiMIOFileInputSettings iAudioSinkBufferAllocatorFileSettings;
 
         PvmiMIOFileInputSettings iVideoSinkYUVFileSettings;
         PvmiMIOFileInputSettings iVideoSinkH263FileSettings;
         PvmiMIOFileInputSettings iVideoSinkM4VFileSettings;
+        PvmiMIOFileInputSettings iVideoSinkBufferAllocatorFileSettings;
+
+
 
         DummyMIOSettings iLipSyncAudioSourceSettings;
         DummyMIOSettings iLipSyncAudioSinkSettings;
diff --git a/engines/2way/test/include/turn_on_test_buffer_alloc.h b/engines/2way/test/include/turn_on_test_buffer_alloc.h
new file mode 100644 (file)
index 0000000..3e4d3b6
--- /dev/null
@@ -0,0 +1,53 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2010 PacketVideo
+ *
+ * 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 TURN_ON_TEST_BUFFER_ALLOC_H_INCLUDED
+#define TURN_ON_TEST_BUFFER_ALLOC_H_INCLUDED
+
+#include "av_using_test_extension.h"
+
+
+
+
+class turn_on_test_buffer_alloc : public av_using_test_extension
+{
+    public:
+        turn_on_test_buffer_alloc(bool aUseProxy = false,
+                                  uint32 aTimeConnection = TEST_DURATION,
+                                  uint32 aMaxTestDuration = MAX_TEST_DURATION)
+                : av_using_test_extension(aUseProxy, aTimeConnection, aMaxTestDuration)
+
+        {
+            iTestName = _STRLIT_CHAR("Use external buffer allocator for decoder nodes");
+
+        }
+
+        ~turn_on_test_buffer_alloc()
+        {
+        }
+
+    private:
+
+        void FinishTimerCallback();
+
+
+};
+
+
+#endif
+
+
diff --git a/engines/2way/test/src/av_using_test_extension.cpp b/engines/2way/test/src/av_using_test_extension.cpp
new file mode 100644 (file)
index 0000000..1f36b97
--- /dev/null
@@ -0,0 +1,62 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2010 PacketVideo
+ *
+ * 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 "negotiated_formats_test.h"
+
+void av_using_test_extension::AllNodesAdded()
+{
+    LetConnectionRun();
+}
+
+
+
+void av_using_test_extension::CreateParts()
+{
+    // Get test extension interface handle
+    // get TSC node
+    iQueryTestInterfaceCmdId = terminal->QueryInterface(PV2WayTestEncExtensionUUID,
+                               iTempTestConfigInterface);
+}
+
+void av_using_test_extension::CommandCompleted(const PVCmdResponse& aResponse)
+{
+    PVCommandId cmdId = aResponse.GetCmdId();
+    if (cmdId < 0)
+        return;
+
+    if (iQueryTestInterfaceCmdId == cmdId)
+    {
+
+        if (aResponse.GetCmdStatus() == PVMFSuccess)
+        {
+            if (iTempTestConfigInterface)
+            {
+                iTestConfigInterface = OSCL_STATIC_CAST(PV2WayTestExtensionInterface*,
+                                                        iTempTestConfigInterface);
+                iTempTestConfigInterface = NULL;
+                // set other values
+                test_base::CreateParts();
+            }
+
+        }
+
+    }
+    else
+    {
+        test_base::CommandCompleted(aResponse);
+    }
+}
index b94b200..407d7f8 100644 (file)
@@ -1,5 +1,5 @@
 /* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 #include "negotiated_formats_test.h"
 
-void negotiated_formats_test::AllNodesAdded()
-{
-    LetConnectionRun();
-}
 
 
 void negotiated_formats_test::FinishTimerCallback()
@@ -91,39 +87,4 @@ void negotiated_formats_test::AddExpectedFormat(TPVDirection aDir,
     }
 }
 
-void negotiated_formats_test::CreateParts()
-{
-    // Get test extension interface handle
-    // get TSC node
-    iQueryTestInterfaceCmdId = terminal->QueryInterface(PV2WayTestEncExtensionUUID,
-                               iTempTestConfigInterface);
-}
-
-void negotiated_formats_test::CommandCompleted(const PVCmdResponse& aResponse)
-{
-    PVCommandId cmdId = aResponse.GetCmdId();
-    if (cmdId < 0)
-        return;
-
-    if (iQueryTestInterfaceCmdId == cmdId)
-    {
-
-        if (aResponse.GetCmdStatus() == PVMFSuccess)
-        {
-            if (iTempTestConfigInterface)
-            {
-                iTestConfigInterface = OSCL_STATIC_CAST(PV2WayTestExtensionInterface*,
-                                                        iTempTestConfigInterface);
-                iTempTestConfigInterface = NULL;
-                // set other values
-                test_base::CreateParts();
-            }
-
-        }
 
-    }
-    else
-    {
-        test_base::CommandCompleted(aResponse);
-    }
-}
index b153e97..fb85c0e 100644 (file)
@@ -37,6 +37,7 @@
 #include "pause_resume_test.h"
 #include "reconnect_test.h"
 #include "error_check_audio_only_test.h"
+#include "turn_on_test_buffer_alloc.h"
 
 
 #include "tsc_h324m_config_interface.h"
@@ -120,6 +121,7 @@ void engine_test_suite::AddIncomingAudioCodecUsingFile(PV2WaySourceAndSinksFile*
     // Audio Sink   /Incoming
     if (oscl_strncmp(PVMF_MIME_PCM16, apAudSinkFormatType, oscl_strlen(PVMF_MIME_PCM16)) == 0)
     {
+
         apSourceAndSinks->AddPreferredCodec(INCOMING, PV_AUDIO, iCodecs.iAudioSinkRawFileSettings);
 
     }
@@ -140,6 +142,7 @@ void engine_test_suite::AddOutgoingVideoCodecUsingFile(PV2WaySourceAndSinksFile*
     }
     else if (oscl_strncmp(PVMF_MIME_H2632000, apVidSrcFormatType, oscl_strlen(PVMF_MIME_H2632000)) == 0)
     {
+
         apSourceAndSinks->AddPreferredCodec(OUTGOING, PV_VIDEO, iCodecs.iVideoSourceH263FileSettings);
     }
     else if (oscl_strncmp(PVMF_MIME_M4V, apVidSrcFormatType, oscl_strlen(PVMF_MIME_M4V)) == 0)
@@ -159,7 +162,9 @@ void engine_test_suite::AddIncomingVideoCodecUsingFile(PV2WaySourceAndSinksFile*
     }
     else if (oscl_strncmp(PVMF_MIME_H2632000, apVidSinkFormatType, oscl_strlen(PVMF_MIME_H2632000)) == 0)
     {
+
         apSourceAndSinks->AddPreferredCodec(INCOMING, PV_VIDEO, iCodecs.iVideoSinkH263FileSettings);
+
     }
     else if (oscl_strncmp(PVMF_MIME_M4V, apVidSinkFormatType, oscl_strlen(PVMF_MIME_M4V)) == 0)
     {
@@ -621,6 +626,7 @@ void engine_test_suite::AddNegotiatedFormatsTests(const bool aProxy,
         pTemp->AddExpectedFormat(OUTGOING, PV_AUDIO, PVMF_MIME_PCM16);
         pTemp->AddExpectedFormat(INCOMING, PV_VIDEO, PVMF_MIME_YUV420);
         pTemp->AddExpectedFormat(OUTGOING, PV_VIDEO, PVMF_MIME_H2632000);
+
         adopt_test_case(pTemp);
     }
 
@@ -1095,6 +1101,7 @@ void engine_test_suite::AddReconnectTests(const bool aProxy, int32 firstTest, in
 
 void engine_test_suite::AddMiscTests(const bool aProxy, int32 firstTest, int32 lastTest)
 {
+
     if (inRange(firstTest, lastTest))
     {
         test_base* pTemp = OSCL_NEW(error_check_audio_only_test, (aProxy));
@@ -1104,6 +1111,22 @@ void engine_test_suite::AddMiscTests(const bool aProxy, int32 firstTest, int32 l
         adopt_test_case(pTemp);
     }
 
+    if (inRange(firstTest, lastTest))
+    {
+
+        test_base* pTemp = OSCL_NEW(turn_on_test_buffer_alloc, (aProxy));
+        PV2WaySourceAndSinksFile* pSourceAndSinks = OSCL_NEW(PV2WaySourceAndSinksFile,
+                (pTemp->GetSdkInfo()));
+        AddOutgoingAudioCodecUsingFile(pSourceAndSinks, PVMF_MIME_PCM16);
+        AddOutgoingVideoCodecUsingFile(pSourceAndSinks, PVMF_MIME_YUV420);
+        pSourceAndSinks->AddPreferredCodec(INCOMING, PV_AUDIO, iCodecs.iAudioSinkBufferAllocatorFileSettings);
+        pSourceAndSinks->AddPreferredCodec(INCOMING, PV_VIDEO, iCodecs.iVideoSinkBufferAllocatorFileSettings);
+        pTemp->AddSourceAndSinks(pSourceAndSinks);
+        adopt_test_case(pTemp);
+
+
+    }
+
 }
 #endif
 
diff --git a/engines/2way/test/src/turn_on_test_buffer_alloc.cpp b/engines/2way/test/src/turn_on_test_buffer_alloc.cpp
new file mode 100644 (file)
index 0000000..9c68933
--- /dev/null
@@ -0,0 +1,43 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2010 PacketVideo
+ *
+ * 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 "turn_on_test_buffer_alloc.h"
+
+
+void turn_on_test_buffer_alloc::FinishTimerCallback()
+{
+    bool pass = false;
+
+    // compare values to what we are expecting
+    if (iTestConfigInterface)
+    {
+
+        bool usingBuffers = iTestConfigInterface->UsingExternalVideoDecBuffers();
+        if (usingBuffers)
+        {
+            pass = true;
+        }
+    }
+
+    test_is_true(pass);
+
+
+    DisconnectSourceSinks();
+
+}
+
+
index 0f626bc..6518306 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1326673"
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1326727"
 #define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20100316
 
 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
index a66a9d3..9aa54f7 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVPLAYER_ENGINE_SDKINFO_LABEL "1326673"
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1326727"
 #define PVPLAYER_ENGINE_SDKINFO_DATE 0x20100316
 
 #endif //PV_PLAYER_SDKINFO_H_INCLUDED
index d9b8a36..2261e1e 100644 (file)
@@ -904,6 +904,16 @@ PVMFStatus PVMFOMXAudioDecNode::HandlePortReEnable()
             }
 
         }
+        else
+        {
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_WARNING,
+                            (0, "PVMFOMXAudioDecNode::HandlePortReEnable Warning- It is OK for this KVP to fail"
+                             "Do NOT attempt to fix the failure in the MIO unless you absolutely want to implement"
+                             "the MIO BUFFER ALLOCATOR - see documentation"));
+
+
+            ReportInfoEvent(PVMFPvmiBufferAllocatorNotAcquired);
+        }
 
         //Buffer allocator kvp query and allocation has to be done again if we landed into handle port reconfiguration
 
@@ -954,6 +964,7 @@ PVMFStatus PVMFOMXAudioDecNode::HandlePortReEnable()
                     {
                         iNumOutputBuffers = iNumBuffers;
                         iOMXComponentOutputBufferSize = iBufferSize;
+                        ReportInfoEvent(PVMFPvmiBufferAlloctorAcquired);
                     }
 
                 }
@@ -964,7 +975,15 @@ PVMFStatus PVMFOMXAudioDecNode::HandlePortReEnable()
                 }
             }
         }
+        else
+        {
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_WARNING,
+                            (0, "PVMFOMXAudioDecNode::HandlePortReEnable Warning- It is OK for this KVP to fail"
+                             "Do NOT attempt to fix the failure in the MIO unless you absolutely want to implement"
+                             "the MIO BUFFER ALLOCATOR -see documentation"));
 
+            ReportInfoEvent(PVMFPvmiBufferAllocatorNotAcquired);
+        }
 
         /* Allocate output buffers */
         if (!CreateOutMemPool(iNumOutputBuffers))
@@ -1427,7 +1446,15 @@ bool PVMFOMXAudioDecNode::NegotiateComponentParameters(OMX_PTR aOutputParameters
 
 
     }
+    else
+    {
+        PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_WARNING,
+                        (0, "PVMFOMXAudioDecNode::NegotiateComponentParameters Warning- It is OK for this KVP to fail"
+                         "Do NOT attempt to fix the failure in the MIO unless you absolutely want to implement"
+                         "the MIO BUFFER ALLOCATOR -see documentation"));
 
+        ReportInfoEvent(PVMFPvmiBufferAllocatorNotAcquired);
+    }
     //Try querying the buffer allocator KVP for output buffer allocation outside of the node
     PvmiKvp* kvp = NULL;
     int numKvp = 0;
@@ -1476,7 +1503,7 @@ bool PVMFOMXAudioDecNode::NegotiateComponentParameters(OMX_PTR aOutputParameters
                 {
                     iNumOutputBuffers = iNumBuffers;
                     iOMXComponentOutputBufferSize = iBufferSize;
-
+                    ReportInfoEvent(PVMFPvmiBufferAlloctorAcquired);
                 }
 
             }
@@ -1488,7 +1515,15 @@ bool PVMFOMXAudioDecNode::NegotiateComponentParameters(OMX_PTR aOutputParameters
             }
         }
     }
+    else
+    {
+        PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_WARNING,
+                        (0, "PVMFOMXAudioDecNode::NegotiateComponentParameters Warning- It is OK for this KVP to fail"
+                         "Do NOT attempt to fix the failure in the MIO unless you absolutely want to implement"
+                         "the MIO BUFFER ALLOCATOR -see documentation"));
 
+        ReportInfoEvent(PVMFPvmiBufferAllocatorNotAcquired);
+    }
 
     iParamPort.nBufferCountActual = iNumOutputBuffers;
 
index 81602db..bc3b9ec 100644 (file)
@@ -342,6 +342,14 @@ PVMFStatus PVMFOMXVideoDecNode::HandlePortReEnable()
 
 
         }
+        else
+        {
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_WARNING,
+                            (0, "PVMFOMXVideoDecNode::HandlePortReEnable Warning- It is OK for this KVP to fail"
+                             "Do NOT attempt to fix the failure in the MIO unless you absolutely want to implement"));
+
+            ReportInfoEvent(PVMFPvmiBufferAllocatorNotAcquired);
+        }
 
         //Buffer allocation has to be done again in case we landed to port reconfiguration
         PvmiKvp* kvp = NULL;
@@ -393,6 +401,7 @@ PVMFStatus PVMFOMXVideoDecNode::HandlePortReEnable()
                     {
                         iNumOutputBuffers = iNumBuffers;
                         iOMXComponentOutputBufferSize = iBufferSize;
+                        ReportInfoEvent(PVMFPvmiBufferAlloctorAcquired);
                     }
                 }
                 else
@@ -404,8 +413,12 @@ PVMFStatus PVMFOMXVideoDecNode::HandlePortReEnable()
         }
         else
         {
-            PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_ERR,
-                            (0, "PVMFOMXVideoDecNode::HandlePortReEnable - Error calling pvmiGetBufferAllocatorSpecificInfoSync"));
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_WARNING,
+                            (0, "PVMFOMXVideoDecNode::HandlePortReEnable Warning- It is OK for this KVP to fail"
+                             "Do NOT attempt to fix the failure in the MIO unless you absolutely want to implement"
+                             "the MIO BUFFER ALLOCATOR -see documentation"));
+            ReportInfoEvent(PVMFPvmiBufferAllocatorNotAcquired);
+
         }
 
         // it is now safe to send command for port reenable
@@ -983,6 +996,7 @@ bool PVMFOMXVideoDecNode::NegotiateComponentParameters(OMX_PTR aOutputParameters
                         // the call succeeded - no need to send extra fsi
                         iCompactFSISettingSucceeded = true;
                         sendFsi = false;
+
                     }
 
                     alloc.deallocate((OsclAny*)(KvpKey));
@@ -1006,6 +1020,14 @@ bool PVMFOMXVideoDecNode::NegotiateComponentParameters(OMX_PTR aOutputParameters
                 return false; // this is going to make everything go out of scope
             }
         }
+        else
+        {
+            PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_WARNING,
+                            (0, "PVMFOMXVideoDecNode::NegotiateComponentParameters Warning- It is OK for this KVP to fail"
+                             "Do NOT attempt to fix the failure in the MIO unless you absolutely want to implement"
+                             "the MIO BUFFER ALLOCATOR -see documentation"));
+            ReportInfoEvent(PVMFPvmiBufferAllocatorNotAcquired);
+        }
 
     }
 
@@ -1061,20 +1083,24 @@ bool PVMFOMXVideoDecNode::NegotiateComponentParameters(OMX_PTR aOutputParameters
                 {
                     iNumOutputBuffers = iNumBuffers;
                     iOMXComponentOutputBufferSize = iBufferSize;
+                    ReportInfoEvent(PVMFPvmiBufferAlloctorAcquired);
                 }
             }
             else
             {
                 ipExternalOutputBufferAllocatorInterface->removeRef();
                 ipExternalOutputBufferAllocatorInterface = NULL;
-
             }
         }
     }
     else
     {
-        PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_ERR,
-                        (0, "PVMFOMXVideoDecNode::NegotiateComponentParameters - Error calling pvmiGetBufferAllocatorSpecificInfoSync"));
+        PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_WARNING,
+                        (0, "PVMFOMXVideoDecNode::NegotiateComponentParameters Warning- It is OK for this KVP to fail"
+                         "Do NOT attempt to fix the failure in the MIO unless you absolutely want to implement"
+                         "the MIO BUFFER ALLOCATOR -see documentation"));
+
+        ReportInfoEvent(PVMFPvmiBufferAllocatorNotAcquired);
     }
 
 
index 56fa653..8c3d26e 100644 (file)
@@ -1,5 +1,5 @@
 /* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ class PvmiMIOFileInputSettings
         {
             iMediaFormat = PVMF_MIME_FORMAT_UNKNOWN;
             iLoopInputFile = true;
+            iTestBufferAlloc = false;
             iSamplingFrequency = 8000;
             iNumChannels = 1;
             iNum20msFramesPerChunk = 1;
@@ -60,6 +61,7 @@ class PvmiMIOFileInputSettings
         {
             iMediaFormat = aSettings.iMediaFormat;
             iLoopInputFile = aSettings.iLoopInputFile;
+            iTestBufferAlloc = aSettings.iTestBufferAlloc;
             iSamplingFrequency = aSettings.iSamplingFrequency;
             iNumChannels = aSettings.iNumChannels;
             iNum20msFramesPerChunk = aSettings.iNum20msFramesPerChunk;
@@ -94,6 +96,7 @@ class PvmiMIOFileInputSettings
         // General settings
         PVMFFormatType iMediaFormat;
         bool iLoopInputFile;
+        bool iTestBufferAlloc;
         OSCL_wStackString<512> iFileName;
         OSCL_wStackString<512> iLogFileName;
         OSCL_wStackString<512> iTextFileName;
index 28f46b4..1166a13 100644 (file)
@@ -48,9 +48,7 @@
 #endif
 
 
-#define TEST_BUFFER_ALLOCATOR 0
 
-#if TEST_BUFFER_ALLOCATOR
 #ifndef PV_INTERFACE_H
 #include "pv_interface.h"
 #endif
@@ -58,7 +56,7 @@
 #ifndef PVMF_FIXEDSIZE_BUFFER_ALLOC_H_INCLUDED
 #include "pvmf_fixedsize_buffer_alloc.h"
 #endif
-#endif
+
 
 class PVLogger;
 class PVRefFileOutputTestObserver;
@@ -180,7 +178,8 @@ class PVRefFileOutput
 
         OSCL_IMPORT_REF PVRefFileOutput(const oscl_wchar* aFileName,
                                         MediaType aMediaType,
-                                        bool aCompressedMedia = false);
+                                        bool aCompressedMedia = false,
+                                        bool aTestbufferAlloc = false);
 
         OSCL_IMPORT_REF PVRefFileOutput(const OSCL_wString& aFileName, bool logStrings = false);
 
@@ -358,6 +357,7 @@ class PVRefFileOutput
         bool iFsConnected;
         Oscl_File iOutputFile;
         bool iFileOpened;
+        bool iTest_Buffer_Alloc;
 
         // Audio parameters.
         OSCL_HeapString<OsclMemAllocator> iAudioFormatString;
@@ -462,8 +462,6 @@ class PVRefFileOutputTestObserver
         OSCL_IMPORT_REF virtual void Pos(PVMFTimestamp& aTimestamp) = 0;
 };
 
-#if TEST_BUFFER_ALLOCATOR
-
 class PVRefBufferAlloc: public PVInterface, public PVMFFixedSizeBufferAlloc
 {
     public:
@@ -493,7 +491,7 @@ class PVRefBufferAlloc: public PVInterface, public PVMFFixedSizeBufferAlloc
         int32 numAllocated;
 };
 
-#endif
+
 
 #endif // PVMI_MEDIA_IO_FILEOUTPUT_H_INCLUDED
 
index 8ea8b2e..3ca6070 100644 (file)
@@ -135,7 +135,8 @@ OSCL_EXPORT_REF PVRefFileOutput::PVRefFileOutput(const oscl_wchar* aFileName
 
 OSCL_EXPORT_REF PVRefFileOutput::PVRefFileOutput(const oscl_wchar* aFileName,
         MediaType aMediaType,
-        bool aCompressedMedia)
+        bool aCompressedMedia,
+        bool aTestbufferAlloc)
         : OsclTimerObject(OsclActiveObject::EPriorityNominal, "pvreffileoutput")
         , iOutputFileName(aFileName)
         , iMediaType(aMediaType)
@@ -146,7 +147,9 @@ OSCL_EXPORT_REF PVRefFileOutput::PVRefFileOutput(const oscl_wchar* aFileName,
         , iLogOutputToFile(false)
 #endif
 {
+
     initData();
+    iTest_Buffer_Alloc = aTestbufferAlloc;
 }
 
 void PVRefFileOutput::initData()
@@ -172,6 +175,7 @@ void PVRefFileOutput::initData()
     iCommandCounter = 0;
     iLogger = NULL;
     iFileOpened = false;
+    iTest_Buffer_Alloc = false;
     iFsConnected = false;
     iCommandResponseQueue.reserve(5);
     iWriteResponseQueue.reserve(5);
@@ -1521,29 +1525,31 @@ PVMFStatus PVRefFileOutput::getParametersSync(PvmiMIOSession aSession, PvmiKeyTy
         aParameters[0].value.uint32_value = DEFAULT_NUM_DECODED_FRAMES_CAPABILITY;
         return PVMFSuccess;
     }
-#if TEST_BUFFER_ALLOCATOR
-    else if (pv_mime_strcmp(aIdentifier, PVMF_SUPPORT_FOR_BUFFER_ALLOCATOR_IN_MIO_KEY) == 0)
+    if (iTest_Buffer_Alloc)
     {
-        return PVMFSuccess;
-    }
-    else if (pv_mime_strcmp(aIdentifier, PVMF_BUFFER_ALLOCATOR_KEY) == 0)
-    {
-        int32 err;
-        aParameters = (PvmiKvp*)oscl_malloc(sizeof(PvmiKvp));
-        if (!aParameters)
+        if (pv_mime_strcmp(aIdentifier, PVMF_SUPPORT_FOR_BUFFER_ALLOCATOR_IN_MIO_KEY) == 0)
         {
-            return PVMFErrNoMemory;
+            return PVMFSuccess;
         }
-
-        OSCL_TRY(err, aParameters[0].value.key_specific_value = (PVInterface *)OSCL_NEW(PVRefBufferAlloc, (iBufferSize, iNumberOfBuffers)) ;);
-        if (err || (NULL == aParameters[0].value.key_specific_value))
+        else if (pv_mime_strcmp(aIdentifier, PVMF_BUFFER_ALLOCATOR_KEY) == 0)
         {
-            return PVMFErrNoMemory;
+            int32 err;
+            aParameters = (PvmiKvp*)oscl_malloc(sizeof(PvmiKvp));
+            if (!aParameters)
+            {
+                return PVMFErrNoMemory;
+            }
 
+            OSCL_TRY(err, aParameters[0].value.key_specific_value = (PVInterface *)OSCL_NEW(PVRefBufferAlloc, (iBufferSize, iNumberOfBuffers)) ;);
+            if (err || (NULL == aParameters[0].value.key_specific_value))
+            {
+                return PVMFErrNoMemory;
+
+            }
+            return PVMFSuccess;
         }
-        return PVMFSuccess;
     }
-#endif
+
     //other queries are not currently supported.
 
     //unrecognized key.
@@ -2578,7 +2584,6 @@ void PVRefFileOutput::UpdateVideoChunkHeaderIdx()
     }
 }
 
-#if TEST_BUFFER_ALLOCATOR
 
 PVRefBufferAlloc::PVRefBufferAlloc(uint32 size, uint32 buffers): refCount(0), bufferSize(size), maxBuffers(buffers), numAllocated(0)
 {
@@ -2652,5 +2657,4 @@ bool PVRefBufferAlloc::queryInterface(const PVUuid& uuid, PVInterface*& aInterfa
     return false;
 }
 
-#endif
 
index b195124..5756ca2 100644 (file)
@@ -563,6 +563,14 @@ const PVMFStatus PVMFInfoSourceFormatUpdated = 55;
 Notification for invalid ts in the RTP packet
 */
 const PVMFStatus PVMFErrInvalidRTPTimeInPkt = 56;
+/*
+ Notification that pvmiGetBufferAllocatorSpecificInfoSync was unsuccessful
+ */
+const PVMFStatus PVMFPvmiBufferAllocatorNotAcquired = 55;
+/*
+ Notification that pvmiGetBufferAllocatorSpecificInfoSync was successful
+ */
+const PVMFStatus PVMFPvmiBufferAlloctorAcquired = 56;
 
 /*
  Placeholder for end of range