12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef VIDEORTP_H
- #define VIDEORTP_H
- #pragma once
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "videoutil.h"
- #include "log.h"
- typedef struct videortp_t videortp_t;
- typedef struct videortp_config_t
- {
- int dir;// 0:none 1:tx 2:rx 3:both
- unsigned int local_pt;
- unsigned int remote_pt;
- unsigned long local_ip;
- unsigned long remote_ip;
- int local_rtp_port;
- int remote_rtp_port;
- int mtu;
- int rx_width;
- int rx_height;
- int tx_width;
- int tx_height;
- int capture_width;
- int capture_height;
- int fps_den;
- int fps_num;
- int bit_rate;
- int quant;
- // if use frame, return TRUE, else 0
- int (*on_rx_frame)(video_frame *frame, void *user_data);
- void (*on_tx_udp)(const char *buf, int size, void *user_data); // for debug
- void (*on_rx_udp)(const char *buf, int size, void *user_data); // for debug
- void (*dbg)(void *user_data, const char *fmt, va_list arg);
- void *user_data;
- }videortp_config_t;
- int videortp_create(const videortp_config_t *config, videortp_t **p_rtp);
- void videortp_destroy(videortp_t *rtp);
- int videortp_start(videortp_t *rtp);
- void videortp_stop(videortp_t *rtp);
- int videortp_force_key_frame(videortp_t *rtp);
- int videortp_send_frame(videortp_t *rtp, const video_frame *frame);
- int videortp_send_yuvframe(videortp_t *vrtp, const video_frame *yuvframe);
- int videortp_reconfig_local_pt(videortp_t *vrtp, unsigned int local_pt);
- #ifdef __cplusplus
- }//extern "C" {
- #endif
- #endif // VIDEORTP_H
|