ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Protected Member Functions | List of all members
ImageResizer.Plugins.FFmpeg.FFmpegPlugin Class Reference
Inheritance diagram for ImageResizer.Plugins.FFmpeg.FFmpegPlugin:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.FFmpeg.FFmpegPlugin:
Collaboration graph
[legend]

Public Member Functions

IPlugin Install (Config c)
 Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc. More...
 
bool Uninstall (Config c)
 Uninstalls the plugin. Should reverse all changes made during Install More...
 
IEnumerable< string > GetSupportedFileExtensions ()
 If the plugin adds support for new file extensions (such as "psd"), they should be returned by this method. More...
 
bool FileExists (string virtualPath, NameValueCollection queryString)
 Returns true if the specified file and querystring indicate a PSD composition request More...
 
IVirtualFile GetFile (string virtualPath, NameValueCollection queryString)
 Returns a virtual file instance for the specified specified file and querystring, if they indicate a PSD composition request. Otherwise, null is returned. More...
 
IEnumerable< string > GetSupportedQuerystringKeys ()
 If the plugin reads any values from the querystring, the names of the keys should be specified here. This information is required so that the HttpModule knows when to handle an image request. More...
 
Stream GetFrameStream (string virtualPath, NameValueCollection queryString)
 

Protected Member Functions

bool IsPathVideoFileWithOurCommands (string virtualPath, NameValueCollection queryString=null)
 True if the file is a .psd.jpeg, .psd.png, etc file. More...
 

Detailed Description

Definition at line 14 of file FFmpegPlugin.cs.

Member Function Documentation

bool ImageResizer.Plugins.FFmpeg.FFmpegPlugin.FileExists ( string  virtualPath,
NameValueCollection  queryString 
)
inline

Returns true if the specified file and querystring indicate a PSD composition request

Parameters
virtualPath
queryString
Returns

Implements ImageResizer.Plugins.IVirtualImageProvider.

Definition at line 45 of file FFmpegPlugin.cs.

46  {
47  return IsPathVideoFileWithOurCommands(virtualPath, queryString) && c.Pipeline.FileExists(virtualPath, new NameValueCollection());
48  }
bool IsPathVideoFileWithOurCommands(string virtualPath, NameValueCollection queryString=null)
True if the file is a .psd.jpeg, .psd.png, etc file.
Definition: FFmpegPlugin.cs:76
IVirtualFile ImageResizer.Plugins.FFmpeg.FFmpegPlugin.GetFile ( string  virtualPath,
NameValueCollection  queryString 
)
inline

Returns a virtual file instance for the specified specified file and querystring, if they indicate a PSD composition request. Otherwise, null is returned.

Parameters
virtualPath
queryString
Returns

Implements ImageResizer.Plugins.IVirtualImageProvider.

Definition at line 57 of file FFmpegPlugin.cs.

58  {
59  if (IsPathVideoFileWithOurCommands(virtualPath, queryString) && c.Pipeline.FileExists(virtualPath, new NameValueCollection()))
60  return new FFmpegVirtualFile(virtualPath, queryString, this);
61  else
62  return null;
63  }
bool FileExists(string virtualPath, NameValueCollection queryString)
Returns true if (a) A registered IVirtualImageProvider says it exists, or (b) if the VirtualPathProvi...
PipelineConfig Pipeline
Access and modify settings related to the HttpModule pipline. Register URL rewriting hooks...
Definition: Config.cs:93
bool IsPathVideoFileWithOurCommands(string virtualPath, NameValueCollection queryString=null)
True if the file is a .psd.jpeg, .psd.png, etc file.
Definition: FFmpegPlugin.cs:76
IEnumerable<string> ImageResizer.Plugins.FFmpeg.FFmpegPlugin.GetSupportedFileExtensions ( )
inline

If the plugin adds support for new file extensions (such as "psd"), they should be returned by this method.

Returns

Implements ImageResizer.Plugins.IFileExtensionPlugin.

Definition at line 34 of file FFmpegPlugin.cs.

35  {
36  return new string[] {"avi", "mp4","avchd","flv","fla","swf","mpg","mpeg","mpe","mov","m4v","mkv","wmv" };
37  }
IEnumerable<string> ImageResizer.Plugins.FFmpeg.FFmpegPlugin.GetSupportedQuerystringKeys ( )
inline

If the plugin reads any values from the querystring, the names of the keys should be specified here. This information is required so that the HttpModule knows when to handle an image request.

Returns

Implements ImageResizer.Plugins.IQuerystringPlugin.

Definition at line 66 of file FFmpegPlugin.cs.

67  {
68  return new string[] {"ffmpeg.seconds" ,"ffmpeg.percent","ffmpeg.skipblankframes" };
69  }
IPlugin ImageResizer.Plugins.FFmpeg.FFmpegPlugin.Install ( Config  c)
inline

Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc.

Parameters
c
Returns

Implements ImageResizer.Plugins.IPlugin.

Definition at line 19 of file FFmpegPlugin.cs.

20  {
21  this.c = c;
22  c.Plugins.add_plugin(this);
23  return this;
24  }
bool ImageResizer.Plugins.FFmpeg.FFmpegPlugin.IsPathVideoFileWithOurCommands ( string  virtualPath,
NameValueCollection  queryString = null 
)
inlineprotected

True if the file is a .psd.jpeg, .psd.png, etc file.

Definition at line 76 of file FFmpegPlugin.cs.

77  {
78  var exts = GetSupportedFileExtensions();
79 
80  var full = ImageResizer.Util.PathUtils.GetFullExtension(virtualPath).ToLowerInvariant().TrimStart('.');
81  var parts = full.Split('.');
82  if (parts.Length < 1) return false;
83  //Only accept the file if our querystring is on it.
84  if (exts.Contains(parts[parts.Length - 1]))
85  {
86  if (queryString == null) queryString = c.Pipeline.ModifiedQueryString;
87  foreach (string s in GetSupportedQuerystringKeys())
88  {
89  if (!string.IsNullOrEmpty(queryString[s])) return true;
90  }
91  }
92  return false;
93  }
IEnumerable< string > GetSupportedQuerystringKeys()
If the plugin reads any values from the querystring, the names of the keys should be specified here...
Definition: FFmpegPlugin.cs:66
IEnumerable< string > GetSupportedFileExtensions()
If the plugin adds support for new file extensions (such as &quot;psd&quot;), they should be returned by this m...
Definition: FFmpegPlugin.cs:34
bool ImageResizer.Plugins.FFmpeg.FFmpegPlugin.Uninstall ( Config  c)
inline

Uninstalls the plugin. Should reverse all changes made during Install

Parameters
c
Returns

Implements ImageResizer.Plugins.IPlugin.

Definition at line 26 of file FFmpegPlugin.cs.

27  {
28  c.Plugins.remove_plugin(this);
29  return true;
30  }

The documentation for this class was generated from the following file: