From 8ef8f52ff7c747d6844bcf969db5b9336055abcc Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 28 Aug 2014 10:09:53 -0700 Subject: [PATCH] win-dshow: Change a few functions to static/inline --- plugins/win-dshow/win-dshow.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index 5e39ddaa3..319424d1c 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -107,13 +107,13 @@ static long long FrameRateInterval(const VideoInfo &cap, min(desired_interval, cap.maxInterval); } -void encode_dstr(struct dstr *str) +static inline void encode_dstr(struct dstr *str) { dstr_replace(str, "#", "#22"); dstr_replace(str, ":", "#3A"); } -void decode_dstr(struct dstr *str) +static inline void decode_dstr(struct dstr *str) { dstr_replace(str, "#3A", ":"); dstr_replace(str, "#22", "#"); @@ -239,13 +239,13 @@ static inline bool ConvertRes(int &cx, int &cy, const char *res) return sscanf(res, "%dx%d", &cx, &cy) == 2; } -static bool FormatMatches(VideoFormat left, VideoFormat right) +static inline bool FormatMatches(VideoFormat left, VideoFormat right) { return left == VideoFormat::Any || right == VideoFormat::Any || left == right; } -static bool ResolutionValid(string res, int &cx, int &cy) +static inline bool ResolutionValid(string res, int &cx, int &cy) { if (!res.size()) return false; @@ -254,12 +254,12 @@ static bool ResolutionValid(string res, int &cx, int &cy) } template -static bool CapsMatch(const VideoInfo &info, F&& f, Fs ... fs) +static inline bool CapsMatch(const VideoInfo &info, F&& f, Fs ... fs) { return f(info) && CapsMatch(info, fs ...); } -static bool CapsMatch(const VideoInfo&) +static inline bool CapsMatch(const VideoInfo&) { return true; } @@ -275,16 +275,16 @@ static bool CapsMatch(const VideoDevice &dev, F ... fs) return any_of(begin(dev.caps), end(dev.caps), matcher); } -bool MatcherMatchVideoFormat(VideoFormat format, bool &did_match, - const VideoInfo &info) +static inline bool MatcherMatchVideoFormat(VideoFormat format, + bool &did_match, const VideoInfo &info) { bool match = FormatMatches(format, info.format); did_match = did_match || match; return match; } -bool MatcherClosestFrameRateSelector(long long interval, long long &best_match, - const VideoInfo &info) +static inline bool MatcherClosestFrameRateSelector(long long interval, + long long &best_match, const VideoInfo &info) { long long current = FrameRateInterval(info, interval); if (llabs(interval - best_match) > llabs(interval - current))