Skip to content

Commit

Permalink
only resolve libass symbols used in QtAV. update capi
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Dec 8, 2014
1 parent 2bc3df6 commit ab6a534
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 14 deletions.
2 changes: 1 addition & 1 deletion contrib/capi
54 changes: 41 additions & 13 deletions src/subtitle/ass_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
//#define DEBUG_RESOLVE
#define DEBUG_LOAD
//#define DEBUG_LOAD

#include "ass_api.h"
#ifndef CAPI_LINK_ASS
#include "capi.h"
#endif //CAPI_LINK_ASS

#include <QtCore/QLibrary>
#endif
#define CAPI_RESOLVE_ASS_ALL 0
namespace ass {
#ifdef CAPI_LINK_ASS
class api_dll {public: bool isLoaded() const {return true;}};
Expand All @@ -34,34 +35,40 @@ static const char* names[] = {
"ass",
NULL
};
#define CAPI_ASS_VERSION
# ifdef CAPI_ASS_VERSION
# if 1
static const int versions[] = {
capi::NoVersion,
5,
4,
capi::EndVersion
// the following line will be replaced by the content of config/ASS/version if exists
5, 4
, capi::EndVersion
};
CAPI_BEGIN_DLL_VER(names, versions)
CAPI_BEGIN_DLL_VER(names, versions, QLibrary)
# else
CAPI_BEGIN_DLL(names)
# endif //CAPI_ASS_VERSION
CAPI_BEGIN_DLL(names, QLibrary)
# endif //1
// CAPI_DEFINE_RESOLVER(argc, return_type, name, argv_no_name)
// mkapi code generation BEGIN
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(0, int, ass_library_version)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(0, ASS_Library *, ass_library_init)
CAPI_DEFINE_RESOLVER(1, void, ass_library_done, ASS_Library *)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(2, void, ass_set_fonts_dir, ASS_Library *, const char *)
CAPI_DEFINE_RESOLVER(2, void, ass_set_extract_fonts, ASS_Library *, int)
CAPI_DEFINE_RESOLVER(2, void, ass_set_style_overrides, ASS_Library *, char **)
CAPI_DEFINE_RESOLVER(1, void, ass_process_force_style, ASS_Track *)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(3, void, ass_set_message_cb, ASS_Library *, void (*msg_cb)
(int level, const char *fmt, va_list args, void *data), void *)
CAPI_DEFINE_RESOLVER(1, ASS_Renderer *, ass_renderer_init, ASS_Library *)
CAPI_DEFINE_RESOLVER(1, void, ass_renderer_done, ASS_Renderer *)
CAPI_DEFINE_RESOLVER(3, void, ass_set_frame_size, ASS_Renderer *, int, int)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(3, void, ass_set_storage_size, ASS_Renderer *, int, int)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(2, void, ass_set_shaper, ASS_Renderer *, ASS_ShapingLevel)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(5, void, ass_set_margins, ASS_Renderer *, int, int, int, int)
CAPI_DEFINE_RESOLVER(2, void, ass_set_use_margins, ASS_Renderer *, int)
CAPI_DEFINE_RESOLVER(2, void, ass_set_pixel_aspect, ASS_Renderer *, double)
Expand All @@ -70,47 +77,61 @@ CAPI_DEFINE_RESOLVER(2, void, ass_set_font_scale, ASS_Renderer *, double)
CAPI_DEFINE_RESOLVER(2, void, ass_set_hinting, ASS_Renderer *, ASS_Hinting)
CAPI_DEFINE_RESOLVER(2, void, ass_set_line_spacing, ASS_Renderer *, double)
CAPI_DEFINE_RESOLVER(2, void, ass_set_line_position, ASS_Renderer *, double)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(6, void, ass_set_fonts, ASS_Renderer *, const char *, const char *, int, const char *, int)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(2, void, ass_set_selective_style_override_enabled, ASS_Renderer *, int)
CAPI_DEFINE_RESOLVER(2, void, ass_set_selective_style_override, ASS_Renderer *, ASS_Style *)
CAPI_DEFINE_RESOLVER(1, int, ass_fonts_update, ASS_Renderer *)
CAPI_DEFINE_RESOLVER(3, void, ass_set_cache_limits, ASS_Renderer *, int, int)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(4, ASS_Image *, ass_render_frame, ASS_Renderer *, ASS_Track *, long long, int *)
CAPI_DEFINE_RESOLVER(1, ASS_Track *, ass_new_track, ASS_Library *)
CAPI_DEFINE_RESOLVER(1, void, ass_free_track, ASS_Track *)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(1, int, ass_alloc_style, ASS_Track *)
CAPI_DEFINE_RESOLVER(1, int, ass_alloc_event, ASS_Track *)
CAPI_DEFINE_RESOLVER(2, void, ass_free_style, ASS_Track *, int)
CAPI_DEFINE_RESOLVER(2, void, ass_free_event, ASS_Track *, int)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(3, void, ass_process_data, ASS_Track *, char *, int)
CAPI_DEFINE_RESOLVER(3, void, ass_process_codec_private, ASS_Track *, char *, int)
CAPI_DEFINE_RESOLVER(5, void, ass_process_chunk, ASS_Track *, char *, int, long long, long long)
CAPI_DEFINE_RESOLVER(1, void, ass_flush_events, ASS_Track *)
CAPI_DEFINE_RESOLVER(3, ASS_Track *, ass_read_file, ASS_Library *, char *, char *)
CAPI_DEFINE_RESOLVER(4, ASS_Track *, ass_read_memory, ASS_Library *, char *, size_t, char *)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE_RESOLVER(3, int, ass_read_styles, ASS_Track *, char *, char *)
CAPI_DEFINE_RESOLVER(4, void, ass_add_font, ASS_Library *, char *, char *, int)
CAPI_DEFINE_RESOLVER(1, void, ass_clear_fonts, ASS_Library *)
CAPI_DEFINE_RESOLVER(3, long long, ass_step_sub, ASS_Track *, long long, int)
#endif //CAPI_RESOLVE_ASS_ALL
// mkapi code generation END
CAPI_END_DLL()
// CAPI_DEFINE(argc, return_type, name, argv_no_name)
typedef void (*msg_cb)
typedef void (*ass_set_message_cb_msg_cb1)
(int level, const char *fmt, va_list args, void *data);
// mkapi code generation BEGIN
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(0, int, ass_library_version)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(0, ASS_Library *, ass_library_init)
CAPI_DEFINE(1, void, ass_library_done, ASS_Library *)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(2, void, ass_set_fonts_dir, ASS_Library *, const char *)
CAPI_DEFINE(2, void, ass_set_extract_fonts, ASS_Library *, int)
CAPI_DEFINE(2, void, ass_set_style_overrides, ASS_Library *, char **)
CAPI_DEFINE(1, void, ass_process_force_style, ASS_Track *)
CAPI_DEFINE(3, void, ass_set_message_cb, ASS_Library *, msg_cb, void *)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(3, void, ass_set_message_cb, ASS_Library *, ass_set_message_cb_msg_cb1, void *)
CAPI_DEFINE(1, ASS_Renderer *, ass_renderer_init, ASS_Library *)
CAPI_DEFINE(1, void, ass_renderer_done, ASS_Renderer *)
CAPI_DEFINE(3, void, ass_set_frame_size, ASS_Renderer *, int, int)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(3, void, ass_set_storage_size, ASS_Renderer *, int, int)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(2, void, ass_set_shaper, ASS_Renderer *, ASS_ShapingLevel)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(5, void, ass_set_margins, ASS_Renderer *, int, int, int, int)
CAPI_DEFINE(2, void, ass_set_use_margins, ASS_Renderer *, int)
CAPI_DEFINE(2, void, ass_set_pixel_aspect, ASS_Renderer *, double)
Expand All @@ -119,28 +140,35 @@ CAPI_DEFINE(2, void, ass_set_font_scale, ASS_Renderer *, double)
CAPI_DEFINE(2, void, ass_set_hinting, ASS_Renderer *, ASS_Hinting)
CAPI_DEFINE(2, void, ass_set_line_spacing, ASS_Renderer *, double)
CAPI_DEFINE(2, void, ass_set_line_position, ASS_Renderer *, double)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(6, void, ass_set_fonts, ASS_Renderer *, const char *, const char *, int, const char *, int)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(2, void, ass_set_selective_style_override_enabled, ASS_Renderer *, int)
CAPI_DEFINE(2, void, ass_set_selective_style_override, ASS_Renderer *, ASS_Style *)
CAPI_DEFINE(1, int, ass_fonts_update, ASS_Renderer *)
CAPI_DEFINE(3, void, ass_set_cache_limits, ASS_Renderer *, int, int)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(4, ASS_Image *, ass_render_frame, ASS_Renderer *, ASS_Track *, long long, int *)
CAPI_DEFINE(1, ASS_Track *, ass_new_track, ASS_Library *)
CAPI_DEFINE(1, void, ass_free_track, ASS_Track *)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(1, int, ass_alloc_style, ASS_Track *)
CAPI_DEFINE(1, int, ass_alloc_event, ASS_Track *)
CAPI_DEFINE(2, void, ass_free_style, ASS_Track *, int)
CAPI_DEFINE(2, void, ass_free_event, ASS_Track *, int)
#endif //CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(3, void, ass_process_data, ASS_Track *, char *, int)
CAPI_DEFINE(3, void, ass_process_codec_private, ASS_Track *, char *, int)
CAPI_DEFINE(5, void, ass_process_chunk, ASS_Track *, char *, int, long long, long long)
CAPI_DEFINE(1, void, ass_flush_events, ASS_Track *)
CAPI_DEFINE(3, ASS_Track *, ass_read_file, ASS_Library *, char *, char *)
CAPI_DEFINE(4, ASS_Track *, ass_read_memory, ASS_Library *, char *, size_t, char *)
#if CAPI_RESOLVE_ASS_ALL
CAPI_DEFINE(3, int, ass_read_styles, ASS_Track *, char *, char *)
CAPI_DEFINE(4, void, ass_add_font, ASS_Library *, char *, char *, int)
CAPI_DEFINE(1, void, ass_clear_fonts, ASS_Library *)
CAPI_DEFINE(3, long long, ass_step_sub, ASS_Track *, long long, int)
#endif //CAPI_RESOLVE_ASS_ALL
// mkapi code generation END
#endif //CAPI_LINK_ASS
api::api() : dll(new api_dll()) {}
Expand Down

0 comments on commit ab6a534

Please sign in to comment.