mirror of
https://gitee.com/openharmony/multimedia_av_codec
synced 2024-11-30 10:32:24 +00:00
修改nativedemo编译报错
Signed-off-by: j30015740 <jinjiaquan@huawei.com>
This commit is contained in:
parent
0d7eeea001
commit
c225b1edf5
@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <memory>
|
||||
|
||||
namespace OHOS {
|
||||
namespace Media {
|
||||
@ -35,5 +36,11 @@ constexpr T AlignUp(T num, U alignment)
|
||||
: num;
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
inline std::shared_ptr<T> ReinterpretPointerCast(const std::shared_ptr<U>& ptr) noexcept
|
||||
{
|
||||
return std::shared_ptr<T>(ptr, reinterpret_cast<T*>(ptr.get()));
|
||||
}
|
||||
|
||||
} // namespace Media
|
||||
} // namespace OHOS
|
@ -29,6 +29,7 @@ group("av_codec_unit_test") {
|
||||
deps += [
|
||||
"unittest:av_muxer_unit_test",
|
||||
"unittest:format_unit_test",
|
||||
"unittest:av_video_unit_test",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
|
||||
#include <ctime>
|
||||
#include "videodec_ffmpeg_demo.h"
|
||||
#include "avcodec_common.h" //AVCodecBufferInfo
|
||||
#include <ctime>
|
||||
#include "securec.h"
|
||||
|
||||
extern "C" {
|
||||
#include <string.h>
|
||||
@ -297,8 +298,8 @@ int32_t VDecFfmpegSample::ConfigureVideoDecoder()
|
||||
format.PutIntValue("height", DEFAULT_HEIGHT);
|
||||
format.PutIntValue("input_buffer_cnt", IN_BUFFER_CNT);
|
||||
format.PutIntValue("surface_pixformat", static_cast<int32_t>(VideoPixelFormat::BGRA));
|
||||
format.PutIntValue("surface_rotation", static_cast<int32_t>(SurfaceRotation::SURFACE_ROTATION_90));
|
||||
format.PutIntValue("surface_scale_type", static_cast<int32_t>(VideoScaleType::VIDEO_SCALE_TYPE_FIT));
|
||||
format.PutIntValue("surface_rotation", static_cast<int32_t>(GraphicTransformType::GRAPHIC_ROTATE_90));
|
||||
format.PutIntValue("surface_scale_type", static_cast<int32_t>(ScalingMode::SCALING_MODE_SCALE_TO_WINDOW));
|
||||
|
||||
|
||||
// 配置config信息
|
||||
@ -313,9 +314,9 @@ int32_t VDecFfmpegSample::SetparameterVideoDecoder()
|
||||
{
|
||||
Format format;
|
||||
format.PutIntValue("bitrate", static_cast<int64_t>(DEFAULT_FRAME_RATE));
|
||||
format.PutIntValue("surface_rotation", static_cast<int32_t>(SurfaceRotation::SURFACE_ROTATION_180));
|
||||
format.PutIntValue("surface_rotation", static_cast<int32_t>(GraphicTransformType::GRAPHIC_ROTATE_180));
|
||||
format.PutIntValue("surface_pixformat", static_cast<int32_t>(VideoPixelFormat::RGBA));
|
||||
format.PutIntValue("surface_scale_type", static_cast<int32_t>(VideoScaleType::VIDEO_SCALE_TYPE_FIT_CROP));
|
||||
format.PutIntValue("surface_scale_type", static_cast<int32_t>(ScalingMode::SCALING_MODE_SCALE_CROP));
|
||||
|
||||
// 配置config信息
|
||||
if (vdec_->SetParameter(format) != AVCS_ERR_OK) {
|
||||
|
Loading…
Reference in New Issue
Block a user