UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
Video Display
Collaboration diagram for Video Display:

Topics

 Audio
 

Files

file  video_display.c
 
file  video_display.h
 

Classes

struct  multi_sources_supp_info
 
struct  video_display_info
 

Macros

#define DISPLAY_NO_GENERIC_FPS_INDICATOR   ((const char *) 0x00)
 
#define PUTF_BLOCKING   LLONG_MAX
 
#define PUTF_DISCARD   (-1LL)
 
#define PUTF_NONBLOCK   0LL
 
#define VIDEO_DISPLAY_ABI_VERSION   21
 

Functions

bool display_ctl_property (struct display *d, int property, void *val, size_t *len)
 Get/set property (similar to ioctl)
 
void display_done (struct display *d)
 This function performs cleanup after done.
 
struct video_frame * display_get_frame (struct display *d)
 Returns video framebuffer which will be written to.
 
void display_join (struct display *d)
 
bool display_needs_mainloop (struct display *d)
 
bool display_put_frame (struct display *d, struct video_frame *frame, long long timeout_ns)
 }
 
bool display_reconfigure (struct display *d, struct video_desc desc, enum video_mode mode)
 
void display_run_mainloop (struct display *d)
 Display mainloop function.
 
void display_run_new_thread (struct display *d)
 
const char * get_audio_conn_flag_name (int audio_init_flag)
 
struct video_frame * get_splashscreen (void)
 
int initialize_video_display (struct module *parent, const char *requested_display, const char *fmt, unsigned int flags, const char *postprocess, struct display **out)
 Initializes video display.
 
void list_video_display_devices (bool full)
 

Display Properties

enum  display_property {
  DISPLAY_PROPERTY_CODECS = 0 , DISPLAY_PROPERTY_RGB_SHIFT = 1 , DISPLAY_PROPERTY_BUF_PITCH = 2 , DISPLAY_PROPERTY_VIDEO_MODE = 3 ,
  DISPLAY_PROPERTY_SUPPORTED_IL_MODES = 4 , DISPLAY_PROPERTY_SUPPORTS_MULTI_SOURCES = 5 , DISPLAY_PROPERTY_AUDIO_FORMAT = 6
}
 
enum  display_prop_vid_mode { DISPLAY_PROPERTY_VIDEO_MERGED = 0 , DISPLAY_PROPERTY_VIDEO_SEPARATE_TILES = 1 , DISPLAY_PROPERTY_VIDEO_SEPARATE_3D = 2 }
 
#define PITCH_DEFAULT   -1
 default pitch, i. e. respective linesize
 

Initialization Flags

#define DISPLAY_FLAG_AUDIO_EMBEDDED   (1<<1)
 
#define DISPLAY_FLAG_AUDIO_AESEBU   (1<<2)
 
#define DISPLAY_FLAG_AUDIO_ANALOG   (1<<3)
 
#define DISPLAY_FLAG_AUDIO_ANY   (DISPLAY_FLAG_AUDIO_EMBEDDED | DISPLAY_FLAG_AUDIO_AESEBU | DISPLAY_FLAG_AUDIO_ANALOG)
 

Detailed Description

API for video display . Normal operation is something like: Thread #1 (main thread)

d = ininitalize_video_display(...);
Thread #2
while(!done) {
// wait for video
// pick one codec that is supported by display
display_reconfigure(video_width, video_height, fps, interlacing, selected_codec);
while(!done && !video_changed) {
f = display_getf();
fill_frame_with_decoded_data(f);
display_putf(f);
}
}
display_putf(NULL);
static void done(void *state)
void display_run_mainloop(struct display *d)
Display mainloop function.
bool display_ctl_property(struct display *d, int property, void *val, size_t *len)
Gets property from video display.
void display_done(struct display *d)
This function performs cleanup after done.
static struct @76 codecs[]
bool display_reconfigure(struct display *d, struct video_desc desc, enum video_mode video_mode)
Reconfigure display to new video format.

If display needs parallel processing, it can use run() function which will be started in main thread. It must return control when receiving NULL frame (poisoned pill).

Note
Codec supported by display can be also a compressed one in which case video_frame::tile::data_len will be filled with appropriate value.

Macro Definition Documentation

◆ DISPLAY_FLAG_AUDIO_AESEBU

