Supported GetMediaMeta for IMM.

This commit is contained in:
sdk-team
2019-08-06 19:37:03 +08:00
parent 8d4de3d11c
commit 76644841af
14 changed files with 2780 additions and 2030 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imm/model/GetMediaMetaRequest.h>
using AlibabaCloud::Imm::Model::GetMediaMetaRequest;
GetMediaMetaRequest::GetMediaMetaRequest() :
RpcServiceRequest("imm", "2017-09-06", "GetMediaMeta")
{}
GetMediaMetaRequest::~GetMediaMetaRequest()
{}
std::string GetMediaMetaRequest::getRegionId()const
{
return regionId_;
}
void GetMediaMetaRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setCoreParameter("RegionId", regionId);
}
std::string GetMediaMetaRequest::getMediaUri()const
{
return mediaUri_;
}
void GetMediaMetaRequest::setMediaUri(const std::string& mediaUri)
{
mediaUri_ = mediaUri;
setCoreParameter("MediaUri", mediaUri);
}
std::string GetMediaMetaRequest::getProject()const
{
return project_;
}
void GetMediaMetaRequest::setProject(const std::string& project)
{
project_ = project;
setCoreParameter("Project", project);
}
std::string GetMediaMetaRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void GetMediaMetaRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setCoreParameter("AccessKeyId", accessKeyId);
}

View File

