UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
null.c
Go to the documentation of this file.
1/*
2 * FILE: video_display/null.c
3 * AUTHOR: Colin Perkins <csp@isi.edu>
4 *
5 * Copyright (c) 2001-2003 University of Southern California
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, is permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 *
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 *
21 * This product includes software developed by the University of Southern
22 * California Information Sciences Institute.
23 *
24 * 4. Neither the name of the University nor of the Institute may be used
25 * to endorse or promote products derived from this software without
26 * specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
29 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
30 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
32 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
38 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
39 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * $Revision: 1.1 $
42 * $Date: 2007/11/08 09:48:59 $
43 *
44 */
45
46#include "config.h"
47#include "config_unix.h"
48#include "config_win32.h"
49#include "debug.h"
50#include "lib_common.h"
51#include "video.h"
52#include "video_display.h"
53
54#define MAGIC_NULL 0x17bad83f
55
56struct state_null {
57 uint32_t magic;
58};
59
60static void display_null_probe(struct device_info **available_cards, int *count, void (**deleter)(void *))
61{
63 *available_cards = NULL;
64 *count = 0;
65}
66
67static void *display_null_init(struct module *parent, const char *fmt, unsigned int flags)
68{
69 UNUSED(fmt);
72 struct state_null *s;
73
74 s = (struct state_null *)calloc(1, sizeof(struct state_null));
75 if (s != NULL) {
76 s->magic = MAGIC_NULL;
77 }
78 return s;
79}
80
81static void display_null_done(void *state)
82{
83 struct state_null *s = (struct state_null *)state;
84 assert(s->magic == MAGIC_NULL);
85 free(s);
86}
87
88static struct video_frame *display_null_getf(void *state)
89{
90 struct state_null *s = (struct state_null *)state;
91 assert(s->magic == MAGIC_NULL);
92 return NULL;
93}
94
95static bool display_null_putf(void *state, struct video_frame *frame, long long nonblock)
96{
97 struct state_null *s = (struct state_null *)state;
98 assert(s->magic == MAGIC_NULL);
101 return true;
102}
103
104static bool display_null_get_property(void *state, int property, void *val, size_t *len)
105{
106 UNUSED(state);
108 UNUSED(val);
109 UNUSED(len);
110
111 return false;
112}
113
115{
116 UNUSED(desc);
117 struct state_null *s = (struct state_null *)state;
118 assert(s->magic == MAGIC_NULL);
119
120 return true;
121}
122
123static void display_null_put_audio_frame(void *state, const struct audio_frame *frame)
124{
125 UNUSED(state);
126 UNUSED(frame);
127}
128
130 int sample_rate)
131{
132 UNUSED(state);
136
137 return false;
138}
139
153
155
#define UNUSED(x)
void ** state
struct video_frame long long nonblock
int void * val
struct video_desc desc
int int int sample_rate
int int channels
struct video_frame * frame
const char * fmt
int void size_t * len
const char unsigned int flags
int void(** deleter)(void *))
int property
int quant_samples
#define VIDEO_DISPLAY_ABI_VERSION
#define DISPLAY_NO_GENERIC_FPS_INDICATOR
int count
Definition hd-rum.c:44
@ LIBRARY_CLASS_VIDEO_DISPLAY
Definition lib_common.h:79
#define REGISTER_HIDDEN_MODULE(name, info, lclass, abi)
Definition lib_common.h:156
const char * parent
Definition settings.cpp:198
struct used to comunicate with audio capture/playback device
Definition types.h:99
uint32_t magic
Definition null.c:57
Struct video_frame represents a video frame and contains video description.
Definition types.h:305
This is an umbrella header for video functions.
static bool display_null_reconfigure(void *state, struct video_desc desc)
Definition null.c:114
static struct video_frame * display_null_getf(void *state)
Definition null.c:88
static const struct video_display_info display_null_info
Definition null.c:140
#define MAGIC_NULL
Definition null.c:54
static void display_null_put_audio_frame(void *state, const struct audio_frame *frame)
Definition null.c:123
static bool display_null_reconfigure_audio(void *state, int quant_samples, int channels, int sample_rate)
Definition null.c:129
static void display_null_probe(struct device_info **available_cards, int *count, void(**deleter)(void *))
Definition null.c:60
static bool display_null_putf(void *state, struct video_frame *frame, long long nonblock)
Definition null.c:95
static void * display_null_init(struct module *parent, const char *fmt, unsigned int flags)
Definition null.c:67
static bool display_null_get_property(void *state, int property, void *val, size_t *len)
Definition null.c:104
static void display_null_done(void *state)
Definition null.c:81