submit_media_info_job.go 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. package mts
  2. //Licensed under the Apache License, Version 2.0 (the "License");
  3. //you may not use this file except in compliance with the License.
  4. //You may obtain a copy of the License at
  5. //
  6. //http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. //Unless required by applicable law or agreed to in writing, software
  9. //distributed under the License is distributed on an "AS IS" BASIS,
  10. //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. //See the License for the specific language governing permissions and
  12. //limitations under the License.
  13. //
  14. // Code generated by Alibaba Cloud SDK Code Generator.
  15. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  16. import (
  17. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  18. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  19. )
  20. func (client *Client) SubmitMediaInfoJob(request *SubmitMediaInfoJobRequest) (response *SubmitMediaInfoJobResponse, err error) {
  21. response = CreateSubmitMediaInfoJobResponse()
  22. err = client.DoAction(request, response)
  23. return
  24. }
  25. func (client *Client) SubmitMediaInfoJobWithChan(request *SubmitMediaInfoJobRequest) (<-chan *SubmitMediaInfoJobResponse, <-chan error) {
  26. responseChan := make(chan *SubmitMediaInfoJobResponse, 1)
  27. errChan := make(chan error, 1)
  28. err := client.AddAsyncTask(func() {
  29. defer close(responseChan)
  30. defer close(errChan)
  31. response, err := client.SubmitMediaInfoJob(request)
  32. responseChan <- response
  33. errChan <- err
  34. })
  35. if err != nil {
  36. errChan <- err
  37. close(responseChan)
  38. close(errChan)
  39. }
  40. return responseChan, errChan
  41. }
  42. func (client *Client) SubmitMediaInfoJobWithCallback(request *SubmitMediaInfoJobRequest, callback func(response *SubmitMediaInfoJobResponse, err error)) <-chan int {
  43. result := make(chan int, 1)
  44. err := client.AddAsyncTask(func() {
  45. var response *SubmitMediaInfoJobResponse
  46. var err error
  47. defer close(result)
  48. response, err = client.SubmitMediaInfoJob(request)
  49. callback(response, err)
  50. result <- 1
  51. })
  52. if err != nil {
  53. defer close(result)
  54. callback(nil, err)
  55. result <- 0
  56. }
  57. return result
  58. }
  59. type SubmitMediaInfoJobRequest struct {
  60. *requests.RpcRequest
  61. Input string `position:"Query" name:"Input"`
  62. UserData string `position:"Query" name:"UserData"`
  63. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  64. ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
  65. OwnerAccount string `position:"Query" name:"OwnerAccount"`
  66. OwnerId requests.Integer `position:"Query" name:"OwnerId"`
  67. PipelineId string `position:"Query" name:"PipelineId"`
  68. }
  69. type SubmitMediaInfoJobResponse struct {
  70. *responses.BaseResponse
  71. RequestId string `json:"RequestId" xml:"RequestId"`
  72. MediaInfoJob struct {
  73. JobId string `json:"JobId" xml:"JobId"`
  74. UserData string `json:"UserData" xml:"UserData"`
  75. PipelineId string `json:"PipelineId" xml:"PipelineId"`
  76. State string `json:"State" xml:"State"`
  77. Code string `json:"Code" xml:"Code"`
  78. Message string `json:"Message" xml:"Message"`
  79. CreationTime string `json:"CreationTime" xml:"CreationTime"`
  80. Input struct {
  81. Bucket string `json:"Bucket" xml:"Bucket"`
  82. Location string `json:"Location" xml:"Location"`
  83. Object string `json:"Object" xml:"Object"`
  84. } `json:"Input" xml:"Input"`
  85. Properties struct {
  86. Width string `json:"Width" xml:"Width"`
  87. Height string `json:"Height" xml:"Height"`
  88. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  89. Duration string `json:"Duration" xml:"Duration"`
  90. Fps string `json:"Fps" xml:"Fps"`
  91. FileSize string `json:"FileSize" xml:"FileSize"`
  92. FileFormat string `json:"FileFormat" xml:"FileFormat"`
  93. Streams struct {
  94. VideoStreamList struct {
  95. VideoStream []struct {
  96. Index string `json:"Index" xml:"Index"`
  97. CodecName string `json:"CodecName" xml:"CodecName"`
  98. CodecLongName string `json:"CodecLongName" xml:"CodecLongName"`
  99. Profile string `json:"Profile" xml:"Profile"`
  100. CodecTimeBase string `json:"CodecTimeBase" xml:"CodecTimeBase"`
  101. CodecTagString string `json:"CodecTagString" xml:"CodecTagString"`
  102. CodecTag string `json:"CodecTag" xml:"CodecTag"`
  103. Width string `json:"Width" xml:"Width"`
  104. Height string `json:"Height" xml:"Height"`
  105. HasBFrames string `json:"HasBFrames" xml:"HasBFrames"`
  106. Sar string `json:"Sar" xml:"Sar"`
  107. Dar string `json:"Dar" xml:"Dar"`
  108. PixFmt string `json:"PixFmt" xml:"PixFmt"`
  109. Level string `json:"Level" xml:"Level"`
  110. Fps string `json:"Fps" xml:"Fps"`
  111. AvgFPS string `json:"AvgFPS" xml:"AvgFPS"`
  112. Timebase string `json:"Timebase" xml:"Timebase"`
  113. StartTime string `json:"StartTime" xml:"StartTime"`
  114. Duration string `json:"Duration" xml:"Duration"`
  115. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  116. NumFrames string `json:"NumFrames" xml:"NumFrames"`
  117. Lang string `json:"Lang" xml:"Lang"`
  118. Rotate string `json:"Rotate" xml:"Rotate"`
  119. NetworkCost struct {
  120. PreloadTime string `json:"PreloadTime" xml:"PreloadTime"`
  121. CostBandwidth string `json:"CostBandwidth" xml:"CostBandwidth"`
  122. AvgBitrate string `json:"AvgBitrate" xml:"AvgBitrate"`
  123. } `json:"NetworkCost" xml:"NetworkCost"`
  124. } `json:"VideoStream" xml:"VideoStream"`
  125. } `json:"VideoStreamList" xml:"VideoStreamList"`
  126. AudioStreamList struct {
  127. AudioStream []struct {
  128. Index string `json:"Index" xml:"Index"`
  129. CodecName string `json:"CodecName" xml:"CodecName"`
  130. CodecTimeBase string `json:"CodecTimeBase" xml:"CodecTimeBase"`
  131. CodecLongName string `json:"CodecLongName" xml:"CodecLongName"`
  132. CodecTagString string `json:"CodecTagString" xml:"CodecTagString"`
  133. CodecTag string `json:"CodecTag" xml:"CodecTag"`
  134. SampleFmt string `json:"SampleFmt" xml:"SampleFmt"`
  135. Samplerate string `json:"Samplerate" xml:"Samplerate"`
  136. Channels string `json:"Channels" xml:"Channels"`
  137. ChannelLayout string `json:"ChannelLayout" xml:"ChannelLayout"`
  138. Timebase string `json:"Timebase" xml:"Timebase"`
  139. StartTime string `json:"StartTime" xml:"StartTime"`
  140. Duration string `json:"Duration" xml:"Duration"`
  141. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  142. NumFrames string `json:"NumFrames" xml:"NumFrames"`
  143. Lang string `json:"Lang" xml:"Lang"`
  144. } `json:"AudioStream" xml:"AudioStream"`
  145. } `json:"AudioStreamList" xml:"AudioStreamList"`
  146. SubtitleStreamList struct {
  147. SubtitleStream []struct {
  148. Index string `json:"Index" xml:"Index"`
  149. Lang string `json:"Lang" xml:"Lang"`
  150. } `json:"SubtitleStream" xml:"SubtitleStream"`
  151. } `json:"SubtitleStreamList" xml:"SubtitleStreamList"`
  152. } `json:"Streams" xml:"Streams"`
  153. Format struct {
  154. NumStreams string `json:"NumStreams" xml:"NumStreams"`
  155. NumPrograms string `json:"NumPrograms" xml:"NumPrograms"`
  156. FormatName string `json:"FormatName" xml:"FormatName"`
  157. FormatLongName string `json:"FormatLongName" xml:"FormatLongName"`
  158. StartTime string `json:"StartTime" xml:"StartTime"`
  159. Duration string `json:"Duration" xml:"Duration"`
  160. Size string `json:"Size" xml:"Size"`
  161. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  162. } `json:"Format" xml:"Format"`
  163. } `json:"Properties" xml:"Properties"`
  164. MNSMessageResult struct {
  165. MessageId string `json:"MessageId" xml:"MessageId"`
  166. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  167. ErrorCode string `json:"ErrorCode" xml:"ErrorCode"`
  168. } `json:"MNSMessageResult" xml:"MNSMessageResult"`
  169. } `json:"MediaInfoJob" xml:"MediaInfoJob"`
  170. }
  171. func CreateSubmitMediaInfoJobRequest() (request *SubmitMediaInfoJobRequest) {
  172. request = &SubmitMediaInfoJobRequest{
  173. RpcRequest: &requests.RpcRequest{},
  174. }
  175. request.InitWithApiInfo("Mts", "2014-06-18", "SubmitMediaInfoJob", "mts", "openAPI")
  176. return
  177. }
  178. func CreateSubmitMediaInfoJobResponse() (response *SubmitMediaInfoJobResponse) {
  179. response = &SubmitMediaInfoJobResponse{
  180. BaseResponse: &responses.BaseResponse{},
  181. }
  182. return
  183. }