Home | History | Annotate | Download | only in gstreamer
      1 /*
      2  * Copyright (C) 2010 Igalia S.L
      3  *
      4  * This library is free software; you can redistribute it and/or
      5  * modify it under the terms of the GNU Library General Public
      6  * License as published by the Free Software Foundation; either
      7  * version 2 of the License, or (at your option) any later version.
      8  *
      9  * This library is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  * Library General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU Library General Public License
     15  * along with this library; see the file COPYING.LIB.  If not, write to
     16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     17  * Boston, MA 02110-1301, USA.
     18  */
     19 
     20 #ifndef ImageGStreamer_h
     21 #define ImageGStreamer_h
     22 
     23 #if USE(GSTREAMER)
     24 
     25 #include "BitmapImage.h"
     26 #include <gst/gst.h>
     27 #include <gst/video/video.h>
     28 #include <wtf/PassRefPtr.h>
     29 
     30 #if USE(CAIRO)
     31 #include <cairo.h>
     32 #endif
     33 
     34 namespace WebCore {
     35 class IntSize;
     36 
     37 class ImageGStreamer : public RefCounted<ImageGStreamer> {
     38     public:
     39         static PassRefPtr<ImageGStreamer> createImage(GstBuffer*);
     40         ~ImageGStreamer();
     41 
     42         PassRefPtr<BitmapImage> image()
     43         {
     44             ASSERT(m_image);
     45             return m_image.get();
     46         }
     47 
     48     private:
     49         RefPtr<BitmapImage> m_image;
     50 
     51 #if USE(CAIRO)
     52         ImageGStreamer(GstBuffer*&, IntSize, cairo_format_t&);
     53 #endif
     54 
     55 #if PLATFORM(QT)
     56         ImageGStreamer(GstBuffer*&, IntSize, QImage::Format);
     57 #endif
     58 
     59 #if PLATFORM(MAC)
     60         ImageGStreamer(GstBuffer*&, IntSize);
     61 #endif
     62 
     63     };
     64 }
     65 
     66 #endif // USE(GSTREAMER)
     67 #endif
     68