UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
video_decompress.h
Go to the documentation of this file.
1
8/*
9 * Copyright (c) 2011-2019 CESNET, z. s. p. o.
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, is permitted provided that the following conditions
14 * are met:
15 *
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 *
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * 3. Neither the name of CESNET nor the names of its contributors may be
24 * used to endorse or promote products derived from this software without
25 * specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
29 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
30 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
31 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
32 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
33 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
34 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 */
41
42#define VIDEO_DECOMPRESS_ABI_VERSION 6
43
48#ifndef __video_decompress_h
49#define __video_decompress_h
50
51#include "types.h"
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57struct state_decompress;
58
63#define DECOMPRESS_PROPERTY_ACCEPTS_CORRUPTED_FRAME 1 /* int */
64
68typedef void *(*decompress_init_t)();
81typedef int (*decompress_reconfigure_t)(void * state, struct video_desc desc,
82 int rshift, int gshift, int bshift, int pitch, codec_t out_codec);
83
84typedef enum {
85 DECODER_NO_FRAME = 0, //Frame not decoded yet
86 DECODER_GOT_FRAME, //Frame decoded and written to destination
90
111 void *state,
112 unsigned char *dst,
113 unsigned char *buffer,
114 unsigned int src_len,
115 int frame_seq,
116 struct video_frame_callbacks *callbacks,
117 struct pixfmt_desc *internal_prop);
118
126typedef int (*decompress_get_property_t)(void *state, int property, void *val, size_t *len);
127
131typedef void (*decompress_done_t)(void *);
132
152
159typedef int (*decompress_get_priority_t)(codec_t compression, struct pixfmt_desc internal, codec_t ugc);
160
169
170bool decompress_init_multi(codec_t compression,
171 struct pixfmt_desc internal,
172 codec_t to,
173 struct state_decompress **out,
174 int count);
175
178 struct video_desc,
179 int rshift,
180 int gshift,
181 int bshift,
182 int pitch,
183 codec_t out_codec);
184
191 unsigned char *dst,
192 unsigned char *src,
193 unsigned int src_len,
194 int frame_seq,
195 struct video_frame_callbacks *callbacks,
196 struct pixfmt_desc *internal_prop);
197
199 int property,
200 void *val,
201 size_t *len);
202
203void decompress_done(struct state_decompress *);
204
205#ifdef __cplusplus
206}
207#endif
208
209#endif /* __video_decompress_h */
210 // end of video_decompress
211
void ** state
int void * val
struct video_desc desc
int void size_t * len
int property
decompress_status
int(* decompress_get_property_t)(void *state, int property, void *val, size_t *len)
decompress_status decompress_frame(struct state_decompress *, unsigned char *dst, unsigned char *src, unsigned int src_len, int frame_seq, struct video_frame_callbacks *callbacks, struct pixfmt_desc *internal_prop)
Decompresses video frame.
int(* decompress_get_priority_t)(codec_t compression, struct pixfmt_desc internal, codec_t ugc)
int decompress_get_property(struct state_decompress *state, int property, void *val, size_t *len)
void(* decompress_done_t)(void *)
void decompress_done(struct state_decompress *)
void *(* decompress_init_t)()
decompress_status(* decompress_decompress_t)(void *state, unsigned char *dst, unsigned char *buffer, unsigned int src_len, int frame_seq, struct video_frame_callbacks *callbacks, struct pixfmt_desc *internal_prop)
Decompresses video frame.
int(* decompress_reconfigure_t)(void *state, struct video_desc desc, int rshift, int gshift, int bshift, int pitch, codec_t out_codec)
vdec_priority
int decompress_reconfigure(struct state_decompress *, struct video_desc, int rshift, int gshift, int bshift, int pitch, codec_t out_codec)
bool decompress_init_multi(codec_t compression, struct pixfmt_desc internal, codec_t to, struct state_decompress **out, int count)
Initializes (multiple) decompress states.
@ DECODER_GOT_CODEC
Internal pixel format was determined.
@ DECODER_NO_FRAME
@ DECODER_UNSUPP_PIXFMT
Decoder can't decode to selected out_codec.
@ DECODER_GOT_FRAME
@ VDEC_PRIO_PREFERRED
@ VDEC_PRIO_NA
decoder cannot handle the codec in any way
@ VDEC_PRIO_LOW
@ VDEC_PRIO_NOT_PREFERRED
@ VDEC_PRIO_PROBE_HI
decoder can probe
@ VDEC_PRIO_PROBE_LO
@ VDEC_PRIO_NORMAL
int count
Definition hd-rum.c:44
decompress_get_priority_t get_decompress_priority
decompress_get_property_t get_property
decompress_reconfigure_t reconfigure
decompress_init_t init
decompress_done_t done
decompress_decompress_t decompress
Struct containing callbacks of a video_frame.
Definition types.h:230
This file contains some common data types.
codec_t
Definition types.h:65