78 ihdtv_send(&m_tx_connection, tx_frame.get(), 9000000);
103static void *ihdtv_sender_thread(
void *arg)
106 struct vidcap *capture_device = (
struct vidcap *)((
void **)arg)[1];
116 "Error receiving frame from capture device\n");
128 , m_tx_connection(), m_rx_connection()
135 if ((argc != 0) && (argc != 1) && (argc != 2)) {
136 throw string(
"Wrong number of parameters");
139 printf(
"Initializing ihdtv protocol\n");
142 if (
params.at(
"capture_device").ptr &&
params.at(
"display_device").ptr) {
144 (
"Error: cannot act as both sender and receiver together in ihdtv mode");
147 m_display_device =
static_cast<struct
display *
>(
params.at(
"display_device").ptr);
149 if (m_display_device) {
151 (&m_rx_connection, (argc == 0) ? NULL : argv[0],
153 0) ? NULL : ((argc == 1) ? argv[0] : argv[1]),
155 throw string(
"Error initializing receiver session");
159 if (
static_cast<struct
display *
>(
params.at(
"capture_device").ptr) != 0) {
161 throw string(
"Error: specify the destination address");
165 (&m_tx_connection, argv[0],
166 (argc == 2) ? argv[1] : argv[0],
168 throw string(
"Error initializing sender session");
172 throw string(
"Support for iHDTV not compiled in");
183 "Please contact %s if you need this.\n", PACKAGE_BUGREPORT);
struct audio_frame ** audio
void send_frame(std::shared_ptr< video_frame >) noexcept override
ihdtv_video_rxtx(std::map< std::string, param_u > const &)
void log_msg(int level, const char *format,...)
#define LOG_LEVEL_WARNING
less severe errors
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.
struct video_frame * display_get_frame(struct display *d)
Returns video framebuffer which will be written to.
struct video_frame * vidcap_grab(struct vidcap *state, struct audio_frame **audio)
Grabs video frame. This function may block for a short period if waiting for incoming frame....
int ihdtv_receive(ihdtv_connection *connection, char *buffer, const unsigned long buffer_length)
int ihdtv_init_rx_session(ihdtv_connection *connection, const char *address_1, const char *address_2, unsigned int port1, unsigned int port2, long mtu)
int ihdtv_init_tx_session(ihdtv_connection *connection, const char *address_1, const char *address_2, long mtu)
int ihdtv_send(ihdtv_connection *connection, struct video_frame *tx_frame, unsigned long buffer_length)
static video_rxtx * create_video_rxtx_ihdtv(std::map< std::string, param_u > const ¶ms)
static const struct video_rxtx_info ihdtv_video_rxtx_info
@ LIBRARY_CLASS_VIDEO_RXTX
#define REGISTER_MODULE(name, info, lclass, abi)
Registers module to global modules' registry.
struct used to comunicate with audio capture/playback device
This struct represents initialized video display state.
char * data
Raw tile data. Pointer must be at least 4B aligned.
unsigned int data_len
length of the data
This struct represents video capture state.
Struct video_frame represents a video frame and contains video description.
struct tile tiles[FLEXIBLE_ARRAY_MEMBER]
struct common_opts m_common
This is an umbrella header for video functions.
#define VIDEO_RXTX_ABI_VERSION