UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
video_capture.h
Go to the documentation of this file.
1
14/*
15 * Copyright (c) 2005-2024 CESNET
16 * Copyright (c) 2002 University of Southern California
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, is permitted provided that the following conditions
20 * are met:
21 *
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 *
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 *
29 * 3. All advertising materials mentioning features or use of this software
30 * must display the following acknowledgement:
31 *
32 * This product includes software developed by the University of Southern
33 * California Information Sciences Institute. This product also includes
34 * software developed by CESNET z.s.p.o.
35 *
36 * 4. Neither the name of the University, Institute, CESNET nor the names of
37 * its contributors may be used to endorse or promote products derived from
38 * this software without specific prior written permission.
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
41 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
42 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
43 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
44 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
45 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
46 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
47 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
49 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
50 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
51 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 */
53
96#ifndef _VIDEO_CAPTURE_H_
97#define _VIDEO_CAPTURE_H_
98
99#ifdef __cplusplus
100#include <cstddef>
101#else
102#include <stdbool.h>
103#include <stddef.h>
104#endif
105
106#include "types.h"
107#include "video_capture_params.h"
108
109#define VIDEO_CAPTURE_ABI_VERSION 13
110
111#ifdef __cplusplus
112extern "C" {
113#endif // __cplusplus
114
115struct audio_frame;
116
121#define VIDCAP_INIT_OK 0
122#define VIDCAP_INIT_NOERR 1
123#define VIDCAP_INIT_FAIL (-1)
124#define VIDCAP_INIT_AUDIO_NOT_SUPPORTED (-2)
126
127#define VIDCAP_NO_GENERIC_FPS_INDICATOR NULL
128
139 int (*init) (struct vidcap_params *param, void **state);
140 void (*done) (void *state);
141 struct video_frame *(*grab) (void *state, struct audio_frame **audio);
144};
145
146struct module;
147struct vidcap;
148
151 struct vidcap_params *params,
152 struct vidcap **state);
153void vidcap_done(struct vidcap *state);
154struct video_frame *vidcap_grab(struct vidcap *state, struct audio_frame **audio);
155const char *vidcap_get_fps_print_prefix(struct vidcap *state);
156
157#ifdef __cplusplus
158}
159#endif // __cplusplus
160
161#endif // _VIDEO_CAPTURE_H_
void ** state
struct audio_frame ** audio
void list_video_capture_devices(bool)
struct video_frame * vidcap_grab(struct vidcap *state, struct audio_frame **audio)
Grabs video frame. This function may block for a short period if waiting for incoming frame....
int initialize_video_capture(struct module *parent, struct vidcap_params *params, struct vidcap **state)
Initializes video capture.
void vidcap_done(struct vidcap *state)
Destroys vidap state.
const char * vidcap_get_fps_print_prefix(struct vidcap *state)
const char * parent
Definition settings.cpp:198
const char * param
Definition settings.cpp:195
struct used to comunicate with audio capture/playback device
Definition types.h:99
This struct represents video capture state.
const char * generic_fps_indicator_prefix
int(* init)(struct vidcap_params *param, void **state)
device_probe_func probe
void(* done)(void *state)
Struct video_frame represents a video frame and contains video description.
Definition types.h:305
This file contains some common data types.
void(* device_probe_func)(struct device_info **available_cards, int *count, void(**deleter)(void *))
Definition types.h:404