summaryrefslogtreecommitdiff
path: root/common/quicktime_win32/CVDirect3DBufferPool.h
blob: 73a3a19d500df9bd1f2a109636bfbc9d1f35486d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
 *  CVDirect3DBufferPool.h
 *  CoreVideo
 *
 *  Created by David Eldred based on CVOpenGLBufferPool.h
 *  Copyright 2004 Apple Computer, Inc. All rights reserved.
 *
 */

 /*! @header CVDirect3DBufferPool.h
	@copyright 2004 Apple Computer, Inc. All rights reserved.
    @discussion CVDirect3DBufferPool is a utility object for managing a set of CVDirect3DBuffer objects that are going to be recycled.
		   
*/

#if !defined(__COREVIDEO__CVDIRECT3DBUFFERPOOL_H__)
#define __COREVIDEO__CVDIRECT3DBUFFERPOOL_H__ 1

#include <CVBase.h>
#include <CVReturn.h>
#include <CVDirect3DBuffer.h>

#if defined(__cplusplus)
extern "C" {
#endif

typedef struct __CVDirect3DBufferPool *CVDirect3DBufferPoolRef;

#define kCVDirect3DBufferPoolMinimumBufferCountKey	CFSTR("MinimumBufferCount")
#define kCVDirect3DBufferPoolMaximumBufferAgeKey		CFSTR("MaximumBufferAge")

CV_EXPORT CFTypeID CVDirect3DBufferPoolGetTypeID();

/*!
    @function   CVDirect3DBufferPoolRetain
    @abstract   Retains a CVDirect3DBufferPoolRef object
    @discussion Equivalent to CFRetain, but NULL safe
    @param      buffer A CVDirect3DBufferPoolRef object that you want to retain.
    @result     A CVDirect3DBufferPoolRef object that is the same as the passed in buffer.
*/
CV_EXPORT CVDirect3DBufferPoolRef CVDirect3DBufferPoolRetain( CVDirect3DBufferPoolRef pixelBufferPool ); // NULL-safe

/*!
    @function   CVDirect3DBufferPoolRelease
    @abstract   Releases a CVDirect3DBufferPoolRef object
    @discussion Equivalent to CFRelease, but NULL safe
    @param      buffer A CVDirect3DBufferPoolRef object that you want to release.
*/
CV_EXPORT void CVDirect3DBufferPoolRelease( CVDirect3DBufferPoolRef pixelBufferPool ); // NULL-safe

/*!
    @function   CVDirect3DBufferPoolCreate
    @abstract   Creates a new Pixel Buffer pool.
    @discussion Equivalent to CFRelease, but NULL safe
    @param      allocator The CFAllocatorRef to use for allocating this buffer pool.  May be NULL.
    @param      poolAttributes   A CFDictionaryRef containing the attributes to be used for the pool itself.
    @param      pixelBufferAttributes   A CFDictionaryRef containing the attributes to be used for creating new D3DBuffers within the pool.
    @param      d3dDevice   the LPDIRECT3DDEVICE9 to be used for allocation of buffers for this pool
    @param      poolOut   The newly created pool will be placed here
    @result     Returns kCVReturnSuccess on success
*/
CV_EXPORT CVReturn CVDirect3DBufferPoolCreate(CFAllocatorRef allocator,
					   CFDictionaryRef poolAttributes,
					   CFDictionaryRef pixelBufferAttributes,
					   void *d3dDevice, 
					   CVDirect3DBufferPoolRef *poolOut);

/*!
    @function   CVDirect3DBufferPoolGetAttributes
    @abstract   Returns the pool attributes dictionary for a CVDirect3DBufferPool
    @param      pool  The CVDirect3DBufferPoolRef to retrieve the attributes from
    @result     Returns the pool attributes dictionary, or NULL on failure.
*/
CV_EXPORT CFDictionaryRef CVDirect3DBufferPoolGetAttributes(CVDirect3DBufferPoolRef pool);

/*!
    @function   CVDirect3DBufferPoolGetDirect3DBufferAttributes
    @abstract   Returns the attributes of pixel buffers that will be created from this pool.
    @discussion This function is provided for those cases where you may need to know some information about the buffers that
                will be created up front.
    @param      pool  The CVDirect3DBufferPoolRef to retrieve the attributes from
    @result     Returns the pixel buffer attributes dictionary, or NULL on failure.
*/
CV_EXPORT CFDictionaryRef CVDirect3DBufferPoolGetDirect3DBufferAttributes(CVDirect3DBufferPoolRef pool);

/*!
    @function   CVDirect3DBufferPoolCreateDirect3DBuffer
    @abstract   Creates a new D3DBuffer object from the pool.
    @discussion The function creates a new (attachment-free) CVDirect3DBuffer using the pixel buffer attributes specifed during pool creation.
    @param      allocator The CFAllocatorRef to use for creating the pixel buffer.  May be NULL.
    @param      pool      The CVDirect3DBufferPool that should create the new CVDirect3DBuffer.
    @param      pixelBufferOut   The newly created pixel buffer will be placed here
    @result     Returns kCVReturnSuccess on success
*/
CV_EXPORT CVReturn CVDirect3DBufferPoolCreateDirect3DBuffer(CFAllocatorRef allocator, 
						         CVDirect3DBufferPoolRef pixelBufferPool,
							 CVDirect3DBufferRef *pixelBufferOut);

#if defined(__cplusplus)
}
#endif

#endif