![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
Video compress functions. More...
#include <cassert>#include <cinttypes>#include <cstdio>#include <cstring>#include <memory>#include <string>#include <thread>#include <vector>#include "messaging.h"#include "module.h"#include "tv.h"#include "utils/synchronized_queue.h"#include "utils/thread.h"#include "utils/vf_split.h"#include "utils/worker.h"#include "video.h"#include "video_compress.h"#include "lib_common.h"#include "debug.h"
Go to the source code of this file.
Classes | |
| struct | compress_state |
| Video compress state. More... | |
| struct | compress_worker_data |
| Auxiliary structure passed to worker thread. More... | |
Macros | |
| #define | MOD_NAME "[vcompress] " |
Functions | |
| static void | async_poison (struct compress_state_real *s) |
| static bool | check_state_count (unsigned tile_count, struct compress_state *proxy) |
| void | compress_done (struct compress_state *proxy) |
| Video compression cleanup function. | |
| void | compress_frame (struct compress_state *proxy, shared_ptr< video_frame > frame) |
| int | compress_init (struct module *parent, const char *config_string, struct compress_state **state) |
| This function initializes video compression. | |
| shared_ptr< video_frame > | compress_pop (struct compress_state *proxy) |
| static void | compress_process_message (struct compress_state *proxy, struct msg_change_compress_data *data) |
| Processes message. | |
| void | show_compress_help (bool full) |
| Displays list of available compressions. | |
Tile API Routines | |
The worker callbacks here are optimization - all tiles are processed concurrently. | |
| static shared_ptr< video_frame > | compress_frame_tiles (struct compress_state *proxy, shared_ptr< video_frame > frame) |
| static void * | compress_tile_callback (void *arg) |
| This function is callback passed to a "thread pool". | |
Video compress functions.
Definition in file video_compress.cpp.
| #define MOD_NAME "[vcompress] " |
Definition at line 62 of file video_compress.cpp.
|
static |
Definition at line 117 of file video_compress.cpp.
References video_compress_info::compress_frame_async_push_func, and video_compress_info::compress_tile_async_push_func.
Referenced by compress_frame(), and compress_process_message().
|
static |
Checks if there are at least as many states as there are tiles. If there are not enough states it initializes new ones.
| proxy | compress state | |
| [in] | frame | uncompressed frame |
Definition at line 287 of file video_compress.cpp.
References video_compress_info::init_func, LOG, LOG_LEVEL_ERROR, compress_state::mod, MOD_NAME, and compress_state::ptr.
Referenced by compress_frame(), and compress_frame_tiles().
|
static |
Compresses video frame with tiles API
| proxy | compress state | |
| [in] | frame | uncompressed frame |
Definition at line 424 of file video_compress.cpp.
References compress_worker_data::callback, check_state_count(), compress_tile_callback(), video_compress_info::compress_tile_func, compress_worker_data::frame, frame, compress_state::ptr, compress_worker_data::ret, compress_worker_data::state, task_run_async(), video_frame::tile_count, vf_merge_tiles(), vf_separate_tiles(), and wait_task().
Referenced by compress_frame().

|
static |
Processes message.
This function is a callback called from control thread to change some parameters of compression.
| [in] | receiver | pointer to the compress module |
| [in] | msg | message to process |
Definition at line 136 of file video_compress.cpp.
References async_poison(), CHANGE_PARAMS, msg_change_compress_data::config_string, free_message(), free_response(), compress_state::mod, new_message(), new_response(), compress_state::ptr, RESPONSE_INT_SERV_ERR, RESPONSE_OK, send_message_to_receiver(), and msg_change_compress_data::what.
Referenced by compress_frame().

|
static |
This function is callback passed to a "thread pool".
| arg | compress_worker_data |
Definition at line 409 of file video_compress.cpp.
References compress_worker_data::callback, compress_worker_data::frame, compress_worker_data::ret, and compress_worker_data::state.
Referenced by compress_frame_tiles().