Exemple #1
0
void THMovie::runVideo()
{
    AVFrame *pFrame = av_frame_alloc();
    int64_t iStreamPts = AV_NOPTS_VALUE;
    double dClockPts;
    int iError;

    while(!m_fAborting)
    {
        av_frame_unref(pFrame);

        iError = getVideoFrame(pFrame, &iStreamPts);
        if(iError < 0)
        {
            break;
        }
        else if(iError == 0)
        {
            continue;
        }

        dClockPts = iStreamPts * av_q2d(m_pFormatContext->streams[m_iVideoStream]->time_base);
        iError = m_pMoviePictureBuffer->write(pFrame, dClockPts);

        if(iError < 0)
        {
            break;
        }
    }

    avcodec_flush_buffers(m_pVideoCodecContext);
    av_frame_free(&pFrame);
}
Exemple #2
0
void
Video::display(Renderer& renderer)
{
	assert(m_def);

	SWFMatrix m = getWorldMatrix();
	const SWFRect& bounds = m_def->bounds();

	GnashImage* img = getVideoFrame();
	if (img)
	{
		renderer.drawVideoFrame(img, &m, &bounds, _smoothing);
	}

	clear_invalidated();
}
Exemple #3
0
void
Video::display(Renderer& renderer, const Transform& base)
{
    assert(m_def);

    const DisplayObject::MaskRenderer mr(renderer, *this);

    const Transform xform = base * transform();
    const SWFRect& bounds = m_def->bounds();

    image::GnashImage* img = getVideoFrame();
    if (img) {
        renderer.drawVideoFrame(img, xform, &bounds, _smoothing);
    }

    clear_invalidated();
}
MINT32
mHalCam::mHalCamVideoProc(
)
{
    MINT32 err = MHAL_NO_ERROR;
    VideoFrame rVideoFrame; 
    if (0 == getVideoFrame(rVideoFrame)) 
    {
        mhalCamTimeStampBufCBInfo rCamTimeStampBufCB(rVideoFrame.hwIndex, 
                                                                              rVideoFrame.timeStampS, 
                                                                              rVideoFrame.timeStampUs); 
        android_atomic_inc(&mVdoBusyFrmCnt); 
        MCAM_DBG1("[mHalCamVideoProc] Video CB (index, stampS, stampUs, busyCnt) = (%d, %d, %d, %d)\n", 
                                      rVideoFrame.hwIndex, rVideoFrame.timeStampS, rVideoFrame.timeStampUs, mVdoBusyFrmCnt); 

        mHalCamCBHandle(MHAL_CAM_CB_VIDEO_RECORD, &rCamTimeStampBufCB);             
    }
    return err;
}
VideoFrame VideoBuffer::getNextVideoFrame(){
    return getVideoFrame((int)size()-1);
//    return getVideoFrame((int)framePos);
}
VideoFrame VideoBuffer::getVideoFrame(float pct){
    return getVideoFrame(getLastTimestamp()-(getInitTime()+getTotalTime()*pct));
}
Exemple #7
0
bool BufferSinkFilterContext::getVideoFrame(VideoFrame &frame, OptionalErrorCode ec)
{
    return getVideoFrame(frame, 0, ec);
}