@@ -0,0 +1,178 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imm/model/GetMediaMetaResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imm;
using namespace AlibabaCloud::Imm::Model;
GetMediaMetaResult::GetMediaMetaResult() :
ServiceResult()
{}
GetMediaMetaResult::GetMediaMetaResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetMediaMetaResult::~GetMediaMetaResult()
{}
void GetMediaMetaResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto mediaMetaNode = value["MediaMeta"];
auto mediaFormatNode = mediaMetaNode["MediaFormat"];
if(!mediaFormatNode["NumberStreams"].isNull())
mediaMeta_.mediaFormat.numberStreams = std::stoi(mediaFormatNode["NumberStreams"].asString());
if(!mediaFormatNode["NumberPrograms"].isNull())
mediaMeta_.mediaFormat.numberPrograms = std::stoi(mediaFormatNode["NumberPrograms"].asString());
if(!mediaFormatNode["FormatName"].isNull())
mediaMeta_.mediaFormat.formatName = mediaFormatNode["FormatName"].asString();
if(!mediaFormatNode["FormatLongName"].isNull())
mediaMeta_.mediaFormat.formatLongName = mediaFormatNode["FormatLongName"].asString();
if(!mediaFormatNode["Size"].isNull())
mediaMeta_.mediaFormat.size = mediaFormatNode["Size"].asString();
if(!mediaFormatNode["Duration"].isNull())
mediaMeta_.mediaFormat.duration = mediaFormatNode["Duration"].asString();
if(!mediaFormatNode["StartTime"].isNull())
mediaMeta_.mediaFormat.startTime = mediaFormatNode["StartTime"].asString();
if(!mediaFormatNode["Bitrate"].isNull())
mediaMeta_.mediaFormat.bitrate = mediaFormatNode["Bitrate"].asString();
if(!mediaFormatNode["CreationTime"].isNull())
mediaMeta_.mediaFormat.creationTime = mediaFormatNode["CreationTime"].asString();
if(!mediaFormatNode["Location"].isNull())
mediaMeta_.mediaFormat.location = mediaFormatNode["Location"].asString();
auto mediaStreamsNode = mediaMetaNode["MediaStreams"];
auto allVideoStreams = value["VideoStreams"]["VideoStream"];
for (auto value : allVideoStreams)
{
MediaMeta::MediaStreams::VideoStream videoStreamObject;
if(!value["Index"].isNull())
videoStreamObject.index = std::stoi(value["Index"].asString());
if(!value["Language"].isNull())
videoStreamObject.language = value["Language"].asString();
if(!value["CodecName"].isNull())
videoStreamObject.codecName = value["CodecName"].asString();
if(!value["CodecLongName"].isNull())
videoStreamObject.codecLongName = value["CodecLongName"].asString();
if(!value["Profile"].isNull())
videoStreamObject.profile = value["Profile"].asString();
if(!value["CodecTimeBase"].isNull())
videoStreamObject.codecTimeBase = value["CodecTimeBase"].asString();
if(!value["CodecTagString"].isNull())
videoStreamObject.codecTagString = value["CodecTagString"].asString();
if(!value["CodecTag"].isNull())
videoStreamObject.codecTag = value["CodecTag"].asString();
if(!value["Width"].isNull())
videoStreamObject.width = std::stoi(value["Width"].asString());
if(!value["Height"].isNull())
videoStreamObject.height = std::stoi(value["Height"].asString());
if(!value["HasBFrames"].isNull())
videoStreamObject.hasBFrames = std::stoi(value["HasBFrames"].asString());
if(!value["SampleAspectRatio"].isNull())
videoStreamObject.sampleAspectRatio = value["SampleAspectRatio"].asString();
if(!value["DisplayAspectRatio"].isNull())
videoStreamObject.displayAspectRatio = value["DisplayAspectRatio"].asString();
if(!value["PixelFormat"].isNull())
videoStreamObject.pixelFormat = value["PixelFormat"].asString();
if(!value["Level"].isNull())
videoStreamObject.level = std::stoi(value["Level"].asString());
if(!value["FrameRrate"].isNull())
videoStreamObject.frameRrate = value["FrameRrate"].asString();
if(!value["AverageFrameRate"].isNull())
videoStreamObject.averageFrameRate = value["AverageFrameRate"].asString();
if(!value["TimeBase"].isNull())
videoStreamObject.timeBase = value["TimeBase"].asString();
if(!value["StartTime"].isNull())
videoStreamObject.startTime = value["StartTime"].asString();
if(!value["Duration"].isNull())
videoStreamObject.duration = value["Duration"].asString();
if(!value["Bitrate"].isNull())
videoStreamObject.bitrate = value["Bitrate"].asString();
if(!value["Frames"].isNull())
videoStreamObject.frames = value["Frames"].asString();
mediaMeta_.mediaStreams.videoStreams.push_back(videoStreamObject);
}
auto allAudioStreams = value["AudioStreams"]["AudioStream"];
for (auto value : allAudioStreams)
{
MediaMeta::MediaStreams::AudioStream audioStreamObject;
if(!value["Index"].isNull())
audioStreamObject.index = std::stoi(value["Index"].asString());
if(!value["CodecName"].isNull())
audioStreamObject.codecName = value["CodecName"].asString();
if(!value["CodecLongName"].isNull())
audioStreamObject.codecLongName = value["CodecLongName"].asString();
if(!value["CodecTimeBase"].isNull())
audioStreamObject.codecTimeBase = value["CodecTimeBase"].asString();
if(!value["CodecTagString"].isNull())
audioStreamObject.codecTagString = value["CodecTagString"].asString();
if(!value["CodecTag"].isNull())
audioStreamObject.codecTag = value["CodecTag"].asString();
if(!value["SampleFormat"].isNull())
audioStreamObject.sampleFormat = value["SampleFormat"].asString();
if(!value["SampleRate"].isNull())
audioStreamObject.sampleRate = value["SampleRate"].asString();
if(!value["Channels"].isNull())
audioStreamObject.channels = std::stoi(value["Channels"].asString());
if(!value["ChannelLayout"].isNull())
audioStreamObject.channelLayout = value["ChannelLayout"].asString();
if(!value["TimeBase"].isNull())
audioStreamObject.timeBase = value["TimeBase"].asString();
if(!value["StartTime"].isNull())
audioStreamObject.startTime = value["StartTime"].asString();
if(!value["Duration"].isNull())
audioStreamObject.duration = value["Duration"].asString();
if(!value["Bitrate"].isNull())
audioStreamObject.bitrate = value["Bitrate"].asString();
if(!value["Frames"].isNull())
audioStreamObject.frames = value["Frames"].asString();
if(!value["Language"].isNull())
audioStreamObject.language = value["Language"].asString();
mediaMeta_.mediaStreams.audioStreams.push_back(audioStreamObject);
}
auto allSubtitleStreams = value["SubtitleStreams"]["SubtitleStream"];
for (auto value : allSubtitleStreams)
{
MediaMeta::MediaStreams::SubtitleStream subtitleStreamObject;
if(!value["Index"].isNull())
subtitleStreamObject.index = std::stoi(value["Index"].asString());
if(!value["Language"].isNull())
subtitleStreamObject.language = value["Language"].asString();
mediaMeta_.mediaStreams.subtitleStreams.push_back(subtitleStreamObject);
}
if(!value["MediaUri"].isNull())
mediaUri_ = value["MediaUri"].asString();
}
std::string GetMediaMetaResult::getMediaUri()const
{
return mediaUri_;
}
GetMediaMetaResult::MediaMeta GetMediaMetaResult::getMediaMeta()const
{
return mediaMeta_;
}

