[vlc-commits] vmem: client should get display resolution too

Sergey Radionov git at videolan.org
Tue Apr 30 10:27:03 CEST 2019


vlc | branch: master | Sergey Radionov <rsatom at gmail.com> | Fri Apr 26 23:05:25 2019 +0700| [27348540007b46359d5bc89f5a2a0a5c6f85e3a1] | committer: Steve Lhomme

vmem: client should get display resolution too

to be able display frames correctly

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=27348540007b46359d5bc89f5a2a0a5c6f85e3a1
---

 include/vlc/libvlc_media_player.h |  8 ++++++--
 modules/video_output/vmem.c       | 11 ++++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index e1d758956e..ca72a550d3 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -346,13 +346,17 @@ typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
  * \param opaque pointer to the private pointer passed to
  *               libvlc_video_set_callbacks() [IN/OUT]
  * \param chroma pointer to the 4 bytes video format identifier [IN/OUT]
- * \param width pointer to the pixel width [IN/OUT]
- * \param height pointer to the pixel height [IN/OUT]
+ * \param width pointer to the buffer width in pixels[IN/OUT]
+ * \param height pointer to the buffer height in pixels[IN/OUT]
  * \param pitches table of scanline pitches in bytes for each pixel plane
  *                (the table is allocated by LibVLC) [OUT]
  * \param lines table of scanlines count for each plane [OUT]
  * \return the number of picture buffers allocated, 0 indicates failure
  *
+ * \version LibVLC 4.0.0 and later.
+ * \param (width+1) - pointer to display width in pixels[IN]
+ * \param (height+1) - pointer to display height in pixels[IN]
+ *
  * \note
  * For each pixels plane, the scanline pitch must be bigger than or equal to
  * the number of bytes per pixel multiplied by the pixel width.
diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index 87ea3244f4..ee5e544656 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -144,13 +144,22 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         memset(sys->pitches, 0, sizeof(sys->pitches));
         memset(sys->lines, 0, sizeof(sys->lines));
 
-        if (setup(&sys->opaque, chroma, &fmt.i_width, &fmt.i_height,
+        unsigned widths[2], heights[2];
+        widths[0] = fmt.i_width;
+        widths[1] = fmt.i_visible_width;
+
+        heights[0] = fmt.i_height;
+        heights[1] = fmt.i_visible_height;
+
+        if (setup(&sys->opaque, chroma, widths, heights,
                            sys->pitches, sys->lines) == 0) {
             msg_Err(vd, "video format setup failure (no pictures)");
             free(sys);
             return VLC_EGENERIC;
         }
         fmt.i_chroma = vlc_fourcc_GetCodecFromString(VIDEO_ES, chroma);
+        fmt.i_width = widths[0];
+        fmt.i_height = heights[0];
 
     } else {
         char *chroma = var_InheritString(vd, "vmem-chroma");



More information about the vlc-commits mailing list