#define DISPLAY_FLAG_AUDIO_AESEBU   (1<<2)

◆ DISPLAY_FLAG_AUDIO_ANALOG

#define DISPLAY_FLAG_AUDIO_ANALOG   (1<<3)

◆ DISPLAY_FLAG_AUDIO_ANY

◆ DISPLAY_FLAG_AUDIO_EMBEDDED

◆ DISPLAY_NO_GENERIC_FPS_INDICATOR

#define DISPLAY_NO_GENERIC_FPS_INDICATOR   ((const char *) 0x00)

Definition at line 151 of file video_display.h.

Referenced by display_caca_info_get().

◆ PITCH_DEFAULT

◆ PUTF_BLOCKING

◆ PUTF_DISCARD

◆ PUTF_NONBLOCK

◆ VIDEO_DISPLAY_ABI_VERSION

#define VIDEO_DISPLAY_ABI_VERSION   21

Definition at line 149 of file video_display.h.

Referenced by initialize_video_display(), and list_video_display_devices().

Enumeration Type Documentation

◆ display_prop_vid_mode

Enumerator
DISPLAY_PROPERTY_VIDEO_MERGED 

monolithic framebuffer

DISPLAY_PROPERTY_VIDEO_SEPARATE_TILES 

framebuffer consists of separate tiles

DISPLAY_PROPERTY_VIDEO_SEPARATE_3D 

same as MERGED but 2 streams should be handled as separate 3D tiles

Definition at line 142 of file video_display.h.

142 {
146};
@ DISPLAY_PROPERTY_VIDEO_SEPARATE_TILES
framebuffer consists of separate tiles
@ DISPLAY_PROPERTY_VIDEO_MERGED
monolithic framebuffer
@ DISPLAY_PROPERTY_VIDEO_SEPARATE_3D
same as MERGED but 2 streams should be handled as separate 3D tiles

◆ display_property

Enumerator
DISPLAY_PROPERTY_CODECS 

list of natively supported codecs - codec_t[]

DISPLAY_PROPERTY_RGB_SHIFT 

red,green,blue shift - int[3] (bits)

DISPLAY_PROPERTY_BUF_PITCH 

requested framebuffer pitch - int (bytes), may be PITCH_DEFAULT

DISPLAY_PROPERTY_VIDEO_MODE 

requested video mode - int (one of display_prop_vid_mode)

DISPLAY_PROPERTY_SUPPORTED_IL_MODES 

display supported interlacing modes - enum interlacing_t[]

DISPLAY_PROPERTY_SUPPORTS_MULTI_SOURCES 

whether display supports receiving data from - returns (struct multi_sources_supp_info *) multiple network sources concurrently

DISPLAY_PROPERTY_AUDIO_FORMAT 
See also
audio_display_info::query_format - in/out parameter is struct audio_desc

Definition at line 128 of file video_display.h.

128 {
129 // getters
138};
@ DISPLAY_PROPERTY_BUF_PITCH
requested framebuffer pitch - int (bytes), may be PITCH_DEFAULT
@ DISPLAY_PROPERTY_SUPPORTS_MULTI_SOURCES
@ DISPLAY_PROPERTY_RGB_SHIFT
red,green,blue shift - int[3] (bits)
@ DISPLAY_PROPERTY_SUPPORTED_IL_MODES
display supported interlacing modes - enum interlacing_t[]
@ DISPLAY_PROPERTY_VIDEO_MODE
requested video mode - int (one of display_prop_vid_mode)
@ DISPLAY_PROPERTY_CODECS
list of natively supported codecs - codec_t[]
@ DISPLAY_PROPERTY_AUDIO_FORMAT

Function Documentation

◆ display_ctl_property()

bool display_ctl_property ( struct display * d,
int property,
void * val,
size_t * len )

Get/set property (similar to ioctl)

Get/set property (similar to ioctl)

Parameters
[in]dvideo display state
[in]propertyone of display_property
[in]valpointer to output buffer where should be the property stored
[in]lenprovided buffer length
[out]lenactual size written

Definition at line 515 of file video_display.c.

