@@ -2,6 +2,7 @@ package cos
22
33import (
44 "context"
5+ "encoding/json"
56 "encoding/xml"
67 "errors"
78 "fmt"
@@ -57,30 +58,38 @@ type Container struct {
5758
5859// Video TODO
5960type Video struct {
60- Codec string `xml:"Codec"`
61- Width string `xml:"Width,omitempty"`
62- Height string `xml:"Height,omitempty"`
63- Fps string `xml:"Fps,omitempty"`
64- Remove string `xml:"Remove,omitempty"`
65- Profile string `xml:"Profile,omitempty"`
66- Bitrate string `xml:"Bitrate,omitempty"`
67- Crf string `xml:"Crf,omitempty"`
68- Gop string `xml:"Gop,omitempty"`
69- Preset string `xml:"Preset,omitempty"`
70- Bufsize string `xml:"Bufsize,omitempty"`
71- Maxrate string `xml:"Maxrate,omitempty"`
72- HlsTsTime string `xml:"HlsTsTime,omitempty"`
73- DashSegment string `xml:"DashSegment,omitempty"`
74- Pixfmt string `xml:"Pixfmt,omitempty"`
75- LongShortMode string `xml:"LongShortMode,omitempty"`
76- Rotate string `xml:"Rotate,omitempty"`
77- AnimateOnlyKeepKeyFrame string `xml:"AnimateOnlyKeepKeyFrame,omitempty"`
78- AnimateTimeIntervalOfFrame string `xml:"AnimateTimeIntervalOfFrame,omitempty"`
79- AnimateFramesPerSecond string `xml:"AnimateFramesPerSecond,omitempty"`
80- Quality string `xml:"Quality,omitempty"`
81- Roi string `xml:"Roi,omitempty"`
82- Crop string `xml:"Crop,omitempty"`
83- Interlaced string `xml:"Interlaced,omitempty"`
61+ Codec string `xml:"Codec"`
62+ Width string `xml:"Width,omitempty"`
63+ Height string `xml:"Height,omitempty"`
64+ Fps string `xml:"Fps,omitempty"`
65+ Remove string `xml:"Remove,omitempty"`
66+ Profile string `xml:"Profile,omitempty"`
67+ Bitrate string `xml:"Bitrate,omitempty"`
68+ Crf string `xml:"Crf,omitempty"`
69+ Gop string `xml:"Gop,omitempty"`
70+ Preset string `xml:"Preset,omitempty"`
71+ Bufsize string `xml:"Bufsize,omitempty"`
72+ Maxrate string `xml:"Maxrate,omitempty"`
73+ HlsTsTime string `xml:"HlsTsTime,omitempty"`
74+ DashSegment string `xml:"DashSegment,omitempty"`
75+ Pixfmt string `xml:"Pixfmt,omitempty"`
76+ LongShortMode string `xml:"LongShortMode,omitempty"`
77+ Rotate string `xml:"Rotate,omitempty"`
78+ AnimateOnlyKeepKeyFrame string `xml:"AnimateOnlyKeepKeyFrame,omitempty"`
79+ AnimateTimeIntervalOfFrame string `xml:"AnimateTimeIntervalOfFrame,omitempty"`
80+ AnimateFramesPerSecond string `xml:"AnimateFramesPerSecond,omitempty"`
81+ Quality string `xml:"Quality,omitempty"`
82+ Roi string `xml:"Roi,omitempty"`
83+ Crop string `xml:"Crop,omitempty"`
84+ Interlaced string `xml:"Interlaced,omitempty"`
85+ ColorParam * VideoColorParam `xml:"ColorParam,omitempty"`
86+ }
87+
88+ type VideoColorParam struct {
89+ ColorRange string `xml:"ColorRange,omitempty"`
90+ ColorSpace string `xml:"ColorSpace,omitempty"`
91+ ColorTrc string `xml:"ColorTrc,omitempty"`
92+ ColorPrimaries string `xml:"ColorPrimaries,omitempty"`
8493}
8594
8695// TranscodeProVideo TODO
@@ -265,6 +274,7 @@ type ConcatFragment struct {
265274 StartTime string `xml:"StartTime,omitempty"`
266275 EndTime string `xml:"EndTime,omitempty"`
267276 FragmentIndex string `xml:"FragmentIndex,omitempty"`
277+ Duration string `xml:"Duration,omitempty"`
268278}
269279
270280// ConcatTemplate TODO
@@ -1173,6 +1183,23 @@ func (s *CIService) DescribeASRProcessQueues(ctx context.Context, opt *DescribeM
11731183 return & res , resp , err
11741184}
11751185
1186+ type DescribeFielProcessQueuesOptions DescribeMediaProcessQueuesOptions
1187+ type DescribeFileProcessQueuesResult DescribeMediaProcessQueuesResult
1188+
1189+ // DescribeFileProcessQueues TODO
1190+ func (s * CIService ) DescribeFileProcessQueues (ctx context.Context , opt * DescribeFielProcessQueuesOptions ) (* DescribeFileProcessQueuesResult , * Response , error ) {
1191+ var res DescribeFileProcessQueuesResult
1192+ sendOpt := sendOptions {
1193+ baseURL : s .client .BaseURL .CIURL ,
1194+ uri : "/file_queue" ,
1195+ optQuery : opt ,
1196+ method : http .MethodGet ,
1197+ result : & res ,
1198+ }
1199+ resp , err := s .client .send (ctx , & sendOpt )
1200+ return & res , resp , err
1201+ }
1202+
11761203// UpdateMediaProcessQueueOptions TODO
11771204type UpdateMediaProcessQueueOptions struct {
11781205 XMLName xml.Name `xml:"Request"`
@@ -1582,11 +1609,15 @@ type NotifyConfig struct {
15821609
15831610// ExtFilter TODO
15841611type ExtFilter struct {
1585- State string `xml:"State,omitempty"`
1586- Audio string `xml:"Audio,omitempty"`
1587- Custom string `xml:"Custom,omitempty"`
1588- CustomExts string `xml:"CustomExts,omitempty"`
1589- AllFile string `xml:"AllFile,omitempty"`
1612+ State string `xml:"State,omitempty"`
1613+ Video string `xml:"Video,omitempty"`
1614+ Audio string `xml:"Audio,omitempty"`
1615+ Image string `xml:"Image,omitempty"`
1616+ ContentType string `xml:"ContentType,omitempty"`
1617+ Custom string `xml:"Custom,omitempty"`
1618+ CustomExts string `xml:"CustomExts,omitempty"`
1619+ AllFile string `xml:"AllFile,omitempty"`
1620+ AutoContentType []string `xml:"AutoContentType,omitempty"`
15901621}
15911622
15921623// NodeInput TODO
@@ -3641,3 +3672,40 @@ type ImageInspectAutoProcessResult struct {
36413672 Code string `xml:"Code,omitempty"`
36423673 Message string `xml:"Message,omitempty"`
36433674}
3675+
3676+ type CosImageInspectOptions struct {
3677+ }
3678+
3679+ // CosImageInspectProcessResult 黑产检测同步接口结果
3680+ type CosImageInspectProcessResult struct {
3681+ PicSize int `json:"picSize,omitempty"`
3682+ PicType string `json:"picType,omitempty"`
3683+ Suspicious bool `json:"suspicious,omitempty"`
3684+ SuspiciousBeginByte int `json:"suspiciousBeginByte,omitempty"`
3685+ SuspiciousEndByte int `json:"suspiciousEndByte,omitempty"`
3686+ SuspiciousSize int `json:"suspiciousSize,omitempty"`
3687+ SuspiciousType string `json:"suspiciousType,omitempty"`
3688+ }
3689+
3690+ // Write 回包是json格式序列化
3691+ func (w * CosImageInspectProcessResult ) Write (p []byte ) (n int , err error ) {
3692+ err = json .Unmarshal (p , w )
3693+ if err != nil {
3694+ return 0 , err
3695+ }
3696+ return len (p ), nil
3697+ }
3698+
3699+ // ImageInspect 黑产检查同步接口
3700+ func (s * CIService ) CosImageInspect (ctx context.Context , name string , opt * CosImageInspectOptions ) (* CosImageInspectProcessResult , * Response , error ) {
3701+ var res CosImageInspectProcessResult
3702+ sendOpt := sendOptions {
3703+ baseURL : s .client .BaseURL .BucketURL ,
3704+ uri : "/" + encodeURIComponent (name ) + "?ci-process=ImageInspect" ,
3705+ optQuery : opt ,
3706+ method : http .MethodGet ,
3707+ result : & res ,
3708+ }
3709+ resp , err := s .client .send (ctx , & sendOpt )
3710+ return & res , resp , err
3711+ }
0 commit comments