Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/5] avradio/vissualize: support simple skiping of chars
@ 2023-07-22 14:11 Michael Niedermayer
  2023-07-22 14:11 ` [FFmpeg-devel] [PATCH 2/5] avradio/vissualize: change color of the active station Michael Niedermayer
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Michael Niedermayer @ 2023-07-22 14:11 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavradio/vissualize.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/libavradio/vissualize.c b/libavradio/vissualize.c
index a3dcf5801b..2d397546dc 100644
--- a/libavradio/vissualize.c
+++ b/libavradio/vissualize.c
@@ -81,8 +81,11 @@ static void draw_char(uint8_t *frame_buffer, ptrdiff_t stride, char ch, int x0,
     }
 }
 
-static void draw_string(uint8_t *frame_buffer, ptrdiff_t stride, char *str, int x0, int y0, int xd, int yd, int r, int g, int b, int w, int h)
+static void draw_string(uint8_t *frame_buffer, ptrdiff_t stride, char *str, int x0, int y0, int xd, int yd, int r, int g, int b, int w, int h, int skipx)
 {
+    x0 += xd*9*skipx;
+    y0 += yd*9*skipx;
+
     while(*str) {
         draw_char(frame_buffer, stride, *str++, x0, y0, xd, yd, r, g, b, w, h);
         x0 += xd*9;
@@ -206,6 +209,7 @@ int ff_sdr_vissualization(SDRContext *sdr, AVStream *st, AVPacket *pkt)
             int color = s->stream ? 64 : 32;
             int size = s->stream ? 181 : 128;
             int xd = size, yd = size;
+            int pos;
 
             if (!s->in_station_list)
                 continue;
@@ -217,14 +221,14 @@ int ff_sdr_vissualization(SDRContext *sdr, AVStream *st, AVPacket *pkt)
             }
             av_strlcatf(text, sizeof(text), "%f Mhz %d %d %d",
                      f/1000000, (int)s->score, ff_sdr_histogram_score(s), s->timeout);
-            draw_string(pkt->data, 4*w, text, xmid + 8*yd, 320*h2, xd, yd, color, color, color, w, h);
+            draw_string(pkt->data, 4*w, text, xmid + 8*yd, 320*h2, xd, yd, color, color, color, w, h, 0);
             if (s->radiotext[0]) {
-                draw_string(pkt->data, 4*w, s->radiotext, xmid + 8*yd, 320*h2 + 24*yd, xd, yd, color, color, color, w, h);
+                draw_string(pkt->data, 4*w, s->radiotext, xmid + 8*yd, 320*h2 + 24*yd, xd, yd, color, color, color, w, h, 0);
             }
             if (s->title[0] || s->artist[0]) {
                 int len = strlen(s->title) + 1;
-                draw_string(pkt->data, 4*w, s->title , xmid + 8*yd, 320*h2 + 2*24*yd, xd, yd, color, color*1.5, color, w, h);
-                draw_string(pkt->data, 4*w, s->artist, xmid + 8*yd + 9*xd*len, 320*h2 + 2*24*yd + 9*yd*len, xd, yd, color, color*2, color, w, h);
+                draw_string(pkt->data, 4*w, s->title , xmid + 8*yd, 320*h2 + 2*24*yd, xd, yd, color, color*1.5, color, w, h, 0);
+                draw_string(pkt->data, 4*w, s->artist, xmid + 8*yd, 320*h2 + 2*24*yd, xd, yd, color, color*2, color, w, h, len);
             }
         }
     }
-- 
2.31.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-24 17:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-22 14:11 [FFmpeg-devel] [PATCH 1/5] avradio/vissualize: support simple skiping of chars Michael Niedermayer
2023-07-22 14:11 ` [FFmpeg-devel] [PATCH 2/5] avradio/vissualize: change color of the active station Michael Niedermayer
2023-07-22 14:11 ` [FFmpeg-devel] [PATCH 3/5] avradio/sdr: Remove direct inclusion of pthread.h Michael Niedermayer
2023-07-22 14:11 ` [FFmpeg-devel] [PATCH 4/5] avradio/sdrdemux: avoid literal offsets in dump code Michael Niedermayer
2023-07-22 14:11 ` [FFmpeg-devel] [PATCH 5/5] avradio/sdrdemux: store min/max frequency, driver, label and tuner Michael Niedermayer
2023-07-24 17:07 ` [FFmpeg-devel] [PATCH 1/5] avradio/vissualize: support simple skiping of chars Michael Niedermayer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git