Browse Source

fix the buf for video_filter and video_viewport option

ZengGengSen 1 year ago
parent
commit
6a52c5c984

+ 5 - 4
app/src/main/cpp/gfx/video_driver.c

@@ -1417,6 +1417,7 @@ retro_proc_address_t video_driver_get_proc_address(const char *sym)
 #ifdef HAVE_VIDEO_FILTER
 void video_driver_filter_free(void)
 {
+   RARCH_LOG("[VideoFilter]: video_driver_filter_free");
    video_driver_state_t *video_st                 = &video_driver_st;
    if (video_st->state_filter)
       rarch_softfilter_free(video_st->state_filter);
@@ -1437,9 +1438,10 @@ void video_driver_filter_free(void)
    video_st->flags          &= ~(VIDEO_FLAG_STATE_OUT_RGB32);
 }
 
-void video_driver_init_filter(enum retro_pixel_format colfmt_int,
+void video_driver_filter_init(enum retro_pixel_format colfmt_int,
       settings_t *settings)
 {
+   RARCH_LOG("[VideoFilter]: video_driver_filter_init");
    unsigned pow2_x, pow2_y, maxsize;
    void *buf                            = NULL;
    video_driver_state_t *video_st       = &video_driver_st;
@@ -3178,9 +3180,8 @@ bool video_driver_init_internal(bool *video_is_threaded, bool verbosity_enabled)
    const char *path_softfilter_plugin     = settings->paths.path_softfilter_plugin;
 
    /* Init video filter only when game is running */
-   if ((runloop_st->current_core.flags & RETRO_CORE_FLAG_GAME_LOADED) &&
-         !string_is_empty(path_softfilter_plugin))
-      video_driver_init_filter(video_driver_pix_fmt, settings);
+   if (!string_is_empty(path_softfilter_plugin))
+      video_driver_filter_init(video_driver_pix_fmt, settings);
 #endif
 
    max_dim   = MAX(geom->max_width, geom->max_height);

+ 1 - 1
app/src/main/cpp/gfx/video_driver.h

@@ -1260,7 +1260,7 @@ void recording_dump_frame(
 
 void video_driver_gpu_record_deinit(void);
 
-void video_driver_init_filter(enum retro_pixel_format colfmt_int,
+void video_driver_filter_init(enum retro_pixel_format colfmt_int,
       settings_t *settings);
 
 void video_context_driver_reset(void);

+ 2 - 2
app/src/main/cpp/play_feature_delivery/play_feature_delivery.c

@@ -246,7 +246,7 @@ JNIEXPORT void JNICALL Java_com_retroarch_browser_retroactivity_RetroActivityCom
 
    RARCH_LOG("[Video] Filter path: %s", settings->paths.path_softfilter_plugin);
 
-   runloop_st->flags2 |= RUNLOOP_FLAG_NEED_REINIT_DRIVERS;
+//   runloop_st->flags2 |= RUNLOOP_FLAG_NEED_REINIT_DRIVERS;
 }
 
 JNIEXPORT void JNICALL Java_com_retroarch_browser_retroactivity_RetroActivityCommon_setAspectRatio
@@ -288,7 +288,7 @@ JNIEXPORT void JNICALL Java_com_retroarch_browser_retroactivity_RetroActivityCom
    custom_vp->y = y;
    custom_vp->width = width;
    custom_vp->height = height;
-   command_event(CMD_EVENT_VIDEO_APPLY_STATE_CHANGES, NULL);
+//   command_event(CMD_EVENT_VIDEO_APPLY_STATE_CHANGES, NULL);
 }
 /******************/
 /* Initialisation */

+ 0 - 4
app/src/main/cpp/runloop.c

@@ -6891,26 +6891,22 @@ int runloop_iterate(void)
 #endif
 
       if (want_runahead) {
-         RARCH_LOG("[DEBUG]: %s:%d", __FILE_NAME__, __LINE__);
          runahead_run(
                  runloop_st,
                  run_ahead_num_frames,
                  run_ahead_hide_warnings,
                  run_ahead_secondary_instance);
       } else if (runloop_st->preempt_data) {
-         RARCH_LOG("[DEBUG]: %s:%d", __FILE_NAME__, __LINE__);
          preempt_run(runloop_st->preempt_data, runloop_st);
       } else
 #endif
       {
-         RARCH_LOG("[DEBUG]: %s:%d", __FILE_NAME__, __LINE__);
          core_run();
       }
    }
 
    /* Increment runtime tick counter after each call to
     * core_run() or run_ahead() */
-   RARCH_LOG("[DEBUG]: %s:%d", __FILE_NAME__, __LINE__);
    runloop_st->core_runtime_usec += runloop_core_runtime_tick(
          runloop_st,
          slowmotion_ratio,

+ 13 - 13
app/src/main/java/com/xugame/gameconsole/emulator/RetroArchEmulatorActivity.java

@@ -405,19 +405,19 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
                                 break;
                         }
                     }
-//                    if (scanLine >= 0 && scanLine < 3) {
-//                        switch (ScreenType.values()[scanLine]) {
-//                            case NORMAL:
-//                                switchFilter(null);
-//                                break;
-//                            case SAI_2X:
-//                                switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/2xSaI.filt");
-//                                break;
-//                            case SCANLINE:
-//                                switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scanline2x.filt");
-//                                break;
-//                        }
-//                    }
+                    if (scanLine >= 0 && scanLine < 3) {
+                        switch (ScreenType.values()[scanLine]) {
+                            case NORMAL:
+                                switchFilter(null);
+                                break;
+                            case SAI_2X:
+                                switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/2xSaI.filt");
+                                break;
+                            case SCANLINE:
+                                switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scanline2x.filt");
+                                break;
+                        }
+                    }
                 }
             } else if (resultCode == 0) {
                 exitLocalGame();