Пример #1
0
    void testDebugMode()
    {

        MpMediaTask*     pMediaTask = 0;
        OsStatus         res;
        int              waitTimeoutCnt;

        // Test 1: Verify that wait for "frame start" timeouts are noticed
        //         only when the media task is not in debug mode
        pMediaTask = MpMediaTask::getMediaTask(10);
        res = pMediaTask->setDebug(FALSE);      // turn debug mode off
        CPPUNIT_ASSERT(res == OS_SUCCESS);
        CPPUNIT_ASSERT(pMediaTask->getDebugMode() == FALSE);

        waitTimeoutCnt = pMediaTask->getWaitTimeoutCnt();
        res = MpMediaTask::signalFrameStart();  // send a signal to the task
        CPPUNIT_ASSERT(res == OS_SUCCESS);
        OsTask::delay(1000);                    // and wait 1 second

        // $$$ Need to understand why the following test fails on vxWorks
        // WHAT THE #(*$&#(*&???  CPPUNIT_ASSERT(pMediaTask->getWaitTimeoutCnt() > waitTimeoutCnt);

        res = pMediaTask->setDebug(TRUE);       // turn debug mode on
        CPPUNIT_ASSERT(res == OS_SUCCESS);
        CPPUNIT_ASSERT(pMediaTask->getDebugMode() == TRUE);

        res = MpMediaTask::signalFrameStart();  // send a signal to the task
        CPPUNIT_ASSERT(res == OS_SUCCESS);      // and give it a chance to run
        OsTask::delay(20);

        waitTimeoutCnt = pMediaTask->getWaitTimeoutCnt();
        OsTask::delay(1000);                     // wait 1 second
        CPPUNIT_ASSERT_EQUAL(waitTimeoutCnt, pMediaTask->getWaitTimeoutCnt());
    }
Пример #2
0
// (static) Displays information on the console about the media processing
// task.
MpFlowGraphBase* MpMediaTask::mediaInfo(void)
{
   MpFlowGraphBase* flowGraphs[20];
   int              i;
   int              numItems;
   MpMediaTask*     pMediaTask;
   MpFlowGraphBase* pFlowGraph;
   OsStatus         res;

   pMediaTask = MpMediaTask::getMediaTask(0);

   printf("\nMedia processing task information\n");
   printf("  Debug mode:                      %s\n",
             pMediaTask->getDebugMode() ? "TRUE" : "FALSE");

   printf("  Processed Frame Count:           %d\n",
             pMediaTask->numProcessedFrames());

   printf("  Processing Time Limit:           %d usecs\n",
             pMediaTask->getTimeLimit());

   printf("  Processing Limit Exceeded Count: %d\n",
             pMediaTask->getLimitExceededCnt());

   i = pMediaTask->getWaitTimeout();
   if (i < 0)
      printf("  Frame Start Wait Timeout:        INFINITE\n");
   else
      printf("  Frame Start Wait Timeout:        %d\n", i);

   printf("  Wait Timeout Exceeded Count:     %d\n",
             pMediaTask->getWaitTimeoutCnt());

   printf("\n  Flow Graph Information\n");
   printf("    Managed:      %d\n", pMediaTask->numManagedFlowGraphs());
   printf("    Started:      %d\n", pMediaTask->numStartedFlowGraphs());

   pFlowGraph = pMediaTask->getFocus();
   if (pFlowGraph == NULL)
      printf("    Focus:        NULL\n");
   else
      printf("    Focus:        %p\n", pFlowGraph);

   res = pMediaTask->getManagedFlowGraphs(flowGraphs, 20, numItems);
   for (i=0; i < numItems; i++)
      printf("    FlowGraph[%d]: %p\n", i, flowGraphs[i]);
   return pFlowGraph;
}