@@ -111,7 +111,7 @@ static bool init_connect(struct ftl_stream *stream);
111111static void * connect_thread (void * data );
112112static void * status_thread (void * data );
113113int _ftl_error_to_obs_error (int status );
114- char * _ftl_error_to_string (int status );
114+ char * ftl_status_code_to_string (int status );
115115
116116static const char * ftl_stream_getname (void * unused )
117117{
@@ -667,7 +667,7 @@ static int try_connect(struct ftl_stream *stream)
667667 stream -> height = (int )obs_output_get_height (stream -> output );
668668
669669 if ((status_code = ftl_ingest_connect (& stream -> ftl_handle )) != FTL_SUCCESS ) {
670- warn ("Ingest connect failed with: %s" , _ftl_error_to_string (status_code ));
670+ warn ("Ingest connect failed with: %s" , ftl_status_code_to_string (status_code ));
671671 return _ftl_error_to_obs_error (status_code );
672672 }
673673
@@ -908,7 +908,7 @@ static void *status_thread(void *data)
908908 }
909909
910910 if (status .type == FTL_STATUS_EVENT && status .msg .event .type == FTL_STATUS_EVENT_TYPE_DISCONNECTED ) {
911- blog (LOG_INFO , "Disconnected from ingest with reason: %s\n" , _ftl_error_to_string (status .msg .event .error_code ));
911+ blog (LOG_INFO , "Disconnected from ingest with reason: %s\n" , ftl_status_code_to_string (status .msg .event .error_code ));
912912
913913 if (status .msg .event .reason == FTL_STATUS_EVENT_REASON_API_REQUEST ) {
914914 break ;
@@ -1054,7 +1054,7 @@ static bool init_connect(struct ftl_stream *stream)
10541054 blog (LOG_ERROR , "H.264 opts %s\n" , obs_data_get_string (video_settings , "x264opts" ));
10551055
10561056 if ((status_code = ftl_ingest_create (& stream -> ftl_handle , & stream -> params )) != FTL_SUCCESS ) {
1057- blog (LOG_ERROR , "Failed to create ingest handle (%s)\n" , _ftl_error_to_string (status_code ));
1057+ blog (LOG_ERROR , "Failed to create ingest handle (%s)\n" , ftl_status_code_to_string (status_code ));
10581058 return false;
10591059 }
10601060
@@ -1075,79 +1075,6 @@ static bool init_connect(struct ftl_stream *stream)
10751075 return true;
10761076}
10771077
1078-
1079- static char error_string [1024 ];
1080-
1081- static char * _ftl_create_error_string (const char * string ) {
1082- strncpy_s (error_string , sizeof (error_string ), string , sizeof (error_string ) - 1 );
1083- return error_string ;
1084- }
1085-
1086- char * _ftl_error_to_string (int status ) {
1087-
1088- switch (status ) {
1089- case FTL_SUCCESS :
1090- return _ftl_create_error_string ("Success" );
1091- case FTL_SOCKET_NOT_CONNECTED :
1092- return _ftl_create_error_string ("The socket is no longer connected" );
1093- case FTL_MALLOC_FAILURE :
1094- return _ftl_create_error_string ("Internal memory allocation error" );
1095- case FTL_INTERNAL_ERROR :
1096- return _ftl_create_error_string ("An Internal error occurred" );
1097- case FTL_CONFIG_ERROR :
1098- return _ftl_create_error_string ("The parameters supplied are invalid or incomplete" );
1099- case FTL_NOT_ACTIVE_STREAM :
1100- return _ftl_create_error_string ("The stream is not active" );
1101- case FTL_NOT_CONNECTED :
1102- return _ftl_create_error_string ("The channel is not connected" );
1103- case FTL_ALREADY_CONNECTED :
1104- return _ftl_create_error_string ("The channel is already connected" );
1105- case FTL_STATUS_TIMEOUT :
1106- return _ftl_create_error_string ("Timed out waiting for status message" );
1107- case FTL_QUEUE_FULL :
1108- return _ftl_create_error_string ("The status queue is full" );
1109- case FTL_STATUS_WAITING_FOR_KEY_FRAME :
1110- return _ftl_create_error_string ("dropping packets until a key frame is recevied" );
1111- case FTL_QUEUE_EMPTY :
1112- return _ftl_create_error_string ("The status queue is empty" );
1113- case FTL_NOT_INITIALIZED :
1114- return _ftl_create_error_string ("The parameters were not correctly initialized" );
1115- case FTL_BAD_REQUEST :
1116- return _ftl_create_error_string ("A request to the ingest was invalid" );
1117- case FTL_DNS_FAILURE :
1118- return _ftl_create_error_string ("Failed to get an ip address for the specified ingest (DNS lookup failure)" );
1119- case FTL_CONNECT_ERROR :
1120- return _ftl_create_error_string ("An unknown error occurred connecting to the socket" );
1121- case FTL_UNSUPPORTED_MEDIA_TYPE :
1122- return _ftl_create_error_string ("The specified media type is not supported" );
1123- case FTL_OLD_VERSION :
1124- return _ftl_create_error_string ("The current version of the FTL-SDK is no longer supported" );
1125- case FTL_UNAUTHORIZED :
1126- return _ftl_create_error_string ("This channel is not authorized to connect to this ingest" );
1127- case FTL_AUDIO_SSRC_COLLISION :
1128- return _ftl_create_error_string ("The Audio SSRC is already in use" );
1129- case FTL_VIDEO_SSRC_COLLISION :
1130- return _ftl_create_error_string ("The Video SSRC is already in use" );
1131- case FTL_STREAM_REJECTED :
1132- return _ftl_create_error_string ("The Ingest rejected the stream" );
1133- case FTL_BAD_OR_INVALID_STREAM_KEY :
1134- return _ftl_create_error_string ("Invalid stream key" );
1135- case FTL_CHANNEL_IN_USE :
1136- return _ftl_create_error_string ("Channel is already actively streaming" );
1137- case FTL_REGION_UNSUPPORTED :
1138- return _ftl_create_error_string ("The location you are attempting to stream from is not authorized to do so by the local government" );
1139- case FTL_NO_MEDIA_TIMEOUT :
1140- return _ftl_create_error_string ("The ingest did not receive any audio or video media for an extended period of time" );
1141- case FTL_USER_DISCONNECT :
1142- return _ftl_create_error_string ("ftl ingest disconnect api was called" );
1143- case FTL_UNKNOWN_ERROR_CODE :
1144- default :
1145- /* Unknown FTL error */
1146- _snprintf_s (error_string , sizeof (error_string ), sizeof (error_string ) - 1 , "Unknown FTL error code (%d)" , status );
1147- return error_string ;
1148- }
1149- }
1150-
11511078// Returns 0 on success
11521079int _ftl_error_to_obs_error (int status ) {
11531080
0 commit comments