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

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

Added modified SAGE sources

Line 
1
2/******************************************************************************
3 * SAGE - Scalable Adaptive Graphics Environment
4 *
5 * Copyright (C) 2004 Electronic Visualization Laboratory,
6 * University of Illinois at Chicago
7 *
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
12 *
13 *  * Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 *  * Redistributions in binary form must reproduce the above
16 *    copyright notice, this list of conditions and the following disclaimer
17 *    in the documentation and/or other materials provided with the distribution.
18 *  * Neither the name of the University of Illinois at Chicago nor
19 *    the names of its contributors may be used to endorse or promote
20 *    products derived from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
26 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 * Direct questions, comments etc about SAGE to http://www.evl.uic.edu/cavern/forum/
35 *
36 *****************************************************************************/
37#ifndef SVC_INPUT_NET_H
38#define SVC_INPUT_NET_H
39
40#include "SVC_common.h"
41#include "SVC_input_module.h"
42#include "SVC_output_module.h"
43#include "SVC_decode_mpeg2.h"
44
45#include <sys/socket.h>
46#include <sys/types.h>
47#include <netinet/in.h>
48#include <unistd.h>
49#include <arpa/inet.h>
50
51typedef void (*NETRECEIVE_CALLBACK)(void* obj);
52
53
54class SVC_input_net : public SVC_input_module
55{
56public:
57      SVC_input_net();
58      void setOutput(SVC_output_module *output_instance);
59      void init(int codec,int color_mode, int buffer_size, int rtp_flag, char* i_addr, int i_port, char* o_addr, int o_port);
60      static void decode_output_callback(void* output_obj, uint8_t * const * buf, void * id, int width, int height);
61      void run();
62      void select_decoder(int codec);
63      static void mpeg2_receive(void* obj);
64      static void dv_receive(void* obj);
65      void decode_ouput(uint8_t * const * buf);
66      void set_imagesize (int width, int height);
67      int get_input_port();
68      char* get_input_addr();
69      int get_buffer_size();
70      SVC_output_module* m_output_module;
71      int m_codec;
72      int is_multicast_addr(char* m_input_addr);
73
74
75private:
76      SVC_decode_mpeg2* m_decode_mpeg2;
77      NETRECEIVE_CALLBACK m_receive_callback;
78      int m_byte_pixel;
79      int m_pid;
80      int m_color_mode;
81      int m_width;
82      int m_height;
83      int m_input_port;
84      char* m_input_addr;
85      int m_output_port;
86      char* m_output_addr;
87      int m_buffer_size;
88
89};
90#endif
Note: See TracBrowser for help on using the repository browser.