From 483b14589378ef2efe0a7b0375a58ea37851f76d Mon Sep 17 00:00:00 2001 From: xufuji456 <839789740@qq.com> Date: Wed, 13 Oct 2021 00:29:28 +0800 Subject: [PATCH] change ffmpeg_hw.c to ffmpeg_hw.cpp --- app/CMakeLists.txt | 2 +- app/src/main/cpp/ffmpeg/{ffmpeg_hw.c => ffmpeg_hw.cpp} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename app/src/main/cpp/ffmpeg/{ffmpeg_hw.c => ffmpeg_hw.cpp} (97%) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 6f0fadc..bd05653 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -24,7 +24,7 @@ add_library( # Sets the name of the library. src/main/cpp/ffmpeg/ffmpeg_opt.c src/main/cpp/ffmpeg_cmd.c src/main/cpp/ffmpeg/ffprobe.c - src/main/cpp/ffmpeg/ffmpeg_hw.c + src/main/cpp/ffmpeg/ffmpeg_hw.cpp src/main/cpp/audio_player.cpp src/main/cpp/openSL_audio_player.cpp src/main/cpp/video_player.cpp diff --git a/app/src/main/cpp/ffmpeg/ffmpeg_hw.c b/app/src/main/cpp/ffmpeg/ffmpeg_hw.cpp similarity index 97% rename from app/src/main/cpp/ffmpeg/ffmpeg_hw.c rename to app/src/main/cpp/ffmpeg/ffmpeg_hw.cpp index 962d8f7..4d33cad 100644 --- a/app/src/main/cpp/ffmpeg/ffmpeg_hw.c +++ b/app/src/main/cpp/ffmpeg/ffmpeg_hw.cpp @@ -58,7 +58,7 @@ static HWDevice *hw_device_add(void) nb_hw_devices = 0; return NULL; } - hw_devices[nb_hw_devices] = av_mallocz(sizeof(HWDevice)); + hw_devices[nb_hw_devices] = static_cast(av_mallocz(sizeof(HWDevice))); if (!hw_devices[nb_hw_devices]) return NULL; return hw_devices[nb_hw_devices++]; @@ -74,7 +74,7 @@ static char *hw_device_default_name(enum AVHWDeviceType type) size_t index_pos; int index, index_limit = 1000; index_pos = strlen(type_name); - name = av_malloc(index_pos + 4); + name = static_cast(av_malloc(index_pos + 4)); if (!name) return NULL; for (index = 0; index < index_limit; index++) { @@ -432,7 +432,7 @@ int hw_device_setup_for_encode(OutputStream *ost) static int hwaccel_retrieve_data(AVCodecContext *avctx, AVFrame *input) { - InputStream *ist = avctx->opaque; + InputStream *ist = static_cast(avctx->opaque); AVFrame *output = NULL; enum AVPixelFormat output_format = ist->hwaccel_output_format; int err; @@ -474,7 +474,7 @@ fail: int hwaccel_decode_init(AVCodecContext *avctx) { - InputStream *ist = avctx->opaque; + InputStream *ist = static_cast(avctx->opaque); ist->hwaccel_retrieve_data = &hwaccel_retrieve_data;