|
|
|
|
@ -46,7 +46,7 @@ int video_get_info(const char* path, struct video_info* out) { (void)path; (void
|
|
|
|
|
int video_needs_transcode(const struct video_info* info) { (void)info; return 1; } |
|
|
|
|
|
|
|
|
|
int video_transcode_start(struct media_async* owner, struct UASYNC* ua, const char* src, const char* dst, |
|
|
|
|
void (*done)(void* arg, int err), void* arg) { |
|
|
|
|
void (*done)(void* arg, int err, const struct video_info* info), void* arg) { |
|
|
|
|
(void)owner; (void)ua; (void)src; (void)dst; (void)done; (void)arg; |
|
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_VIDEO, "video: built without FFmpeg (HAVE_FFMPEG undefined)"); |
|
|
|
|
return -1; |
|
|
|
|
@ -191,7 +191,8 @@ struct vc_ctx {
|
|
|
|
|
char src[1024]; |
|
|
|
|
char dst[1024]; |
|
|
|
|
struct UASYNC* ua; |
|
|
|
|
void (*done)(void* arg, int err); |
|
|
|
|
void (*done)(void* arg, int err, const struct video_info* info); |
|
|
|
|
struct video_info result; |
|
|
|
|
void* arg; |
|
|
|
|
|
|
|
|
|
int err; |
|
|
|
|
@ -529,7 +530,7 @@ static void vc_done_trampoline(void* raw, int error) {
|
|
|
|
|
struct vc_ctx* ctx = (struct vc_ctx*)raw; |
|
|
|
|
vc_active_set(0); |
|
|
|
|
vc_progress_set(-1); |
|
|
|
|
if (ctx->done) ctx->done(ctx->arg, error ? error : ctx->err); |
|
|
|
|
if (ctx->done) ctx->done(ctx->arg, error ? error : ctx->err, &ctx->result); |
|
|
|
|
u_free(ctx); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -567,11 +568,12 @@ static void vc_thread_entry(void* raw) {
|
|
|
|
|
vc_cleanup(ctx); |
|
|
|
|
|
|
|
|
|
out: |
|
|
|
|
if (!ctx->err && video_get_info(ctx->dst, &ctx->result)) ctx->err = -1; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int video_transcode_start(struct media_async* owner, struct UASYNC* ua, const char* src, const char* dst, |
|
|
|
|
void (*done)(void* arg, int err), void* arg) { |
|
|
|
|
void (*done)(void* arg, int err, const struct video_info* info), void* arg) { |
|
|
|
|
if (!owner || !ua || !src || !dst || !done) { |
|
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_VIDEO, "video: transcode_start invalid args"); |
|
|
|
|
return -1; |
|
|
|
|
|