516{
517 assert(d->magic == DISPLAY_MAGIC);
518 if (!d->postprocess){
519 return d->funcs->ctl_property(d->state, property, val, len);
520 }
521
522 switch (property) {
524 *(int *) val = PITCH_DEFAULT;
525 *len = sizeof(int);
526 return true;
528 {
529 codec_t display_codecs[VIDEO_CODEC_COUNT];
530 codec_t pp_codecs[VIDEO_CODEC_COUNT];
531 size_t display_codecs_count, pp_codecs_count;
532 size_t nlen;
533 bool ret;
534 nlen = sizeof display_codecs;
535 ret = d->funcs->ctl_property(d->state, DISPLAY_PROPERTY_CODECS, display_codecs, &nlen);
536 if (!ret) {
537 log_msg(LOG_LEVEL_ERROR, "[Display] Unable to get display supported codecs.\n");
538 return false;
539 }
540 display_codecs_count = nlen / sizeof(codec_t);
541 nlen = sizeof pp_codecs;
543 if (ret) {
544 if (nlen == 0) { // problem detected
545 log_msg(LOG_LEVEL_ERROR, "[Decoder] Unable to get supported codecs.\n");
546 return false;
547
548 }
549 pp_codecs_count = nlen / sizeof(codec_t);
551 d->postprocess, display_codecs,
552 &display_codecs_count, pp_codecs,
553 pp_codecs_count);
554 }
555 nlen = display_codecs_count * sizeof(codec_t);
556 if (nlen <= *len) {
557 *len = nlen;
558 memcpy(val, display_codecs, nlen);
559 return true;
560 }
561 return false;
562 }
563 break;
564 default:
565 return d->funcs->ctl_property(d->state, property, val, len);
566 }
567}
int void * val
int void size_t * len
int property
void log_msg(int level, const char *format,...)
Definition debug.cpp:130
#define LOG_LEVEL_ERROR
general errors
Definition debug.h:59
#define PITCH_DEFAULT
default pitch, i. e. respective linesize
void * state
state of the created video capture driver
const struct video_display_info * funcs
struct vo_postprocess_state * postprocess
uint32_t magic
For debugging. Conatins DISPLAY_MAGIC.
bool(* ctl_property)(void *state, int property, void *val, size_t *len)
codec_t
Definition types.h:65
@ VIDEO_CODEC_COUNT
count of known video codecs (including VIDEO_CODEC_NONE)
Definition types.h:108
static void restrict_returned_codecs(struct vo_postprocess_state *postprocess, codec_t *display_codecs, size_t *display_codecs_count, codec_t *pp_codecs, size_t pp_codecs_count)
#define DISPLAY_MAGIC
bool vo_postprocess_get_property(struct vo_postprocess_state *s, int property, void *val, size_t *len)
#define VO_PP_PROPERTY_CODECS

References video_display_info::ctl_property, DISPLAY_MAGIC, DISPLAY_PROPERTY_BUF_PITCH, DISPLAY_PROPERTY_CODECS, funcs, len, LOG_LEVEL_ERROR, log_msg(), magic, PITCH_DEFAULT, postprocess, property, restrict_returned_codecs(), state, val, VIDEO_CODEC_COUNT, vo_postprocess_get_property(), and VO_PP_PROPERTY_CODECS.

Referenced by display_aggregate_get_property(), display_blend_get_property(), display_conference_get_property(), display_multiplier_get_property(), main(), ultragrid_rtp_video_rxtx::receiver_loop(), reconfigure_decoder(), vidcap_ug_input_init(), video_decoder_register_display(), and worker().

Here is the call graph for this function:

◆ display_done()

void display_done ( struct display * d)

This function performs cleanup after done.

Parameters
ddisplay do be destroyed (must not be NULL)

Definition at line 184 of file video_display.c.

185{
186 assert(d->magic == DISPLAY_MAGIC);
187 d->funcs->done(d->state);
188 module_done(&d->mod);
190 free(d->display_name);
191 free(d);
192}
void module_done(struct module *module_data)
Definition module.c:93
struct module mod
char * display_name
void(* done)(void *state)
void vo_postprocess_done(struct vo_postprocess_state *s)

References DISPLAY_MAGIC, display_name, video_display_info::done, funcs, magic, mod, module_done(), postprocess, state, and vo_postprocess_done().

