Skip to content

Commit f501c7d

Browse files
authored
Merge pull request #198 from tencentyun/feature_lilang_d8d6b147
Feature lilang d8d6b147
2 parents aee204c + dbe46a4 commit f501c7d

File tree

18 files changed

+2771
-4646
lines changed

18 files changed

+2771
-4646
lines changed

ci.go

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,30 @@ type UserListInfo struct {
120120
ListResults []UserListResults `xml:",omitempty"`
121121
}
122122

123+
// AuditingMaskInfo 审核马赛克信息
124+
type AuditingMaskInfo struct {
125+
RecordInfo *AuditingMaskRecordInfo `xml:",omitempty"`
126+
LiveInfo *AuditingMaskLiveInfo `xml:",omitempty"`
127+
}
128+
129+
// AuditingMaskInfo 审核马赛克信息
130+
type AuditingMaskRecordInfo struct {
131+
Code string `xml:"Code,omitempty"`
132+
Message string `xml:"Message,omitempty"`
133+
Output *struct {
134+
Region string `xml:"Region,omitempty"`
135+
Bucket string `xml:"Bucket,omitempty"`
136+
Object string `xml:"Object,omitempty"`
137+
} `xml:"Output,omitempty"`
138+
}
139+
140+
// AuditingMaskInfo 审核马赛克信息
141+
type AuditingMaskLiveInfo struct {
142+
StartTime string `xml:"StartTime,omitempty"`
143+
EndTime string `xml:"EndTime,omitempty"`
144+
Output string `xml:"Output,omitempty"`
145+
}
146+
123147
//UserListResults 命中账号黑白名单信息
124148
type UserListResults struct {
125149
ListType *int `xml:",omitempty"`
@@ -234,6 +258,41 @@ type FreezeConf struct {
234258
TeenagerScore string `xml:",omitempty"`
235259
}
236260

261+
// AuditingMask is auto Mask options
262+
type AuditingMask struct {
263+
Images []AuditingMaskImages `xml:",omitempty"`
264+
Audios []AuditingMaskAudios `xml:",omitempty"`
265+
CosOutput *AuditingMaskCosOutput `xml:",omitempty"`
266+
LiveOutput *AuditingMaskLiveOutput `xml:",omitempty"`
267+
}
268+
269+
// AuditingMaskImages 审核马赛克相关参数
270+
type AuditingMaskImages struct {
271+
Label string `xml:",omitempty"`
272+
Type string `xml:",omitempty"`
273+
Url string `xml:",omitempty"`
274+
}
275+
276+
// AuditingMaskAudios 审核马赛克相关参数
277+
type AuditingMaskAudios struct {
278+
Label string `xml:",omitempty"`
279+
Type string `xml:",omitempty"`
280+
}
281+
282+
// AuditingMaskCosOutput 审核马赛克相关参数
283+
type AuditingMaskCosOutput struct {
284+
Region string `xml:"Region,omitempty"`
285+
Bucket string `xml:"Bucket,omitempty"`
286+
Object string `xml:"Object,omitempty"`
287+
Transcode *Transcode `xml:",omitempty"`
288+
}
289+
290+
// AuditingMaskLiveOutput 审核马赛克相关参数
291+
type AuditingMaskLiveOutput struct {
292+
Url string `xml:"Url,omitempty"`
293+
Transcode *Transcode `xml:",omitempty"`
294+
}
295+
237296
// ImageAuditingInputOptions is the option of BatchImageAuditingOptions
238297
type ImageAuditingInputOptions struct {
239298
DataId string `xml:",omitempty"`
@@ -353,6 +412,7 @@ type VideoAuditingJobConf struct {
353412
BizType string `xml:",omitempty"`
354413
DetectContent int `xml:",omitempty"`
355414
Freeze *FreezeConf `xml:",omitempty"`
415+
Mask *AuditingMask `xml:",omitempty"`
356416
}
357417

358418
// PutVideoAuditingJobSnapshot is the snapshot config of VideoAuditingJobConf
@@ -426,6 +486,7 @@ type AuditingJobDetail struct {
426486
Type string `xml:",omitempty"`
427487
ListInfo *UserListInfo `xml:",omitempty"`
428488
ForbidState int `xml:",omitempty"`
489+
MaskInfo *AuditingMaskInfo `xml:",omitempty"`
429490
}
430491

431492
// GetVideoAuditingJobSnapshot is the snapshot result of AuditingJobDetail

ci_media.go

Lines changed: 195 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ import (
1515

1616
// JobInput TODO
1717
type JobInput struct {
18-
Object string `xml:"Object,omitempty"`
19-
Lang string `xml:"Lang,omitempty"`
20-
Type string `xml:"Type,omitempty"`
21-
BasicType string `xml:"BasicType,omitempty"`
18+
Object string `xml:"Object,omitempty"`
19+
Lang string `xml:"Lang,omitempty"`
20+
Type string `xml:"Type,omitempty"`
21+
BasicType string `xml:"BasicType,omitempty"`
22+
CosHeaders []struct {
23+
Key string `xml:"Key"`
24+
Value string `xml:"Value"`
25+
} `xml:"CosHeaders"`
2226
}
2327

2428
// StreamExtract TODO
@@ -128,12 +132,13 @@ type TransConfig struct {
128132

129133
// Transcode TODO
130134
type Transcode struct {
131-
Container *Container `xml:"Container,omitempty"`
132-
Video *Video `xml:"Video,omitempty"`
133-
TimeInterval *TimeInterval `xml:"TimeInterval,omitempty"`
134-
Audio *Audio `xml:"Audio,omitempty"`
135-
TransConfig *TransConfig `xml:"TransConfig,omitempty"`
136-
AudioMix *AudioMix `xml:"AudioMix,omitempty"`
135+
Container *Container `xml:"Container,omitempty"`
136+
Video *Video `xml:"Video,omitempty"`
137+
TimeInterval *TimeInterval `xml:"TimeInterval,omitempty"`
138+
Audio *Audio `xml:"Audio,omitempty"`
139+
TransConfig *TransConfig `xml:"TransConfig,omitempty"`
140+
AudioMix *AudioMix `xml:"AudioMix,omitempty"`
141+
AudioMixArray []AudioMix `xml:"AudioMixArray,omitempty"`
137142
}
138143

139144
// TranscodePro TODO
@@ -711,6 +716,12 @@ type MediaProcessJobOperation struct {
711716
VideoTargetRecResult *VideoTargetRecResult `xml:"VideoTargetRecResult,omitempty"`
712717
SegmentVideoBody *SegmentVideoBody `xml:"SegmentVideoBody,omitempty"`
713718
FreeTranscode string `xml:"FreeTranscode,omitempty"`
719+
PicProcess *PicProcess `xml:"PicProcess,omitempty"`
720+
PicProcessResult *PicProcessResult `xml:"PicProcessResult,omitempty"`
721+
PosterProduction *PosterProduction `xml:"PosterProduction,omitempty"`
722+
SpeechRecognition *SpeechRecognition `xml:"SpeechRecognition,omitempty"`
723+
SpeechRecognitionResult *SpeechRecognitionResult `xml:"SpeechRecognitionResult,omitempty"`
724+
SoundHoundResult *SoundHoundResult `xml:"SoundHoundResult,omitempty"`
714725
}
715726

716727
// CreatePicJobsOptions TODO
@@ -765,6 +776,13 @@ type MediaProcessJobDetail struct {
765776
QueueId string `xml:"QueueId,omitempty"`
766777
Input *JobInput `xml:"Input,omitempty"`
767778
Operation *MediaProcessJobOperation `xml:"Operation,omitempty"`
779+
SubTag string `xml:"SubTag,omitempty"`
780+
Workflow []struct {
781+
Name string `xml:"Name,omitempty"`
782+
RunId string `xml:"RunId,omitempty"`
783+
WorkflowId string `xml:"WorkflowId,omitempty"`
784+
WorkflowName string `xml:"WorkflowName,omitempty"`
785+
} `xml:"Workflow"`
768786
}
769787

770788
// CreatePicJobsResult TODO
@@ -1173,6 +1191,9 @@ type DescribeAIProcessBucketsOptions DescribeMediaProcessBucketsOptions
11731191
// DescribeASRProcessBucketsOptions TODO
11741192
type DescribeASRProcessBucketsOptions DescribeMediaProcessBucketsOptions
11751193

1194+
// DescribeFileProcessBucketsOptions TODO
1195+
type DescribeFileProcessBucketsOptions DescribeMediaProcessBucketsOptions
1196+
11761197
// DescribeMediaProcessBucketsOptions TODO
11771198
type DescribeMediaProcessBucketsOptions struct {
11781199
Regions string `url:"regions,omitempty"`
@@ -1222,6 +1243,16 @@ type DescribeASRProcessBucketsResult struct {
12221243
MediaBucketList []MediaProcessBucket `xml:"AsrBucketList,omitempty"`
12231244
}
12241245

1246+
// DescribeFileProcessBucketsResult TODO
1247+
type DescribeFileProcessBucketsResult struct {
1248+
XMLName xml.Name `xml:"Response"`
1249+
RequestId string `xml:"RequestId,omitempty"`
1250+
TotalCount int `xml:"TotalCount,omitempty"`
1251+
PageNumber int `xml:"PageNumber,omitempty"`
1252+
PageSize int `xml:"PageSize,omitempty"`
1253+
FileBucketList []MediaProcessBucket `xml:"FileBucketList,omitempty"`
1254+
}
1255+
12251256
// MediaProcessBucket TODO
12261257
type MediaProcessBucket struct {
12271258
Name string `xml:"Name,omitempty"`
@@ -1287,6 +1318,20 @@ func (s *CIService) DescribeASRProcessBuckets(ctx context.Context, opt *Describe
12871318
return &res, resp, err
12881319
}
12891320

1321+
// DescribeFileProcessBuckets TODO
1322+
func (s *CIService) DescribeFileProcessBuckets(ctx context.Context, opt *DescribeFileProcessBucketsOptions) (*DescribeFileProcessBucketsResult, *Response, error) {
1323+
var res DescribeFileProcessBucketsResult
1324+
sendOpt := sendOptions{
1325+
baseURL: s.client.BaseURL.CIURL,
1326+
uri: "/file_bucket",
1327+
optQuery: opt,
1328+
method: http.MethodGet,
1329+
result: &res,
1330+
}
1331+
resp, err := s.client.send(ctx, &sendOpt)
1332+
return &res, resp, err
1333+
}
1334+
12901335
// GetMediaInfoResult TODO
12911336
type GetMediaInfoResult struct {
12921337
XMLName xml.Name `xml:"Response"`
@@ -1327,7 +1372,6 @@ type GenerateMediaInfoOptions struct {
13271372
// GenerateMediaInfo TODO
13281373
// 生成媒体信息接口,支持大文件,耗时较大请求
13291374
func (s *CIService) GenerateMediaInfo(ctx context.Context, opt *GenerateMediaInfoOptions) (*GetMediaInfoResult, *Response, error) {
1330-
13311375
var res GetMediaInfoResult
13321376
sendOpt := sendOptions{
13331377
baseURL: s.client.BaseURL.CIURL,
@@ -1580,7 +1624,12 @@ type WorkflowNodeCondition struct {
15801624

15811625
// SegmentVideoBody TODO
15821626
type SegmentVideoBody struct {
1583-
Mode string `xml:"Mode,omitempty"`
1627+
Mode string `xml:"Mode,omitempty"`
1628+
SegmentType string `xml:"SegmentType,omitempty"`
1629+
BackgroundBlue string `xml:"BackgroundBlue,omitempty"`
1630+
BackgroundRed string `xml:"BackgroundRed,omitempty"`
1631+
BackgroundGreen string `xml:"BackgroundGreen,omitempty"`
1632+
BackgroundLogoUrl string `xml:"BackgroundLogoUrl,omitempty"`
15841633
}
15851634

15861635
// NodeSmartCover TODO
@@ -3210,3 +3259,137 @@ func (s *CIService) DelImage(ctx context.Context, name string, opt *DelImageOpti
32103259
resp, err := s.client.send(ctx, &sendOpt)
32113260
return resp, err
32123261
}
3262+
3263+
// CreateJobsOptions 提交任务的公用结构体
3264+
type CreateJobsOptions CreateMediaJobsOptions
3265+
3266+
// CreateJobsOptions 任务结果的公用结构体
3267+
type CreateJobsResult CreateMediaJobsResult
3268+
3269+
// CreateJobsOptions 提交任务的公用方法
3270+
func (s *CIService) CreateJob(ctx context.Context, opt *CreateJobsOptions) (*CreateJobsResult, *Response, error) {
3271+
var res CreateJobsResult
3272+
sendOpt := sendOptions{
3273+
baseURL: s.client.BaseURL.CIURL,
3274+
uri: "/jobs",
3275+
method: http.MethodPost,
3276+
body: opt,
3277+
result: &res,
3278+
}
3279+
resp, err := s.client.send(ctx, &sendOpt)
3280+
return &res, resp, err
3281+
}
3282+
3283+
// CreateJobsOptions 提交任务的公用方法
3284+
func (s *CIService) CancelJob(ctx context.Context, jobId string) (*Response, error) {
3285+
sendOpt := sendOptions{
3286+
baseURL: s.client.BaseURL.CIURL,
3287+
uri: "/jobs/" + jobId + "?cancel",
3288+
method: http.MethodPut,
3289+
}
3290+
resp, err := s.client.send(ctx, &sendOpt)
3291+
return resp, err
3292+
}
3293+
3294+
// DescribeJobsOptions 查询任务的公用选项
3295+
type DescribeJobsOptions DescribeMediaJobsOptions
3296+
3297+
// DescribeJobsResult 查询任务结果的公用结构体
3298+
type DescribeJobsResult DescribeMediaJobsResult
3299+
3300+
// DescribeJobs 查询任务列表的公用方法
3301+
func (s *CIService) DescribeJobs(ctx context.Context, opt *DescribeJobsOptions) (*DescribeJobsResult, *Response, error) {
3302+
var res DescribeJobsResult
3303+
sendOpt := sendOptions{
3304+
baseURL: s.client.BaseURL.CIURL,
3305+
uri: "/jobs",
3306+
optQuery: opt,
3307+
method: http.MethodGet,
3308+
result: &res,
3309+
}
3310+
resp, err := s.client.send(ctx, &sendOpt)
3311+
return &res, resp, err
3312+
}
3313+
3314+
// DescribeJobs 查询指定任务的公用方法
3315+
func (s *CIService) DescribeJob(ctx context.Context, jobid string) (*DescribeJobsResult, *Response, error) {
3316+
var res DescribeJobsResult
3317+
sendOpt := sendOptions{
3318+
baseURL: s.client.BaseURL.CIURL,
3319+
uri: "/jobs/" + jobid,
3320+
method: http.MethodGet,
3321+
result: &res,
3322+
}
3323+
resp, err := s.client.send(ctx, &sendOpt)
3324+
return &res, resp, err
3325+
}
3326+
3327+
// JobsNotifyBody TODO
3328+
type JobsNotifyBody struct {
3329+
XMLName xml.Name `xml:"Response"`
3330+
EventName string `xml:"EventName"`
3331+
JobsDetail []MediaProcessJobDetail `xml:"JobsDetail,omitempty"`
3332+
}
3333+
3334+
// ModifyM3U8TokenOptions TODO
3335+
type ModifyM3U8TokenOptions struct {
3336+
Token string `url:"token"`
3337+
}
3338+
3339+
// ModifyM3U8Token TODO
3340+
func (s *CIService) ModifyM3U8Token(ctx context.Context, name string, opt *ModifyM3U8TokenOptions, id ...string) (*Response, error) {
3341+
var u string
3342+
if len(id) == 1 {
3343+
u = fmt.Sprintf("/%s?versionId=%s&ci-process=modifym3u8token", encodeURIComponent(name), id[0])
3344+
} else if len(id) == 0 {
3345+
u = fmt.Sprintf("/%s?ci-process=modifym3u8token", encodeURIComponent(name))
3346+
} else {
3347+
return nil, fmt.Errorf("wrong params")
3348+
}
3349+
3350+
sendOpt := sendOptions{
3351+
baseURL: s.client.BaseURL.BucketURL,
3352+
uri: u,
3353+
method: http.MethodGet,
3354+
optQuery: opt,
3355+
disableCloseBody: true,
3356+
}
3357+
resp, err := s.client.send(ctx, &sendOpt)
3358+
return resp, err
3359+
}
3360+
3361+
// DescribeJobsOptions 查询模板的公用选项
3362+
type DescribeTemplateOptions DescribeMediaTemplateOptions
3363+
3364+
// DescribeJobsResult 查询模板结果的公用结构体
3365+
type DescribeTemplateResult DescribeMediaTemplateResult
3366+
3367+
// DescribeTemplate 搜索模板的公用方法
3368+
func (s *CIService) DescribeTemplate(ctx context.Context, opt *DescribeTemplateOptions) (*DescribeTemplateResult, *Response, error) {
3369+
var res DescribeTemplateResult
3370+
sendOpt := sendOptions{
3371+
baseURL: s.client.BaseURL.CIURL,
3372+
uri: "/template",
3373+
optQuery: opt,
3374+
method: http.MethodGet,
3375+
result: &res,
3376+
}
3377+
resp, err := s.client.send(ctx, &sendOpt)
3378+
return &res, resp, err
3379+
}
3380+
3381+
// DescribeJobsResult 删除模板结果的公用结构体
3382+
type DeleteTemplateResult DeleteMediaTemplateResult
3383+
3384+
// DeleteTemplate 删除模板的公用方法
3385+
func (s *CIService) DeleteTemplate(ctx context.Context, tempalteId string) (*DeleteTemplateResult, *Response, error) {
3386+
var res DeleteTemplateResult
3387+
sendOpt := sendOptions{
3388+
baseURL: s.client.BaseURL.CIURL,
3389+
uri: "/template/" + tempalteId,
3390+
method: http.MethodDelete,
3391+
result: &res,
3392+
}
3393+
resp, err := s.client.send(ctx, &sendOpt)
3394+
return &res, resp, err
3395+
}

0 commit comments

Comments
 (0)