Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/3rdparty/phonon/qt7/videoframe.mm

    r2 r561  
    2020#import <QuartzCore/CIFilter.h>
    2121#import <QuartzCore/CIContext.h>
     22
     23//#define CACHE_CV_TEXTURE
    2224
    2325QT_BEGIN_NAMESPACE
     
    7173    void VideoFrame::copyMembers(const VideoFrame& frame)
    7274    {
     75#ifdef CACHE_CV_TEXTURE
    7376        m_cachedCVTextureRef = frame.m_cachedCVTextureRef;
     77#endif
    7478                m_cachedCIImage = frame.m_cachedCIImage;
    7579                m_cachedQImage = frame.m_cachedQImage;
     
    106110    CVOpenGLTextureRef VideoFrame::cachedCVTexture() const
    107111    {
     112#ifdef CACHE_CV_TEXTURE
    108113        if (!m_cachedCVTextureRef && m_videoPlayer){
    109114            m_videoPlayer->setColors(m_brightness, m_contrast, m_hue, m_saturation);
    110115            (const_cast<VideoFrame *>(this))->m_cachedCVTextureRef = m_videoPlayer->currentFrameAsCVTexture();
     116            CVOpenGLTextureRetain((const_cast<VideoFrame *>(this))->m_cachedCVTextureRef);
    111117        }
    112118        return m_cachedCVTextureRef;
     119#else
     120        if (m_videoPlayer){
     121            m_videoPlayer->setColors(m_brightness, m_contrast, m_hue, m_saturation);
     122            return m_videoPlayer->currentFrameAsCVTexture();
     123        }
     124        return 0;
     125#endif
    113126    }
    114127
     
    330343    void VideoFrame::invalidateImage() const
    331344    {
     345#ifdef CACHE_CV_TEXTURE
    332346        if (m_cachedCVTextureRef){
    333347            CVOpenGLTextureRelease(m_cachedCVTextureRef);
    334348            (const_cast<VideoFrame *>(this))->m_cachedCVTextureRef = 0;
    335349        }
     350#endif
    336351        if (m_cachedCIImage){
    337352                        [(CIImage *) m_cachedCIImage release];
     
    347362    void VideoFrame::retain() const
    348363    {
     364#ifdef CACHE_CV_TEXTURE
    349365        if (m_cachedCVTextureRef)
    350366            CVOpenGLTextureRetain(m_cachedCVTextureRef);
     367#endif
    351368                if (m_cachedCIImage)
    352369                        [(CIImage *) m_cachedCIImage retain];
     
    359376    void VideoFrame::release() const
    360377    {
    361         if (m_cachedCVTextureRef)
     378#ifdef CACHE_CV_TEXTURE
     379        if (m_cachedCVTextureRef){
    362380            CVOpenGLTextureRelease(m_cachedCVTextureRef);
     381            (const_cast<VideoFrame *>(this))->m_cachedCVTextureRef = 0;
     382        }
     383#endif
    363384                if (m_cachedCIImage)
    364385                        [(CIImage *) m_cachedCIImage release];
     
    369390
    370391        (const_cast<VideoFrame *>(this))->m_backgroundFrame = 0;
    371         (const_cast<VideoFrame *>(this))->m_cachedCVTextureRef = 0;
    372392        (const_cast<VideoFrame *>(this))->m_cachedCIImage = 0;
    373393        (const_cast<VideoFrame *>(this))->m_cachedNSBitmap = 0;
Note: See TracChangeset for help on using the changeset viewer.