Vision Apps User Guide
gst_wrapper.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef _TI_GST_WRAPPER_H_
34 #define _TI_GST_WRAPPER_H_
35 
36 
38 
39 
59 
70 
81 
87 int32_t appGstStart();
88 
96 int32_t appGstEnqAppSrc(uint8_t idx);
97 
105 int32_t appGstDeqAppSrc(uint8_t idx);
106 
113 int32_t appGstEnqEosAppSrc();
114 
124 int32_t appGstDeqAppSink(uint8_t idx);
125 
135 int32_t appGstEnqAppSink(uint8_t idx);
136 
143 int32_t appGstStop();
144 
150 void appGstDeInit();
151 
152 
159 void appGstPrintStats();
160 
161 /* @} */
162 
163 #endif /* _TI_GST_WRAPPER_H_ */
164 
#define CODEC_MAX_BUFFER_DEPTH
Definition: codec_wrapper.h:55
int32_t appGstSinkInit(void *(*data_ptr)[CODEC_MAX_NUM_CHANNELS][CODEC_MAX_NUM_PLANES])
Initializes the AppSink elements to be able to pull buffers from the GstPipeline. Registers the data_...
int32_t appGstDeqAppSrc(uint8_t idx)
Wait for a previously pushed buffer to be consumed by the GstPipeline.
#define CODEC_MAX_NUM_CHANNELS
Definition: codec_wrapper.h:59
#define CODEC_MAX_NUM_PLANES
Definition: codec_wrapper.h:54
void appGstPrintStats()
Prints the current count of the numbers of buffers pushed/pulled to/from the GstPipeline. Not multi-thread safe.
int32_t appGstDeqAppSink(uint8_t idx)
Pull a buffer from the AppSink element into the bufferpool.
int32_t appGstEnqEosAppSrc()
Push EOS (End Of Stream) to the AppSrc element. Signals the elements to stop processing buffers after...
int32_t appGstEnqAppSink(uint8_t idx)
Release a previously pulled GstBuffer back to GStreamer and cleanup.
int32_t appGstInit(app_codec_wrapper_params_t *prm)
Launches the GstPipeline described by user defined parameters. Initializes the gst_wrapper and calls ...
void appGstDeInit()
Unmaps all buffers that were mapped and destroys all GStreamer objects.
int32_t appGstStop()
Stops the GstPipeline that was in playing state. If there is no AppSink element, waits to recieve EOS...
int32_t appGstStart()
Starts the GstPipeline that was launched previously.
Init parameters.
Definition: codec_wrapper.h:66
int32_t appGstSrcInit(void *data_ptr[CODEC_MAX_BUFFER_DEPTH][CODEC_MAX_NUM_CHANNELS][CODEC_MAX_NUM_PLANES])
Initializes the AppSrc elements to be able to push buffers to the GstPipeline. Wraps the given alloca...
int32_t appGstEnqAppSrc(uint8_t idx)
Push a buffer from the bufferpool to the AppSrc element.