Go to the documentation of this file.
11 #ifdef LIBAV_TRANSCODE
40 timecode, pd_array, NULL, NULL);
50 boolean transcode_prep(
void) {
60 d_print(
_(
"Plugin %s not found.\n"), TRANSCODE_PLUGIN_NAME);
74 boolean transcode_get_params(
char **fnameptr) {
76 LiVESList *retvals = NULL;
79 LiVESResponseType resp;
81 if (!*fnameptr) *fnameptr = lives_build_filename(
mainw->
vid_save_dir, DEF_TRANSCODE_FILENAME, NULL);
105 }
while (resp == LIVES_RESPONSE_RETRY);
110 if (resp == LIVES_RESPONSE_CANCEL) {
144 #define COUNT_CHKVAL 100
146 boolean transcode_clip(
int start,
int end,
boolean internal,
char *def_pname) {
148 weed_plant_t *frame_layer = NULL;
152 float **fltbuf = NULL;
155 const char *img_ext = NULL;
157 char *msg = NULL, *pname = NULL;
158 double spf = 0., ospf;
160 boolean audio =
FALSE;
161 boolean swap_endian =
FALSE;
164 boolean needs_dprint =
FALSE;
165 boolean manage_ds =
FALSE;
168 int asigned = 0, aendian = 0;
170 int interp = LIVES_INTERP_FAST;
171 int width, height, pwidth, pheight;
172 int tgamma = WEED_GAMMA_SRGB;
177 if (def_pname) pname = lives_strdup(def_pname);
180 if (!transcode_prep())
return FALSE;
182 if (!transcode_get_params(&pname))
goto tr_err2;
201 int in_arate =
cfile->arate;
207 ospf = spf = (double)(
cfile->arate) /
cfile->fps;
223 if (
cfile->asampsize > 8) {
226 else swap_endian =
FALSE;
240 for (i = 0; i <
cfile->achans; i++) {
241 fltbuf[i] = (
float *)
lives_malloc((
int)(spf + 1.) *
cfile->achans *
sizeof(float));
246 if (
cfile->asampsize == 8) {
261 THREADVAR(rowstride_alignment_hint) = 16;
281 width = pwidth = vpp->
fwidth;
282 height = pheight = vpp->
fheight;
284 width =
cfile->hsize;
285 height =
cfile->vsize;
302 for (i = start; !end || i <= end; i++) {
304 if (count++ == COUNT_CHKVAL)
327 #ifdef MATCH_PALETTES
347 if (
THREADVAR(read_failed) || in_bytes < 0) {
357 nsamps = in_bytes /
cfile->achans / (
cfile->asampsize >> 3);
359 for (j = 0; j <
cfile->achans; j++) {
361 if (
cfile->asampsize == 16) {
390 spf = ospf + (spf - (double)((
int)spf));
405 if (((width ^ pwidth) >> 2) || ((height ^ pheight) >> 1)) {
411 tgamma = WEED_GAMMA_LINEAR;
414 tgamma = WEED_GAMMA_BT709;
429 WEED_SEED_BOOLEAN,
"PVI", copy_frame_layer, vpp, currticks);
432 if (
error)
goto tr_err;
468 transcode_cleanup(vpp);
int palette
width in pixels, but converted to macropixels for the player
boolean lives_freep(void **ptr)
LiVESList * do_onchange_init(lives_rfx_t *rfx)
LIVES_GLOBAL_INLINE boolean lives_proc_thread_cancelled(lives_proc_thread_t tinfo)
boolean has_audio_filters(lives_af_t af_type)
boolean get_rfx_param_by_name_string(lives_rfx_t *rfx, const char *name, char **return_value)
boolean(* render_audio_frame_float)(float **audio, int nsamps)
_vid_playback_plugin * open_vid_playback_plugin(const char *name, boolean in_use)
LIVES_GLOBAL_INLINE weed_layer_t * weed_layer_new(int layer_type)
char workdir[PATH_MAX]
kept in locale encoding
#define CLIP_AUDIO_FILENAME
_vid_playback_plugin * vpp
video plugin
weed_plant_t * on_rte_apply(weed_layer_t *layer, int opwidth, int opheight, weed_timecode_t tc)
LIVES_GLOBAL_INLINE int weed_layer_get_width(weed_layer_t *layer)
LIVES_GLOBAL_INLINE boolean lives_strcmp(const char *st1, const char *st2)
returns FALSE if strings match
int *(* get_palette_list)(void)
weed_plantptr_t lives_proc_thread_t
lives proc_threads API
volatile boolean transrend_ready
#define SWAP_U_TO_S
sign swapping
boolean set_rfx_param_by_name_string(lives_rfx_t *rfx, const char *name, const char *value, boolean update_visual)
#define TICKS_PER_SECOND_DBL
actually microseconds / 100.
@ CANCEL_KILL
normal - kill background processes working on current clip
LIVES_GLOBAL_INLINE int weed_layer_get_height(weed_layer_t *layer)
@ CANCEL_USER
user pressed stop
boolean check_storage_space(int clipno, boolean is_processing)
LIVES_GLOBAL_INLINE weed_layer_t * weed_layer_nullify_pixel_data(weed_layer_t *layer)
boolean letterbox_layer(weed_layer_t *layer, int nwidth, int nheight, int width, int height, LiVESInterpType interp, int tpal, int tclamp)
int lives_open_buffered_rdonly(const char *pathname)
void param_demarshall(lives_rfx_t *rfx, LiVESList *plist, boolean with_min_max, boolean upd)
void close_vid_playback_plugin(_vid_playback_plugin *vpp)
void rfx_free(lives_rfx_t *rfx)
#define WEED_LAYER_TYPE_VIDEO
void end_threaded_dialog(void)
void threaded_dialog_spin(double fraction)
ssize_t lives_read_buffered(int fd, void *buf, ssize_t count, boolean allow_less)
LIVES_GLOBAL_INLINE boolean weed_palette_is_yuv(int pal)
void weed_apply_audio_effects_rt(weed_layer_t *alayer, weed_timecode_t tc, boolean analysers_only, boolean is_audio_thread)
volatile lives_cancel_t cancelled
LIVES_GLOBAL_INLINE boolean weed_palette_is_rgb(int pal)
float sample_move_d16_float(float *dst, short *src, uint64_t nsamples, uint64_t src_skip, int is_unsigned, boolean rev_endian, float vol)
weed_layer_t * transrend_layer
lives_proc_thread_t lives_proc_thread_create(lives_thread_attr_t attr, lives_funcptr_t func, int return_type, const char *args_fmt,...)
create the specific plant which defines a background task to be run
void rfx_clean_exe(lives_rfx_t *rfx)
void d_print(const char *fmt,...)
#define VPP_CAN_RESIZE
type sepcific caps
void sample_move_d8_d16(short *dst, uint8_t *src, uint64_t nsamples, size_t tbytes, double scale, int nDstChannels, int nSrcChannels, int swap_sign)
LIVES_GLOBAL_INLINE int weed_layer_get_palette(weed_layer_t *layer)
boolean(* init_screen)(int width, int height, boolean fullscreen, uint64_t window_id, int argc, char **argv)
void d_print_failed(void)
int lives_close_buffered(int fd)
LIVES_GLOBAL_INLINE ticks_t q_gint64(ticks_t in, double fps)
error("LSD_RANDFUNC(ptr, size) must be defined")
boolean check_layer_ready(weed_layer_t *layer)
block until layer pixel_data is ready.
LIVES_GLOBAL_INLINE weed_layer_t * weed_layer_set_audio_data(weed_layer_t *layer, float **data, int arate, int naudchans, weed_size_t nsamps)
void get_letterbox_sizes(int *pwidth, int *pheight, int *lb_width, int *lb_height, boolean player_can_upscale)
calculate sizes for letterboxing
void do_threaded_dialog(const char *trans_text, boolean has_cancel)
#define lives_strdup_printf(fmt,...)
weed_plant_t weed_layer_t
void lives_list_free_all(LiVESList **)
char * get_mountpoint_for(const char *dir)
lives_proc_thread_t transrend_proc
#define LIVES_THRDATTR_NONE
weed_layer_t * weed_layer_copy(weed_layer_t *dlayer, weed_layer_t *slayer)
copy source layer slayer to dest layer dlayer
void pull_frame_threaded(weed_layer_t *layer, const char *img_ext, weed_timecode_t tc, int width, int height)
_future_prefs * future_prefs
LIVES_GLOBAL_INLINE void ** weed_layer_get_pixel_data(weed_layer_t *layer, int *nplanes)
#define lives_vol_from_linear(vol)
boolean suppress_dprint
tidy up, e.g. by blocking "switched to file..." and "closed file..." messages
video playback plugin window - fixed part
char vpp_name[64]
new video playback plugin
void(* exit_screen)(uint16_t mouse_x, uint16_t mouse_y)
#define WEED_LAYER_TYPE_AUDIO
off_t lives_lseek_buffered_rdonly(int fd, off_t offset)
const char * get_image_ext_for_type(lives_img_type_t imgtype)
LIVES_GLOBAL_INLINE weed_layer_t * weed_layer_set_palette_yuv(weed_layer_t *layer, int palette, int clamping, int sampling, int subspace)
void d_print_enough(int frames)
boolean convert_layer_palette_full(weed_layer_t *layer, int outpl, int oclamping, int osampling, int osubspace, int tgamma)
convert the palette of a layer
boolean letterbox
playback with letterbox
boolean resize_layer(weed_layer_t *layer, int width, int height, LiVESInterpType interp, int opal_hint, int oclamp_hint)
resize a layer
@ LIVES_INTENTION_TRANSCODE
LIVES_GLOBAL_INLINE float ** weed_layer_get_audio_data(weed_layer_t *layer, int *naudchans)
LIVES_GLOBAL_INLINE weed_layer_t * weed_layer_free(weed_layer_t *layer)
frees pixel_data for a layer, then the layer itself
void *(* lives_funcptr_t)(void *)
_vppaw * on_vpp_advanced_clicked(LiVESButton *button, livespointer user_data)
boolean(* init_audio)(int in_sample_rate, int in_nchans, int argc, char **argv)
boolean compact_rowstrides(weed_layer_t *layer)
void do_read_failed_error_s(const char *s, const char *addinfo)
char vid_save_dir[PATH_MAX]
@ CANCEL_SOFT
just cancel in GUI (for keep, etc)
LIVES_GLOBAL_INLINE int lives_proc_thread_join_boolean(lives_proc_thread_t tinfo)
boolean(* set_palette)(int palette)
#define lives_nanosleep_until_nonzero(condition)
LIVES_GLOBAL_INLINE boolean gamma_convert_layer(int gamma_type, weed_layer_t *layer)
boolean(* set_fps)(double fps)
lives_cancel_type_t cancel_type
boolean(* render_frame)(int hsize, int vsize, ticks_t timecode, void **pixel_data, void **return_data, weed_plant_t **play_params)
LIVES_GLOBAL_INLINE int weed_palette_get_pixels_per_macropixel(int pal)
int(* set_yuv_palette_clamping)(int clamping_type)