1 /* 2 INTEL CONFIDENTIAL 3 Copyright 2009 Intel Corporation All Rights Reserved. 4 The source code contained or described herein and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers and licensors. The Material contains trade secrets and proprietary and confidential information of Intel or its suppliers and licensors. The Material is protected by worldwide copyright and trade secret laws and treaty provisions. No part of the Material may be used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, or disclosed in any way without Intel’s prior express written permission. 5 6 No license under any patent, copyright, trade secret or other intellectual property right is granted to or conferred upon you by disclosure or delivery of the Materials, either expressly, by implication, inducement, estoppel or otherwise. Any license under such intellectual property rights must be express and approved by Intel in writing. 7 */ 8 9 #ifndef __MIX_BUFFER_H__ 10 #define __MIX_BUFFER_H__ 11 12 #include <mixparams.h> 13 #include "mixvideodef.h" 14 15 /** 16 * MIX_TYPE_BUFFER: 17 * 18 * Get type of class. 19 */ 20 #define MIX_TYPE_BUFFER (mix_buffer_get_type ()) 21 22 /** 23 * MIX_BUFFER: 24 * @obj: object to be type-casted. 25 */ 26 #define MIX_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIX_TYPE_BUFFER, MixBuffer)) 27 28 /** 29 * MIX_IS_BUFFER: 30 * @obj: an object. 31 * 32 * Checks if the given object is an instance of #MixParams 33 */ 34 #define MIX_IS_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIX_TYPE_BUFFER)) 35 36 /** 37 * MIX_BUFFER_CLASS: 38 * @klass: class to be type-casted. 39 */ 40 #define MIX_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIX_TYPE_BUFFER, MixBufferClass)) 41 42 /** 43 * MIX_IS_BUFFER_CLASS: 44 * @klass: a class. 45 * 46 * Checks if the given class is #MixParamsClass 47 */ 48 #define MIX_IS_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIX_TYPE_BUFFER)) 49 50 /** 51 * MIX_BUFFER_GET_CLASS: 52 * @obj: a #MixParams object. 53 * 54 * Get the class instance of the object. 55 */ 56 #define MIX_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIX_TYPE_BUFFER, MixBufferClass)) 57 58 typedef void (*MixBufferCallback)(gulong token, guchar *data); 59 60 typedef struct _MixBuffer MixBuffer; 61 typedef struct _MixBufferClass MixBufferClass; 62 63 /** 64 * MixBuffer: 65 * 66 * MI-X VideoConfig Parameter object 67 */ 68 struct _MixBuffer { 69 /*< public > */ 70 MixParams parent; 71 72 /*< public > */ 73 guchar *data; 74 guint size; 75 gulong token; 76 MixBufferCallback callback; 77 78 gpointer reserved; 79 }; 80 81 /** 82 * MixBufferClass: 83 * 84 * MI-X VideoConfig object class 85 */ 86 struct _MixBufferClass { 87 /*< public > */ 88 MixParamsClass parent_class; 89 90 /* class members */ 91 }; 92 93 /** 94 * mix_buffer_get_type: 95 * @returns: type 96 * 97 * Get the type of object. 98 */ 99 GType mix_buffer_get_type(void); 100 101 /** 102 * mix_buffer_new: 103 * @returns: A newly allocated instance of #MixBuffer 104 * 105 * Use this method to create new instance of #MixBuffer 106 */ 107 MixBuffer *mix_buffer_new(void); 108 /** 109 * mix_buffer_ref: 110 * @mix: object to add reference 111 * @returns: the MixBuffer instance where reference count has been increased. 112 * 113 * Add reference count. 114 */ 115 MixBuffer *mix_buffer_ref(MixBuffer * mix); 116 117 /** 118 * mix_buffer_unref: 119 * @obj: object to unref. 120 * 121 * Decrement reference count of the object. 122 */ 123 void mix_buffer_unref(MixBuffer * mix); 124 125 /* Class Methods */ 126 127 MIX_RESULT mix_buffer_set_data(MixBuffer * obj, guchar *data, guint size, 128 gulong token, MixBufferCallback callback); 129 130 #endif /* __MIX_BUFFER_H__ */ 131