60#define MAX_QUEUE_LEN 3
61#define MOD_NAME "[display cap. f.] "
92 size_t len =
sizeof display_codecs;
100 len =
sizeof rgb_shift;
105 int src_linesize = 0;
106 int dst_linesize = 0;
109 pthread_mutex_lock(&s->
lock);
111 pthread_cond_wait(&s->
cv, &s->
lock);
114 pthread_mutex_unlock(&s->
lock);
132 configured_desc = new_desc;
136 dec((
unsigned char *) df->
tiles[0].
data + i * dst_linesize, (
unsigned char *) f->
tiles[0].
data + i * src_linesize, dst_linesize, rgb_shift[0], rgb_shift[1], rgb_shift[2]);
147 char warn[] =
MOD_NAME "Capture filter \"display\" is experimental and may not "
148 "always work as expected, especially if the same SW display "
149 "type (eg. GL) is given as both preview display and a regular one.";
152 if (strlen(cfg) == 0 || strcmp(cfg,
"help") == 0) {
153 color_printf(
"Previews captured frame with specified dispay.\n"
155 "\t" TBOLD(
"--capture-filter display:<display_cfg>")
"\n");
159 char *requested_display =
strdupa(cfg);
160 char *delim = strchr(requested_display,
':');
161 const char *
fmt =
"";
176 pthread_mutex_init(&s->
lock, NULL);
177 pthread_cond_init(&s->
cv, NULL);
190 pthread_mutex_lock(&s->
lock);
192 pthread_mutex_unlock(&s->
lock);
198 pthread_mutex_unlock(&s->
lock);
199 pthread_cond_signal(&s->
cv);
211 pthread_mutex_destroy(&s->
lock);
212 pthread_cond_destroy(&s->
cv);
void vf_free(struct video_frame *buf)
Frees video_frame structure.
struct video_desc video_desc_from_frame(const struct video_frame *frame)
Returns struct video_desc from video frame.
int vc_get_linesize(unsigned int width, codec_t codec)
#define CAPTURE_FILTER_ABI_VERSION
int color_printf(const char *format,...)
void log_msg(int level, const char *format,...)
#define LOG_LEVEL_NOTICE
information that may be interesting
#define LOG_LEVEL_ERROR
general errors
#define LOG_LEVEL_WARNING
less severe errors
static struct video_frame * filter(void *state, struct video_frame *in)
static void * worker(void *arg)
static codec_t select_display_codec(codec_t *display_codecs, codec_t recv_codec)
static void done(void *state)
static int init(struct module *parent, const char *cfg, void **state)
bool display_put_frame(struct display *d, struct video_frame *frame, long long timeout_ns)
Puts filled video frame. After calling this function, video frame cannot be used.
bool display_ctl_property(struct display *d, int property, void *val, size_t *len)
Gets property from video display.
void display_run_new_thread(struct display *d)
void display_done(struct display *d)
This function performs cleanup after done.
void display_join(struct display *d)
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.
struct video_frame * display_get_frame(struct display *d)
Returns video framebuffer which will be written to.
@ DISPLAY_PROPERTY_RGB_SHIFT
red,green,blue shift - int[3] (bits)
@ DISPLAY_PROPERTY_CODECS
list of natively supported codecs - codec_t[]
@ LIBRARY_CLASS_CAPTURE_FILTER
#define REGISTER_HIDDEN_MODULE(name, info, lclass, abi)
void simple_linked_list_append(struct simple_linked_list *l, void *data)
int simple_linked_list_size(struct simple_linked_list *l)
struct simple_linked_list * simple_linked_list_init(void)
void simple_linked_list_destroy(struct simple_linked_list *l)
void * simple_linked_list_pop(struct simple_linked_list *l)
decoder_t get_decoder_from_to(codec_t in, codec_t out)
decoder_t get_best_decoder_from(codec_t in, const codec_t *out_candidates, codec_t *out)
decoder_func_t * decoder_t
struct simple_linked_list * frame_queue
This struct represents initialized video display state.
char * data
Raw tile data. Pointer must be at least 4B aligned.
Struct video_frame represents a video frame and contains video description.
struct tile tiles[FLEXIBLE_ARRAY_MEMBER]
@ VIDEO_NORMAL
normal video (one tile)
@ VIDEO_CODEC_NONE
dummy color spec
@ VIDEO_CODEC_COUNT
count of known video codecs (including VIDEO_CODEC_NONE)
char * wrap_paragraph(char *text)
const char * video_desc_to_string(struct video_desc d)
This is an umbrella header for video functions.
bool codec_is_in_set(codec_t codec, const codec_t *set)
bool display_reconfigure(struct display *d, struct video_desc desc, enum video_mode video_mode)
Reconfigure display to new video format.
struct video_frame * vf_get_copy(struct video_frame *original_frame)
Makes deep copy of the video frame.
bool video_desc_eq(struct video_desc a, struct video_desc b)
Compares two video descriptions.