From 44ba398443049366efb8d61926eb08662b57148a Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 15 Aug 2021 21:07:21 +0200 Subject: [PATCH] Fixing windows export --- include/export.h | 2 +- include/transcoder.h | 12 +++++++----- src/destroyer.c | 5 +++-- src/info.c | 13 +++++++------ src/transmuxer.c | 3 ++- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/include/export.h b/include/export.h index 36dec34..f478ebb 100644 --- a/include/export.h +++ b/include/export.h @@ -8,4 +8,4 @@ #define API __declspec(dllexport) #else #define API -#endif \ No newline at end of file +#endif diff --git a/include/transcoder.h b/include/transcoder.h index 6c3ba4e..8749f5b 100644 --- a/include/transcoder.h +++ b/include/transcoder.h @@ -7,16 +7,18 @@ #include "export.h" #include "stream.h" +API int init(); + API int transmux(const char *path, const char *out_path, float *playable_duration); //API int transcode(const char *path, const char *out_path, float *playable_duration); API stream *extract_infos(const char *path, - const char *out_path, - unsigned *stream_count, - unsigned *track_count, - bool reextract); + const char *out_path, + unsigned *stream_count, + unsigned *track_count, + bool reextract); -void destroy_stream(stream *s); +API void destroy_stream(stream *s); API void free_streams(stream *streamsPtr, unsigned count); \ No newline at end of file diff --git a/src/destroyer.c b/src/destroyer.c index 65f76f4..29f5b47 100644 --- a/src/destroyer.c +++ b/src/destroyer.c @@ -3,9 +3,10 @@ // #include "stream.h" +#include "export.h" #include -void destroy_stream(stream *s) +API void destroy_stream(stream *s) { free(s->title); free(s->language); @@ -13,7 +14,7 @@ void destroy_stream(stream *s) free(s->path); } -void free_streams(stream *s, unsigned count) +API void free_streams(stream *s, unsigned count) { for (unsigned i = 0; i < count; i++) destroy_stream(s + i); diff --git a/src/info.c b/src/info.c index 23ed7a9..10c9bd9 100644 --- a/src/info.c +++ b/src/info.c @@ -4,10 +4,11 @@ #include #include +#include "export.h" #include "stream.h" #include "helper.h" -int init() +API int init() { puts("Kyoo's transcoder initiated."); return sizeof(stream); @@ -70,11 +71,11 @@ stream parse_stream(AVStream *stream, type stream_type, const char *path) }; } -stream *extract_infos(const char *path, - const char *out_path, - unsigned *stream_count, - unsigned *track_count, - bool reextract) +API stream *extract_infos(const char *path, + const char *out_path, + unsigned *stream_count, + unsigned *track_count, + bool reextract) { AVFormatContext *ctx = NULL; AVFormatContext **output_list; diff --git a/src/transmuxer.c b/src/transmuxer.c index 73e5782..946893d 100644 --- a/src/transmuxer.c +++ b/src/transmuxer.c @@ -3,6 +3,7 @@ // #include "compatibility.h" +#include "export.h" #include "transcoder.h" #include "helper.h" #include "path_helper.h" @@ -104,7 +105,7 @@ static void destroy_context(AVFormatContext *in_ctx, AVFormatContext *out_ctx, A free(stream_map); } -int transmux(const char *path, const char *out_path, float *playable_duration) +API int transmux(const char *path, const char *out_path, float *playable_duration) { AVFormatContext *in_ctx = NULL; AVFormatContext *out_ctx = NULL;