@@ -27,7 +27,7 @@
#include <libavutil/mem.h>
#include <libavutil/error.h>
-const char *stream_format_names[] = { "mkv" };
+const char *stream_format_names[] = { "mkv", "hls", "dash" };
static struct HTTPDConfig *parsed_configs = NULL;
@@ -152,8 +152,12 @@ int configs_parse(lua_State *L)
return luaL_error(L, "Error could not allocate stream formats");
}
key = lua_tostring(L, -1);
- if (!strncmp("mkv", key, 3)) {
+ if (!strcmp("mkv", key)) {
stream->formats[nb_formats++] = FMT_MATROSKA;
+ } else if (!strcmp("hls", key)) {
+ stream->formats[nb_formats++] = FMT_HLS;
+ } else if (!strcmp("dash", key)) {
+ stream->formats[nb_formats++] = FMT_DASH;
} else {
fprintf(stderr, "Warning unknown format (%s) in stream format configuration.\n",
key);
@@ -20,6 +20,7 @@
#define CONFIGREADER_H
#include "httpd.h"
+#include <stdio.h>
/**
* Read configurations from a file using the lua format. The configurations
@@ -24,11 +24,11 @@
#define HTTPD_CLIENT_ERROR -2
#define HTTPD_OTHER_ERROR -3
-#include "publisher.h"
-
-/** Supported stream formats, for now only matroska */
+/** Supported stream formats */
enum StreamFormat {
FMT_MATROSKA = 0,
+ FMT_HLS,
+ FMT_DASH,
FMT_NB,
};
@@ -60,11 +60,12 @@ struct HTTPClient {
void *httpd_data;
};
+
/** HTTPDInterface that an httpd implementation must provide */
struct HTTPDInterface {
int (*init) (void **server, struct HTTPDConfig config);
int (*free) (void *server);
- int (*accept)(void *server, struct HTTPClient **client, int reply_code);
+ int (*accept)(void *server, struct HTTPClient **client, const char **valid_files);
int (*write) (void *server, struct HTTPClient *client, const unsigned char *buf, int size);
int (*read) (void *server, struct HTTPClient *client, unsigned char *buf, int size);
void (*close)(void *server, struct HTTPClient *client);
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com> --- configreader.c | 8 ++++++-- configreader.h | 1 + httpd.h | 9 +++++---- 3 files changed, 12 insertions(+), 6 deletions(-)