From 288828bfdf37899b23ec122697b37534d90d88a3 Mon Sep 17 00:00:00 2001 From: zhanghongran Date: Mon, 22 May 2023 12:02:25 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0#define=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanghongran --- frameworks/native/capi/common/native_object.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frameworks/native/capi/common/native_object.h b/frameworks/native/capi/common/native_object.h index 6582db39a..805fbff6b 100644 --- a/frameworks/native/capi/common/native_object.h +++ b/frameworks/native/capi/common/native_object.h @@ -13,6 +13,9 @@ * limitations under the License. */ +#ifndef NATIVE_OBJECT_H +#define NATIVE_OBJECT_H + #include #include "avsource.h" #include "native_avsource.h" @@ -24,4 +27,6 @@ struct AVSourceObject : public OH_AVSource { ~AVSourceObject() = default; const std::shared_ptr source_; -}; \ No newline at end of file +}; + +#endif // NATIVE_OBJECT_H \ No newline at end of file -- Gitee From c348eecd8c0e62184fb12db2d721469f1502c29d Mon Sep 17 00:00:00 2001 From: zhanghongran Date: Mon, 22 May 2023 12:43:41 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=8C=E5=AE=BD?= =?UTF-8?q?=E8=BF=87=E9=95=BF=E5=92=8C=E7=A9=BA=E6=A0=BC=E4=B8=8D=E5=BD=93?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanghongran --- frameworks/native/capi/avcodec/native_video_encoder.cpp | 3 ++- services/engine/muxer/muxer_engine_impl.cpp | 2 +- .../avcodec_test/native/surface/surface_native_mock.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frameworks/native/capi/avcodec/native_video_encoder.cpp b/frameworks/native/capi/avcodec/native_video_encoder.cpp index 11930e886..e36c9db6e 100644 --- a/frameworks/native/capi/avcodec/native_video_encoder.cpp +++ b/frameworks/native/capi/avcodec/native_video_encoder.cpp @@ -377,7 +377,8 @@ OH_AVErrCode OH_VideoEncoder_NotifyEndOfStream(OH_AVCodec *codec) CHECK_AND_RETURN_RET_LOG(videoEncObj->videoEncoder_ != nullptr, AV_ERR_INVALID_VAL, "Video encoder is nullptr!"); int32_t ret = videoEncObj->videoEncoder_->NotifyEos(); - CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AV_ERR_OPERATE_NOT_PERMIT, "Video encoder notify end of stream failed!"); + CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AV_ERR_OPERATE_NOT_PERMIT, + "Video encoder notify end of stream failed!"); return AV_ERR_OK; } diff --git a/services/engine/muxer/muxer_engine_impl.cpp b/services/engine/muxer/muxer_engine_impl.cpp index 42820502f..7d2edf0dc 100644 --- a/services/engine/muxer/muxer_engine_impl.cpp +++ b/services/engine/muxer/muxer_engine_impl.cpp @@ -265,7 +265,7 @@ int32_t MuxerEngineImpl::DumpInfo(int32_t fd) std::string("Track_") + std::to_string(mediaDescIdx) + "_Info"); for (auto iter : dumpTable) { dumpControler.AddInfoFromFormat( - DUMP_MUXER_INFO_INDEX + (dumpTrackIndex << 8) + dumpInfoIndex, + DUMP_MUXER_INFO_INDEX + (dumpTrackIndex << DUMP_OFFSET_8) + dumpInfoIndex, mediaDesc, iter.first, iter.second); dumpInfoIndex++; } diff --git a/test/unittest/avcodec_test/native/surface/surface_native_mock.cpp b/test/unittest/avcodec_test/native/surface/surface_native_mock.cpp index d96af8be4..a484b548a 100644 --- a/test/unittest/avcodec_test/native/surface/surface_native_mock.cpp +++ b/test/unittest/avcodec_test/native/surface/surface_native_mock.cpp @@ -34,7 +34,7 @@ sptr SurfaceNativeMock::GetSurface() { if (surface_ == nullptr) { sptr option = new Rosen::WindowOption(); - option->SetWindowRect({0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT}); + option->SetWindowRect({ 0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT }); option->SetWindowType(Rosen::WindowType::WINDOW_TYPE_APP_LAUNCHING); option->SetWindowMode(Rosen::WindowMode::WINDOW_MODE_FLOATING); window_ = Rosen::Window::Create("avcodec_unittest", option); -- Gitee