summaryrefslogtreecommitdiffstats
path: root/libhb/work.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2015-10-24 14:06:56 -0700
committerJohn Stebbins <[email protected]>2016-01-21 12:38:42 -0700
commit10ea76c71197b302b10088d93680a4bed4bc6b8e (patch)
tree459b46b16256c39ed34fe1f0a4b9476ec3439871 /libhb/work.c
parentef956e695879c716dc22c96f7f8fa24e3fa5d08c (diff)
libhb: Add libavfilter support and pad filter
New filter types HB_FILTER_AVFILTER and HB_FILTER_PAD. Settings for HB_FILTER_AVFILTER are the same as you would pass to avconv from the command line -vf option, except that we do not support multi-input or multi-output filters. Settings for HB_FILTER_PAD are "width:height:color:x_offset:y_offset". width x height is the size of the output frame after padding. color may be a w3c color name or RGB value (default black). x_offset, y_offset is the position of the video within the padded area (default centered). Any of the values may be omitted or "auto".
Diffstat (limited to 'libhb/work.c')
-rw-r--r--libhb/work.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/libhb/work.c b/libhb/work.c
index 1ed356dd1..6e3195e0b 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -387,12 +387,23 @@ void hb_display_job_info(hb_job_t *job)
hb_log(" + %s (default settings)", filter->name);
if( filter->info )
{
- hb_filter_info_t info;
- filter->info( filter, &info );
- if( info.human_readable_desc[0] )
+ hb_filter_info_t * info;
+
+ info = filter->info(filter);
+ if (info != NULL &&
+ info->human_readable_desc != NULL &&
+ info->human_readable_desc[0] != 0)
{
- hb_log(" + %s", info.human_readable_desc);
+ char * line, * pos = NULL;
+ char * tmp = strdup(info->human_readable_desc);
+ for (line = strtok_r(tmp, "\n", &pos); line != NULL;
+ line = strtok_r(NULL, "\n", &pos))
+ {
+ hb_log(" + %s", line);
+ }
+ free(tmp);
}
+ hb_filter_info_close(&info);
}
}
}
@@ -1146,6 +1157,7 @@ static int sanitize_qsv( hb_job_t * job )
// validated, CPU-based filters
case HB_FILTER_ROTATE:
case HB_FILTER_RENDER_SUB:
+ case HB_FILTER_AVFILTER:
encode_only = 1;
break;
@@ -1244,6 +1256,7 @@ static int sanitize_qsv( hb_job_t * job )
// then, validated filters
case HB_FILTER_ROTATE: // TODO: use Media SDK for this
case HB_FILTER_RENDER_SUB:
+ case HB_FILTER_AVFILTER:
num_cpu_filters++;
break;
@@ -1399,6 +1412,10 @@ static void do_job(hb_job_t *job)
{
hb_filter_init_t init;
+ // Combine HB_FILTER_AVFILTERs that are sequential
+ hb_avfilter_combine(job->list_filter);
+
+ memset(&init, 0, sizeof(init));
init.job = job;
init.pix_fmt = AV_PIX_FMT_YUV420P;
init.geometry.width = title->geometry.width;
@@ -1615,7 +1632,6 @@ static void do_job(hb_job_t *job)
for (i = 0; i < hb_list_count(job->list_filter); i++)
{
hb_filter_object_t * filter = hb_list_item(job->list_filter, i);
-
filter->fifo_in = fifo_in;
filter->fifo_out = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE );
fifo_in = filter->fifo_out;