forked from crunchy/screen_streamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flv_bytestream_ext.h
52 lines (41 loc) · 1.41 KB
/
flv_bytestream_ext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <rtmp.h>
#include <log.h>
#include <x264cli.h>
#include <output/flv_bytestream.h>
typedef struct
{
flv_buffer *c;
uint8_t *sei;
int sei_len;
int64_t i_fps_num;
int64_t i_fps_den;
int64_t i_framenum;
uint64_t i_framerate_pos;
uint64_t i_duration_pos;
uint64_t i_filesize_pos;
uint64_t i_bitrate_pos;
uint8_t b_write_length;
int64_t i_prev_dts;
int64_t i_prev_cts;
int64_t i_delay_time;
int64_t i_init_delta;
int i_delay_frames;
double d_timebase;
int b_vfr_input;
int b_dts_compress;
unsigned start;
} rtmp_flv_hnd_t;
rtmp_flv_hnd_t *open_flv_buffer();
RTMP *open_RTMP_stream( char *stream_uri );
int close_RTMP_stream(rtmp_flv_hnd_t handle, RTMP *rtmp);
int flv_flush_RTMP_data( RTMP *rtmp, flv_buffer *c );
int send_invoke( RTMP *rtmp, uint16_t x, uint16_t y, uint32_t timestamp, const char* room_name );
int write_RTMP_header( hnd_t handle, RTMP *rtmp);
int set_RTMP_param( hnd_t handle, x264_param_t *p_param );
int write_RTMP_headers( hnd_t handle, RTMP *rtmp, x264_nal_t *p_nal );
int write_RTMP_frame( hnd_t handle, RTMP *rtmp, uint8_t *p_nalu, int i_size, x264_picture_t *p_picture );
void setup_shared_object(const char *shared_object, RTMP *rtmp);
void update_x_y_and_timestamp(const char *shared_object, RTMP *rtmp, uint16_t x, uint16_t y, uint64_t timestamp, int so_version);