void CKeyframe::InsertFrame (size_t idx) { size_t lastframe = frames.size()-1; if (idx > lastframe) return; frames.push_back(TKeyframe()); for (size_t i=frames.size()-1; i>idx; i--) CopyFrame (i-1, i); ResetFrame2 (&frames[idx]); }
void VideoOutputOpenGL::UpdatePauseFrame(void) { QMutexLocker locker(&gl_context_lock); VideoFrame *used_frame = vbuffers.head(kVideoBuffer_used); if (!used_frame) used_frame = vbuffers.GetScratchFrame(); CopyFrame(&av_pause_frame, used_frame); }
void VideoOutputOpenGL::UpdatePauseFrame(int64_t &disp_timecode) { QMutexLocker locker(&gl_context_lock); VideoFrame *used_frame = vbuffers.Head(kVideoBuffer_used); if (!used_frame) used_frame = vbuffers.GetScratchFrame(); CopyFrame(&av_pause_frame, used_frame); disp_timecode = av_pause_frame.disp_timecode; }
void CKeyframe::InsertFrame (int idx) { if (numFrames >= MAX_KEY_FRAMES) return; int lastframe = numFrames-1; if (idx < 0 || idx > lastframe) return; if (frames[numFrames] == NULL) frames[numFrames] = new (TKeyframe2); for (int i=numFrames; i>idx; i--) CopyFrame (i-1, i); ResetFrame2 (frames[idx]); numFrames++; }
/* Redraw window content function. * ARGUMENTS: * - window device context: * HDC hDC; * RETURNS: None. */ VOID physic::anim::Paint( HDC hDC ) { StartFrame(); glPushAttrib(GL_ALL_ATTRIB_BITS); Navigation.Render(this); glPopAttrib(); World.ModelUpdate(this); World.Render(this); EndFrame(); CopyFrame(); IncrFrameCount(); } /* End of 'physic::anim::Paint' function */
/* [noscript] gfxASurface getFrame(in PRUint32 aWhichFrame, * in PRUint32 aFlags; */ NS_IMETHODIMP VectorImage::GetFrame(PRUint32 aWhichFrame, PRUint32 aFlags, gfxASurface** _retval) { NS_ENSURE_ARG_POINTER(_retval); nsRefPtr<gfxImageSurface> surface; nsresult rv = CopyFrame(aWhichFrame, aFlags, getter_AddRefs(surface)); if (NS_SUCCEEDED(rv)) { *_retval = surface.forget().get(); } return rv; }
void VideoOutputOpenGL::ProcessFrame(VideoFrame *frame, OSD *osd, FilterChain *filterList, const PIPMap &pipPlayers, FrameScanType scan) { QMutexLocker locker(&gl_context_lock); if (!gl_context) return; bool sw_frame = codec_is_std(video_codec_id) && video_codec_id != kCodec_NONE; bool deint_proc = m_deinterlacing && (m_deintFilter != NULL); OpenGLLocker ctx_lock(gl_context); bool pauseframe = false; if (!frame) { frame = vbuffers.GetScratchFrame(); CopyFrame(vbuffers.GetScratchFrame(), &av_pause_frame); pauseframe = true; } if (filterList && sw_frame) filterList->ProcessFrame(frame); bool safepauseframe = pauseframe && !IsBobDeint(); if (sw_frame && deint_proc && m_deinterlaceBeforeOSD && (!pauseframe || safepauseframe)) { m_deintFilter->ProcessFrame(frame, scan); } if (!window.IsEmbedding()) { gl_pipchain_active = NULL; ShowPIPs(frame, pipPlayers); } if (sw_frame && (!pauseframe || safepauseframe) && deint_proc && !m_deinterlaceBeforeOSD) { m_deintFilter->ProcessFrame(frame, scan); } if (gl_videochain && sw_frame) { bool soft_bob = m_deinterlacing && (m_deintfiltername == "bobdeint"); gl_videochain->UpdateInputFrame(frame, soft_bob); } }
size_t CKeyframe::DeleteFrame (size_t idx) { if (frames.size() < 2) return idx; size_t lastframe = frames.size()-1; if (idx > lastframe) return 0; if (idx == lastframe) { frames.pop_back(); return frames.size()-1; } else { for (size_t i=idx; i<lastframe-1; i++) CopyFrame (i+1, i); frames.pop_back(); return idx; } }
int CKeyframe::DeleteFrame (int idx) { if (numFrames < 2) return idx; int lastframe = numFrames-1; if (idx < 0 || idx > lastframe) return 0; if (idx == lastframe) { free (frames[lastframe]); frames[lastframe] = NULL; numFrames--; return numFrames-1; } else { for (int i=idx; i<lastframe-1; i++) CopyFrame (i+1, i); free (frames[lastframe]); frames[lastframe] = NULL; numFrames--; return idx; } }
HRESULT CDecDXVA2::DeliverDXVA2Frame(LAVFrame *pFrame) { if (m_bNative) { if (!pFrame->data[0] || !pFrame->data[3]) { DbgLog((LOG_ERROR, 10, L"No sample or surface for DXVA2 frame?!?!")); ReleaseFrame(&pFrame); return S_FALSE; } pFrame->format = LAVPixFmt_DXVA2; Deliver(pFrame); } else { if (CopyFrame(pFrame)) Deliver(pFrame); else ReleaseFrame(&pFrame); } return S_OK; }
void VideoOutputOpenGLVAAPI::UpdatePauseFrame(int64_t &disp_timecode) { if (codec_is_std(video_codec_id)) { VideoOutputOpenGL::UpdatePauseFrame(disp_timecode); return; } vbuffers.begin_lock(kVideoBuffer_used); if (vbuffers.Size(kVideoBuffer_used)) { VideoFrame *frame = vbuffers.Head(kVideoBuffer_used); CopyFrame(&av_pause_frame, frame); m_pauseBuffer = frame->buf; disp_timecode = frame->disp_timecode; } else LOG(VB_PLAYBACK, LOG_WARNING, LOC + "Could not update pause frame - no used frames."); vbuffers.end_lock(); }
void VideoOutputOpenGL::ProcessFrame(VideoFrame *frame, OSD */*osd*/, FilterChain *filterList, const PIPMap &pipPlayers, FrameScanType scan) { QMutexLocker locker(&gl_context_lock); if (!gl_context) return; if (!gl_valid) { if (!gCoreContext->IsUIThread()) { LOG(VB_GENERAL, LOG_ERR, LOC + "ProcessFrame called from wrong thread"); } QSize size = window.GetActualVideoDim(); InitDisplayMeasurements(size.width(), size.height(), false); DestroyVideoResources(); CreateVideoResources(); BestDeint(); gl_valid = true; } bool sw_frame = codec_sw_copy(video_codec_id) && video_codec_id != kCodec_NONE; bool deint_proc = m_deinterlacing && (m_deintFilter != nullptr); OpenGLLocker ctx_lock(gl_context); bool pauseframe = false; if (!frame) { frame = vbuffers.GetScratchFrame(); CopyFrame(vbuffers.GetScratchFrame(), &av_pause_frame); pauseframe = true; } if (sw_frame) { CropToDisplay(frame); } bool dummy = frame->dummy; if (filterList && sw_frame && !dummy) filterList->ProcessFrame(frame); bool safepauseframe = pauseframe && !IsBobDeint(); if (sw_frame && deint_proc && m_deinterlaceBeforeOSD && (!pauseframe || safepauseframe) && !dummy) { m_deintFilter->ProcessFrame(frame, scan); } if (!window.IsEmbedding()) { gl_pipchain_active = nullptr; ShowPIPs(frame, pipPlayers); } if (sw_frame && (!pauseframe || safepauseframe) && deint_proc && !m_deinterlaceBeforeOSD && !dummy) { m_deintFilter->ProcessFrame(frame, scan); } if (gl_videochain && sw_frame && !dummy) { bool soft_bob = m_deinterlacing && (m_deintfiltername == "bobdeint"); gl_videochain->UpdateInputFrame(frame, soft_bob); } }
/* Redraw window content function. * ARGUMENTS: * - window device context: * HDC hDC; * RETURNS: None. */ VOID tlr::anim::Paint( HDC hDC ) { CopyFrame(); IncrFrameCount(); } /* End of 'tlr::anim::Paint' function */