libxcoder 5.6.0
Loading...
Searching...
No Matches
ni_filter_utils.h
Go to the documentation of this file.
1/*******************************************************************************
2 *
3 * Copyright (C) 2022 NETINT Technologies
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18 * SOFTWARE.
19 *
20 ******************************************************************************/
21
22/*!*****************************************************************************
23 * \file filter_utils.h
24 *
25 * \brief Video filtering utility functions shared by Libxcoder API examples
26 ******************************************************************************/
27#pragma once
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
40
49
50int ni_scaler_params_set_value(ni_scale_params_t *params, const char *name, const char *value);
51int ni_drawbox_params_set_value(ni_drawbox_params_t *params, const char *name, const char *value);
52int retrieve_filter_params(char filter_params[], ni_scale_params_t *scale_params, ni_drawbox_params_t *drawbox_params);
53
54void init_scaler_params(ni_scaler_input_params_t *p_scaler_params, ni_scaler_opcode_t op, int in_rec_width,
55 int in_rec_height, int in_rec_x, int in_rec_y, int out_rec_x, int out_rec_y);
56int scaler_session_open(ni_session_context_t *p_scaler_ctx, int iXcoderGUID, ni_scaler_opcode_t op);
57int launch_scaler_operation(ni_session_context_t *p_scaler_ctx, int iXcoderGUID,
58 ni_frame_t *p_frame_in_up, ni_frame_t *p_frame_in_bg,
59 ni_session_data_io_t *p_data_out, ni_scaler_input_params_t scaler_params);
60
62 ni_session_context_t *p_overlay_ctx, ni_session_context_t *p_fmt_ctx,
63 ni_frame_t *p_frame_in, ni_session_data_io_t *p_data_out, ni_drawbox_params_t *p_box_params,
64 int iXcoderGUID, int input_format, int output_format);
65int scale_filter(ni_session_context_t *p_ctx, ni_frame_t *p_frame_in,
66 ni_session_data_io_t *p_data_out, int iXcoderGUID,
67 int scale_width, int scale_height, int in_format, int out_format);
68
69#ifdef __cplusplus
70}
71#endif
enum _ni_scaler_opcode ni_scaler_opcode_t
void init_scaler_params(ni_scaler_input_params_t *p_scaler_params, ni_scaler_opcode_t op, int in_rec_width, int in_rec_height, int in_rec_x, int in_rec_y, int out_rec_x, int out_rec_y)
Init scaler params here - both user setting params and fixed params.
int scale_filter(ni_session_context_t *p_ctx, ni_frame_t *p_frame_in, ni_session_data_io_t *p_data_out, int iXcoderGUID, int scale_width, int scale_height, int in_format, int out_format)
Do a scale and/or format-change operation.
struct _ni_drawbox_params ni_drawbox_params_t
int retrieve_filter_params(char filter_params[], ni_scale_params_t *scale_params, ni_drawbox_params_t *drawbox_params)
int ni_scaler_params_set_value(ni_scale_params_t *params, const char *name, const char *value)
int drawbox_filter(ni_session_context_t *p_crop_ctx, ni_session_context_t *p_pad_ctx, ni_session_context_t *p_overlay_ctx, ni_session_context_t *p_fmt_ctx, ni_frame_t *p_frame_in, ni_session_data_io_t *p_data_out, ni_drawbox_params_t *p_box_params, int iXcoderGUID, int input_format, int output_format)
Use crop->pad->overlay to simulate a drawbox filter.
int launch_scaler_operation(ni_session_context_t *p_scaler_ctx, int iXcoderGUID, ni_frame_t *p_frame_in_up, ni_frame_t *p_frame_in_bg, ni_session_data_io_t *p_data_out, ni_scaler_input_params_t scaler_params)
Launch scaler operation and get the result hw frame.
int scaler_session_open(ni_session_context_t *p_scaler_ctx, int iXcoderGUID, ni_scaler_opcode_t op)
open scaler session
struct _ni_scale_params ni_scale_params_t
int ni_drawbox_params_set_value(ni_drawbox_params_t *params, const char *name, const char *value)