mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-20 09:40:08 +00:00
video_capture: Remove duplicit vidcap_params definition
The struct vidcap_params is already defined in video_capture_params.cpp
This commit is contained in:
@@ -71,23 +71,6 @@ using namespace std;
|
||||
|
||||
#define VIDCAP_MAGIC 0x76ae98f0
|
||||
|
||||
struct vidcap_params;
|
||||
|
||||
/**
|
||||
* Defines parameters passed to video capture driver.
|
||||
*/
|
||||
struct vidcap_params {
|
||||
char *driver; ///< driver name
|
||||
char *fmt; ///< driver options
|
||||
unsigned int flags; ///< one of @ref vidcap_flags
|
||||
|
||||
char *requested_capture_filter;
|
||||
char *name; ///< input name (capture alias in config file or complete config if not alias)
|
||||
struct vidcap_params *next; /**< Pointer to next vidcap params. Used by aggregate capture drivers.
|
||||
* Last device in list has @ref driver set to NULL. */
|
||||
struct module *parent;
|
||||
};
|
||||
|
||||
/// @brief This struct represents video capture state.
|
||||
struct vidcap {
|
||||
struct module mod;
|
||||
@@ -176,7 +159,8 @@ int initialize_video_capture(struct module *parent,
|
||||
while ((t = vidcap_params_get_next(t0))) {
|
||||
t0 = t;
|
||||
}
|
||||
if (t0->driver == NULL && t0->requested_capture_filter != NULL) {
|
||||
if (vidcap_params_get_driver(t0) == NULL
|
||||
&& vidcap_params_get_capture_filter(t0) != NULL) {
|
||||
log_msg(LOG_LEVEL_ERROR, "Capture filter (--capture-filter) needs to be "
|
||||
"specified before capture (-t)\n");
|
||||
return -1;
|
||||
@@ -200,7 +184,7 @@ int initialize_video_capture(struct module *parent,
|
||||
d->mod.cls = MODULE_CLASS_CAPTURE;
|
||||
module_register(&d->mod, parent);
|
||||
|
||||
param->parent = &d->mod;
|
||||
vidcap_params_set_parent(param, &d->mod);
|
||||
int ret = vci->init(param, &d->state);
|
||||
|
||||
switch (ret) {
|
||||
@@ -224,11 +208,11 @@ int initialize_video_capture(struct module *parent,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = capture_filter_init(&d->mod, param->requested_capture_filter,
|
||||
ret = capture_filter_init(&d->mod, vidcap_params_get_capture_filter(param),
|
||||
&d->capture_filter);
|
||||
if (ret < 0) {
|
||||
log_msg(LOG_LEVEL_ERROR, "Unable to initialize capture filter: %s.\n",
|
||||
param->requested_capture_filter);
|
||||
vidcap_params_get_capture_filter(param));
|
||||
}
|
||||
|
||||
if (ret != 0) {
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
#define _VIDEO_CAPTURE_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "video_capture_params.h"
|
||||
|
||||
#define VIDEO_CAPTURE_ABI_VERSION 9
|
||||
|
||||
@@ -115,8 +116,6 @@ struct vidcap_type {
|
||||
struct device_info *cards;
|
||||
};
|
||||
|
||||
struct vidcap_params;
|
||||
|
||||
/// @name vidcap_retval
|
||||
/// @anchor vidcap_retval
|
||||
/// Video capture init return values
|
||||
@@ -160,8 +159,6 @@ bool vidcap_generic_fps(struct vidcap *state);
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#include "video_capture_params.h"
|
||||
|
||||
#endif // _VIDEO_CAPTURE_H_
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -189,6 +189,11 @@ void vidcap_params_set_capture_filter(struct vidcap_params *params,
|
||||
params->requested_capture_filter = strdup(req_capture_filter);
|
||||
}
|
||||
|
||||
const char *vidcap_params_get_capture_filter(const struct vidcap_params *params)
|
||||
{
|
||||
return params->requested_capture_filter;
|
||||
}
|
||||
|
||||
void vidcap_params_set_flags(struct vidcap_params *params, unsigned int flags)
|
||||
{
|
||||
params->flags = flags;
|
||||
|
||||
@@ -72,6 +72,7 @@ void vidcap_params_set_parent(struct vidcap_params *params, str
|
||||
void vidcap_params_set_device(struct vidcap_params *params, const char *config);
|
||||
void vidcap_params_set_capture_filter(struct vidcap_params *params,
|
||||
const char *req_capture_filter);
|
||||
const char *vidcap_params_get_capture_filter(const struct vidcap_params *params);
|
||||
void vidcap_params_set_flags(struct vidcap_params *params, unsigned int flags);
|
||||
/// @}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user