From 65bc72ee58c1773b8ea7e891a8766cd767b9a78a Mon Sep 17 00:00:00 2001 From: sslivins Date: Fri, 30 Sep 2016 16:45:22 -0700 Subject: [PATCH] get actual bytes sent including rtp header and ones that are discarded by sdk --- plugins/libftl/ftl-sdk | 2 +- plugins/obs-outputs/ftl-stream.c | 27 ++++++++------------------- plugins/win-dshow/libdshowcapture | 2 +- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/plugins/libftl/ftl-sdk b/plugins/libftl/ftl-sdk index a6156b49a90f59..246c544cad344b 160000 --- a/plugins/libftl/ftl-sdk +++ b/plugins/libftl/ftl-sdk @@ -1 +1 @@ -Subproject commit a6156b49a90f59055b333a1fdbb774fe7fa7f13c +Subproject commit 246c544cad344b94d16a631ee9408a8706a89f7e diff --git a/plugins/obs-outputs/ftl-stream.c b/plugins/obs-outputs/ftl-stream.c index 1a286992c77d40..38a03e39e70113 100755 --- a/plugins/obs-outputs/ftl-stream.c +++ b/plugins/obs-outputs/ftl-stream.c @@ -284,11 +284,10 @@ static inline bool get_next_packet(struct ftl_stream *stream, static int send_packet(struct ftl_stream *stream, struct encoder_packet *packet, bool is_header, size_t idx) { - uint8_t *data; enum obs_encoder_type type; - size_t size; int recv_size = 0; int ret = 0; + int bytes_sent = 0; #ifdef TEST_FRAMEDROPS os_sleep_ms(rand() % 40); @@ -326,26 +325,23 @@ static int send_packet(struct ftl_stream *stream, } consumed += len; - //throw away access delimiter packets - //if (video_stream[0] != 9 && video_stream[0] != 12) - { + + int send_marker_bit = (consumed >= packet->size) && !is_header; - int send_marker_bit = (consumed >= packet->size) && !is_header; + bytes_sent += ftl_ingest_send_media(&stream->ftl_handle, FTL_VIDEO_DATA, video_stream, len, send_marker_bit); - ftl_ingest_send_media(&stream->ftl_handle, FTL_VIDEO_DATA, video_stream, len, send_marker_bit); - } video_stream += len; } } else if (packet->type == OBS_ENCODER_AUDIO) { - ftl_ingest_send_media(&stream->ftl_handle, FTL_AUDIO_DATA, packet->data, packet->size, 0); + bytes_sent += ftl_ingest_send_media(&stream->ftl_handle, FTL_AUDIO_DATA, packet->data, packet->size, 0); } else { warn("Got packet type %d\n", packet->type); } - stream->total_bytes_sent += packet->size; + stream->total_bytes_sent += bytes_sent; obs_free_encoder_packet(packet); return ret; @@ -481,16 +477,9 @@ static inline bool send_headers(struct ftl_stream *stream) size_t i = 0; bool next = true; -// if (!send_audio_header(stream, i++, &next)) -// return false; if (!send_video_header(stream)) return false; -/* - while (next) { - if (!send_audio_header(stream, i++, &next)) - return false; - } -*/ + return true; } @@ -880,7 +869,7 @@ static void *status_thread(void *data) if ((status_code = ftl_ingest_connect(&stream->ftl_handle)) != FTL_SUCCESS) { blog(LOG_WARNING, "Failed to connect to ingest %d\n", status_code); obs_output_signal_stop(stream->output, OBS_OUTPUT_DISCONNECTED); - return; + return NULL; } blog(LOG_WARNING, "Done\n"); diff --git a/plugins/win-dshow/libdshowcapture b/plugins/win-dshow/libdshowcapture index 993d29af172495..dc4a981047ee25 160000 --- a/plugins/win-dshow/libdshowcapture +++ b/plugins/win-dshow/libdshowcapture @@ -1 +1 @@ -Subproject commit 993d29af172495857e82a29e403c965dc8a92d9f +Subproject commit dc4a981047ee25d6b7a1f336bc5b233bc94d090f