1 /*
2 * combiner.h --
3 *
4 * FIXME: This file needs a description here.
5 *
6 * Copyright (c) 2001-2002 The Regents of the University of California.
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 * A. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 * B. Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 * C. Neither the names of the copyright holders nor the names of its
18 * contributors may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
22 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #ifndef _COMBINER_H
35 #define _COMBINER_H
36 #include <string.h>
37 #include "tclcl.h"
38 #include "renderer.h"
39
40 // this is a simple class for a list node...
41 class CombinerSourceNode {
42 public:
43 CombinerSourceNode(char* s, int pos);
44 char source[5]; // name of the source
45 int pos; // position of the source in the destination frame
46 int width; // its width (in pixels)
47 int height; // its height (in pixels)
48 CombinerSourceNode* next; // the next node in the list
49 };
50
51 // this is the class that takes multiple streams as input and then
52 // combines them into one stream to hand off to a real encoder...
53 class Combiner : public TclObject {
54 public:
55 Combiner();
56 ~Combiner();
57 int command(int argc, const char*const* argv);
58 void recv(Buffer* b, char* source, int colorModel);
59 protected:
60 Renderer* destination; // the real encoder that we output to
61 int width; // the combined frame's width
62 int height; // the combined frame's height
63 CombinerSourceNode* sources; // list of all the sources.
64 YuvFrame* frame_; // our combined frame.
65 u_int8_t* frame_data_; // the data for our combined frame
66 };
67
68 // this is the Renderer class that receives one frame and then hands
69 // it off to the combiner. We need this to give a source name to
70 // each frame given to Combiner
71 class CombinerSource : public Renderer {
72 public:
73 CombinerSource(Combiner* destination, const char* src, int color);
74 void setcolor(int x) {};
75 void recv(Buffer* b, int, int) {recv(b);};
76 void recv(Buffer* b);
77 protected:
78 Combiner* dest; // the combiner that we output to
79 char src[10]; // the name of the source
80 int colorModel; // the colorModel of this source
81 };
82
83 #endif
84
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.