Skip to content

Commit 8ed20bb

Browse files
committed
filter: improve none context
1 parent 83f5236 commit 8ed20bb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/QtAV/EncodeFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Q_AV_EXPORT VideoEncodeFilter : public VideoFilter
7676
DPTR_DECLARE_PRIVATE(VideoEncodeFilter)
7777
public:
7878
VideoEncodeFilter(QObject* parent = 0);
79-
bool isSupported(VideoFilterContext::Type) const Q_DECL_OVERRIDE { return true;}
79+
bool isSupported(VideoFilterContext::Type t) const Q_DECL_OVERRIDE { return t == VideoFilterContext::None;}
8080
/*!
8181
* \brief createEncoder
8282
* Destroy old encoder and create a new one. Filter has the ownership.

src/QtAV/LibAVFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class Q_AV_EXPORT LibAVFilterVideo : public VideoFilter, public LibAVFilter
7575
Q_PROPERTY(QStringList filters READ filters)
7676
public:
7777
LibAVFilterVideo(QObject *parent = 0);
78-
bool isSupported(VideoFilterContext::Type) const Q_DECL_OVERRIDE { return true;}
78+
bool isSupported(VideoFilterContext::Type t) const Q_DECL_OVERRIDE { return t == VideoFilterContext::None;}
7979
QStringList filters() const; //the same as LibAVFilter::videoFilters
8080
Q_SIGNALS:
8181
void optionsChanged();

src/filter/Filter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ bool VideoFilter::prepareContext(VideoFilterContext *&ctx, Statistics *statistic
145145
DPTR_D(VideoFilter);
146146
if (!ctx || !isSupported(ctx->type())) {
147147
//qDebug("no context: %p, or context type %d is not supported", ctx, ctx? ctx->type() : 0);
148-
return false;
148+
return isSupported(VideoFilterContext::None);
149149
}
150150
if (!d.context || d.context->type() != ctx->type()) {
151151
VideoFilterContext* c = VideoFilterContext::create(ctx->type());//each filter has it's own context instance, but share the common parameters

0 commit comments

Comments
 (0)