Commit 818c1aff authored by giles's avatar giles

Add WebM support.

This is David Richard's webm support patch from the icecast-webm branch.

svn path=/icecast/trunk/icecast/; revision=18402
parents 1295a56c 6003670c
......@@ -10,13 +10,13 @@ noinst_HEADERS = admin.h cfgfile.h logging.h sighandler.h connection.h \
global.h util.h slave.h source.h stats.h refbuf.h client.h \
compat.h fserve.h xslt.h yp.h event.h md5.h \
auth.h auth_htpasswd.h auth_url.h \
format.h format_ogg.h format_mp3.h \
format.h format_ogg.h format_mp3.h format_ebml.h \
format_vorbis.h format_theora.h format_flac.h format_speex.h format_midi.h \
format_kate.h format_skeleton.h format_opus.h
icecast_SOURCES = cfgfile.c main.c logging.c sighandler.c connection.c global.c \
util.c slave.c source.c stats.c refbuf.c client.c \
xslt.c fserve.c event.c admin.c md5.c \
format.c format_ogg.c format_mp3.c format_midi.c format_flac.c \
format.c format_ogg.c format_mp3.c format_midi.c format_flac.c format_ebml.c \
auth.c auth_htpasswd.c format_kate.c format_skeleton.c format_opus.c
EXTRA_icecast_SOURCES = yp.c \
auth_url.c \
......
......@@ -40,6 +40,7 @@
#include "format_ogg.h"
#include "format_mp3.h"
#include "format_ebml.h"
#include "logging.h"
#include "stats.h"
......@@ -64,6 +65,16 @@ format_type_t format_get_type (const char *contenttype)
return FORMAT_TYPE_OGG;
else if(strcmp(contenttype, "video/ogg") == 0)
return FORMAT_TYPE_OGG;
else if(strcmp(contenttype, "audio/webm") == 0)
return FORMAT_TYPE_EBML;
else if(strcmp(contenttype, "video/webm") == 0)
return FORMAT_TYPE_EBML;
else if(strcmp(contenttype, "audio/x-matroska") == 0)
return FORMAT_TYPE_EBML;
else if(strcmp(contenttype, "video/x-matroska") == 0)
return FORMAT_TYPE_EBML;
else if(strcmp(contenttype, "video/x-matroska-3d") == 0)
return FORMAT_TYPE_EBML;
else
/* We default to the Generic format handler, which
can handle many more formats than just mp3 */
......@@ -78,6 +89,9 @@ int format_get_plugin(format_type_t type, source_t *source)
case FORMAT_TYPE_OGG:
ret = format_ogg_get_plugin (source);
break;
case FORMAT_TYPE_EBML:
ret = format_ebml_get_plugin (source);
break;
case FORMAT_TYPE_GENERIC:
ret = format_mp3_get_plugin (source);
break;
......
......@@ -29,6 +29,7 @@ typedef enum _format_type_tag
{
FORMAT_ERROR, /* No format, source not processable */
FORMAT_TYPE_OGG,
FORMAT_TYPE_EBML,
FORMAT_TYPE_GENERIC
} format_type_t;
......
This diff is collapsed.
/* Icecast
*
* This program is distributed under the GNU General Public License,
* version 2. A copy of this license is included with this source.
* At your option, this specific source file can also be distributed
* under the GNU GPL version 3.
*
* Copyright 2012, David Richards, Mozilla Foundation,
* and others (see AUTHORS for details).
*/
/* format_ebml.h
**
** ebml format plugin header
**
*/
#ifndef __FORMAT_EBML_H__
#define __FORMAT_EBML_H__
#include "format.h"
typedef struct ebml_st ebml_t;
typedef struct ebml_source_state_st ebml_source_state_t;
struct ebml_source_state_st {
ebml_t *ebml;
refbuf_t *header;
int file_headers_written;
};
int format_ebml_get_plugin (source_t *source);
#endif /* __FORMAT_EBML_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment