Lines Matching refs:ctx
164 struct vfw_ctx *ctx = s->priv_data;
167 unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer;
169 if(dropscore[++ctx->frame_num%ndropscores] <= buffer_fullness) {
181 struct vfw_ctx *ctx;
185 ctx = s->priv_data;
192 WaitForSingleObject(ctx->mutex, INFINITE);
206 for(ppktl = &ctx->pktl ; *ppktl ; ppktl = &(*ppktl)->next);
209 ctx->curbufsize += vdhdr->dwBytesUsed;
211 SetEvent(ctx->event);
212 ReleaseMutex(ctx->mutex);
216 ReleaseMutex(ctx->mutex);
222 struct vfw_ctx *ctx = s->priv_data;
225 if(ctx->hwnd) {
226 SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
227 SendMessage(ctx->hwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0);
228 DestroyWindow(ctx->hwnd);
230 if(ctx->mutex)
231 CloseHandle(ctx->mutex);
232 if(ctx->event)
233 CloseHandle(ctx->event);
235 pktl = ctx->pktl;
248 struct vfw_ctx *ctx = s->priv_data;
276 ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0);
277 if(!ctx->hwnd) {
285 ret = SendMessage(ctx->hwnd, WM_CAP_DRIVER_CONNECT, devnum, 0);
288 DestroyWindow(ctx->hwnd);
292 SendMessage(ctx->hwnd, WM_CAP_SET_OVERLAY, 0, 0);
293 SendMessage(ctx->hwnd, WM_CAP_SET_PREVIEW, 0, 0);
295 ret = SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0,
302 SetWindowLongPtr(ctx->hwnd, GWLP_USERDATA, (LONG_PTR) s);
311 bisize = SendMessage(ctx->hwnd, WM_CAP_GET_VIDEOFORMAT, 0, 0);
319 ret = SendMessage(ctx->hwnd, WM_CAP_GET_VIDEOFORMAT, bisize, (LPARAM) bi);
325 ret = av_parse_video_rate(&framerate_q, ctx->framerate);
327 av_log(s, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", ctx->framerate);
331 if (ctx->video_size) {
333 ret = av_parse_video_size(&w, &h, ctx->video_size);
354 ret = SendMessage(ctx->hwnd, WM_CAP_SET_VIDEOFORMAT, bisize, (LPARAM) bi);
364 ret = SendMessage(ctx->hwnd, WM_CAP_GET_SEQUENCE_SETUP, sizeof(cparms),
379 ret = SendMessage(ctx->hwnd, WM_CAP_SET_SEQUENCE_SETUP, sizeof(cparms),
415 ctx->mutex = CreateMutex(NULL, 0, NULL);
416 if(!ctx->mutex) {
420 ctx->event = CreateEvent(NULL, 1, 0, NULL);
421 if(!ctx->event) {
426 ret = SendMessage(ctx->hwnd, WM_CAP_SEQUENCE_NOFILE, 0, 0);
442 struct vfw_ctx *ctx = s->priv_data;
446 WaitForSingleObject(ctx->mutex, INFINITE);
447 pktl = ctx->pktl;
448 if(ctx->pktl) {
449 *pkt = ctx->pktl->pkt;
450 ctx->pktl = ctx->pktl->next;
453 ResetEvent(ctx->event);
454 ReleaseMutex(ctx->mutex);
459 WaitForSingleObject(ctx->event, INFINITE);
464 ctx->curbufsize -= pkt->size;