Skip to content

Commit 7088554

Browse files
author
mikatong
committed
update
1 parent 3731c0c commit 7088554

9 files changed

+73
-38
lines changed

.changelog/2569.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
```release-note:enhancement
2-
resource/tencentcloud_vod_adaptive_dynamic_streaming_template: support params vcrf, gop, preserve_hdr_switch, codec_tag; compatible id
2+
resource/tencentcloud_vod_adaptive_dynamic_streaming_template: Add vcrf, gop, preserve_hdr_switch, codec_tag. Adjust resource unique id to subAppId#templateId.
33
```
44

55
```release-note:enhancement
6-
resource/tencentcloud_vod_image_sprite_template: support params format, type; compatible id
6+
resource/tencentcloud_vod_image_sprite_template: Add format, type. Adjust resource unique id to subAppId#templateId.
77
```
88

99
```release-note:enhancement
10-
resource/tencentcloud_vod_procedure_template: update params media_process_task, support params ai_analysis_task, ai_recognition_task, review_audio_video_task, type; compatible id
10+
resource/tencentcloud_vod_procedure_template: Update params media_process_task, add ai_analysis_task, ai_recognition_task, review_audio_video_task, type. Adjust resource unique id to subAppId#templateId.
1111
```
1212

1313
```release-note:enhancement
14-
resource/tencentcloud_vod_sample_snapshot_template: compatible id.
14+
resource/tencentcloud_vod_sample_snapshot_template: Adjust resource unique id to subAppId#templateId.
1515
```
1616

1717
```release-note:enhancement
18-
resource/tencentcloud_vod_snapshot_by_time_offset_template: support params type; compatible id
18+
resource/tencentcloud_vod_snapshot_by_time_offset_template: Add type. Adjust resource unique id to subAppId#templateId.
1919
```

