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_INPUT_NULL_H |
---|
38 | #define SVC_INPUT_NULL_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 | |
---|
51 | typedef void (*NETRECEIVE_CALLBACK)(void* obj); |
---|
52 | |
---|
53 | |
---|
54 | class SVC_input_null : public SVC_input_module |
---|
55 | { |
---|
56 | public: |
---|
57 | SVC_input_null(); |
---|
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 | |
---|
73 | |
---|
74 | private: |
---|
75 | SVC_decode_mpeg2* m_decode_mpeg2; |
---|
76 | NETRECEIVE_CALLBACK m_receive_callback; |
---|
77 | int m_byte_pixel; |
---|
78 | int m_pid; |
---|
79 | int m_color_mode; |
---|
80 | int m_width; |
---|
81 | int m_height; |
---|
82 | int m_input_port; |
---|
83 | char* m_input_addr; |
---|
84 | int m_output_port; |
---|
85 | char* m_output_addr; |
---|
86 | int m_buffer_size; |
---|
87 | |
---|
88 | }; |
---|
89 | #endif |
---|