diff --git a/multimedia/media/media_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h b/multimedia/media/media_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h index 784b2f3ef85b65b3ae97ffd873d7c1a5e2ddf745..672ea072e13634f4656d71768aacd5e03cfa88e8 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 15b0a2105bb5e7def2c4f30bd61215ed320d1611..895c4683efe24babe0b07a4297d20bff50b52dc8 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 13e1f681471adcc363cbc4b1f75c2a4d4bc880b1..26d172d6121c8a90b526066b1ea450b8e6d94c6c 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 e052c5d4453aab9ab5866fb9d2bfbdd3a647388c..ef641f94a2ea42a22675b79f4c4fed80f6226150 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 b4828305a4c1a311c57dca70e7ab192fc4e11fff..4287cb9506cf6bd5ef6f73fee546185c51915eb7 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 cb9dc04427194d127c5968d40a4266f83f6a5b98..556fb9a223a28807dd5df6cbf489e434b2988d2e 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 {