Skip to content

Commit 7e9078c

Browse files
committed
support chaining calls
1 parent fafc731 commit 7e9078c

13 files changed

+838
-4
lines changed

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
#ignore thumbnails created by windows
3+
Thumbs.db
4+
#Ignore files build by Visual Studio
5+
*.obj
6+
*.exe
7+
*.pdb
8+
*.user
9+
*.aps
10+
*.pch
11+
*.vspscc
12+
*_i.c
13+
*_p.c
14+
*.ncb
15+
*.suo
16+
*.tlb
17+
*.tlh
18+
*.bak
19+
*.cache
20+
*.ilk
21+
*.log
22+
[Bb]in
23+
[Dd]ebug*/
24+
*.lib
25+
*.sbr
26+
obj/
27+
[Rr]elease*/
28+
_ReSharper*/
29+
[Tt]est[Rr]esult*

Qiniu/Qiniu.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<DefineConstants>DEBUG;TRACE</DefineConstants>
2121
<ErrorReport>prompt</ErrorReport>
2222
<WarningLevel>4</WarningLevel>
23+
<DocumentationFile>..\bin\Qiniu.XML</DocumentationFile>
2324
</PropertyGroup>
2425
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2526
<DebugType>pdbonly</DebugType>
@@ -48,7 +49,7 @@
4849
<Reference Include="System.Data" />
4950
<Reference Include="System.Xml" />
5051
</ItemGroup>
51-
<ItemGroup>
52+
<ItemGroup>
5253
<Compile Include="Http\HttpCode.cs" />
5354
<Compile Include="Http\HttpFileType.cs" />
5455
<Compile Include="Http\HttpFormFile.cs" />
@@ -57,7 +58,7 @@
5758
<Compile Include="Storage\Model\CdnRefreshResult.cs" />
5859
<Compile Include="Common\Config.cs" />
5960
<Compile Include="Common\Zone.cs" />
60-
<Compile Include="Common\ZoneHelper.cs" />
61+
<Compile Include="Common\ZoneHelper.cs" />
6162
<Compile Include="Http\CancellationSignal.cs" />
6263
<Compile Include="Http\CompletionHandler.cs" />
6364
<Compile Include="Http\HttpResult.cs" />
@@ -85,9 +86,16 @@
8586
<Compile Include="Storage\UploadOptions.cs" />
8687
<Compile Include="Storage\UpProgressHandler.cs" />
8788
<Compile Include="Util\Auth.cs" />
89+
<Compile Include="Util\IPersistentOps.cs" />
90+
<Compile Include="Util\IPersistentOpsAvthumb.cs" />
91+
<Compile Include="Util\IPersistentOpsAvthumbForAudio.cs" />
92+
<Compile Include="Util\IPersistentOpsAvthumbForVideo.cs" />
8893
<Compile Include="Util\Mac.cs" />
8994
<Compile Include="Util\CRC32.cs" />
95+
<Compile Include="Util\PersistentOps.Avthumb.cs" />
96+
<Compile Include="Util\PersistentOps.cs" />
9097
<Compile Include="Util\PutPolicy.cs" />
98+
<Compile Include="Util\PutPolicy.Extension.cs" />
9199
<Compile Include="Util\QETag.cs" />
92100
<Compile Include="Util\StringUtils.cs" />
93101
</ItemGroup>