tencentcloud/services/vod/resource_tc_vod_adaptive_dynamic_streaming_template.go

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func ResourceTencentCloudVodAdaptiveDynamicStreamingTemplate() *schema.Resource
6868
"sub_app_id": {
6969
Type: schema.TypeInt,
7070
Optional: true,
71-
Description: "Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.",
71+
Description: "The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.",
7272
},
7373
"stream_info": {
7474
Type: schema.TypeList,
@@ -144,7 +144,7 @@ func ResourceTencentCloudVodAdaptiveDynamicStreamingTemplate() *schema.Resource
144144
"preserve_hdr_switch": {
145145
Type: schema.TypeString,
146146
Optional: true,
147-
Default: "OFF",
147+
Computed: true,
148148
Description: "Whether the transcoding output still maintains HDR when the original video is HDR (High Dynamic Range). Value range:\n" +
149149
"- ON: if the original file is HDR, the transcoding output remains HDR;, otherwise the transcoding output is SDR (Standard Dynamic Range);\n" +
150150
"- OFF: regardless of whether the original file is HDR or SDR, the transcoding output is SDR;\n" +
@@ -153,7 +153,7 @@ func ResourceTencentCloudVodAdaptiveDynamicStreamingTemplate() *schema.Resource
153153
"codec_tag": {
154154
Type: schema.TypeString,
155155
Optional: true,
156-
Default: "hvc1",
156+
Computed: true,
157157
Description: "Encoding label, valid only if the encoding format of the video stream is H.265 encoding. Available values:\n" +
158158
"- hvc1: stands for hvc1 tag;\n" +
159159
"- hev1: stands for the hev1 tag;\n" +
@@ -203,7 +203,7 @@ func ResourceTencentCloudVodAdaptiveDynamicStreamingTemplate() *schema.Resource
203203
"remove_video": {
204204
Type: schema.TypeBool,
205205
Optional: true,
206-
Default: false,
206+
Computed: true,
207207
Description: "Whether to remove video stream. Valid values: `false`: no, `true`: yes. `false` by default.",
208208
},
209209
"tehd_config": {
@@ -225,7 +225,7 @@ func ResourceTencentCloudVodAdaptiveDynamicStreamingTemplate() *schema.Resource
225225
"max_video_bitrate": {
226226
Type: schema.TypeInt,
227227
Optional: true,
228-
Default: 0,
228+
Computed: true,
229229
Description: "Video bitrate limit, which is valid when Type specifies extreme speed HD type. If you leave it empty or enter 0, there is no video bitrate limit.",
230230
},
231231
},
@@ -276,12 +276,11 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateCreate(d *schema.Res
276276
}
277277
streamInfos := d.Get("stream_info").([]interface{})
278278
request.StreamInfos = make([]*vod.AdaptiveStreamTemplate, 0, len(streamInfos))
279-
for idx, item := range streamInfos {
279+
for _, item := range streamInfos {
280280
v := item.(map[string]interface{})
281281
video := v["video"].([]interface{})[0].(map[string]interface{})
282282
audio := v["audio"].([]interface{})[0].(map[string]interface{})
283283
rAudio := REMOVE_AUDIO_TO_UNINT[v["remove_audio"].(bool)]
284-
rVideo := REMOVE_AUDIO_TO_UNINT[v["remove_video"].(bool)]
285284
videoTemplateInfo := &vod.VideoTemplateInfo{
286285
Codec: helper.String(video["codec"].(string)),
287286
Fps: helper.IntUint64(video["fps"].(int)),
@@ -290,17 +289,24 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateCreate(d *schema.Res
290289
Width: helper.IntUint64(video["width"].(int)),
291290
Height: helper.IntUint64(video["height"].(int)),
292291
FillType: helper.String(video["fill_type"].(string)),
293-
Vcrf: helper.IntUint64(video["vcrf"].(int)),
294-
Gop: helper.IntUint64(video["gop"].(int)),
295-
PreserveHDRSwitch: helper.String(video["preserve_hdr_switch"].(string)),
296-
CodecTag: helper.String(video["codec_tag"].(string)),
297292
}
298-
if v, ok := d.GetOkExists(fmt.Sprintf("stream_info.%d.vcrf", idx)); ok {
293+
var rVideo uint64
294+
if v, ok := video["remove_video"]; ok && v.(bool) {
295+
rVideo = REMOVE_AUDIO_TO_UNINT[v.(bool)]
296+
}
297+
if v, ok := video["vcrf"]; ok && v.(int) != 0 {
299298
videoTemplateInfo.Vcrf = helper.IntUint64(v.(int))
300299
}
301-
if v, ok := d.GetOkExists(fmt.Sprintf("stream_info.%d.gop", idx)); ok {
300+
if v, ok := video["gop"]; ok {
302301
videoTemplateInfo.Gop = helper.IntUint64(v.(int))
303302
}
303+
if v, ok := video["preserve_hdr_switch"]; ok && v.(string) != "" {
304+
videoTemplateInfo.PreserveHDRSwitch = helper.String(v.(string))
305+
}
306+
if v, ok := video["codec_tag"]; ok && v.(string) != "" {
307+
videoTemplateInfo.CodecTag = helper.String(v.(string))
308+
}
309+
304310
var tehdConfig map[string]interface{}
305311
if len(v["tehd_config"].([]interface{})) > 0 {
306312
tehdConfig = v["tehd_config"].([]interface{})[0].(map[string]interface{})
@@ -320,10 +326,13 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateCreate(d *schema.Res
320326
if tehdConfig == nil {
321327
return nil
322328
}
323-
return &vod.TEHDConfig{
324-
Type: helper.String(tehdConfig["type"].(string)),
325-
MaxVideoBitrate: helper.IntUint64(tehdConfig["max_video_bitrate"].(int)),
329+
tehd := &vod.TEHDConfig{
330+
Type: helper.String(tehdConfig["type"].(string)),
331+
}
332+
if v, ok := tehdConfig["max_video_bitrate"]; ok {
333+
tehd.MaxVideoBitrate = helper.IntUint64(v.(int))
326334
}
335+
return tehd
327336
}(),
328337
})
329338
}
@@ -510,7 +519,10 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateUpdate(d *schema.Res
510519
tehdConfig = v["tehd_config"].([]interface{})[0].(map[string]interface{})
511520
}
512521
rAudio := REMOVE_AUDIO_TO_UNINT[v["remove_audio"].(bool)]
513-
rVideo := REMOVE_AUDIO_TO_UNINT[v["remove_video"].(bool)]
522+
var rVideo uint64
523+
if v, ok := video["remove_video"]; ok && v.(bool) {
524+
rVideo = REMOVE_AUDIO_TO_UNINT[v.(bool)]
525+
}
514526
request.StreamInfos = append(request.StreamInfos, &vod.AdaptiveStreamTemplate{
515527
Video: &vod.VideoTemplateInfo{
516528
Codec: helper.String(video["codec"].(string)),
@@ -529,11 +541,31 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateUpdate(d *schema.Res
529541
}
530542
return helper.IntUint64(height)
531543
}(video["height"].(int)),
532-
FillType: helper.String(video["fill_type"].(string)),
533-
Vcrf: helper.IntUint64(video["vcrf"].(int)),
534-
Gop: helper.IntUint64(video["gop"].(int)),
535-
PreserveHDRSwitch: helper.String(video["preserve_hdr_switch"].(string)),
536-
CodecTag: helper.String(video["codec_tag"].(string)),
544+
FillType: helper.String(video["fill_type"].(string)),
545+
Vcrf: func() *uint64 {
546+
if v, ok := video["vcrf"]; !ok || v.(int) == 0 {
547+
return nil
548+
}
549+
return helper.IntUint64(video["vcrf"].(int))
550+
}(),
551+
Gop: func() *uint64 {
552+
if _, ok := video["gop"]; !ok {
553+
return nil
554+
}
555+
return helper.IntUint64(video["gop"].(int))
556+
}(),
557+
PreserveHDRSwitch: func() *string {
558+
if v, ok := video["preserve_hdr_switch"]; !ok || v.(string) == "" {
559+
return nil
560+
}
561+
return helper.String(video["preserve_hdr_switch"].(string))
562+
}(),
563+
CodecTag: func() *string {
564+
if v, ok := video["codec_tag"]; !ok || v.(string) == "" {
565+
return nil
566+
}
567+
return helper.String(video["codec_tag"].(string))
568+
}(),
537569
},
538570
Audio: &vod.AudioTemplateInfo{
539571
Codec: helper.String(audio["codec"].(string)),
@@ -547,10 +579,13 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateUpdate(d *schema.Res
547579
if tehdConfig == nil {
548580
return nil
549581
}
550-
return &vod.TEHDConfig{
551-
Type: helper.String(tehdConfig["type"].(string)),
552-
MaxVideoBitrate: helper.IntUint64(tehdConfig["max_video_bitrate"].(int)),
582+
tehd := &vod.TEHDConfig{
583+
Type: helper.String(tehdConfig["type"].(string)),
584+
}
585+
if v, ok := tehdConfig["max_video_bitrate"]; ok {
586+
tehd.MaxVideoBitrate = helper.IntUint64(v.(int))
553587
}
588+
return tehd
554589
}(),
555590
})
556591
}

tencentcloud/services/vod/resource_tc_vod_image_sprite_template.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ func ResourceTencentCloudVodImageSpriteTemplate() *schema.Resource {
9090
"sub_app_id": {
9191
Type: schema.TypeInt,
9292
Optional: true,
93-
Description: "Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.",
93+
Description: "The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.",
9494
},
9595
"format": {
9696
Type: schema.TypeString,
9797
Optional: true,
98-
Default: "jpg",
98+
Computed: true,
9999
Description: "Image format, Valid values:\n" +
100100
"- jpg: jpg format;\n" +
101101
"- png: png format;\n" +

tencentcloud/services/vod/resource_tc_vod_procedure_template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func ResourceTencentCloudVodProcedureTemplate() *schema.Resource {
4444
"sub_app_id": {
4545
Type: schema.TypeInt,
4646
Optional: true,
47-
Description: "Subapplication ID in VOD. For customers who activate VOD from December 25, 2023, if they access the resources in the VOD application (whether it is the default application or the newly created application), you must fill in this field as Application ID.",
47+
Description: "The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.",
4848
},
4949
"media_process_task": {
5050
Type: schema.TypeList,

tencentcloud/services/vod/resource_tc_vod_snapshot_by_time_offset_template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func ResourceTencentCloudVodSnapshotByTimeOffsetTemplate() *schema.Resource {
6868
"sub_app_id": {
6969
Type: schema.TypeInt,
7070
Optional: true,
71-
Description: "Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.",
71+
Description: "The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.",
7272
},
7373
"fill_type": {
7474
Type: schema.TypeString,

website/docs/r/vod_adaptive_dynamic_streaming_template.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The following arguments are supported:
5959
* `disable_higher_video_bitrate` - (Optional, Bool) Whether to prohibit transcoding video from low bitrate to high bitrate. Valid values: `false`,`true`. `false`: no, `true`: yes. Default value: `false`.
6060
* `disable_higher_video_resolution` - (Optional, Bool) Whether to prohibit transcoding from low resolution to high resolution. Valid values: `false`,`true`. `false`: no, `true`: yes. Default value: `false`.
6161
* `drm_type` - (Optional, String, ForceNew) DRM scheme type. Valid values: `SimpleAES`. If this field is an empty string, DRM will not be performed on the video.
62-
* `sub_app_id` - (Optional, Int) Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.
62+
* `sub_app_id` - (Optional, Int) The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.
6363

6464
The `audio` object of `stream_info` supports the following:
6565

website/docs/r/vod_image_sprite_template.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The following arguments are supported:
5353
Default value: jpg.
5454
* `height` - (Optional, Int) Maximum value of the `height` (or short side) of a screenshot in px. Value range: 0 and [128, 4,096]. If both `width` and `height` are `0`, the resolution will be the same as that of the source video; If `width` is `0`, but `height` is not `0`, `width` will be proportionally scaled; If `width` is not `0`, but `height` is `0`, `height` will be proportionally scaled; If both `width` and `height` are not `0`, the custom resolution will be used. Default value: `0`.
5555
* `resolution_adaptive` - (Optional, Bool) Resolution adaption. Valid values: `true`,`false`. `true`: enabled. In this case, `width` represents the long side of a video, while `height` the short side; `false`: disabled. In this case, `width` represents the width of a video, while `height` the height. Default value: `true`.
56-
* `sub_app_id` - (Optional, Int) Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.
56+
* `sub_app_id` - (Optional, Int) The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.
5757
* `width` - (Optional, Int) Maximum value of the `width` (or long side) of a screenshot in px. Value range: 0 and [128, 4,096]. If both `width` and `height` are `0`, the resolution will be the same as that of the source video; If `width` is `0`, but `height` is not `0`, width will be proportionally scaled; If `width` is not `0`, but `height` is `0`, `height` will be proportionally scaled; If both `width` and `height` are not `0`, the custom resolution will be used. Default value: `0`.
5858

5959
## Attributes Reference

website/docs/r/vod_procedure_template.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ The following arguments are supported:
150150
* `comment` - (Optional, String) Template description. Length limit: 256 characters.
151151
* `media_process_task` - (Optional, List) Parameter of video processing task.
152152
* `review_audio_video_task` - (Optional, List) Type parameter of AI-based content recognition task.
153-
* `sub_app_id` - (Optional, Int) Subapplication ID in VOD. For customers who activate VOD from December 25, 2023, if they access the resources in the VOD application (whether it is the default application or the newly created application), you must fill in this field as Application ID.
153+
* `sub_app_id` - (Optional, Int) The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.
154154

155155
The `adaptive_dynamic_streaming_task_list` object of `media_process_task` supports the following:
156156

website/docs/r/vod_snapshot_by_time_offset_template.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The following arguments are supported:
3535
* `format` - (Optional, String) Image format. Valid values: `jpg`, `png`. Default value: `jpg`.
3636
* `height` - (Optional, Int) Maximum value of the `height` (or short side) of a screenshot in px. Value range: 0 and [128, 4,096]. If both `width` and `height` are `0`, the resolution will be the same as that of the source video; If `width` is `0`, but `height` is not `0`, `width` will be proportionally scaled; If `width` is not `0`, but `height` is `0`, `height` will be proportionally scaled; If both `width` and `height` are not `0`, the custom resolution will be used. Default value: `0`.
3737
* `resolution_adaptive` - (Optional, Bool) Resolution adaption. Valid values: `true`,`false`. `true`: enabled. In this case, `width` represents the long side of a video, while `height` the short side; `false`: disabled. In this case, `width` represents the width of a video, while `height` the height. Default value: `true`.
38-
* `sub_app_id` - (Optional, Int) Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.
38+
* `sub_app_id` - (Optional, Int) The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.
3939
* `width` - (Optional, Int) Maximum value of the `width` (or long side) of a screenshot in px. Value range: 0 and [128, 4,096]. If both `width` and `height` are `0`, the resolution will be the same as that of the source video; If `width` is `0`, but `height` is not `0`, width will be proportionally scaled; If `width` is not `0`, but `height` is `0`, `height` will be proportionally scaled; If both `width` and `height` are not `0`, the custom resolution will be used. Default value: `0`.
4040

4141
## Attributes Reference

0 commit comments

Comments
 (0)