This now allows us to figure out the correct address for split buffer
chroma-downsampled planar YCbCr formats

Signed-off-by: André Draszik <andre.dras...@st.com>
---
 src/core/surface.c        | 9 ++++++++-
 src/core/surface_buffer.c | 9 ++++++++-
 systems/sdl/primary.c     | 4 ++++
 systems/x11/primary.c     | 4 ++++
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/core/surface.c b/src/core/surface.c
index 02f48ea..5934164 100644
--- a/src/core/surface.c
+++ b/src/core/surface.c
@@ -1582,7 +1582,14 @@ dfb_surface_dump_buffer2( CoreSurface           *surface,
           int n3;
 
           /* Prepare one row. */
-          u8 *src8 = dfb_surface_data_offset( surface, lock.addr, lock.pitch, 
0, i );
+          u8 *src8, *src_cb, *src_cr;
+          int pitch_cb, pitch_cr;
+
+          src8 = dfb_surface_data_offset( surface, lock.addr, lock.pitch, 0, i 
);
+          dfb_surface_data_cbcr_offset( surface,
+                                        lock.addr, lock.pitch, 0, i,
+                                        &src_cb, &pitch_cb,
+                                        &src_cr, &pitch_cr );
 
           /* Write color buffer to pixmap file. */
           if (rgb) {
diff --git a/src/core/surface_buffer.c b/src/core/surface_buffer.c
index a42a41d..1195cfd 100644
--- a/src/core/surface_buffer.c
+++ b/src/core/surface_buffer.c
@@ -878,7 +878,14 @@ dfb_surface_buffer_dump_type_locked( CoreSurfaceBuffer     
*buffer,
           int n3;
 
           /* Prepare one row. */
-          u8 *src8 = dfb_surface_data_offset( surface, lock->addr, 
lock->pitch, 0, i );
+          u8 *src8, *src_cb, *src_cr;
+          int pitch_cb, pitch_cr;
+
+          src8 = dfb_surface_data_offset( surface, lock->addr, lock->pitch, 0, 
i );
+          dfb_surface_data_cbcr_offset( surface,
+                                        lock->addr, lock->pitch, 0, i,
+                                        &src_cb, &pitch_cb,
+                                        &src_cr, &pitch_cr );
 
           /* Write color buffer to pixmap file. */
           if (rgb) {
diff --git a/systems/sdl/primary.c b/systems/sdl/primary.c
index 0978aca..90a50f5 100644
--- a/systems/sdl/primary.c
+++ b/systems/sdl/primary.c
@@ -338,6 +338,8 @@ update_screen( int x, int y, int w, int h )
      int                    i, n;
      void                  *dst;
      void                  *src;
+     u8                    *src_cb, *src_cr;
+     int                    pitch_cb, pitch_cr;
      DFBResult              ret;
      CoreSurface           *surface;
      CoreSurfaceBuffer     *buffer;
@@ -392,6 +394,8 @@ update_screen( int x, int y, int w, int h )
      dst += DFB_BYTES_PER_LINE( surface->config.format, x ) + y * 
screen->pitch;
 
      src = dfb_surface_data_offset( surface, lock.addr, lock.pitch, x, y);
+     dfb_surface_data_cbcr_offset( surface, lock.addr, lock.pitch, x, y,
+                                   &src_cb, &pitch_cb, &src_cr, &pitch_cr );
 
      D_DEBUG_AT( SDL_Updates, "  -> copying pixels...\n" );
 
diff --git a/systems/x11/primary.c b/systems/x11/primary.c
index d73aff6..b188597 100644
--- a/systems/x11/primary.c
+++ b/systems/x11/primary.c
@@ -761,6 +761,8 @@ update_screen( DFBX11 *x11, const DFBRectangle *clip, 
CoreSurfaceBufferLock *loc
 {
      void                  *dst;
      void                  *src;
+     u8                    *src_cb, *src_cr;
+     int                    pitch_cb, pitch_cr;
      unsigned int           offset = 0;
      XImage                *ximage;
      CoreSurfaceAllocation *allocation;
@@ -869,6 +871,8 @@ update_screen( DFBX11 *x11, const DFBRectangle *clip, 
CoreSurfaceBufferLock *loc
 
           dst = xw->virtualscreen + rect.x * xw->bpp + (rect.y + offset) * 
ximage->bytes_per_line;
           src = dfb_surface_data_offset( allocation->surface, lock->addr, 
lock->pitch, rect.x, rect.y );
+          dfb_surface_data_cbcr_offset( allocation->surface, lock->addr, 
lock->pitch, rect.x, rect.y,
+                                        &src_cb, &pitch_cb, &src_cr, &pitch_cr 
);
 
           switch (xw->depth) {
                case 32:
-- 
1.8.2

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to