Permalink
Browse files

Merge commit 'slicehost/v0.7-eyetv' into ryan-new-ffmpeg

  • Loading branch information...
2 parents 8c756ea + b93c1b5 commit 10d812a01f04153a49522847e9a7ca59189b9195 @elan elan committed Mar 19, 2009
View
11 xbmc/FileSystem/FileEyeTVSocket.h
@@ -12,9 +12,7 @@
#include "IFile.h"
#include "pa_ringbuffer.h"
-extern "C"
-{
-}
+#import "CoreFoundation/CFSocket.h"
namespace XFILE
{
@@ -34,8 +32,13 @@ namespace XFILE
virtual void Close();
protected:
+ static void EyeTVSocketCallback(CFSocketRef s,
+ CFSocketCallBackType type,
+ CFDataRef address,
+ const void * data,
+ void * info);
private:
- int eyetvSock;
+ CFSocketRef eyetvSockRef;
PaUtilRingBuffer* streamBuffer;
void* streamBufferData;
bool initialised;
View
79 xbmc/FileSystem/FileEyeTVSocket.mm
@@ -9,9 +9,9 @@
*
*/
+#import <Cocoa/Cocoa.h>
#include "FileEyeTVSocket.h"
-#import <Cocoa/Cocoa.h>
#import "log.h"
#import <sys/un.h>
@@ -27,17 +27,59 @@
CFileEyeTVSocket::~CFileEyeTVSocket()
{
Close();
+}
- initialised = false;
+
+void CFileEyeTVSocket::EyeTVSocketCallback(CFSocketRef s,
+ CFSocketCallBackType type,
+ CFDataRef address,
+ const void * data,
+ void * info)
+{
+#pragma unused(address)
+
+ assert(s != NULL);
+
+ CFileEyeTVSocket *socketObject = (CFileEyeTVSocket *)info;
+ assert(socketObject != NULL);
+
+ switch (type) {
+ case kCFSocketDataCallBack:
+
+ CFDataRef newData;
+ newData = (CFDataRef) data;
+ assert(newData != NULL);
+ assert(CFGetTypeID(newData) == CFDataGetTypeID());
+
+ if ( CFDataGetLength(newData) == 0 )
+ {
+ // A zero length data indicates the end of the data stream; the client is dead
+ // so we just go and remove our record of it.
+ CLog::Log(LOGDEBUG, "EOF from EyeTV socket");
+
+ socketObject->Close();
+ }
+ else
+ {
+ // Append the new data to whatever data we have already buffered
+ PaUtil_WriteRingBuffer(socketObject->streamBuffer, CFDataGetBytePtr(newData), CFDataGetLength(newData));
+ }
+
+ break;
+ default:
+ assert(false);
+ break;
+ }
}
+
//*********************************************************************************************
bool CFileEyeTVSocket::Open(const CURL& url, bool bBinary)
{
struct sockaddr_un publicAddr, peerAddr;
- int publicSock;
+ int publicSock, eyetvSock;
initialised = false;
@@ -74,8 +116,7 @@
{
perror(strerror(errno));
return false;
- }
-
+ }
if( bind(publicSock, (struct sockaddr *)&publicAddr, sizeof(struct sockaddr_un)) == -1 )
{
@@ -99,7 +140,7 @@
// initialise the receiver buffer
uint32_t streamBufferSize = 1;
- while(streamBufferSize <= 1024768 * 8) // ensure power of 2, buffer 8MB
+ while(streamBufferSize <= 1024768 * 10) // ensure power of 2, buffer 10MB
{
streamBufferSize <<= 1;
}
@@ -137,7 +178,21 @@
if (initialised)
{
- //try to buffer 1mb initially
+ // Attach to CFSocket
+ CFSocketContext context;
+
+ memset(&context, 0, sizeof(context));
+ context.info = this;
+
+
+ eyetvSockRef = CFSocketCreateWithNative(kCFAllocatorDefault,
+ eyetvSock,
+ kCFSocketDataCallBack,
+ EyeTVSocketCallback,
+ &context);
+
+ // Link to runloop
+
}
return initialised;
@@ -152,8 +207,9 @@
uint64_t len;
/* Read data */
- len = read(eyetvSock, lpBuf, uiBufSize);
-
+ //len = read(eyetvSock, lpBuf, uiBufSize);
+ len = PaUtil_ReadRingBuffer(streamBuffer, lpBuf, uiBufSize);
+
if (len < uiBufSize)
{
CLog::Log(LOGERROR, "short read from EyeTV server socket (%i KB of %li KB requested)", len / 1024, uiBufSize / 1024);
@@ -178,9 +234,12 @@
CLog::Log(LOGINFO, "EyeTV server notified of shutdown" );
- close(eyetvSock);
+ CFSocketInvalidate(eyetvSockRef);
CLog::Log(LOGINFO, "EyeTV socket closed and freed" );
+
+ initialised = false;
+
}
}
View
2 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLiba52.cpp
@@ -285,7 +285,7 @@ int CDVDAudioCodecLiba52::Decode(BYTE* pData, int iSize)
m_dll.a52_frame(m_pState, frame, &flags, &level, bias);
- m_dll.a52_dynrng(m_pState, NULL, NULL);
+ //m_dll.a52_dynrng(m_pState, NULL, NULL);
for (int i = 0; i < 6; i++)
{
View
230 xbmc/lib/libass/ass.h 100755 → 100644
@@ -1 +1,229 @@
-// -*- c-basic-offset: 8; indent-tabs-mode: t -*-
+// -*- c-basic-offset: 8; indent-tabs-mode: t -*-
+// vim:ts=8:sw=8:noet:ai:
+/*
+ * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
+ *
+ * This file is part of libass.
+ *
+ * libass is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libass 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 libass; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef LIBASS_ASS_H
+#define LIBASS_ASS_H
+
+#include <stdio.h>
+#include "ass_types.h"
+
+/// Libass renderer object. Contents are private.
+typedef struct ass_renderer_s ass_renderer_t;
+
+/// a linked list of images produced by ass renderer
+typedef struct ass_image_s {
+ int w, h; // bitmap width/height
+ int stride; // bitmap stride
+ unsigned char* bitmap; // 1bpp stride*h alpha buffer
+ uint32_t color; // RGBA
+ int dst_x, dst_y; // bitmap placement inside the video frame
+
+ struct ass_image_s* next; // linked list
+} ass_image_t;
+
+/// Hinting type
+typedef enum {ASS_HINTING_NONE = 0,
+ ASS_HINTING_LIGHT,
+ ASS_HINTING_NORMAL,
+ ASS_HINTING_NATIVE
+} ass_hinting_t;
+
+/**
+ * \brief initialize the library
+ * \return library handle or NULL if failed
+ */
+ass_library_t* ass_library_init(void);
+
+/**
+ * \brief finalize the library
+ * \param priv library handle
+ */
+void ass_library_done(ass_library_t*);
+
+/**
+ * \brief set private font directory
+ * It is used for saving embedded fonts and also in font lookup.
+ */
+void ass_set_fonts_dir(ass_library_t* priv, const char* fonts_dir);
+
+void ass_set_extract_fonts(ass_library_t* priv, int extract);
+
+void ass_set_style_overrides(ass_library_t* priv, char** list);
+
+/**
+ * \brief initialize the renderer
+ * \param priv library handle
+ * \return renderer handle or NULL if failed
+ */
+ass_renderer_t* ass_renderer_init(ass_library_t*);
+
+/**
+ * \brief finalize the renderer
+ * \param priv renderer handle
+ */
+void ass_renderer_done(ass_renderer_t* priv);
+
+void ass_set_frame_size(ass_renderer_t* priv, int w, int h);
+void ass_set_margins(ass_renderer_t* priv, int t, int b, int l, int r);
+void ass_set_use_margins(ass_renderer_t* priv, int use);
+void ass_set_aspect_ratio(ass_renderer_t* priv, double ar);
+void ass_set_font_scale(ass_renderer_t* priv, double font_scale);
+void ass_set_hinting(ass_renderer_t* priv, ass_hinting_t ht);
+void ass_set_line_spacing(ass_renderer_t* priv, double line_spacing);
+
+/**
+ * \brief set font lookup defaults
+ */
+int ass_set_fonts(ass_renderer_t* priv, const char* default_font, const char* default_family);
+
+/**
+ * \brief set font lookup defaults, don't use fontconfig even if it is available
+ */
+int ass_set_fonts_nofc(ass_renderer_t* priv, const char* default_font, const char* default_family);
+
+/**
+ * \brief render a frame, producing a list of ass_image_t
+ * \param priv library
+ * \param track subtitle track
+ * \param now video timestamp in milliseconds
+ */
+ass_image_t* ass_render_frame(ass_renderer_t *priv, ass_track_t* track, long long now, int* detect_change);
+
+
+// The following functions operate on track objects and do not need an ass_renderer //
+
+/**
+ * \brief allocate a new empty track object
+ * \return pointer to empty track
+ */
+ass_track_t* ass_new_track(ass_library_t*);
+
+/**
+ * \brief deallocate track and all its child objects (styles and events)
+ * \param track track to deallocate
+ */
+void ass_free_track(ass_track_t* track);
+
+/**
+ * \brief allocate new style
+ * \param track track
+ * \return newly allocated style id
+ */
+int ass_alloc_style(ass_track_t* track);
+
+/**
+ * \brief allocate new event
+ * \param track track
+ * \return newly allocated event id
+ */
+int ass_alloc_event(ass_track_t* track);
+
+/**
+ * \brief delete a style
+ * \param track track
+ * \param sid style id
+ * Deallocates style data. Does not modify track->n_styles.
+ */
+void ass_free_style(ass_track_t* track, int sid);
+
+/**
+ * \brief delete an event
+ * \param track track
+ * \param eid event id
+ * Deallocates event data. Does not modify track->n_events.
+ */
+void ass_free_event(ass_track_t* track, int eid);
+
+/**
+ * \brief Parse a chunk of subtitle stream data.
+ * \param track track
+ * \param data string to parse
+ * \param size length of data
+ */
+void ass_process_data(ass_track_t* track, char* data, int size);
+
+/**
+ * \brief Parse Codec Private section of subtitle stream
+ * \param track target track
+ * \param data string to parse
+ * \param size length of data
+ */
+void ass_process_codec_private(ass_track_t* track, char *data, int size);
+
+/**
+ * \brief Parse a chunk of subtitle stream data. In Matroska, this contains exactly 1 event (or a commentary).
+ * \param track track
+ * \param data string to parse
+ * \param size length of data
+ * \param timecode starting time of the event (milliseconds)
+ * \param duration duration of the event (milliseconds)
+*/
+void ass_process_chunk(ass_track_t* track, char *data, int size, long long timecode, long long duration);
+
+char* read_file_recode(char* fname, char* codepage, size_t* size);
+
+/**
+ * \brief Read subtitles from file.
+ * \param fname file name
+ * \return newly allocated track
+*/
+ass_track_t* ass_read_file(ass_library_t* library, char* fname, char* codepage);
+
+/**
+ * \brief Read subtitles from memory.
+ * \param library libass library object
+ * \param buf pointer to subtitles text
+ * \param bufsize size of buffer
+ * \param codepage recode buffer contents from given codepage
+ * \return newly allocated track
+*/
+ass_track_t* ass_read_memory(ass_library_t* library, char* buf, size_t bufsize, char* codepage);
+/**
+ * \brief read styles from file into already initialized track
+ * \return 0 on success
+ */
+int ass_read_styles(ass_track_t* track, char* fname, char* codepage);
+
+/**
+ * \brief Add a memory font.
+ * \param name attachment name
+ * \param data binary font data
+ * \param data_size data size
+*/
+void ass_add_font(ass_library_t* library, char* name, char* data, int data_size);
+
+/**
+ * \brief Remove all fonts stored in ass_library object
+ */
+void ass_clear_fonts(ass_library_t* library);
+
+/**
+ * \brief Calculates timeshift from now to the start of some other subtitle event, depending on movement parameter
+ * \param track subtitle track
+ * \param now current time, ms
+ * \param movement how many events to skip from the one currently displayed
+ * +2 means "the one after the next", -1 means "previous"
+ * \return timeshift, ms
+ */
+long long ass_step_sub(ass_track_t* track, long long now, int movement);
+
+#endif /* LIBASS_ASS_H */
View
4 xbmc/lib/libass/ass_bitmap.h 100755 → 100644
@@ -28,7 +28,7 @@
typedef struct ass_synth_priv_s ass_synth_priv_t;
-ass_synth_priv_t* ass_synth_init(void);
+ass_synth_priv_t* ass_synth_init(double);
void ass_synth_done(ass_synth_priv_t* priv);
typedef struct bitmap_s {
@@ -46,7 +46,7 @@ typedef struct bitmap_s {
* \param bm_g out: pointer to the bitmap of glyph shadow is returned here
* \param be 1 = produces blurred bitmaps, 0 = normal bitmaps
*/
-int glyph_to_bitmap(ass_synth_priv_t* priv, FT_Glyph glyph, FT_Glyph outline_glyph, bitmap_t** bm_g, bitmap_t** bm_o, bitmap_t** bm_s, int be);
+int glyph_to_bitmap(ass_synth_priv_t* priv_blur, FT_Glyph glyph, FT_Glyph outline_glyph, bitmap_t** bm_g, bitmap_t** bm_o, bitmap_t** bm_s, int be, double blur_radius);
void ass_free_bitmap(bitmap_t* bm);
View
52 xbmc/lib/libass/ass_cache.h 100755 → 100644
@@ -27,12 +27,10 @@
#include "ass_font.h"
#include "ass_bitmap.h"
-typedef struct hashmap_s ass_font_cache_t;
-
-ass_font_cache_t* ass_font_cache_init(void);
-ass_font_t* ass_font_cache_find(ass_font_cache_t* cache, ass_font_desc_t* desc);
-void* ass_font_cache_add(ass_font_cache_t* cache, ass_font_t* font);
-void ass_font_cache_done(ass_font_cache_t* cache);
+void ass_font_cache_init(void);
+ass_font_t* ass_font_cache_find(ass_font_desc_t* desc);
+void* ass_font_cache_add(ass_font_t* font);
+void ass_font_cache_done(void);
// describes a bitmap; bitmaps with equivalents structs are considered identical
@@ -44,6 +42,7 @@ typedef struct bitmap_hash_key_s {
unsigned outline; // border width, 16.16 fixed point value
int bold, italic;
char be; // blur edges
+ double blur; // gaussian blur
unsigned scale_x, scale_y; // 16.16
int frx, fry, frz; // signed 16.16
@@ -60,12 +59,32 @@ typedef struct bitmap_hash_val_s {
bitmap_t* bm_s;
} bitmap_hash_val_t;
-typedef struct hashmap_s ass_bitmap_cache_t;
+void ass_bitmap_cache_init(void);
+void* cache_add_bitmap(bitmap_hash_key_t* key, bitmap_hash_val_t* val);
+bitmap_hash_val_t* cache_find_bitmap(bitmap_hash_key_t* key);
+void ass_bitmap_cache_reset(void);
+void ass_bitmap_cache_done(void);
+
+
+// Cache for composited bitmaps
+typedef struct composite_hash_key_s {
+ int aw, ah, bw, bh;
+ int ax, ay, bx, by;
+ bitmap_hash_key_t a;
+ bitmap_hash_key_t b;
+} composite_hash_key_t;
+
+typedef struct composite_hash_val_s {
+ unsigned char* a;
+ unsigned char* b;
+} composite_hash_val_t;
+
+void ass_composite_cache_init(void);
+void* cache_add_composite(composite_hash_key_t* key, composite_hash_val_t* val);
+composite_hash_val_t* cache_find_composite(composite_hash_key_t* key);
+void ass_composite_cache_reset(void);
+void ass_composite_cache_done(void);
-ass_bitmap_cache_t* ass_bitmap_cache_init(void);
-void* cache_add_bitmap(ass_bitmap_cache_t* cache, bitmap_hash_key_t* key, bitmap_hash_val_t* val);
-bitmap_hash_val_t* cache_find_bitmap(ass_bitmap_cache_t* cache, bitmap_hash_key_t* key);
-void ass_bitmap_cache_done(ass_bitmap_cache_t* cache);
// describes an outline glyph
typedef struct glyph_hash_key_s {
@@ -85,12 +104,11 @@ typedef struct glyph_hash_val_s {
FT_Vector advance; // 26.6, advance distance to the next bitmap in line
} glyph_hash_val_t;
-typedef struct hashmap_s ass_glyph_cache_t;
-
-ass_glyph_cache_t* ass_glyph_cache_init(void);
-void* cache_add_glyph(ass_glyph_cache_t* cache, glyph_hash_key_t* key, glyph_hash_val_t* val);
-glyph_hash_val_t* cache_find_glyph(ass_glyph_cache_t* cache, glyph_hash_key_t* key);
-void ass_glyph_cache_done(ass_glyph_cache_t* cache);
+void ass_glyph_cache_init(void);
+void* cache_add_glyph(glyph_hash_key_t* key, glyph_hash_val_t* val);
+glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key);
+void ass_glyph_cache_reset(void);
+void ass_glyph_cache_done(void);
typedef struct hashmap_s hashmap_t;
typedef void (*hashmap_item_dtor_t)(void* key, size_t key_size, void* value, size_t value_size);
View
1 xbmc/lib/libass/ass_font.h 100755 → 100644
@@ -33,6 +33,7 @@ typedef struct ass_font_desc_s {
char* family;
unsigned bold;
unsigned italic;
+ int treat_family_as_pattern;
} ass_font_desc_t;
#define ASS_FONT_MAX_FACES 10
View
4 xbmc/lib/libass/ass_fontconfig.h 100755 → 100644
@@ -28,14 +28,14 @@
#include <ft2build.h>
#include FT_FREETYPE_H
-#ifdef HAVE_FONTCONFIG
+#ifdef CONFIG_FONTCONFIG
#include <fontconfig/fontconfig.h>
#endif
typedef struct fc_instance_s fc_instance_t;
fc_instance_t* fontconfig_init(ass_library_t* library, FT_Library ftlibrary, const char* family, const char* path, int fc);
-char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index, uint32_t code);
+char* fontconfig_select(fc_instance_t* priv, const char* family, int treat_family_as_pattern, unsigned bold, unsigned italic, int* index, uint32_t code);
void fontconfig_done(fc_instance_t* priv);
#endif /* LIBASS_FONTCONFIG_H */
View
3 xbmc/lib/libass/ass_library.h 100755 → 100644
@@ -23,8 +23,6 @@
#ifndef LIBASS_LIBRARY_H
#define LIBASS_LIBRARY_H
-#include "ass_cache.h"
-
typedef struct ass_fontdata_s {
char* name;
char* data;
@@ -38,7 +36,6 @@ struct ass_library_s {
ass_fontdata_t* fontdata;
int num_fontdata;
- ass_font_cache_t* font_cache;
};
#endif /* LIBASS_LIBRARY_H */
View
2 xbmc/lib/libass/ass_types.h 100755 → 100644
@@ -58,6 +58,7 @@ typedef struct ass_style_s {
int MarginV;
// int AlphaLevel;
int Encoding;
+ int treat_fontname_as_pattern;
} ass_style_t;
typedef struct render_priv_s render_priv_t;
@@ -105,6 +106,7 @@ typedef struct ass_track_s {
int PlayResY;
double Timer;
int WrapStyle;
+ char ScaledBorderAndShadow;
int default_style; // index of default style
View
8 xbmc/lib/libass/ass_utils.h 100755 → 100644
@@ -25,14 +25,12 @@
#include <stdint.h>
-#ifdef WIN32
-#define inline __inline
-#endif
-
-int mystrtoi(char** p, int base, int* res);
+int mystrtoi(char** p, int* res);
+int mystrtoll(char** p, long long* res);
int mystrtou32(char** p, int base, uint32_t* res);
int mystrtod(char** p, double* res);
int strtocolor(char** q, uint32_t* res);
+char parse_bool(char* str);
static inline int d6_to_int(int x) {
return (x + 32) >> 6;
View
5 xbmc/lib/libass/help_mp.h
@@ -2,6 +2,7 @@
#define __LIBASS_HELP_MP_H__
#define MSGTR_LIBASS_FT_Glyph_To_BitmapError "[ass] FT_Glyph_To_Bitmap error %d \n"
#define MSGTR_LIBASS_UnsupportedPixelMode "[ass] Unsupported pixel mode: %d\n"
+#define MSGTR_LIBASS_GlyphBBoxTooLarge "[ass] Glyph bounding box too large: %dx%dpx\n"
#define MSGTR_LIBASS_NoStyleNamedXFoundUsingY "[ass] [%p] Warning: no style named '%s' found, using '%s'\n"
#define MSGTR_LIBASS_BadTimestamp "[ass] bad timestamp\n"
#define MSGTR_LIBASS_BadEncodedDataSize "[ass] bad encoded data size\n"
@@ -19,7 +20,7 @@
#define MSGTR_LIBASS_NotADirectory "[ass] Not a directory: %s\n"
#define MSGTR_LIBASS_TooManyFonts "[ass] Too many fonts\n"
#define MSGTR_LIBASS_ErrorOpeningFont "[ass] Error opening font: %s, %d\n"
-#define MSGTR_LIBASS_SelectedFontFamilyIsNotTheRequestedOne "[ass] fontconfig: Selected font family is not the requested one: '%s' != '%s'\n"
+#define MSGTR_LIBASS_SelectedFontFamilyIsNotTheRequestedOne "[ass] fontconfig: Selected font is not the requested one: '%s' != '%s'\n"
#define MSGTR_LIBASS_UsingDefaultFontFamily "[ass] fontconfig_select: Using default font family: (%s, %d, %d) -> %s, %d\n"
#define MSGTR_LIBASS_UsingDefaultFont "[ass] fontconfig_select: Using default font: (%s, %d, %d) -> %s, %d\n"
#define MSGTR_LIBASS_UsingArialFontFamily "[ass] fontconfig_select: Using 'Arial' font family: (%s, %d, %d) -> %s, %d\n"
@@ -46,7 +47,7 @@
#define MSGTR_LIBASS_EmptyEvent "[ass] Empty event!\n"
#define MSGTR_LIBASS_MAX_GLYPHS_Reached "[ass] MAX_GLYPHS reached: event %d, start = %llu, duration = %llu\n Text = %s\n"
#define MSGTR_LIBASS_EventHeightHasChanged "[ass] Warning! Event height has changed! \n"
-#define MSGTR_LIBASS_GlyphNotFoundReselectingFont "[ass] Glyph 0x%X not found, reselecting font for (%s, %d, %d)\n"
+#define MSGTR_LIBASS_GlyphNotFoundReselectingFont "[ass] Glyph 0x%X not found, selecting one more font for (%s, %d, %d)\n"
#define MSGTR_LIBASS_GlyphNotFound "[ass] Glyph 0x%X not found in font for (%s, %d, %d)\n"
#define MSGTR_LIBASS_ErrorOpeningMemoryFont "[ass] Error opening memory font: %s\n"
#define MSGTR_LIBASS_NoCharmaps "[ass] font face with no charmaps\n"
View
63 xbmc/lib/libass/mputils.h 100755 → 100644
@@ -1,38 +1,35 @@
-/*
- * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
- *
- * This file is part of libass.
- *
- * libass is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * libass 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 libass; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef LIBASS_MPUTILS_H
-#define LIBASS_MPUTILS_H
-
-#include "mp_msg.h"
+#ifndef __MPUTILS_H__
+#define __MPUTILS_H__
+
#include "help_mp.h"
-//#include "libvo/font_load.h" // for blur()
-//#include "subreader.h" // for guess_buffer_cp
-//#include "libvo/sub.h" // for utf8_get_char
-//#include "libavutil/common.h"
-#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
-#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+unsigned utf8_get_char(char **str);
-#ifdef _WIN32
-#define mp_msg my_mp_msg
+void my_mp_msg(int lvl, char *lvl_str, char *fmt, ...);
+
+#ifdef __VISUALC__
+static void mp_msg(int mod, int level, const char *fmt, ...) {
+ // MSVC doesn't like the # used all around for mp_msg, so it breaks va_arg
+}
+#else
+#define mp_msg(mod, level, args...) my_mp_msg(level, #level, args)
#endif
-#endif /* LIBASS_MPUTILS_H */
+#define MSGT_ASS 43
+
+#define MSGL_FATAL 0
+#define MSGL_ERR 1
+#define MSGL_WARN 2
+#define MSGL_INFO 4
+#define MSGL_V 6
+#define MSGL_DBG2 7
+
+void blur(unsigned char *buffer, unsigned short *tmp2, int width, int height,
+ int stride, int *m2, int r, int mwidth);
+
+void* guess_buffer_cp(unsigned char* buffer, int buflen, char *preferred_language, char *fallback);
+
+#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
+
+#endif

0 comments on commit 10d812a

Please sign in to comment.