Qiniu/Util/IPersistentOps.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
namespace Qiniu.Util
3+
{
4+
/// <summary>
5+
/// 表示该对象是一个预处理操作。
6+
/// </summary>
7+
public interface IPersistentOps
8+
{
9+
/// <summary>
10+
/// 获取操作字符串。
11+
/// </summary>
12+
/// <returns>操作字符串。</returns>
13+
string GetOpsString();
14+
}
15+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
namespace Qiniu.Util
3+
{
4+
/// <summary>
5+
/// 表示该对象是一个音视频转码 (avthumb)操作。
6+
/// </summary>
7+
public interface IPersistentOpsAvthumb : IPersistentOps
8+
{
9+
/// <summary>
10+
/// A/V 封装格式,具体细节请参考支持转换的封装格式。
11+
/// </summary>
12+
string Format { get; }
13+
/// <summary>
14+
/// A/V 指定视频截取的开始时间,单位:秒,支持精确到毫秒,例如3.345s。用于视频截取,从一段视频中截取一段视频。
15+
/// </summary>
16+
double? SeekStart { set; get; }
17+
/// <summary>
18+
/// A/V 指定视频截取的长度,单位:秒,支持精确到毫秒,例如1.500s。用于视频截取,从一段视频中截取一段视频。
19+
/// </summary>
20+
double? Duration { set; get; }
21+
/// <summary>
22+
/// A/V 是否清除文件的metadata,1为清除,0为保留。
23+
/// </summary>
24+
int? StripMeta { set; get; }
25+
/// <summary>
26+
/// 在数据处理命令后用管道符 | 拼接 saveas/<encodedEntryURI> 指令,指示七牛服务器使用EncodedEntryURI格式中指定的 Bucket 与 Key 来保存处理结果。
27+
/// </summary>
28+
string SaveAs { set; get; }
29+
}
30+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
namespace Qiniu.Util
3+
{
4+
/// <summary>
5+
/// 表示该对象是一个音频转码 (avthumb)操作。
6+
/// </summary>
7+
public interface IPersistentOpsAvthumbForAudio : IPersistentOpsAvthumb
8+
{
9+
/// <summary>
10+
/// A 音频码率,单位:比特每秒(bit/s),常用码率:64k,128k,192k,256k,320k等。若指定码率大于原音频码率,则使用原音频码率进行转码。
11+
/// </summary>
12+
string BitRate { set; get; }
13+
/// <summary>
14+
/// A 音频质量,取值范围为0-9(mp3),10-500(aac),仅支持mp3和aac,值越小越高。不能与上述码率参数共用。
15+
/// </summary>
16+
int? AudioQuality { set; get; }
17+
/// <summary>
18+
/// A 音频采样频率,单位:赫兹(Hz),常用采样频率:8000,12050,22050,44100等。
19+
/// </summary>
20+
int? SamplingRate { set; get; }
21+
/// <summary>
22+
/// A 音频编码格式,具体细节请参考支持转换的音频编码格式。
23+
/// </summary>
24+
string AudioCodec { set; get; }
25+
/// <summary>
26+
/// A 设置音频的profile等级,支持:aac_he。注:需配合 libfdk_aac 编码方案使用,如 avthumb/m4a/acodec/libfdk_aac/audioProfile/aac_he。
27+
/// </summary>
28+
string Profile { set; get; }
29+
/// <summary>
30+
/// A 转码成mp3时是否写入xing header,默认1写入,写入会导致 file,afinfo 等命令识别出错误的码率。好处是在需要音频时长、帧数的时候只需要获取header。
31+
/// </summary>
32+
string Xing { set; get; }
33+
/// <summary>
34+
/// A 是否去除音频流,0为保留,1为去除。
35+
/// 默认值为0。
36+
/// </summary>
37+
int? AudioNo { set; get; }
38+
}
39+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
using System;
2+
namespace Qiniu.Util
3+
{
4+
/// <summary>
5+
/// 表示该对象是一个视频转码 (avthumb)操作。
6+
/// </summary>
7+
public interface IPersistentOpsAvthumbForVideo : IPersistentOpsAvthumb
8+
{
9+
/// <summary>
10+
/// V 视频帧率,每秒显示的帧数,单位:赫兹(Hz),常用帧率:24,25,30等,一般用默认值。
11+
/// </summary>
12+
int? FrameRate { set; get; }
13+
/// <summary>
14+
/// V 视频码率,单位:比特每秒(bit/s),常用视频码率:128k,1.25m,5m等。若指定码率大于原视频码率,则使用原视频码率进行转码。
15+
/// </summary>
16+
string VideoBitRate { set; get; }
17+
/// <summary>
18+
/// V 视频编码格式,具体细节请参考支持转换的视频编码格式。
19+
/// </summary>
20+
string VideoCodec { set; get; }
21+
/// <summary>
22+
/// V 字幕编码方案,支持方案:mov_text。该参数仅用于修改带字幕视频的字幕编码。
23+
/// </summary>
24+
string SubtitleCodec { set; get; }
25+
/// <summary>
26+
/// V 添加字幕,支持:srt格式字幕(uft-8编码和和utf-8 BOM编码)、带有字幕的mkv文件、embed(将原视频的字幕流嵌入目标视频)。基于URL安全的base64编码。
27+
/// </summary>
28+
string SubtitleURL { set; get; }
29+
/// <summary>
30+
/// V 指定视频分辨率,格式为<width>x<height>或者预定义值,width 取值范围 [20,3840],height 取值范围 [20,2160]。
31+
/// </summary>
32+
string Resolution { set; get; }
33+
/// <summary>
34+
/// V 配合参数/s/使用,指定为1时,把视频按原始比例缩放到/s/指定的矩形框内,0或者不指定会强制缩放到对应分辨率,可能造成视频变形。
35+
/// </summary>
36+
int? Autoscale { set; get; }
37+
/// <summary>
38+
/// V 该参数为视频在播放器中显示的宽高比,格式为<width>:<height>。例如:取值3:4表示视频在播放器中播放是宽:高=3:4(注:此处取值仅为体现演示效果)。
39+
/// </summary>
40+
string Aspect { set; get; }
41+
/// <summary>
42+
/// V 设置h264的crf值,整数,取值范围[18,28],值越小,画质更清晰。注意:不可与vb共用
43+
/// </summary>
44+
int? H264Crf { set; get; }
45+
/// <summary>
46+
/// V 指定顺时针旋转的度数,可取值为90、180、270、auto,默认为不旋转。
47+
/// </summary>
48+
int? Degree { set; get; }
49+
/// <summary>
50+
/// V 水印图片的源路径,目前仅支持远程路径,需要经过urlsafe_base64_encode。水印具体介绍见视频水印。
51+
/// </summary>
52+
string EncodedRemoteImageUrl { set; get; }
53+
/// <summary>
54+
/// V 视频图片水印位置,存在/wmImage/时生效。
55+
/// </summary>
56+
string Gravity { set; get; }
57+
/// <summary>
58+
/// V 水印文本内容,需要经过urlsafe_base64_encode。
59+
/// </summary>
60+
string EncodedText { set; get; }
61+
/// <summary>
62+
/// V 文本位置(默认NorthEast)
63+
/// </summary>
64+
string GravityText { set; get; }
65+
/// <summary>
66+
/// V 文本字体,需要经过urlsafe_base64_encode,默认为黑体,注意:中文水印必须指定中文字体。
67+
/// </summary>
68+
string Font { set; get; }
69+
/// <summary>
70+
/// V 水印文字颜色,需要经过urlsafe_base64_encode,RGB格式,可以是颜色名称(例如红色)或十六进制(例如#FF0000),参考RGB颜色编码表,默认为黑色。
71+
/// </summary>
72+
string FontColor { set; get; }
73+
/// <summary>
74+
/// V 水印文字大小,单位: 缇,等于1/20磅,默认值0(默认大小)
75+
/// </summary>
76+
int? FontSize { set; get; }
77+
/// <summary>
78+
/// V 是否去除视频流,0为保留,1为去除。
79+
/// 默认值为0。
80+
/// </summary>
81+
int? VideoNo { set; get; }
82+
}
83+
}

0 commit comments

Comments
 (0)