From fdaf3c34267775ad3e9e8431bbb541433fde09f2 Mon Sep 17 00:00:00 2001 From: yj Date: Sun, 25 Jun 2023 22:15:31 +0800 Subject: [PATCH] =?UTF-8?q?player=5Fframework=E7=9B=B8=E5=85=B3xts?= =?UTF-8?q?=E6=94=B9=E6=88=90avcodec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yj --- .../audioDecEncNdk/include/ADecEncNdkSample.h | 2 +- .../audioDecEncNdk/src/ADecEncNdkSample.cpp | 2 +- .../src/ActsAudioDecEncNdkTest.cpp | 2 +- .../videoDecEncNdk/include/VDecEncNdkSample.h | 2 +- .../src/ActsVideoDecEncNdkTest.cpp | 16 +++++++++------- .../videoDecEncNdk/src/VDecEncNdkSample.cpp | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/multimedia/media/media_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h b/multimedia/media/media_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h index 784b2f3ef..672ea072e 100644 --- a/multimedia/media/media_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h +++ b/multimedia/media/media_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h @@ -33,7 +33,7 @@ #include "ndktest_log.h" namespace OHOS { -namespace MediaAVCodec { +namespace Media { class ADecEncSignal { public: std::mutex inMutexDec_; diff --git a/multimedia/media/media_cpp_standard/audioDecEncNdk/src/ADecEncNdkSample.cpp b/multimedia/media/media_cpp_standard/audioDecEncNdk/src/ADecEncNdkSample.cpp index 15b0a2105..895c4683e 100644 --- a/multimedia/media/media_cpp_standard/audioDecEncNdk/src/ADecEncNdkSample.cpp +++ b/multimedia/media/media_cpp_standard/audioDecEncNdk/src/ADecEncNdkSample.cpp @@ -19,7 +19,7 @@ #include "native_avcodec_base.h" using namespace OHOS; -using namespace OHOS::MediaAVCodec; +using namespace OHOS::Media; using namespace std; namespace { diff --git a/multimedia/media/media_cpp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp b/multimedia/media/media_cpp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp index 13e1f6814..26d172d61 100644 --- a/multimedia/media/media_cpp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp +++ b/multimedia/media/media_cpp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp @@ -26,7 +26,7 @@ using namespace std; using namespace testing::ext; using namespace OHOS; -using namespace OHOS::MediaAVCodec; +using namespace OHOS::Media; namespace { class ActsAudioDecEncNdkTest : public testing::Test { diff --git a/multimedia/media/media_cpp_standard/videoDecEncNdk/include/VDecEncNdkSample.h b/multimedia/media/media_cpp_standard/videoDecEncNdk/include/VDecEncNdkSample.h index e052c5d44..ef641f94a 100644 --- a/multimedia/media/media_cpp_standard/videoDecEncNdk/include/VDecEncNdkSample.h +++ b/multimedia/media/media_cpp_standard/videoDecEncNdk/include/VDecEncNdkSample.h @@ -35,7 +35,7 @@ #include "native_avcodec_videoencoder.h" namespace OHOS { -namespace MediaAVCodec { +namespace Media { class VDecEncSignal { public: std::mutex inMutexDec_; diff --git a/multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp b/multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp index b4828305a..4287cb950 100644 --- a/multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp +++ b/multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp @@ -25,7 +25,7 @@ using namespace std; using namespace testing::ext; using namespace OHOS; -using namespace OHOS::MediaAVCodec; +using namespace OHOS::Media; namespace { class ActsVideoDecEncNdkTest : public testing::Test { @@ -41,6 +41,7 @@ void ActsVideoDecEncNdkTest::TearDownTestCase() {} void ActsVideoDecEncNdkTest::SetUp() {} void ActsVideoDecEncNdkTest::TearDown() {} const string MIME_TYPE_AVC = "video/avc"; +const string MIME_TYPE_MPEG4 = "video/mp4v-es"; constexpr uint32_t DEFAULT_WIDTH = 320; constexpr uint32_t DEFAULT_HEIGHT = 240; constexpr uint32_t DEFAULT_PIXELFORMAT = 2; @@ -122,7 +123,8 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010 struct OH_AVCodec* videoDec = vDecEncSample->CreateVideoDecoderByMime(MIME_TYPE_AVC); ASSERT_NE(nullptr, videoDec); - struct OH_AVCodec* videoEnc = vDecEncSample->CreateVideoEncoderByMime(MIME_TYPE_AVC); + struct OH_AVCodec* videoEnc = vDecEncSample->CreateVideoEncoderByMime(MIME_TYPE_MPEG4); + videoEnc = vDecEncSample->CreateVideoEncoderByMime(MIME_TYPE_AVC); ASSERT_NE(nullptr, videoEnc); vDecEncSample->SetReadPath(READPATH); vDecEncSample->SetSavePath("/data/media/video_001.h264"); @@ -135,7 +137,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010 {OH_MD_KEY_PIXEL_FORMAT, DEFAULT_PIXELFORMAT}, }; ASSERT_EQ(true, SetFormat(VideoFormat, VideoParam)); - OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_TRACK_TYPE, OH_MediaType::MEDIA_TYPE_VID); + OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_TRACK_TYPE, MEDIA_TYPE_VID); OH_AVFormat_SetDoubleValue(VideoFormat, OH_MD_KEY_FRAME_RATE, DEFAULT_FRAMERATE); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureDec(VideoFormat)); @@ -188,7 +190,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_020 OH_AVFormat *VideoFormat = createFormat(); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureDec(VideoFormat)); - OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE, OH_VideoEncodeBitrateMode::CBR); + OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE, CBR); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureEnc(VideoFormat)); ASSERT_EQ(AV_ERR_OK, vDecEncSample->GetSurface()); ASSERT_EQ(AV_ERR_OK, vDecEncSample->SetOutputSurface()); @@ -232,7 +234,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_030 vDecEncSample->SetSavePath("/data/media/video_003.h264"); OH_AVFormat *VideoFormat = createFormat(); - OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_PROFILE, OH_AVCProfile::AVC_PROFILE_BASELINE); + OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_PROFILE, AVC_PROFILE_BASELINE); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureDec(VideoFormat)); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureEnc(VideoFormat)); @@ -275,7 +277,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_040 vDecEncSample->SetSavePath("/data/media/video_004.h264"); OH_AVFormat *VideoFormat = createFormat(); - OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_PROFILE, OH_AVCProfile::AVC_PROFILE_HIGH); + OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_PROFILE, AVC_PROFILE_HIGH); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureDec(VideoFormat)); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureEnc(VideoFormat)); @@ -331,7 +333,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_050 vDecEncSample->SetSavePath("/data/media/video_005.h264"); OH_AVFormat *VideoFormat = createFormat(); - OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_PROFILE, OH_AVCProfile::AVC_PROFILE_MAIN); + OH_AVFormat_SetIntValue(VideoFormat, OH_MD_KEY_PROFILE, AVC_PROFILE_MAIN); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureDec(VideoFormat)); ASSERT_EQ(AV_ERR_OK, vDecEncSample->ConfigureEnc(VideoFormat)); diff --git a/multimedia/media/media_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp b/multimedia/media/media_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp index cb9dc0442..556fb9a22 100644 --- a/multimedia/media/media_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp +++ b/multimedia/media/media_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp @@ -23,7 +23,7 @@ #include "VDecEncNdkSample.h" using namespace OHOS; -using namespace OHOS::MediaAVCodec; +using namespace OHOS::Media; using namespace std; namespace { -- GitLab