source: trunk/src/testing/app/svc/include/SVC_buffer_manager.h @ 4

Revision 4, 2.8 KB checked in by ajaworski, 13 years ago (diff)

Added modified SAGE sources

Line 
1/******************************************************************************
2 * SAGE - Scalable Adaptive Graphics Environment
3 *
4 * Copyright (C) 2004 Electronic Visualization Laboratory,
5 * University of Illinois at Chicago
6 *
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright
13 *    notice, this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above
15 *    copyright notice, this list of conditions and the following disclaimer
16 *    in the documentation and/or other materials provided with the distribution.
17 *  * Neither the name of the University of Illinois at Chicago nor
18 *    the names of its contributors may be used to endorse or promote
19 *    products derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Direct questions, comments etc about SAGE to http://www.evl.uic.edu/cavern/forum/
34 *
35 *****************************************************************************/
36
37#ifndef SVC_BUFFER_MANAGER_H
38#define SVC_BUFFER_MANAGER_H
39
40#include <stdio.h>
41#include <stdlib.h>
42#include <string.h>
43#include <pthread.h>
44
45#define RAWDATA_BUFFER_LENGTH 60
46
47
48
49class SVC_buffer
50{
51public:
52        SVC_buffer();
53        int init(int width, int height, int byte_pixel);
54        void put_data(unsigned char* data, long size);
55        unsigned char* pop_data();
56        int pop_data(unsigned char* output_buffer);
57        void print_current_buflen();
58        int isnotinit();
59        int get_width(){ return m_width;};
60        int get_height(){ return m_height;}
61        int get_byte_pixel(){return m_byte_pixel;}
62
63
64private:
65        unsigned char **m_buffer_list;
66        int m_width;
67        int m_height;
68        int m_byte_pixel;
69        int m_buf_front;
70        int m_buf_rear;
71        int m_first_flag;
72        pthread_mutex_t m_put_lock;
73        pthread_mutex_t m_pop_lock;
74        pthread_cond_t m_cond;
75};
76
77
78class SVC_buffer_manager
79{
80public:
81        SVC_buffer_manager();
82        SVC_buffer* create_buffer_instance();
83
84private:
85        SVC_buffer** m_svc_buffer_list;
86};
87
88
89#endif
Note: See TracBrowser for help on using the repository browser.