3 Commits

Author SHA1 Message Date
Dan Albert
1bfbb64c01 Merge 2d36bf2ee3 into 38c889d999 2025-09-11 14:21:32 +00:00
Dan Albert
38c889d999 Increase warning level in native-midi. 2025-09-11 12:32:22 +00:00
Dan Albert
2d36bf2ee3 Increase warning level in native-codec. 2025-09-10 16:45:32 -07:00
3 changed files with 19 additions and 21 deletions

View File

@@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.22.1) cmake_minimum_required(VERSION 3.22.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -UNDEBUG") include(AppLibrary)
add_library(native-codec-jni SHARED add_app_library(native-codec-jni SHARED
looper.cpp looper.cpp
native-codec-jni.cpp) native-codec-jni.cpp
)
# Include libraries needed for native-codec-jni lib
target_link_libraries(native-codec-jni target_link_libraries(native-codec-jni
android android
log log
mediandk mediandk
OpenMAXAL) OpenMAXAL
)

View File

@@ -199,7 +199,7 @@ void mylooper::handle(int what, void* obj) {
extern "C" { extern "C" {
jboolean Java_com_example_nativecodec_NativeCodec_createStreamingMediaPlayer( jboolean Java_com_example_nativecodec_NativeCodec_createStreamingMediaPlayer(
JNIEnv* env, jclass clazz, jobject assetMgr, jstring filename) { JNIEnv* env, jclass, jobject assetMgr, jstring filename) {
LOGV("@@@ create"); LOGV("@@@ create");
// convert Java string to UTF-8 // convert Java string to UTF-8
@@ -269,7 +269,7 @@ jboolean Java_com_example_nativecodec_NativeCodec_createStreamingMediaPlayer(
// set the playing state for the streaming media player // set the playing state for the streaming media player
void Java_com_example_nativecodec_NativeCodec_setPlayingStreamingMediaPlayer( void Java_com_example_nativecodec_NativeCodec_setPlayingStreamingMediaPlayer(
JNIEnv* env, jclass clazz, jboolean isPlaying) { JNIEnv*, jclass, jboolean isPlaying) {
LOGV("@@@ playpause: %d", isPlaying); LOGV("@@@ playpause: %d", isPlaying);
if (mlooper) { if (mlooper) {
if (isPlaying) { if (isPlaying) {
@@ -281,8 +281,7 @@ void Java_com_example_nativecodec_NativeCodec_setPlayingStreamingMediaPlayer(
} }
// shut down the native media system // shut down the native media system
void Java_com_example_nativecodec_NativeCodec_shutdown(JNIEnv* env, void Java_com_example_nativecodec_NativeCodec_shutdown(JNIEnv*, jclass) {
jclass clazz) {
LOGV("@@@ shutdown"); LOGV("@@@ shutdown");
if (mlooper) { if (mlooper) {
mlooper->post(kMsgDecodeDone, &data, true /* flush */); mlooper->post(kMsgDecodeDone, &data, true /* flush */);
@@ -297,8 +296,7 @@ void Java_com_example_nativecodec_NativeCodec_shutdown(JNIEnv* env,
} }
// set the surface // set the surface
void Java_com_example_nativecodec_NativeCodec_setSurface(JNIEnv* env, void Java_com_example_nativecodec_NativeCodec_setSurface(JNIEnv* env, jclass,
jclass clazz,
jobject surface) { jobject surface) {
// obtain a native window from a Java surface // obtain a native window from a Java surface
if (data.window) { if (data.window) {
@@ -311,7 +309,7 @@ void Java_com_example_nativecodec_NativeCodec_setSurface(JNIEnv* env,
// rewind the streaming media player // rewind the streaming media player
void Java_com_example_nativecodec_NativeCodec_rewindStreamingMediaPlayer( void Java_com_example_nativecodec_NativeCodec_rewindStreamingMediaPlayer(
JNIEnv* env, jclass clazz) { JNIEnv*, jclass) {
LOGV("@@@ rewind"); LOGV("@@@ rewind");
if (mlooper) { if (mlooper) {
mlooper->post(kMsgSeek, &data); mlooper->post(kMsgSeek, &data);

View File

@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.22.1) cmake_minimum_required(VERSION 3.22.1)
project(native_midi LANGUAGES C CXX) project(native_midi LANGUAGES CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -O0") include(AppLibrary)
add_library(${PROJECT_NAME} add_app_library(${PROJECT_NAME}
SHARED SHARED
AppMidiManager.cpp AppMidiManager.cpp
MainActivity.cpp MainActivity.cpp
) )