Update videorecog.
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
2020-11-16 Version: patch
|
||||||
|
- Update videorecog.
|
||||||
|
|
||||||
2020-11-16 Version: patch
|
2020-11-16 Version: patch
|
||||||
- Update objectdet.
|
- Update objectdet.
|
||||||
|
|
||||||
|
|||||||
94
videorecog/CMakeLists.txt
Normal file
94
videorecog/CMakeLists.txt
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||||
|
|
||||||
|
set(videorecog_public_header
|
||||||
|
include/alibabacloud/videorecog/VideorecogClient.h
|
||||||
|
include/alibabacloud/videorecog/VideorecogExport.h )
|
||||||
|
|
||||||
|
set(videorecog_public_header_model
|
||||||
|
include/alibabacloud/videorecog/model/DetectVideoShotRequest.h
|
||||||
|
include/alibabacloud/videorecog/model/DetectVideoShotResult.h
|
||||||
|
include/alibabacloud/videorecog/model/GenerateVideoCoverRequest.h
|
||||||
|
include/alibabacloud/videorecog/model/GenerateVideoCoverResult.h
|
||||||
|
include/alibabacloud/videorecog/model/GetAsyncJobResultRequest.h
|
||||||
|
include/alibabacloud/videorecog/model/GetAsyncJobResultResult.h )
|
||||||
|
|
||||||
|
set(videorecog_src
|
||||||
|
src/VideorecogClient.cc
|
||||||
|
src/model/DetectVideoShotRequest.cc
|
||||||
|
src/model/DetectVideoShotResult.cc
|
||||||
|
src/model/GenerateVideoCoverRequest.cc
|
||||||
|
src/model/GenerateVideoCoverResult.cc
|
||||||
|
src/model/GetAsyncJobResultRequest.cc
|
||||||
|
src/model/GetAsyncJobResultResult.cc )
|
||||||
|
|
||||||
|
add_library(videorecog ${LIB_TYPE}
|
||||||
|
${videorecog_public_header}
|
||||||
|
${videorecog_public_header_model}
|
||||||
|
${videorecog_src})
|
||||||
|
|
||||||
|
set_target_properties(videorecog
|
||||||
|
PROPERTIES
|
||||||
|
LINKER_LANGUAGE CXX
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}videorecog
|
||||||
|
)
|
||||||
|
|
||||||
|
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||||
|
set_target_properties(videorecog
|
||||||
|
PROPERTIES
|
||||||
|
DEFINE_SYMBOL ALIBABACLOUD_VIDEORECOG_LIBRARY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(videorecog
|
||||||
|
PRIVATE include
|
||||||
|
${CMAKE_SOURCE_DIR}/core/include
|
||||||
|
)
|
||||||
|
target_link_libraries(videorecog
|
||||||
|
core)
|
||||||
|
|
||||||
|
if(CMAKE_HOST_WIN32)
|
||||||
|
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||||
|
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||||
|
add_dependencies(videorecog
|
||||||
|
jsoncpp)
|
||||||
|
target_include_directories(videorecog
|
||||||
|
PRIVATE ${jsoncpp_install_dir}/include)
|
||||||
|
target_link_libraries(videorecog
|
||||||
|
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||||
|
set_target_properties(videorecog
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_OPTIONS "/bigobj")
|
||||||
|
else()
|
||||||
|
target_include_directories(videorecog
|
||||||
|
PRIVATE /usr/include/jsoncpp)
|
||||||
|
target_link_libraries(videorecog
|
||||||
|
jsoncpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
install(FILES ${videorecog_public_header}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/videorecog)
|
||||||
|
install(FILES ${videorecog_public_header_model}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/videorecog/model)
|
||||||
|
install(TARGETS videorecog
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
)
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_VIDEORECOG_VIDEORECOGCLIENT_H_
|
||||||
|
#define ALIBABACLOUD_VIDEORECOG_VIDEORECOGCLIENT_H_
|
||||||
|
|
||||||
|
#include <future>
|
||||||
|
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||||
|
#include <alibabacloud/core/EndpointProvider.h>
|
||||||
|
#include <alibabacloud/core/RpcServiceClient.h>
|
||||||
|
#include "VideorecogExport.h"
|
||||||
|
#include "model/DetectVideoShotRequest.h"
|
||||||
|
#include "model/DetectVideoShotResult.h"
|
||||||
|
#include "model/GenerateVideoCoverRequest.h"
|
||||||
|
#include "model/GenerateVideoCoverResult.h"
|
||||||
|
#include "model/GetAsyncJobResultRequest.h"
|
||||||
|
#include "model/GetAsyncJobResultResult.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace AlibabaCloud
|
||||||
|
{
|
||||||
|
namespace Videorecog
|
||||||
|
{
|
||||||
|
class ALIBABACLOUD_VIDEORECOG_EXPORT VideorecogClient : public RpcServiceClient
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Outcome<Error, Model::DetectVideoShotResult> DetectVideoShotOutcome;
|
||||||
|
typedef std::future<DetectVideoShotOutcome> DetectVideoShotOutcomeCallable;
|
||||||
|
typedef std::function<void(const VideorecogClient*, const Model::DetectVideoShotRequest&, const DetectVideoShotOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectVideoShotAsyncHandler;
|
||||||
|
typedef Outcome<Error, Model::GenerateVideoCoverResult> GenerateVideoCoverOutcome;
|
||||||
|
typedef std::future<GenerateVideoCoverOutcome> GenerateVideoCoverOutcomeCallable;
|
||||||
|
typedef std::function<void(const VideorecogClient*, const Model::GenerateVideoCoverRequest&, const GenerateVideoCoverOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateVideoCoverAsyncHandler;
|
||||||
|
typedef Outcome<Error, Model::GetAsyncJobResultResult> GetAsyncJobResultOutcome;
|
||||||
|
typedef std::future<GetAsyncJobResultOutcome> GetAsyncJobResultOutcomeCallable;
|
||||||
|
typedef std::function<void(const VideorecogClient*, const Model::GetAsyncJobResultRequest&, const GetAsyncJobResultOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetAsyncJobResultAsyncHandler;
|
||||||
|
|
||||||
|
VideorecogClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||||
|
VideorecogClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||||
|
VideorecogClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||||
|
~VideorecogClient();
|
||||||
|
DetectVideoShotOutcome detectVideoShot(const Model::DetectVideoShotRequest &request)const;
|
||||||
|
void detectVideoShotAsync(const Model::DetectVideoShotRequest& request, const DetectVideoShotAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||||
|
DetectVideoShotOutcomeCallable detectVideoShotCallable(const Model::DetectVideoShotRequest& request) const;
|
||||||
|
GenerateVideoCoverOutcome generateVideoCover(const Model::GenerateVideoCoverRequest &request)const;
|
||||||
|
void generateVideoCoverAsync(const Model::GenerateVideoCoverRequest& request, const GenerateVideoCoverAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||||
|
GenerateVideoCoverOutcomeCallable generateVideoCoverCallable(const Model::GenerateVideoCoverRequest& request) const;
|
||||||
|
GetAsyncJobResultOutcome getAsyncJobResult(const Model::GetAsyncJobResultRequest &request)const;
|
||||||
|
void getAsyncJobResultAsync(const Model::GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||||
|
GetAsyncJobResultOutcomeCallable getAsyncJobResultCallable(const Model::GetAsyncJobResultRequest& request) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // !ALIBABACLOUD_VIDEORECOG_VIDEORECOGCLIENT_H_
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_VIDEORECOG_VIDEORECOGEXPORT_H_
|
||||||
|
#define ALIBABACLOUD_VIDEORECOG_VIDEORECOGEXPORT_H_
|
||||||
|
|
||||||
|
#include <alibabacloud/core/Global.h>
|
||||||
|
|
||||||
|
#if defined(ALIBABACLOUD_SHARED)
|
||||||
|
# if defined(ALIBABACLOUD_VIDEORECOG_LIBRARY)
|
||||||
|
# define ALIBABACLOUD_VIDEORECOG_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||||
|
# else
|
||||||
|
# define ALIBABACLOUD_VIDEORECOG_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define ALIBABACLOUD_VIDEORECOG_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // !ALIBABACLOUD_VIDEORECOG_VIDEORECOGEXPORT_H_
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_VIDEORECOG_MODEL_DETECTVIDEOSHOTREQUEST_H_
|
||||||
|
#define ALIBABACLOUD_VIDEORECOG_MODEL_DETECTVIDEOSHOTREQUEST_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||||
|
#include <alibabacloud/videorecog/VideorecogExport.h>
|
||||||
|
|
||||||
|
namespace AlibabaCloud
|
||||||
|
{
|
||||||
|
namespace Videorecog
|
||||||
|
{
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
class ALIBABACLOUD_VIDEORECOG_EXPORT DetectVideoShotRequest : public RpcServiceRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
DetectVideoShotRequest();
|
||||||
|
~DetectVideoShotRequest();
|
||||||
|
|
||||||
|
bool getAsync()const;
|
||||||
|
void setAsync(bool async);
|
||||||
|
std::string getVideoUrl()const;
|
||||||
|
void setVideoUrl(const std::string& videoUrl);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool async_;
|
||||||
|
std::string videoUrl_;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // !ALIBABACLOUD_VIDEORECOG_MODEL_DETECTVIDEOSHOTREQUEST_H_
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_VIDEORECOG_MODEL_DETECTVIDEOSHOTRESULT_H_
|
||||||
|
#define ALIBABACLOUD_VIDEORECOG_MODEL_DETECTVIDEOSHOTRESULT_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <utility>
|
||||||
|
#include <alibabacloud/core/ServiceResult.h>
|
||||||
|
#include <alibabacloud/videorecog/VideorecogExport.h>
|
||||||
|
|
||||||
|
namespace AlibabaCloud
|
||||||
|
{
|
||||||
|
namespace Videorecog
|
||||||
|
{
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
class ALIBABACLOUD_VIDEORECOG_EXPORT DetectVideoShotResult : public ServiceResult
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
std::vector<std::string> shotFrameIds;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
DetectVideoShotResult();
|
||||||
|
explicit DetectVideoShotResult(const std::string &payload);
|
||||||
|
~DetectVideoShotResult();
|
||||||
|
Data getData()const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void parse(const std::string &payload);
|
||||||
|
private:
|
||||||
|
Data data_;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // !ALIBABACLOUD_VIDEORECOG_MODEL_DETECTVIDEOSHOTRESULT_H_
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_VIDEORECOG_MODEL_GENERATEVIDEOCOVERREQUEST_H_
|
||||||
|
#define ALIBABACLOUD_VIDEORECOG_MODEL_GENERATEVIDEOCOVERREQUEST_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||||
|
#include <alibabacloud/videorecog/VideorecogExport.h>
|
||||||
|
|
||||||
|
namespace AlibabaCloud
|
||||||
|
{
|
||||||
|
namespace Videorecog
|
||||||
|
{
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
class ALIBABACLOUD_VIDEORECOG_EXPORT GenerateVideoCoverRequest : public RpcServiceRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenerateVideoCoverRequest();
|
||||||
|
~GenerateVideoCoverRequest();
|
||||||
|
|
||||||
|
bool getIsGif()const;
|
||||||
|
void setIsGif(bool isGif);
|
||||||
|
bool getAsync()const;
|
||||||
|
void setAsync(bool async);
|
||||||
|
std::string getVideoUrl()const;
|
||||||
|
void setVideoUrl(const std::string& videoUrl);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool isGif_;
|
||||||
|
bool async_;
|
||||||
|
std::string videoUrl_;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // !ALIBABACLOUD_VIDEORECOG_MODEL_GENERATEVIDEOCOVERREQUEST_H_
|
||||||
@@ -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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_VIDEORECOG_MODEL_GENERATEVIDEOCOVERRESULT_H_
|
||||||
|
#define ALIBABACLOUD_VIDEORECOG_MODEL_GENERATEVIDEOCOVERRESULT_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <utility>
|
||||||
|
#include <alibabacloud/core/ServiceResult.h>
|
||||||
|
#include <alibabacloud/videorecog/VideorecogExport.h>
|
||||||
|
|
||||||
|
namespace AlibabaCloud
|
||||||
|
{
|
||||||
|
namespace Videorecog
|
||||||
|
{
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
class ALIBABACLOUD_VIDEORECOG_EXPORT GenerateVideoCoverResult : public ServiceResult
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
struct Output
|
||||||
|
{
|
||||||
|
float confidence;
|
||||||
|
std::string imageURL;
|
||||||
|
};
|
||||||
|
std::vector<Output> outputs;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
GenerateVideoCoverResult();
|
||||||
|
explicit GenerateVideoCoverResult(const std::string &payload);
|
||||||
|
~GenerateVideoCoverResult();
|
||||||
|
Data getData()const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void parse(const std::string &payload);
|
||||||
|
private:
|
||||||
|
Data data_;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // !ALIBABACLOUD_VIDEORECOG_MODEL_GENERATEVIDEOCOVERRESULT_H_
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_VIDEORECOG_MODEL_GETASYNCJOBRESULTREQUEST_H_
|
||||||
|
#define ALIBABACLOUD_VIDEORECOG_MODEL_GETASYNCJOBRESULTREQUEST_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||||
|
#include <alibabacloud/videorecog/VideorecogExport.h>
|
||||||
|
|
||||||
|
namespace AlibabaCloud
|
||||||
|
{
|
||||||
|
namespace Videorecog
|
||||||
|
{
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
class ALIBABACLOUD_VIDEORECOG_EXPORT GetAsyncJobResultRequest : public RpcServiceRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
GetAsyncJobResultRequest();
|
||||||
|
~GetAsyncJobResultRequest();
|
||||||
|
|
||||||
|
bool getAsync()const;
|
||||||
|
void setAsync(bool async);
|
||||||
|
std::string getJobId()const;
|
||||||
|
void setJobId(const std::string& jobId);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool async_;
|
||||||
|
std::string jobId_;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // !ALIBABACLOUD_VIDEORECOG_MODEL_GETASYNCJOBRESULTREQUEST_H_
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_VIDEORECOG_MODEL_GETASYNCJOBRESULTRESULT_H_
|
||||||
|
#define ALIBABACLOUD_VIDEORECOG_MODEL_GETASYNCJOBRESULTRESULT_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <utility>
|
||||||
|
#include <alibabacloud/core/ServiceResult.h>
|
||||||
|
#include <alibabacloud/videorecog/VideorecogExport.h>
|
||||||
|
|
||||||
|
namespace AlibabaCloud
|
||||||
|
{
|
||||||
|
namespace Videorecog
|
||||||
|
{
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
class ALIBABACLOUD_VIDEORECOG_EXPORT GetAsyncJobResultResult : public ServiceResult
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
std::string status;
|
||||||
|
std::string errorCode;
|
||||||
|
std::string errorMessage;
|
||||||
|
std::string jobId;
|
||||||
|
std::string result;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
GetAsyncJobResultResult();
|
||||||
|
explicit GetAsyncJobResultResult(const std::string &payload);
|
||||||
|
~GetAsyncJobResultResult();
|
||||||
|
Data getData()const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void parse(const std::string &payload);
|
||||||
|
private:
|
||||||
|
Data data_;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // !ALIBABACLOUD_VIDEORECOG_MODEL_GETASYNCJOBRESULTRESULT_H_
|
||||||
161
videorecog/src/VideorecogClient.cc
Normal file
161
videorecog/src/VideorecogClient.cc
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
/*
|
||||||
|
* 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/videorecog/VideorecogClient.h>
|
||||||
|
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||||
|
|
||||||
|
using namespace AlibabaCloud;
|
||||||
|
using namespace AlibabaCloud::Location;
|
||||||
|
using namespace AlibabaCloud::Videorecog;
|
||||||
|
using namespace AlibabaCloud::Videorecog::Model;
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
const std::string SERVICE_NAME = "videorecog";
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::VideorecogClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||||
|
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||||
|
{
|
||||||
|
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||||
|
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "videorecog");
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::VideorecogClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||||
|
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||||
|
{
|
||||||
|
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||||
|
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "videorecog");
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::VideorecogClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||||
|
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||||
|
{
|
||||||
|
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||||
|
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "videorecog");
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::~VideorecogClient()
|
||||||
|
{}
|
||||||
|
|
||||||
|
VideorecogClient::DetectVideoShotOutcome VideorecogClient::detectVideoShot(const DetectVideoShotRequest &request) const
|
||||||
|
{
|
||||||
|
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||||
|
if (!endpointOutcome.isSuccess())
|
||||||
|
return DetectVideoShotOutcome(endpointOutcome.error());
|
||||||
|
|
||||||
|
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||||
|
|
||||||
|
if (outcome.isSuccess())
|
||||||
|
return DetectVideoShotOutcome(DetectVideoShotResult(outcome.result()));
|
||||||
|
else
|
||||||
|
return DetectVideoShotOutcome(outcome.error());
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideorecogClient::detectVideoShotAsync(const DetectVideoShotRequest& request, const DetectVideoShotAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||||
|
{
|
||||||
|
auto fn = [this, request, handler, context]()
|
||||||
|
{
|
||||||
|
handler(this, request, detectVideoShot(request), context);
|
||||||
|
};
|
||||||
|
|
||||||
|
asyncExecute(new Runnable(fn));
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::DetectVideoShotOutcomeCallable VideorecogClient::detectVideoShotCallable(const DetectVideoShotRequest &request) const
|
||||||
|
{
|
||||||
|
auto task = std::make_shared<std::packaged_task<DetectVideoShotOutcome()>>(
|
||||||
|
[this, request]()
|
||||||
|
{
|
||||||
|
return this->detectVideoShot(request);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||||
|
return task->get_future();
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::GenerateVideoCoverOutcome VideorecogClient::generateVideoCover(const GenerateVideoCoverRequest &request) const
|
||||||
|
{
|
||||||
|
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||||
|
if (!endpointOutcome.isSuccess())
|
||||||
|
return GenerateVideoCoverOutcome(endpointOutcome.error());
|
||||||
|
|
||||||
|
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||||
|
|
||||||
|
if (outcome.isSuccess())
|
||||||
|
return GenerateVideoCoverOutcome(GenerateVideoCoverResult(outcome.result()));
|
||||||
|
else
|
||||||
|
return GenerateVideoCoverOutcome(outcome.error());
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideorecogClient::generateVideoCoverAsync(const GenerateVideoCoverRequest& request, const GenerateVideoCoverAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||||
|
{
|
||||||
|
auto fn = [this, request, handler, context]()
|
||||||
|
{
|
||||||
|
handler(this, request, generateVideoCover(request), context);
|
||||||
|
};
|
||||||
|
|
||||||
|
asyncExecute(new Runnable(fn));
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::GenerateVideoCoverOutcomeCallable VideorecogClient::generateVideoCoverCallable(const GenerateVideoCoverRequest &request) const
|
||||||
|
{
|
||||||
|
auto task = std::make_shared<std::packaged_task<GenerateVideoCoverOutcome()>>(
|
||||||
|
[this, request]()
|
||||||
|
{
|
||||||
|
return this->generateVideoCover(request);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||||
|
return task->get_future();
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::GetAsyncJobResultOutcome VideorecogClient::getAsyncJobResult(const GetAsyncJobResultRequest &request) const
|
||||||
|
{
|
||||||
|
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||||
|
if (!endpointOutcome.isSuccess())
|
||||||
|
return GetAsyncJobResultOutcome(endpointOutcome.error());
|
||||||
|
|
||||||
|
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||||
|
|
||||||
|
if (outcome.isSuccess())
|
||||||
|
return GetAsyncJobResultOutcome(GetAsyncJobResultResult(outcome.result()));
|
||||||
|
else
|
||||||
|
return GetAsyncJobResultOutcome(outcome.error());
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideorecogClient::getAsyncJobResultAsync(const GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||||
|
{
|
||||||
|
auto fn = [this, request, handler, context]()
|
||||||
|
{
|
||||||
|
handler(this, request, getAsyncJobResult(request), context);
|
||||||
|
};
|
||||||
|
|
||||||
|
asyncExecute(new Runnable(fn));
|
||||||
|
}
|
||||||
|
|
||||||
|
VideorecogClient::GetAsyncJobResultOutcomeCallable VideorecogClient::getAsyncJobResultCallable(const GetAsyncJobResultRequest &request) const
|
||||||
|
{
|
||||||
|
auto task = std::make_shared<std::packaged_task<GetAsyncJobResultOutcome()>>(
|
||||||
|
[this, request]()
|
||||||
|
{
|
||||||
|
return this->getAsyncJobResult(request);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||||
|
return task->get_future();
|
||||||
|
}
|
||||||
|
|
||||||
51
videorecog/src/model/DetectVideoShotRequest.cc
Normal file
51
videorecog/src/model/DetectVideoShotRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* 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/videorecog/model/DetectVideoShotRequest.h>
|
||||||
|
|
||||||
|
using AlibabaCloud::Videorecog::Model::DetectVideoShotRequest;
|
||||||
|
|
||||||
|
DetectVideoShotRequest::DetectVideoShotRequest() :
|
||||||
|
RpcServiceRequest("videorecog", "2020-03-20", "DetectVideoShot")
|
||||||
|
{
|
||||||
|
setMethod(HttpRequest::Method::Post);
|
||||||
|
}
|
||||||
|
|
||||||
|
DetectVideoShotRequest::~DetectVideoShotRequest()
|
||||||
|
{}
|
||||||
|
|
||||||
|
bool DetectVideoShotRequest::getAsync()const
|
||||||
|
{
|
||||||
|
return async_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DetectVideoShotRequest::setAsync(bool async)
|
||||||
|
{
|
||||||
|
async_ = async;
|
||||||
|
setBodyParameter("Async", async ? "true" : "false");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DetectVideoShotRequest::getVideoUrl()const
|
||||||
|
{
|
||||||
|
return videoUrl_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DetectVideoShotRequest::setVideoUrl(const std::string& videoUrl)
|
||||||
|
{
|
||||||
|
videoUrl_ = videoUrl;
|
||||||
|
setBodyParameter("VideoUrl", videoUrl);
|
||||||
|
}
|
||||||
|
|
||||||
53
videorecog/src/model/DetectVideoShotResult.cc
Normal file
53
videorecog/src/model/DetectVideoShotResult.cc
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* 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/videorecog/model/DetectVideoShotResult.h>
|
||||||
|
#include <json/json.h>
|
||||||
|
|
||||||
|
using namespace AlibabaCloud::Videorecog;
|
||||||
|
using namespace AlibabaCloud::Videorecog::Model;
|
||||||
|
|
||||||
|
DetectVideoShotResult::DetectVideoShotResult() :
|
||||||
|
ServiceResult()
|
||||||
|
{}
|
||||||
|
|
||||||
|
DetectVideoShotResult::DetectVideoShotResult(const std::string &payload) :
|
||||||
|
ServiceResult()
|
||||||
|
{
|
||||||
|
parse(payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
DetectVideoShotResult::~DetectVideoShotResult()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void DetectVideoShotResult::parse(const std::string &payload)
|
||||||
|
{
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value value;
|
||||||
|
reader.parse(payload, value);
|
||||||
|
setRequestId(value["RequestId"].asString());
|
||||||
|
auto dataNode = value["Data"];
|
||||||
|
auto allShotFrameIds = dataNode["ShotFrameIds"]["ShotFrameId"];
|
||||||
|
for (auto value : allShotFrameIds)
|
||||||
|
data_.shotFrameIds.push_back(value.asString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DetectVideoShotResult::Data DetectVideoShotResult::getData()const
|
||||||
|
{
|
||||||
|
return data_;
|
||||||
|
}
|
||||||
|
|
||||||
62
videorecog/src/model/GenerateVideoCoverRequest.cc
Normal file
62
videorecog/src/model/GenerateVideoCoverRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* 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/videorecog/model/GenerateVideoCoverRequest.h>
|
||||||
|
|
||||||
|
using AlibabaCloud::Videorecog::Model::GenerateVideoCoverRequest;
|
||||||
|
|
||||||
|
GenerateVideoCoverRequest::GenerateVideoCoverRequest() :
|
||||||
|
RpcServiceRequest("videorecog", "2020-03-20", "GenerateVideoCover")
|
||||||
|
{
|
||||||
|
setMethod(HttpRequest::Method::Post);
|
||||||
|
}
|
||||||
|
|
||||||
|
GenerateVideoCoverRequest::~GenerateVideoCoverRequest()
|
||||||
|
{}
|
||||||
|
|
||||||
|
bool GenerateVideoCoverRequest::getIsGif()const
|
||||||
|
{
|
||||||
|
return isGif_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenerateVideoCoverRequest::setIsGif(bool isGif)
|
||||||
|
{
|
||||||
|
isGif_ = isGif;
|
||||||
|
setBodyParameter("IsGif", isGif ? "true" : "false");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GenerateVideoCoverRequest::getAsync()const
|
||||||
|
{
|
||||||
|
return async_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenerateVideoCoverRequest::setAsync(bool async)
|
||||||
|
{
|
||||||
|
async_ = async;
|
||||||
|
setBodyParameter("Async", async ? "true" : "false");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GenerateVideoCoverRequest::getVideoUrl()const
|
||||||
|
{
|
||||||
|
return videoUrl_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenerateVideoCoverRequest::setVideoUrl(const std::string& videoUrl)
|
||||||
|
{
|
||||||
|
videoUrl_ = videoUrl;
|
||||||
|
setBodyParameter("VideoUrl", videoUrl);
|
||||||
|
}
|
||||||
|
|
||||||
60
videorecog/src/model/GenerateVideoCoverResult.cc
Normal file
60
videorecog/src/model/GenerateVideoCoverResult.cc
Normal 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/videorecog/model/GenerateVideoCoverResult.h>
|
||||||
|
#include <json/json.h>
|
||||||
|
|
||||||
|
using namespace AlibabaCloud::Videorecog;
|
||||||
|
using namespace AlibabaCloud::Videorecog::Model;
|
||||||
|
|
||||||
|
GenerateVideoCoverResult::GenerateVideoCoverResult() :
|
||||||
|
ServiceResult()
|
||||||
|
{}
|
||||||
|
|
||||||
|
GenerateVideoCoverResult::GenerateVideoCoverResult(const std::string &payload) :
|
||||||
|
ServiceResult()
|
||||||
|
{
|
||||||
|
parse(payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
GenerateVideoCoverResult::~GenerateVideoCoverResult()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void GenerateVideoCoverResult::parse(const std::string &payload)
|
||||||
|
{
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value value;
|
||||||
|
reader.parse(payload, value);
|
||||||
|
setRequestId(value["RequestId"].asString());
|
||||||
|
auto dataNode = value["Data"];
|
||||||
|
auto allOutputsNode = dataNode["Outputs"]["Output"];
|
||||||
|
for (auto dataNodeOutputsOutput : allOutputsNode)
|
||||||
|
{
|
||||||
|
Data::Output outputObject;
|
||||||
|
if(!dataNodeOutputsOutput["ImageURL"].isNull())
|
||||||
|
outputObject.imageURL = dataNodeOutputsOutput["ImageURL"].asString();
|
||||||
|
if(!dataNodeOutputsOutput["Confidence"].isNull())
|
||||||
|
outputObject.confidence = std::stof(dataNodeOutputsOutput["Confidence"].asString());
|
||||||
|
data_.outputs.push_back(outputObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GenerateVideoCoverResult::Data GenerateVideoCoverResult::getData()const
|
||||||
|
{
|
||||||
|
return data_;
|
||||||
|
}
|
||||||
|
|
||||||
51
videorecog/src/model/GetAsyncJobResultRequest.cc
Normal file
51
videorecog/src/model/GetAsyncJobResultRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* 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/videorecog/model/GetAsyncJobResultRequest.h>
|
||||||
|
|
||||||
|
using AlibabaCloud::Videorecog::Model::GetAsyncJobResultRequest;
|
||||||
|
|
||||||
|
GetAsyncJobResultRequest::GetAsyncJobResultRequest() :
|
||||||
|
RpcServiceRequest("videorecog", "2020-03-20", "GetAsyncJobResult")
|
||||||
|
{
|
||||||
|
setMethod(HttpRequest::Method::Post);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetAsyncJobResultRequest::~GetAsyncJobResultRequest()
|
||||||
|
{}
|
||||||
|
|
||||||
|
bool GetAsyncJobResultRequest::getAsync()const
|
||||||
|
{
|
||||||
|
return async_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetAsyncJobResultRequest::setAsync(bool async)
|
||||||
|
{
|
||||||
|
async_ = async;
|
||||||
|
setBodyParameter("Async", async ? "true" : "false");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GetAsyncJobResultRequest::getJobId()const
|
||||||
|
{
|
||||||
|
return jobId_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetAsyncJobResultRequest::setJobId(const std::string& jobId)
|
||||||
|
{
|
||||||
|
jobId_ = jobId;
|
||||||
|
setBodyParameter("JobId", jobId);
|
||||||
|
}
|
||||||
|
|
||||||
60
videorecog/src/model/GetAsyncJobResultResult.cc
Normal file
60
videorecog/src/model/GetAsyncJobResultResult.cc
Normal 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/videorecog/model/GetAsyncJobResultResult.h>
|
||||||
|
#include <json/json.h>
|
||||||
|
|
||||||
|
using namespace AlibabaCloud::Videorecog;
|
||||||
|
using namespace AlibabaCloud::Videorecog::Model;
|
||||||
|
|
||||||
|
GetAsyncJobResultResult::GetAsyncJobResultResult() :
|
||||||
|
ServiceResult()
|
||||||
|
{}
|
||||||
|
|
||||||
|
GetAsyncJobResultResult::GetAsyncJobResultResult(const std::string &payload) :
|
||||||
|
ServiceResult()
|
||||||
|
{
|
||||||
|
parse(payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetAsyncJobResultResult::~GetAsyncJobResultResult()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void GetAsyncJobResultResult::parse(const std::string &payload)
|
||||||
|
{
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value value;
|
||||||
|
reader.parse(payload, value);
|
||||||
|
setRequestId(value["RequestId"].asString());
|
||||||
|
auto dataNode = value["Data"];
|
||||||
|
if(!dataNode["JobId"].isNull())
|
||||||
|
data_.jobId = dataNode["JobId"].asString();
|
||||||
|
if(!dataNode["Status"].isNull())
|
||||||
|
data_.status = dataNode["Status"].asString();
|
||||||
|
if(!dataNode["Result"].isNull())
|
||||||
|
data_.result = dataNode["Result"].asString();
|
||||||
|
if(!dataNode["ErrorCode"].isNull())
|
||||||
|
data_.errorCode = dataNode["ErrorCode"].asString();
|
||||||
|
if(!dataNode["ErrorMessage"].isNull())
|
||||||
|
data_.errorMessage = dataNode["ErrorMessage"].asString();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GetAsyncJobResultResult::Data GetAsyncJobResultResult::getData()const
|
||||||
|
{
|
||||||
|
return data_;
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user