android/ringlibsdl/project/jni/smpeg2-2.0.0/video/MPEGvideo.cpp
bool
MPEGvideo:: SetDisplay(MPEG_DisplayCallback callback, void *data, SDL_mutex *lock)
{
    _callback = callback;
    _callback_data = data;
    _callback_lock = lock;

    if ( !_stream ) {
        decodeInitTables();

        InitCrop();
        InitIDCT();

        _stream = NewVidStream( (unsigned int) BUF_LENGTH );
        if( _stream ) {
            _stream->_smpeg        = this;
            _stream->ditherType    = FULL_COLOR_DITHER;

            if( mpegVidRsrc( 0, _stream, 1 ) == NULL ) {
                SetError("Not an MPEG video stream");
                return false;
            }
        }

        if ( ! InitPictImages(_stream, _w, _h) )
            return false;
    }
    return true;
}
/*
   Returns zero if fails.

   lock - lock is held while MPEG stream is playing
   callback - called on every frame, for display update
*/
Returns zero if fails.
lock - lock is held while MPEG stream is playing
callback - called on every frame, for display update
Returns zero if fails . lock - lock is held while MPEG stream is playing callback - called on every frame for display update
bool
MPEGvideo:: SetDisplay(MPEG_DisplayCallback callback, void *data, SDL_mutex *lock)
{
    _callback = callback;
    _callback_data = data;
    _callback_lock = lock;
    if ( !_stream ) {
        decodeInitTables();
        InitCrop();
        InitIDCT();
        _stream = NewVidStream( (unsigned int) BUF_LENGTH );
        if( _stream ) {
            _stream->_smpeg        = this;
            _stream->ditherType    = FULL_COLOR_DITHER;
            if( mpegVidRsrc( 0, _stream, 1 ) == NULL ) {
                SetError("Not an MPEG video stream");
                return false;
            }
        }
        if ( ! InitPictImages(_stream, _w, _h) )
            return false;
    }
    return true;
}
bool MPEGvideo :: SetDisplay ( MPEG_DisplayCallback callback , void * data , SDL_mutex * lock ) { _callback = callback ; _callback_data = data ; _callback_lock = lock ; if ( ! _stream ) { decodeInitTables ( ) ; InitCrop ( ) ; InitIDCT ( ) ; _stream = NewVidStream ( ( unsigned int ) BUF_LENGTH ) ; if ( _stream ) { _stream -> _smpeg = this ; _stream -> ditherType = FULL_COLOR_DITHER ; if ( mpegVidRsrc ( 0 , _stream , 1 ) == NULL ) { SetError ( " " ) ; return false ; } } if ( ! InitPictImages ( _stream , _w , _h ) ) return false ; } return true ; }
Returns zero if fails.
Returns zero if fails .