summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-01 17:36:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-02 07:44:37 +0100
commit61064b56bf926aea5a9a7e2dfdead34277217090 (patch)
tree54873a8bee701b2169e08da0cba3ce122d7bd624 /avmedia
parentd60d2973eca003b46860bf5effe9d0e638268f94 (diff)
avmedia: move BitmapWriteAccess inside Bitmap
part of a larger project to hide BitmapWriteAccess inside Bitmap Change-Id: Ia46c12b3297107892a6236633c11ca9ada6edbd4 Reviewed-on: https://gerrit.libreoffice.org/49106 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/gstreamer/gstframegrabber.cxx19
1 files changed, 1 insertions, 18 deletions
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx
index 550510979329..60aed4206ac1 100644
--- a/avmedia/source/gstreamer/gstframegrabber.cxx
+++ b/avmedia/source/gstreamer/gstframegrabber.cxx
@@ -174,24 +174,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
int nStride = GST_ROUND_UP_4( nWidth * 3 );
Bitmap aBmp( Size( nWidth, nHeight ), 24 );
-
- BitmapWriteAccess *pWrite = aBmp.AcquireWriteAccess();
- if( pWrite )
- {
- // yet another cheesy pixel copying loop
- for( int y = 0; y < nHeight; ++y )
- {
- sal_uInt8 *p = pData + y * nStride;
- Scanline pScanline = pWrite->GetScanline(y);
- for (int x = 0; x < nWidth; ++x)
- {
- BitmapColor col(p[0], p[1], p[2]);
- pWrite->SetPixelOnData(pScanline, x, col);
- p += 3;
- }
- }
- }
- Bitmap::ReleaseAccess( pWrite );
+ aBmp.SetToData( pData, nStride );
#ifndef AVMEDIA_GST_0_10
gst_buffer_unmap( pBuf, &aMapInfo );