/** This will be called whenever something very unexpected occurs. This
  * function must not return. */
void fatalError(void)
{
	streamError();
	cli();
	for (;;)
	{
		// do nothing
	}
}
Example #2
0
void GstVideoPlayerBackend::setVideoBuffer(VideoHttpBuffer *videoHttpBuffer)
{
    if (m_videoBuffer)
    {
        disconnect(m_videoBuffer, 0, this, 0);
        m_videoBuffer->clearPlayback();
        m_videoBuffer->deleteLater();
    }

    m_videoBuffer = videoHttpBuffer;

    if (m_videoBuffer)
    {
        connect(m_videoBuffer, SIGNAL(bufferingStarted()), this, SIGNAL(bufferingStarted()));
        connect(m_videoBuffer, SIGNAL(bufferingStopped()), this, SIGNAL(bufferingStopped()));
        connect(m_videoBuffer, SIGNAL(bufferingReady()), SLOT(playIfReady()));
        connect(m_videoBuffer, SIGNAL(streamError(QString)), SLOT(streamError(QString)));
    }
}
Example #3
0
bool
JobInfoCommunicator::streamStdFile( const char *which )
{
    if(!strcmp(which,ATTR_JOB_INPUT)) {
        return streamInput();
    } else if(!strcmp(which,ATTR_JOB_OUTPUT)) {
        return streamOutput();
    } else if(!strcmp(which,ATTR_JOB_ERROR)) {
        return streamError();
    } else {
        return false;
    }
}
Example #4
0
bool baseStructureParser<streamT>::readUntil(bool inTerm, const char* termChars, int numTermChars,
        char& termHit, string& result) {
    result = "";
    // Outer loop that keeps reading more chunks of size bufSize from the file
    while(1) {
        //cout << "        ru: bufIdx="<<bufIdx<<", bufSize="<<bufSize<<endl;
        // Iterate through the rest of the file looking for terminator chars
        while(bufIdx<dataInBuf) {
            for(int i=0; i<numTermChars; i++) {
                // If the current character in buf is a terminator, return the result
                if(isMember(buf[bufIdx], termChars, numTermChars)) {
                    if(inTerm) {
                        termHit=buf[bufIdx];
                        return true;
                    }
                } else {
                    if(!inTerm) {
                        termHit=buf[bufIdx];
                        return true;
                    }
                }
            }
            // If the current character in buf is a terminator, return the result
            if(!inTerm) {
                termHit=buf[bufIdx];
                //nextChar();
                return true;
            }
            // If the character is not a terminator, append it to ret
            result += buf[bufIdx];
            bufIdx++;
        }

        //cout << "        ru: feof(f)="<<feof(f)<<", ferror(f)="<<ferror(f)<<endl;

        // If we've reached the end of the file, return unsuccessfuly
        if(streamEnd()) return false;

        // If we've encountered an error, yell
        if(streamError()) {
            fprintf(stderr, "ERROR reading file!");
//      exit(-1);
        }

        nextChar();
    }
}
Example #5
0
/**
 * Handles stream erorrs (\<stream:error/\> element).
 */
void Stream::handleStreamError(const Parser::Event& event)
{
    d->lastStreamError = StreamError( event.element() );
    emit streamError();
}
void VideoHttpBuffer::sendStreamError(const QString &message)
{
    emit streamError(message);
    emit bufferingStopped();
    gst_element_set_state(GST_ELEMENT(m_element), GST_STATE_NULL);
}