• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem creating CVPixelBufferPool using CVPixelBufferPoolCreate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem creating CVPixelBufferPool using CVPixelBufferPoolCreate


  • Subject: Problem creating CVPixelBufferPool using CVPixelBufferPoolCreate
  • From: MacDeveloper <email@hidden>
  • Date: Fri, 3 Aug 2007 16:09:46 +0530

Hi all,

I am facing problem in creating CVPixelBufferPool using CVPixelBufferPoolCreate.
If I use CFDictionary for attributes it fails. And success on using NSDictionary.
Why these 2 are not equal.



1. using CFDictionary
//Create buffer pool
int pixelFormat = k32ARGBPixelFormat;
CFNumberRef pixelFormatNumber = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &pixelFormat);


int width = 320;
CFNumberRef widthNumber = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &width);


int height = 240;
CFNumberRef heightNumber = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &height);


CFDictionaryKeyCallBacks keyCallBack = kCFTypeDictionaryKeyCallBacks;
CFDictionaryValueCallBacks valueCallBack = kCFTypeDictionaryValueCallBacks;
CFMutableDictionaryRef dictionaryRef = CFDictionaryCreateMutable (kCFAllocatorDefault, 3, &keyCallBack, &valueCallBack);


CFDictionarySetValue(dictionaryRef, pixelFormatNumber, kCVPixelBufferPixelFormatTypeKey);
CFDictionarySetValue(dictionaryRef, widthNumber, kCVPixelBufferWidthKey);
CFDictionarySetValue(dictionaryRef, heightNumber, kCVPixelBufferHeightKey);


CVPixelBufferPoolRef bufferPool;
CVReturn theError = CVPixelBufferPoolCreate(kCFAllocatorDefault, NULL, (CFDictionaryRef)dictionaryRef, &bufferPool);


  this returns error  !

2.  using NSDictionary
   //Create buffer pool
   NSMutableDictionary*	 attributes;
   attributes = [NSMutableDictionary dictionary];

  int pixelFormat = k32ARGBPixelFormat;
  int width = 320;
  int height = 240;

[attributes setObject:[NSNumber numberWithInt:k32ARGBPixelFormat] forKey:(NSString*)kCVPixelBufferPixelFormatTypeKey];
[attributes setObject:[NSNumber numberWithInt:width] forKey: (NSString*)kCVPixelBufferWidthKey];
[attributes setObject:[NSNumber numberWithInt:height] forKey: (NSString*)kCVPixelBufferHeightKey];
CVPixelBufferPoolRef bufferPool;
CVReturn theError = CVPixelBufferPoolCreate(kCFAllocatorDefault, NULL, (CFDictionaryRef) attributes, &bufferPool);


  This returns success


Regards, Mac



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problem creating CVPixelBufferPool using CVPixelBufferPoolCreate
      • From: MacDeveloper <email@hidden>
  • Prev by Date: Re: Loading NSFont from file
  • Next by Date: Re: Problem creating CVPixelBufferPool using CVPixelBufferPoolCreate
  • Previous by thread: Re: Absolute path to the Application
  • Next by thread: Re: Problem creating CVPixelBufferPool using CVPixelBufferPoolCreate
  • Index(es):
    • Date
    • Thread