Referenced by sage_video_rxtx::~sage_video_rxtx(), state_blend_common::~state_blend_common(), ultragrid_rtp_video_rxtx::~ultragrid_rtp_video_rxtx(), display_aggregate_done(), display_aggregate_init(), done(), hd_rum_decompress_done(), initialize_video_display(), main(), test_video_display(), and vidcap_ug_input_done().

Here is the call graph for this function:

◆ display_get_frame()

struct video_frame * display_get_frame ( struct display * d)

Returns video framebuffer which will be written to.

Currently there is a restriction on number of concurrently acquired frames - only one frame can be hold at the moment. Every obtained frame from this call has to be returned back with display_put_frame()

Returns
video frame

Definition at line 321 of file video_display.c.

322{
323 struct message *msg;
324 while((msg = check_message(&d->mod))) {
325 struct response *r = process_message(d, (struct msg_universal *) msg);
326 free_message(msg, r);
327 }
328
329 assert(d->magic == DISPLAY_MAGIC);
330 if (d->postprocess) {
332 } else {
333 return d->funcs->getf(d->state);
334 }
335}
void free_message(struct message *msg, struct response *r)
struct message * check_message(struct module *mod)
struct msghdr msg
struct video_frame *(* getf)(void *state)
static struct response * process_message(struct display *d, struct msg_universal *msg)
struct video_frame * vo_postprocess_getf(struct vo_postprocess_state *s)

References check_message(), DISPLAY_MAGIC, free_message(), funcs, video_display_info::getf, magic, mod, msg, postprocess, process_message(), state, and vo_postprocess_getf().

Referenced by decompress_thread(), display_aggregate_getf(), display_blend_run(), display_conference_worker(), display_multiplier_worker(), ihdtv_video_rxtx::receiver_loop(), loopback_video_rxtx::receiver_loop(), reconfigure_decoder(), sage_video_rxtx::send_frame(), and worker().

Here is the call graph for this function:

◆ display_join()

void display_join ( struct display * d)

Joins the display task if run in a separate thread (

See also
display_run_new_thread).

The function blocks while the display runs. The display can be terminated by passing a poisoned pill (frame == NULL) using the display_put_frame() call.

Definition at line 273 of file video_display.c.

274{
275 assert(d->magic == DISPLAY_MAGIC);
276 if (d->thread_started) {
277 CHECK(pthread_join(d->thread_id, NULL));
278 }
279}
_Bool thread_started
pthread_t thread_id
thread ID of the display thread (
#define CHECK(cmd)

References CHECK, DISPLAY_MAGIC, magic, thread_id, and thread_started.

Referenced by sage_video_rxtx::~sage_video_rxtx(), display_aggregate_run(), display_blend_run(), display_multiplier_run(), done(), hd_rum_decompress_done(), and vidcap_ug_input_done().

◆ display_needs_mainloop()

bool display_needs_mainloop ( struct display * d)

Returns true if display has a run routine that needs to be run in a main thread

Definition at line 197 of file video_display.c.

198{
199 assert(d->magic == DISPLAY_MAGIC);
200 return d->funcs->run != NULL;
201}
void(* run)(void *state)
callback to display main event loop; may be NULL

References DISPLAY_MAGIC, funcs, magic, and video_display_info::run.

Referenced by display_multiplier_init(), and display_run_new_thread().

◆ display_put_frame()

bool display_put_frame ( struct display * d,
struct video_frame * frame,
long long timeout_ns )

}

}

Parameters
ddisplay to be putted frame to
frameframe that has been obtained from display_get_frame() and has not yet been put. Should not be NULL unless we want to quit display mainloop.
timeout_nsspecifies timeout that should be waited (
See also
putf_flags). displays may ignore the value and act like PUTF_NONBLOCK if blocking is not requested.
Return values
trueif displayed succesfully (or discarded if flag=PUTF_DISCARD)
falseif not displayed when flag=PUTF_NONBLOCK and it would block

Definition at line 372 of file video_display.c.

