From 8dfd1167c025756f28a9d95929018fc8319b4f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Beb=C3=B6k?= Date: Sat, 16 Mar 2024 10:48:31 +0100 Subject: [PATCH] chg: add size parameter to mpeg2_open (#505) --- examples/videoplayer/videoplayer.c | 2 +- include/mpeg2.h | 2 +- src/video/mpeg2.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/videoplayer/videoplayer.c b/examples/videoplayer/videoplayer.c index 414b6efb61..d034a68d11 100644 --- a/examples/videoplayer/videoplayer.c +++ b/examples/videoplayer/videoplayer.c @@ -37,7 +37,7 @@ int main(void) { fclose(f); mpeg2_t mp2; - mpeg2_open(&mp2, "rom:/movie.m1v"); + mpeg2_open(&mp2, "rom:/movie.m1v", display_get_width(), display_get_height()); wav64_t music; wav64_open(&music, "movie.wav64"); diff --git a/include/mpeg2.h b/include/mpeg2.h index 64aff034d2..4b0a8b8114 100644 --- a/include/mpeg2.h +++ b/include/mpeg2.h @@ -21,7 +21,7 @@ typedef struct { yuv_blitter_t yuv_blitter; } mpeg2_t; -void mpeg2_open(mpeg2_t *mp2, const char *fn); +void mpeg2_open(mpeg2_t *mp2, const char *fn, int output_width, int output_height); float mpeg2_get_framerate(mpeg2_t *mp2); bool mpeg2_next_frame(mpeg2_t *mp2); void mpeg2_draw_frame(mpeg2_t *mp2, display_context_t disp); diff --git a/src/video/mpeg2.c b/src/video/mpeg2.c index ac5ead55b7..44a9dd36c1 100644 --- a/src/video/mpeg2.c +++ b/src/video/mpeg2.c @@ -93,7 +93,7 @@ void rsp_mpeg1_set_quant_matrix(bool intra, const uint8_t quant_mtx[64]) { #define PL_MPEG_IMPLEMENTATION #include "pl_mpeg/pl_mpeg.h" -void mpeg2_open(mpeg2_t *mp2, const char *fn) { +void mpeg2_open(mpeg2_t *mp2, const char *fn, int output_width, int output_height) { memset(mp2, 0, sizeof(mpeg2_t)); rsp_mpeg1_init(); @@ -126,7 +126,7 @@ void mpeg2_open(mpeg2_t *mp2, const char *fn) { // Create a YUV blitter for this resolution mp2->yuv_blitter = yuv_blitter_new_fmv( width, height, - display_get_width(), display_get_height(), + output_width, output_height, NULL); }