[Live-devel] Problem with doEventLoop() in Qt

antonio nunziante nunzianteantonio at gmail.com
Mon Oct 31 07:31:19 PDT 2011


Dear community,

I hope in your help. I suppose I'm doing some errors with function pointer
and I'm completely stopped on this point.
When the program goes from the SingleStep Method to the ContinueAfterOption
Method I see that the screenwidget variables loose their right value and
feels as undefined.

Please, help me. I attach the Qt Project.
-Antonio

2011/10/31 antonio nunziante <nunzianteantonio at gmail.com>

> Hi,
>
> i have the error the second time I call the method SingleStep(0) in my
> doEventLoop() method.
>
> It occurs in this block of instructions (exactly at the instruction (*
> handler->handlerProc)(handler->clientData, resultConditionSet) )
>
>
> if (handler == NULL && fLastHandledSocketNum >= 0) {
>
>     // We didn't call a handler, but we didn't get to check all of them,
>
>      // so try again from the beginning:
>
>      iter.reset();
>
>      while ((handler = iter.next()) != NULL) {
>
>        int sock = handler->socketNum; // alias
>
>        int resultConditionSet = 0;
>
>        if (FD_ISSET(sock, &readSet) && FD_ISSET(sock, &fReadSet)/*sanity check*/) resultConditionSet |= SOCKET_READABLE;
>
>        if (FD_ISSET(sock, &writeSet) && FD_ISSET(sock, &fWriteSet)/*sanity check*/) resultConditionSet |= SOCKET_WRITABLE;
>
>        if (FD_ISSET(sock, &exceptionSet) && FD_ISSET(sock, &fExceptionSet)/*sanity check*/) resultConditionSet |= SOCKET_EXCEPTION;
>
>        if ((resultConditionSet&handler->conditionSet) != 0 && handler->handlerProc != NULL) {
>
>          fLastHandledSocketNum = sock;
>
>              // Note: we set "fLastHandledSocketNum" before calling the handler,
>
>              // in case the handler calls "doEventLoop()" reentrantly.
>
>          (*handler->handlerProc)(handler->clientData, resultConditionSet);
>
>          break;
>
>        }
>
>     }
>
>     if (handler == NULL) fLastHandledSocketNum = -1;//because we didn't call a handler
>
>    }
>
>
> Could I attach my code?
>
>
> Thank you
> -Antonio
>
> 2011/10/28 Ross Finlayson <finlayson at live555.com>
>
>> I'm trying to implement a GUI with QtWidget in order to show video frame
>> from a rtsp camera.
>>
>> I started from the code of openRTSP and I modified it in order to have
>> c++ classes.
>>
>> After it runs:
>>
>> env->taskScheduler().doEventLoop();
>>
>> it comes back to the "continueAfterOPTIONS" member function. The problem
>> is that all class variables lose their values, probably a problem with
>> memory management.
>>
>>
>> The problem is more likely to be that you're not using this function
>> correctly.  Note that the "continueAfterOPTIONS()" function (and the other
>> "continueAfter...()" functions) take a "RTSPClient*" as the first
>> parameter.  In the current code, this parameter is not used (because we
>> have only one "RTSPClient" object, which is a global variable
>> "ourRTSPClient").  However, if you want to use this code in your own custom
>> application - where the "RTSPClient" object is not a global variable (or
>> there's more than one "RTSPClient" object) - then you will need to use this
>> first parameter to the "continueAfter...()" functions; it will point to the
>> "RTSPClient" object.
>>
>>
>> Ross Finlayson
>> Live Networks, Inc.
>> http://www.live555.com/
>>
>>
>> _______________________________________________
>> live-devel mailing list
>> live-devel at lists.live555.com
>> http://lists.live555.com/mailman/listinfo/live-devel
>>
>>
>
>
> --
> *
> Antonio Nunziante
> *
>



-- 
*
Antonio Nunziante
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111031/a6b7ef1d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QVideoPlayerWidget.rar
Type: application/rar
Size: 11972 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111031/a6b7ef1d/attachment-0001.bin>


More information about the live-devel mailing list