[vlc-commits] screen/mac: set frame rate (closes #14507 for 2.2)

Felix Paul Kühne git at videolan.org
Mon Jul 20 19:23:43 CEST 2015


vlc/vlc-2.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Jul 20 19:23:30 2015 +0200| [2b7694d377fd80e76292335fd2483b25bb038281] | committer: Felix Paul Kühne

screen/mac: set frame rate (closes #14507 for 2.2)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=2b7694d377fd80e76292335fd2483b25bb038281
---

 modules/access/screen/mac.c |   26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/modules/access/screen/mac.c b/modules/access/screen/mac.c
index af7988b..9d0c586 100644
--- a/modules/access/screen/mac.c
+++ b/modules/access/screen/mac.c
@@ -55,6 +55,8 @@ struct screen_data_t
     int screen_width;
     int screen_height;
 
+    float rate;
+
     CGDirectDisplayID display_id;
 
     CGContextRef offscreen_context;
@@ -75,6 +77,7 @@ int screen_InitCapture(demux_t *p_demux)
 
     /* fetch the screen we should capture */
     p_data->display_id = kCGDirectMainDisplay;
+    p_data->rate = var_InheritFloat (p_demux, "screen-fps");
 
     unsigned int displayCount = 0;
     returnedError = CGGetOnlineDisplayList(0, NULL, &displayCount);
@@ -112,16 +115,19 @@ int screen_InitCapture(demux_t *p_demux)
 
     /* setup format */
     es_format_Init(&p_sys->fmt, VIDEO_ES, VLC_CODEC_RGB32);
-    p_sys->fmt.video.i_visible_width  =
-    p_sys->fmt.video.i_width          = rect.size.width;
-    p_sys->fmt.video.i_visible_height =
-    p_sys->fmt.video.i_height         = rect.size.height;
-    p_sys->fmt.video.i_bits_per_pixel = 32;
-    p_sys->fmt.video.i_chroma         = VLC_CODEC_RGB32;
-    p_sys->fmt.video.i_rmask          = 0x00ff0000;
-    p_sys->fmt.video.i_gmask          = 0x0000ff00;
-    p_sys->fmt.video.i_bmask          = 0x000000ff;
-    p_sys->fmt.video.i_sar_num = p_sys->fmt.video.i_sar_den = 1;
+    p_sys->fmt.video.i_visible_width   =
+    p_sys->fmt.video.i_width           = rect.size.width;
+    p_sys->fmt.video.i_visible_height  =
+    p_sys->fmt.video.i_height          = rect.size.height;
+    p_sys->fmt.video.i_bits_per_pixel  = 32;
+    p_sys->fmt.video.i_chroma          = VLC_CODEC_RGB32;
+    p_sys->fmt.video.i_rmask           = 0x00ff0000;
+    p_sys->fmt.video.i_gmask           = 0x0000ff00;
+    p_sys->fmt.video.i_bmask           = 0x000000ff;
+    p_sys->fmt.video.i_frame_rate      = 1000 * p_data->rate;
+    p_sys->fmt.video.i_frame_rate_base = 1000;
+    p_sys->fmt.video.i_sar_num         =
+    p_sys->fmt.video.i_sar_den         = 1;
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list