373{
374 assert(d->magic == DISPLAY_MAGIC);
375
376 if (!frame) {
377 return d->funcs->putf(d->state, frame, timeout_ns);
378 }
379
380 if (!d->postprocess) {
381 return display_frame_helper(d, frame, timeout_ns);
382 }
383
384 bool display_ret = true;
385 for (int i = 0; i < d->pp_output_frames_count; ++i) {
386 struct video_frame *display_frame = d->funcs->getf(d->state);
387 int ret = vo_postprocess(d->postprocess,
388 frame,
390 d->display_pitch);
391 frame = NULL;
392 if (!ret) {
394 return 1;
395 }
396
397 display_ret = display_frame_helper(d, display_frame, timeout_ns);
398 }
399 return display_ret;
400
401}
struct video_frame * frame
#define PUTF_DISCARD
static void display_frame(struct state_sdl *s, struct video_frame *frame)
Definition sdl.cpp:219
int display_pitch
int pp_output_frames_count
bool(* putf)(void *state, struct video_frame *frame, long long timeout_ns)
Struct video_frame represents a video frame and contains video description.
Definition types.h:305
static bool display_frame_helper(struct display *d, struct video_frame *frame, long long timeout_ns)
bool vo_postprocess(struct vo_postprocess_state *s, struct video_frame *in, struct video_frame *out, int req_pitch)

References display_frame(), display_frame_helper(), DISPLAY_MAGIC, display_pitch, frame, funcs, video_display_info::getf, magic, postprocess, pp_output_frames_count, video_display_info::putf, PUTF_DISCARD, state, and vo_postprocess().

Referenced by sage_video_rxtx::~sage_video_rxtx(), decompress_thread(), display_aggregate_putf(), display_blend_run(), display_conference_worker(), display_multiplier_worker(), hd_rum_decompress_done(), ihdtv_video_rxtx::receiver_loop(), loopback_video_rxtx::receiver_loop(), ultragrid_rtp_video_rxtx::receiver_loop(), reconfigure_decoder(), sage_video_rxtx::send_frame(), vidcap_ug_input_done(), video_decoder_remove_display(), and worker().

Here is the call graph for this function:

◆ display_reconfigure()

bool display_reconfigure ( struct display * d,
struct video_desc desc,
enum video_mode mode )

◆ display_run_mainloop()

void display_run_mainloop ( struct display * d)

Display mainloop function.

It is intended for GUI displays (GL/SDL), which run main event loop and need to be run from main thread of the program (macOS).

The display can be terminated by passing a poisoned pill (frame == NULL) using the display_put_frame() call.

Parameters
ddisplay to be run

Definition at line 232 of file video_display.c.

233{
234 assert(d->magic == DISPLAY_MAGIC);
235 if (d->funcs->run) {
236 d->funcs->run(d->state);
237 } else if (mainloop) {
239 }
240}
void * mainloop_udata
Definition host.cpp:187
mainloop_t mainloop
mainloop to be run if display mainloop isn't run
Definition host.cpp:186

References DISPLAY_MAGIC, funcs, magic, mainloop, mainloop_udata, video_display_info::run, and state.

Referenced by display_conference_run(), display_multiplier_run(), and main().

◆ display_run_new_thread()

void display_run_new_thread ( struct display * d)

This function runs the display in a new thread and does not block.

It should not be used for GUI displays (GL/SDL), which usually need to be run from main thread of the * program (OS X).

Displays started with this functions need to be waited on (

See also
display_join) before they are destroyed.
Parameters
ddisplay to be run

Definition at line 253 of file video_display.c.

254{
255 assert(d->magic == DISPLAY_MAGIC);
256 if (display_needs_mainloop(d)) {
257 log_msg(LOG_LEVEL_WARNING, "Display requires mainloop, but is "
258 "being run in a new thread!\n");
259 }
260 if (d->funcs->run) {
261 CHECK(pthread_create(&d->thread_id, NULL, display_run_helper, d));
262 d->thread_started = 1;
263 }
264}
#define LOG_LEVEL_WARNING
less severe errors
Definition debug.h:60
bool display_needs_mainloop(struct display *d)
static void * display_run_helper(void *args)

References CHECK, DISPLAY_MAGIC, display_needs_mainloop(), display_run_helper(), funcs, LOG_LEVEL_WARNING, log_msg(), magic, video_display_info::run, thread_id, and thread_started.

Referenced by sage_video_rxtx::sage_video_rxtx(), display_aggregate_run(), display_blend_init(), display_multiplier_run(), hd_rum_decompress_init(), init(), and vidcap_ug_input_init().