View File

@@ -45,9 +45,9 @@ void GetSetResult::parse(const std::string &payload)
if(!value["SetName"].isNull())
setName_ = value["SetName"].asString();
if(!value["CreateTime"].isNull())
createTime_ = std::stol(value["CreateTime"].asString());
createTime_ = value["CreateTime"].asString();
if(!value["ModifyTime"].isNull())
modifyTime_ = std::stol(value["ModifyTime"].asString());
modifyTime_ = value["ModifyTime"].asString();
if(!value["FaceCount"].isNull())
faceCount_ = std::stoi(value["FaceCount"].asString());
if(!value["ImageCount"].isNull())
@@ -59,7 +59,7 @@ void GetSetResult::parse(const std::string &payload)
}
long GetSetResult::getModifyTime()const
std::string GetSetResult::getModifyTime()const
{
return modifyTime_;
}
@@ -74,7 +74,7 @@ int GetSetResult::getVideoCount()const
return videoCount_;
}
long GetSetResult::getCreateTime()const
std::string GetSetResult::getCreateTime()const
{
return createTime_;
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imm/model/ListProjectAPIsRequest.h>
using AlibabaCloud::Imm::Model::ListProjectAPIsRequest;
ListProjectAPIsRequest::ListProjectAPIsRequest() :
RpcServiceRequest("imm", "2017-09-06", "ListProjectAPIs")
{}
ListProjectAPIsRequest::~ListProjectAPIsRequest()
{}
std::string ListProjectAPIsRequest::getRegionId()const
{
return regionId_;
}
void ListProjectAPIsRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setCoreParameter("RegionId", regionId);
}
std::string ListProjectAPIsRequest::getProject()const
{
return project_;
}
void ListProjectAPIsRequest::setProject(const std::string& project)
{
project_ = project;
setCoreParameter("Project", project);
}
std::string ListProjectAPIsRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void ListProjectAPIsRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setCoreParameter("AccessKeyId", accessKeyId);
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imm/model/ListProjectAPIsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imm;
using namespace AlibabaCloud::Imm::Model;
ListProjectAPIsResult::ListProjectAPIsResult() :
ServiceResult()
{}
ListProjectAPIsResult::ListProjectAPIsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListProjectAPIsResult::~ListProjectAPIsResult()
{}
void ListProjectAPIsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allAPIs = value["APIs"]["APIs"];
for (const auto &item : allAPIs)
aPIs_.push_back(item.asString());
if(!value["Project"].isNull())
project_ = value["Project"].asString();
}
std::string ListProjectAPIsResult::getProject()const
{
return project_;
}
std::vector<std::string> ListProjectAPIsResult::getAPIs()const
{
return aPIs_;
}