mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
FS-7505: clean up and support multiple formats to same extensions {modname=mod_vlc}rtmp://foo.com/flvplayback also move [/tmp]file to be {spool_path=/tmp}
This commit is contained in:
committed by
Michael Jerris
parent
54d15cf6e9
commit
509241bd65
@@ -203,7 +203,7 @@ SWITCH_DECLARE(switch_json_api_interface_t *) switch_loadable_module_get_json_ap
|
||||
\param name the name of the file format
|
||||
\return the desired file format interface
|
||||
*/
|
||||
SWITCH_DECLARE(switch_file_interface_t *) switch_loadable_module_get_file_interface(const char *name);
|
||||
SWITCH_DECLARE(switch_file_interface_t *) switch_loadable_module_get_file_interface(const char *name, const char *modname);
|
||||
|
||||
/*!
|
||||
\brief Retrieve the speech interface by it's registered name
|
||||
|
||||
@@ -298,6 +298,17 @@ struct switch_file_interface {
|
||||
struct switch_file_interface *next;
|
||||
};
|
||||
|
||||
typedef struct switch_mm_s {
|
||||
int samplerate;
|
||||
int channels;
|
||||
int keyint;
|
||||
int ab;
|
||||
int vb;
|
||||
int vw;
|
||||
int vh;
|
||||
float fps;
|
||||
} switch_mm_t;
|
||||
|
||||
/*! an abstract representation of a file handle (some parameters based on compat with libsndfile) */
|
||||
struct switch_file_handle {
|
||||
/*! the interface of the module that implemented the current file type */
|
||||
@@ -360,6 +371,8 @@ struct switch_file_handle {
|
||||
uint32_t cur_channels;
|
||||
uint32_t cur_samplerate;
|
||||
char *stream_name;
|
||||
char *modname;
|
||||
switch_mm_t mm;
|
||||
};
|
||||
|
||||
/*! \brief Abstract interface to an asr module */
|
||||
|
||||
+10
-22
@@ -1032,7 +1032,6 @@ SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char clos
|
||||
static inline void switch_separate_file_params(const char *file, char **file_portion, char **params_portion)
|
||||
{
|
||||
char *e = NULL;
|
||||
int x;
|
||||
char *space = strdup(file);
|
||||
|
||||
file = space;
|
||||
@@ -1040,18 +1039,14 @@ static inline void switch_separate_file_params(const char *file, char **file_por
|
||||
*file_portion = NULL;
|
||||
*params_portion = NULL;
|
||||
|
||||
for (x = 0; x < 2; x++) {
|
||||
if (*file == '[' && *(file + 1) == *SWITCH_PATH_SEPARATOR) {
|
||||
e = switch_find_end_paren(file, '[', ']');
|
||||
} else if (*file == '{') {
|
||||
e = switch_find_end_paren(file, '{', '}');
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
while (*file == '{') {
|
||||
e = switch_find_end_paren(file, '{', '}');
|
||||
file = e + 1;
|
||||
while(*file == ' ') file++;
|
||||
}
|
||||
|
||||
|
||||
if (e) {
|
||||
file = e + 1;
|
||||
*file_portion = strdup((char *)file);
|
||||
*++e = '\0';
|
||||
*params_portion = (char *)space;
|
||||
@@ -1065,19 +1060,12 @@ static inline void switch_separate_file_params(const char *file, char **file_por
|
||||
static inline switch_bool_t switch_is_file_path(const char *file)
|
||||
{
|
||||
const char *e;
|
||||
int r, x;
|
||||
int r;
|
||||
|
||||
for (x = 0; x < 2; x++) {
|
||||
if (*file == '[' && *(file + 1) == *SWITCH_PATH_SEPARATOR) {
|
||||
if ((e = switch_find_end_paren(file, '[', ']'))) {
|
||||
file = e + 1;
|
||||
}
|
||||
} else if (*file == '{') {
|
||||
if ((e = switch_find_end_paren(file, '{', '}'))) {
|
||||
file = e + 1;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
while(*file == '{') {
|
||||
if ((e = switch_find_end_paren(file, '{', '}'))) {
|
||||
file = e + 1;
|
||||
while(*file == ' ') file++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user