![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <assert.h>#include <ctype.h>#include <errno.h>#include <limits.h>#include <math.h>#include <pthread.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include "audio/types.h"#include "compat/platform_semaphore.h"#include "debug.h"#include "host.h"#include "lib_common.h"#include "testcard_common.h"#include "tv.h"#include "types.h"#include "utils/color_out.h"#include "utils/fs.h"#include "utils/macros.h"#include "utils/thread.h"#include "video.h"#include "video_capture.h"#include "video_capture_params.h"#include "video_codec.h"#include "video_frame.h"
Go to the source code of this file.
Classes | |
| struct | testcard_state2 |
Macros | |
| #define | AUDIO_BPS 2 |
| #define | AUDIO_BUFFER_SIZE |
| #define | AUDIO_SAMPLE_RATE 48000 |
| #define | BANNER_HEIGHT 150L |
| #define | BANNER_MARGIN_BOTTOM 75L |
| #define | BUFFER_SEC 1 |
| #define | DEFAULT_FORMAT "1920:1080:24:UYVY" |
| #define | EPS_PLUS_1 1.0001 |
| #define | FONT_HEIGHT 108 |
| #define | MOD_NAME "[testcard2] " |
Functions | |
| static int | configure_audio (struct testcard_state2 *s) |
| static void | grab_audio (struct testcard_state2 *s) |
| static bool | parse_fmt (struct testcard_state2 *s, char *fmt) |
| REGISTER_MODULE (testcard2, &vidcap_testcard2_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION) | |
| static void | vidcap_testcard2_done (void *state) |
| static struct video_frame * | vidcap_testcard2_grab (void *arg, struct audio_frame **audio) |
| static int | vidcap_testcard2_init (struct vidcap_params *params, void **state) |
| static void | vidcap_testcard2_probe (struct device_info **available_devices, int *count, void(**deleter)(void *)) |
| void * | vidcap_testcard2_thread (void *args) |
Variables | |
| static const struct video_capture_info | vidcap_testcard2_info |
Definition in file testcard2.c.
| #define AUDIO_BPS 2 |
Definition at line 87 of file testcard2.c.
Referenced by configure_audio(), and grab_audio().
| #define AUDIO_BUFFER_SIZE |
Definition at line 85 of file testcard2.c.
Referenced by configure_audio().
| #define AUDIO_SAMPLE_RATE 48000 |
Definition at line 88 of file testcard2.c.
Referenced by configure_audio(), and grab_audio().
| #define BANNER_HEIGHT 150L |
Definition at line 89 of file testcard2.c.
Referenced by vidcap_testcard2_thread().
| #define BANNER_MARGIN_BOTTOM 75L |
Definition at line 90 of file testcard2.c.
Referenced by vidcap_testcard2_thread().
| #define BUFFER_SEC 1 |
Definition at line 91 of file testcard2.c.
| #define DEFAULT_FORMAT "1920:1080:24:UYVY" |
Definition at line 92 of file testcard2.c.
Referenced by vidcap_testcard2_init().
| #define EPS_PLUS_1 1.0001 |
Definition at line 93 of file testcard2.c.
Referenced by vidcap_testcard2_thread().
| #define FONT_HEIGHT 108 |
Definition at line 94 of file testcard2.c.
Referenced by vidcap_testcard2_thread().
| #define MOD_NAME "[testcard2] " |
Definition at line 95 of file testcard2.c.
Referenced by vidcap_testcard2_init(), and vidcap_testcard2_thread().
|
static |
Definition at line 147 of file testcard2.c.
References testcard_state2::audio, AUDIO_BPS, AUDIO_BUFFER_SIZE, audio_capture_channels, AUDIO_SAMPLE_RATE, testcard_state2::audio_silence, testcard_state2::audio_tone, audio_frame::bps, audio_frame::ch_count, DEFAULT_AUDIO_CAPTURE_CHANNELS, and audio_frame::sample_rate.
Referenced by vidcap_testcard2_init().
|
static |
Definition at line 572 of file testcard2.c.
References testcard_state2::audio, AUDIO_BPS, testcard_state2::audio_remained, AUDIO_SAMPLE_RATE, testcard_state2::audio_silence, testcard_state2::audio_tone, audio_frame::ch_count, audio_frame::data, audio_frame::data_len, testcard_state2::last_audio_time, testcard_state2::play_audio_frame, testcard_state2::seconds_tone_played, and tv_diff().
Referenced by vidcap_testcard2_grab().

|
static |
Definition at line 167 of file testcard2.c.
References video_desc::color_spec, testcard_state2::desc, fmt, get_codec_from_name(), video_desc::height, LOG_LEVEL_ERROR, log_msg(), parse_fps(), VIDEO_CODEC_NONE, and video_desc::width.
Referenced by vidcap_testcard2_init().

| REGISTER_MODULE | ( | testcard2 | , |
| & | vidcap_testcard2_info, | ||
| LIBRARY_CLASS_VIDEO_CAPTURE | , | ||
| VIDEO_CAPTURE_ABI_VERSION | ) |
|
static |
Definition at line 367 of file testcard2.c.
References testcard_state2::audio_silence, testcard_state2::audio_tone, testcard_state2::bg, testcard_state2::data, testcard_state2::data_consumed_cv, testcard_state2::lock, testcard_state2::should_exit, state, and testcard_state2::thread_id.
|
static |
Definition at line 600 of file testcard2.c.
References audio, testcard_state2::audio, video_frame::callbacks, testcard_state2::data, tile::data, testcard_state2::data_consumed_cv, video_frame_callbacks::data_deleter, audio_frame::data_len, testcard_state2::desc, video_frame_callbacks::dispose, frame, grab_audio(), testcard_state2::grab_audio, testcard_state2::lock, platform_sem_wait(), testcard_state2::semaphore, testcard_state2::should_exit, video_frame::tiles, vf_alloc_desc(), vf_data_deleter(), and vf_free().

|
static |
Definition at line 210 of file testcard2.c.
References testcard_state2::audio_remained, testcard_state2::audio_silence, testcard_state2::audio_tone, testcard_state2::bg, COL_NUM, color_printf(), video_desc::color_spec, configure_audio(), testcard_state2::count, testcard_pixmap::data, testcard_state2::data_consumed_cv, DEFAULT_FORMAT, testcard_state2::desc, fmt, get_codec_from_name(), get_video_desc_from_string(), testcard_state2::grab_audio, testcard_pixmap::h, testcard_rect::h, video_desc::height, video_desc::interlacing, IS_KEY_PREFIX, testcard_state2::lock, LOG_LEVEL_ERROR, LOG_LEVEL_VERBOSE, log_msg(), MIN, MOD_NAME, parse_fmt(), parse_fps(), platform_sem_init(), testcard_state2::play_audio_frame, PROGRESSIVE, rect_colors, RGBA, testcard_state2::seconds_tone_played, testcard_state2::semaphore, testcard_state2::start_time, state, TBOLD, testcard_convert_buffer(), testcard_fillRect(), testcard_show_codec_help(), testcard_state2::thread_id, video_desc::tile_count, TRED, vc_get_datalen(), VIDCAP_FLAG_AUDIO_EMBEDDED, VIDCAP_INIT_FAIL, VIDCAP_INIT_NOERR, VIDCAP_INIT_OK, vidcap_params_get_flags(), vidcap_params_get_fmt(), vidcap_testcard2_thread(), VIDEO_CODEC_NONE, testcard_pixmap::w, testcard_rect::w, video_desc::width, testcard_rect::x, and testcard_rect::y.

|
static |
Definition at line 635 of file testcard2.c.
| void * vidcap_testcard2_thread | ( | void * | arg | ) |
Only text banner is rendered in RGBA, other elements (background, squares) are already converted to destination color space. Keep in mind that the regions should be aligned to 6 (v210 block size), won't work for R12L
Definition at line 394 of file testcard2.c.
References BANNER_HEIGHT, BANNER_MARGIN_BOTTOM, testcard_state2::bg, video_desc::color_spec, testcard_state2::count, testcard_state2::data, testcard_state2::data_consumed_cv, testcard_state2::desc, EPS_PLUS_1, font, FONT_HEIGHT, video_desc::fps, get_bpp(), testcard_rect::h, video_desc::height, IF_NOT_NULL_ELSE, testcard_state2::last_audio_time, testcard_state2::lock, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, log_msg(), MAX_PADDING, MAX_PATH_SIZE, MIN, MOD_NAME, MSG, platform_sem_post(), testcard_state2::play_audio_frame, RGBA, testcard_state2::semaphore, set_thread_name(), testcard_state2::should_exit, testcard_state2::start_time, testcard_state2::t0, testcard_convert_buffer(), tv_add_usec(), tv_diff(), tv_diff_usec(), tv_gt(), usleep(), vc_get_datalen(), vc_get_linesize(), testcard_rect::w, video_desc::width, testcard_rect::x, and testcard_rect::y.
Referenced by vidcap_testcard2_init().

|
static |
Definition at line 642 of file testcard2.c.