]> git.sesse.net Git - vlc/blobdiff - modules/video_output/vmem.c
video_output/mmal: Add mmal based video output plugin
[vlc] / modules / video_output / vmem.c
index ede49a4fde5e80d0b01e2838abe0440d67f34a0c..b4026fff9d6c4e3163942d031e8fc9fc9aaf0438 100644 (file)
@@ -1,24 +1,24 @@
 /*****************************************************************************
  * vmem.c: memory video driver for vlc
  *****************************************************************************
- * Copyright (C) 2008 the VideoLAN team
+ * Copyright (C) 2008 VLC authors and VideoLAN
  * Copyrgiht (C) 2010 RĂ©mi Denis-Courmont
  *
  * Authors: Sam Hocevar <sam@zoy.org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -139,7 +139,8 @@ static int Open(vlc_object_t *object)
     sys->pool = NULL;
 
     /* Define the video format */
-    video_format_t fmt = vd->fmt;
+    video_format_t fmt;
+    video_format_ApplyRotation(&fmt, &vd->fmt);
 
     if (setup != NULL) {
         char chroma[5];
@@ -175,6 +176,9 @@ static int Open(vlc_object_t *object)
         sys->count = 1;
         sys->cleanup = NULL;
     }
+    fmt.i_x_offset = fmt.i_y_offset = 0;
+    fmt.i_visible_width = fmt.i_width;
+    fmt.i_visible_height = fmt.i_height;
 
     if (!fmt.i_chroma) {
         msg_Err(vd, "vmem-chroma should be 4 characters long");
@@ -253,16 +257,16 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
     picture_t *pictures[count];
 
     for (unsigned i = 0; i < count; i++) {
-        picture_resource_t rsc;
-
-        rsc.p_sys = malloc(sizeof(*rsc.p_sys));
-        if (unlikely(!rsc.p_sys)) {
+        picture_sys_t *picsys = malloc(sizeof (*picsys));
+        if (unlikely(picsys == NULL))
+        {
             count = i;
             break;
         }
+        picsys->sys = sys;
+        picsys->id = NULL;
 
-        rsc.p_sys->sys = sys;
-        rsc.p_sys->id = NULL;
+        picture_resource_t rsc = { .p_sys = picsys };
 
         for (unsigned i = 0; i < PICTURE_PLANE_MAX; i++) {
             /* vmem-lock is responsible for the allocation */