From 4aad7bac04754cd99117d7819aa8bfe67fec5122 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Thu, 30 Aug 2018 20:34:09 +0930 Subject: [PATCH] rtmp: remove rtmp.c --- rtmp/rtmp.c | 86 ----------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 rtmp/rtmp.c diff --git a/rtmp/rtmp.c b/rtmp/rtmp.c deleted file mode 100644 index 663052a4..00000000 --- a/rtmp/rtmp.c +++ /dev/null @@ -1,86 +0,0 @@ -/* -NAME - rtmp.c - -DESCRIPTION - See Readme.md - -AUTHOR - Saxon Nelson-Milton - Dan Kortschak - -LICENSE - RTMPWrapper.c is Copyright (C) 2017 the Australian Ocean Lab (AusOcean) - - It is free software: you can redistribute it and/or modify them - under the terms of the GNU General Public License as published by the - Free Software Foundation, either version 3 of the License, or (at your - option) any later version. - - It is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with revid in gpl.txt. If not, see http://www.gnu.org/licenses. -*/ -#include -#include -#include -#include -#include -#include -#include - -RTMP* start_session(RTMP* rtmp, char* url, uint connect_timeout) { - rtmp = RTMP_Alloc(); - RTMP_Init(rtmp); - rtmp->Link.timeout = connect_timeout; - if (!RTMP_SetupURL(rtmp, url)) { - RTMP_Close(rtmp); - RTMP_Free(rtmp); - errno = EINVAL; - return NULL; - } - - RTMP_EnableWrite(rtmp); - RTMP_SetBufferMS(rtmp, 3600 * 1000); - if (!RTMP_Connect(rtmp, NULL)) { - RTMP_Close(rtmp); - RTMP_Free(rtmp); - errno = EIO; - return NULL; - } - - if (!RTMP_ConnectStream(rtmp, 0)) { - RTMP_Close(rtmp); - RTMP_Free(rtmp); - errno = EIO; - return NULL; - } - - return rtmp; -} - -unsigned int write_frame(RTMP* rtmp, char* data, uint data_length) { - if (!RTMP_IsConnected(rtmp)) { - return 1; - } - - if (!RTMP_Write(rtmp, (const char*)data, data_length)) { - return 2; - } - - return 0; -} - -unsigned int end_session(RTMP* rtmp) { - if (rtmp == NULL) { - return 3; - } - - RTMP_Close(rtmp); - RTMP_Free(rtmp); - return 0; -}