@@ -57,7 +57,8 @@ void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
ref->pts, ref->pkt_pos);
- if (ref->width) {
+ switch(ref->type) {
+ case AVMEDIA_TYPE_VIDEO:
ff_tlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
ref->sample_aspect_ratio.num, ref->sample_aspect_ratio.den,
ref->width, ref->height,
@@ -65,12 +66,13 @@ void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
ref->top_field_first ? 'T' : 'B', /* Top / Bottom */
ref->key_frame,
av_get_picture_type_char(ref->pict_type));
- }
- if (ref->nb_samples) {
+ break;
+ case AVMEDIA_TYPE_AUDIO:
ff_tlog(ctx, " cl:%"PRId64"d n:%d r:%d",
ref->channel_layout,
ref->nb_samples,
ref->sample_rate);
+ break;
}
ff_tlog(ctx, "]%s", end ? "\n" : "");
@@ -314,6 +314,8 @@ static int filter_link_check_formats(void *log, AVFilterLink *link, AVFilterForm
return ret;
break;
+ case AVMEDIA_TYPE_SUBTITLE:
+ return 0;
default:
av_assert0(!"reached");
}
@@ -444,6 +446,9 @@ static int query_formats(AVFilterGraph *graph, void *log_ctx)
if (!link)
continue;
+ if (link->type == AVMEDIA_TYPE_SUBTITLE)
+ continue;
+
neg = ff_filter_get_negotiation(link);
av_assert0(neg);
for (neg_step = 1; neg_step < neg->nb_mergers; neg_step++) {
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavcodec/avcodec.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
@@ -430,6 +431,12 @@ int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout)
return 0;
}
+int ff_add_subtitle_type(AVFilterFormats **avff, int64_t fmt)
+{
+ ADD_FORMAT(avff, fmt, ff_formats_unref, int, formats, nb_formats);
+ return 0;
+}
+
AVFilterFormats *ff_all_formats(enum AVMediaType type)
{
AVFilterFormats *ret = NULL;
@@ -443,6 +450,13 @@ AVFilterFormats *ff_all_formats(enum AVMediaType type)
return NULL;
fmt++;
}
+ } else if (type == AVMEDIA_TYPE_SUBTITLE) {
+ if (ff_add_subtitle_type(&ret, AV_SUBTITLE_FMT_BITMAP) < 0)
+ return NULL;
+ if (ff_add_subtitle_type(&ret, AV_SUBTITLE_FMT_ASS) < 0)
+ return NULL;
+ if (ff_add_subtitle_type(&ret, AV_SUBTITLE_FMT_TEXT) < 0)
+ return NULL;
}
return ret;
@@ -180,6 +180,9 @@ int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts);
av_warn_unused_result
int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout);
+av_warn_unused_result
+int ff_add_subtitle_type(AVFilterFormats **avff, int64_t fmt);
+
/**
* Add *ref as a new reference to f.
*/