Here is the call graph for this function:

◆ get_audio_conn_flag_name()

const char * get_audio_conn_flag_name ( int audio_init_flag)

Definition at line 636 of file video_display.c.

637{
638 switch (audio_init_flag) {
639 case 0:
640 return "(none)";
642 return "embedeed";
644 return "AES/EBU";
646 return "analog";
647 default:
648 UG_ASSERT(0 && "Wrong audio flag!");
649 }
650}
#define DISPLAY_FLAG_AUDIO_ANALOG
#define DISPLAY_FLAG_AUDIO_AESEBU
#define DISPLAY_FLAG_AUDIO_EMBEDDED
#define UG_ASSERT(cond)
unconditional alternative to assert that is not affected by NDEBUG macro
Definition macros.h:78

References DISPLAY_FLAG_AUDIO_AESEBU, DISPLAY_FLAG_AUDIO_ANALOG, DISPLAY_FLAG_AUDIO_EMBEDDED, and UG_ASSERT.

Referenced by set_audio_props().

◆ get_splashscreen()

struct video_frame * get_splashscreen ( void )
Returns
default UG splashscreen, caller is obliged to call vf_free() on the result

Definition at line 604 of file video_display.c.

605{
606 struct video_desc desc;
607
608 desc.width = 512;
609 desc.height = 512;
612 desc.fps = 1;
613 desc.tile_count = 1;
614
616
617 const char *data = splash_data;
618 memset(frame->tiles[0].data, 0, frame->tiles[0].data_len);
619 for (unsigned int y = 0; y < splash_height; ++y) {
620 char *line = frame->tiles[0].data;
621 line += vc_get_linesize(frame->tiles[0].width,
622 frame->color_spec) *
623 (((frame->tiles[0].height - splash_height) / 2) + y);
624 line += vc_get_linesize(
625 (frame->tiles[0].width - splash_width)/2,
627 for (unsigned int x = 0; x < splash_width; ++x) {
628 HEADER_PIXEL(data,line);
629 line += 4;
630 }
631 }
632 return frame;
633}
struct video_desc desc
int vc_get_linesize(unsigned int width, codec_t codec)
struct video_frame * vf_alloc_desc_data(struct video_desc desc)
#define HEADER_PIXEL(data, pixel)
Definition splashscreen.h:8
static const char *const splash_data
static const unsigned int splash_width
Definition splashscreen.h:3
static const unsigned int splash_height
Definition splashscreen.h:4
unsigned int width
Definition types.h:280
char * data
Raw tile data. Pointer must be at least 4B aligned.
Definition types.h:287
unsigned int data_len
length of the data
Definition types.h:288
unsigned int height
Definition types.h:281
unsigned int tile_count
Definition types.h:185
codec_t color_spec
Definition types.h:182
enum interlacing_t interlacing
Definition types.h:184
double fps
Definition types.h:183
unsigned int width
width of every tile (!)
Definition types.h:179
unsigned int height
height of every tile (!)
Definition types.h:180
struct tile tiles[FLEXIBLE_ARRAY_MEMBER]
Definition types.h:345
codec_t color_spec
Definition types.h:306
@ PROGRESSIVE
progressive frame
Definition types.h:164
@ RGBA
RGBA 8-bit, big-endian.
Definition types.h:70

References video_desc::color_spec, video_frame::color_spec, tile::data, tile::data_len, desc, video_desc::fps, frame, HEADER_PIXEL, tile::height, video_desc::height, video_desc::interlacing, PROGRESSIVE, RGBA, splash_data, splash_height, splash_width, video_desc::tile_count, video_frame::tiles, vc_get_linesize(), vf_alloc_desc_data(), tile::width, and video_desc::width.

Referenced by display_caca_init(), display_gl_init_opengl(), get_splash_fb(), gl_load_splashscreen(), loadSplashscreen(), and loadSplashscreen().

Here is the call graph for this function:

◆ initialize_video_display()

int initialize_video_display ( struct module * parent,
const char * requested_display,
const char * fmt,
unsigned int flags,
const char * postprocess,
struct display ** out )

Initializes video display.

Parameters
[in]requested_displayvideo display module name, not NULL
[in]fmtcommand-line entered format string, not NULL
[in]flagsbit sum of display_flags
[in]postprocessconfiguration for display postprocess, is NULL if no present
[out]outoutput display state. Defined only if initialization was successful.
Return values
0if sucessful
-1if failed
1if successfully shown help (no state returned)

Definition at line 124 of file video_display.c.

126{
127 assert (requested_display != NULL && fmt != NULL && out != NULL);
128
129 if (postprocess && (strcmp(postprocess, "help") == 0 || strcmp(postprocess, "fullhelp") == 0)) {
130 show_vo_postprocess_help(strcmp(postprocess, "fullhelp") == 0);
131 return 1;
132 }
133
134 const struct video_display_info *vdi = (const struct video_display_info *)
136
137 if (!vdi) {
138 log_msg(LOG_LEVEL_ERROR, "WARNING: Selected '%s' display card "
139 "was not found.\n", requested_display);
140 return -1;
141 }
142
143 struct display *d = calloc(1, sizeof(struct display));
144 d->magic = DISPLAY_MAGIC;
145 d->funcs = vdi;
146
150
151 d->state = d->funcs->init(&d->mod, fmt, flags);
152
153 if (d->state == NULL) {
154 debug_msg("Unable to start display %s\n",
155 requested_display);
156 module_done(&d->mod);
157 free(d);
158 return -1;
159 } else if (d->state == INIT_NOERR) {
160 module_done(&d->mod);
161 free(d);
162 return 1;
163 }
164
165 if (postprocess) {
167 if (!d->postprocess) {
168 display_done(d);
169 return 1;
170 }
171 }
172
173 d->t0 = get_time_in_ns();
174 d->display_name = strdup(requested_display);
175
176 *out = d;
177 return 0;
178}
const char * fmt
const char unsigned int flags
#define debug_msg(...)
#define debug_msg(...) log_msg(LOG_LEVEL_DEBUG, "[pid/%d +%d %s] ", getpid(), LINE,...
Definition debug.h:92
#define VIDEO_DISPLAY_ABI_VERSION
void module_init_default(struct module *module_data)
Definition module.c:48
void module_register(struct module *module_data, struct module *parent)
Definition module.c:82
@ MODULE_CLASS_DISPLAY
Definition module.h:94
#define INIT_NOERR
Definition host.h:73
const void * load_library(const char *name, enum library_class cls, int abi_version)
@ LIBRARY_CLASS_VIDEO_DISPLAY
Definition lib_common.h:79
const char * parent
Definition settings.cpp:198
This struct represents initialized video display state.
time_ns_t t0
enum module_class cls
Definition module.h:115
void *(* init)(struct module *parent, const char *fmt, unsigned int flags)
static time_ns_t get_time_in_ns()
Definition tv.h:101
void show_vo_postprocess_help(bool full)
struct vo_postprocess_state * vo_postprocess_init(const char *config_string)

References module::cls, debug_msg, display_done(), DISPLAY_MAGIC, display_name, flags, fmt, funcs, get_time_in_ns(), video_display_info::init, INIT_NOERR, LIBRARY_CLASS_VIDEO_DISPLAY, load_library(), LOG_LEVEL_ERROR, log_msg(), magic, mod, MODULE_CLASS_DISPLAY, module_done(), module_init_default(), module_register(), parent, postprocess, show_vo_postprocess_help(), state, t0, VIDEO_DISPLAY_ABI_VERSION, and vo_postprocess_init().

Referenced by sage_video_rxtx::sage_video_rxtx(), display_aggregate_init(), display_blend_fork(), display_blend_init(), display_conference_fork(), display_conference_init(), display_multiplier_init(), hd_rum_decompress_init(), init(), main(), test_video_display(), and vidcap_ug_input_init().

Here is the call graph for this function:

◆ list_video_display_devices()

void list_video_display_devices ( bool full)

Definition at line 100 of file video_display.c.

101{
102 printf("Available display devices:\n");
104 if (!full) {
105 printf("(use \"fullhelp\" to show hidden displays)\n");
106 }
107}
void list_modules(enum library_class cls, int abi_version, bool full)

References LIBRARY_CLASS_VIDEO_DISPLAY, list_modules(), and VIDEO_DISPLAY_ABI_VERSION.

Referenced by parse_options_internal(), and test_video_display().

Here is the call graph for this function: