WKCAImageQueue.cpp [plain text]
#include "config.h"
#include "WKCAImageQueue.h"
#include <CoreFoundation/CoreFoundation.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RetainPtr.h>
namespace WebCore {
class WKCAImageQueuePrivate {
public:
RetainPtr<CAImageQueueRef> m_imageQueue;
};
static CAImageQueueRef WKCAImageQueueRetain(CAImageQueueRef iq)
{
if (iq)
return (CAImageQueueRef)CFRetain(iq);
return 0;
}
static void WKCAImageQueueRelease(CAImageQueueRef iq)
{
if (iq)
CFRelease(iq);
}
WKCAImageQueue::WKCAImageQueue(uint32_t width, uint32_t height, uint32_t capacity)
: m_private(adoptPtr(new WKCAImageQueuePrivate()))
{
m_private->m_imageQueue = adoptCF(wkCAImageQueueCreate(width, height, capacity));
}
WKCAImageQueue::WKCAImageQueue(const WKCAImageQueue& o)
: m_private(adoptPtr(new WKCAImageQueuePrivate()))
{
m_private->m_imageQueue = o.m_private->m_imageQueue;
}
WKCAImageQueue::~WKCAImageQueue(void)
{
}
WKCAImageQueue& WKCAImageQueue::operator=(const WKCAImageQueue& o)
{
m_private->m_imageQueue = o.m_private->m_imageQueue;
return *this;
}
size_t WKCAImageQueue::collect()
{
return wkCAImageQueueCollect(m_private->m_imageQueue.get());
}
bool WKCAImageQueue::insertImage(double t, unsigned int type, uint64_t id, uint32_t flags, ReleaseCallback release, void* info)
{
return wkCAImageQueueInsertImage(m_private->m_imageQueue.get(), t, type, id, flags, release, info);
}
uint64_t WKCAImageQueue::registerPixelBuffer(void *data, size_t data_size, size_t rowbytes, size_t width, size_t height, uint32_t pixel_format, CFDictionaryRef attachments, uint32_t flags)
{
return wkCAImageQueueRegisterPixelBuffer(m_private->m_imageQueue.get(), data, data_size, rowbytes, width, height, pixel_format, attachments, flags);
}
void WKCAImageQueue::setFlags(uint32_t mask, uint32_t flags)
{
wkCAImageQueueSetFlags(m_private->m_imageQueue.get(), mask, flags);
}
CFTypeRef WKCAImageQueue::get()
{
return m_private->m_imageQueue.get();
}
}