mpeghdec
FraunhoferIISMPEG-HDecoderLibrary
mpeghUIManager.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2 Software License for The Fraunhofer FDK MPEG-H Software
3 
4 Copyright (c) 2018 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten
5 Forschung e.V. and Contributors
6 All rights reserved.
7 
8 1. INTRODUCTION
9 
10 The "Fraunhofer FDK MPEG-H Software" is software that implements the ISO/MPEG
11 MPEG-H 3D Audio standard for digital audio or related system features. Patent
12 licenses for necessary patent claims for the Fraunhofer FDK MPEG-H Software
13 (including those of Fraunhofer), for the use in commercial products and
14 services, may be obtained from the respective patent owners individually and/or
15 from Via LA (www.via-la.com).
16 
17 Fraunhofer supports the development of MPEG-H products and services by offering
18 additional software, documentation, and technical advice. In addition, it
19 operates the MPEG-H Trademark Program to ease interoperability testing of end-
20 products. Please visit www.mpegh.com for more information.
21 
22 2. COPYRIGHT LICENSE
23 
24 Redistribution and use in source and binary forms, with or without modification,
25 are permitted without payment of copyright license fees provided that you
26 satisfy the following conditions:
27 
28 * You must retain the complete text of this software license in redistributions
29 of the Fraunhofer FDK MPEG-H Software or your modifications thereto in source
30 code form.
31 
32 * You must retain the complete text of this software license in the
33 documentation and/or other materials provided with redistributions of
34 the Fraunhofer FDK MPEG-H Software or your modifications thereto in binary form.
35 You must make available free of charge copies of the complete source code of
36 the Fraunhofer FDK MPEG-H Software and your modifications thereto to recipients
37 of copies in binary form.
38 
39 * The name of Fraunhofer may not be used to endorse or promote products derived
40 from the Fraunhofer FDK MPEG-H Software without prior written permission.
41 
42 * You may not charge copyright license fees for anyone to use, copy or
43 distribute the Fraunhofer FDK MPEG-H Software or your modifications thereto.
44 
45 * Your modified versions of the Fraunhofer FDK MPEG-H Software must carry
46 prominent notices stating that you changed the software and the date of any
47 change. For modified versions of the Fraunhofer FDK MPEG-H Software, the term
48 "Fraunhofer FDK MPEG-H Software" must be replaced by the term "Third-Party
49 Modified Version of the Fraunhofer FDK MPEG-H Software".
50 
51 3. No PATENT LICENSE
52 
53 NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
54 limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
55 Fraunhofer provides no warranty of patent non-infringement with respect to this
56 software. You may use this Fraunhofer FDK MPEG-H Software or modifications
57 thereto only for purposes that are authorized by appropriate patent licenses.
58 
59 4. DISCLAIMER
60 
61 This Fraunhofer FDK MPEG-H Software is provided by Fraunhofer on behalf of the
62 copyright holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED
63 WARRANTIES, including but not limited to the implied warranties of
64 merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE
65 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE for any direct, indirect,
66 incidental, special, exemplary, or consequential damages, including but not
67 limited to procurement of substitute goods or services; loss of use, data, or
68 profits, or business interruption, however caused and on any theory of
69 liability, whether in contract, strict liability, or tort (including
70 negligence), arising in any way out of the use of this software, even if
71 advised of the possibility of such damage.
72 
73 5. CONTACT INFORMATION
74 
75 Fraunhofer Institute for Integrated Circuits IIS
76 Attention: Division Audio and Media Technologies - MPEG-H FDK
77 Am Wolfsmantel 33
78 91058 Erlangen, Germany
79 www.iis.fraunhofer.de/amm
80 amm-info@iis.fraunhofer.de
81 -----------------------------------------------------------------------------*/
82 
83 /************************************** ***************************************
84  Author(s): Matthias Neusinger
85  Description: MPEG-H UI Manager
86 
87  This software and/or program is protected by copyright law and international
88  treaties. Any reproduction or distribution of this software and/or program,
89  or any portion of it, may result in severe civil and criminal penalties, and
90  will be prosecuted to the maximum extent possible under law.
91 
92 *******************************************************************************/
93 
94 #ifndef MPEGHUIMANAGER_H
95 #define MPEGHUIMANAGER_H
96 
102 #include "mpeghexport.h"
103 
104 #ifdef __cplusplus
105 extern "C" {
106 #endif
107 
108 typedef struct MPEGH_UI_MANAGER* HANDLE_MPEGH_UI_MANAGER;
109 
110 #define MAX_NUMBER_SECONDARY_STREAMS 16
111 
112 typedef enum {
113  MPEGH_UI_OK = 0,
114  MPEGH_UI_OUT_OF_MEMORY,
115  MPEGH_UI_BUFFER_TOO_SMALL, /* This error is not recoverable until a new RAP frame is processed,
116  i.e. UI events will be delayed. */
117  MPEGH_UI_INVALID_PARAM,
118  MPEGH_UI_NOT_ALLOWED,
119  MPEGH_UI_INVALID_STATE,
120  MPEGH_UI_PARSE_ERROR,
121  MPEGH_UI_OK_BUT_NO_VALID_DATA
122 } MPEGH_UI_ERROR;
123 
129 #define MPEGH_UI_FORCE_UPDATE 1
130 
135 #define MPEGH_UI_FORCE_RESTART_XML 4
136 
142 #define MPEGH_UI_NO_CHANGE 1
143 
148 #define MPEGH_UI_CONTINUES_XML 2
149 
155 #define MPEGH_UI_INCOMPLETE_XML 4
156 
162 #define MPEGH_UI_SHORT_OUTPUT 8
163 
169 MPEGHDEC_EXPORT HANDLE_MPEGH_UI_MANAGER mpegh_UI_Manager_Open(void);
170 
177 MPEGHDEC_EXPORT void mpegh_UI_Manager_Close(HANDLE_MPEGH_UI_MANAGER self);
178 
202 MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_GetXmlSceneState(HANDLE_MPEGH_UI_MANAGER self, char* xmlOut,
203  unsigned int xmlOutSize,
204  unsigned int flagsIn,
205  unsigned int* flagsOut);
206 
217 MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_ApplyXmlAction(HANDLE_MPEGH_UI_MANAGER self,
218  const char* xmlIn, unsigned int xmlInSize,
219  unsigned int* flagsOut);
220 
229 MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_FeedMHAS(HANDLE_MPEGH_UI_MANAGER self,
230  unsigned char* mhasBuffer,
231  unsigned int mhasLength);
232 
248 MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_UpdateMHAS(HANDLE_MPEGH_UI_MANAGER self,
249  unsigned char* mhasBuffer,
250  unsigned int mhasBufferLength,
251  unsigned int* mhasLength);
252 
276 MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_SetPersistenceMemory(HANDLE_MPEGH_UI_MANAGER self,
277  void* persistenceMemoryBlock,
278  unsigned short persistenceMemorySize);
279 
295 MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_GetPersistenceMemory(HANDLE_MPEGH_UI_MANAGER self,
296  void** persistenceMemoryBlock,
297  unsigned short* persistenceMemorySize);
298 
299 #ifdef __cplusplus
300 }
301 #endif
302 
303 #endif
MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_GetXmlSceneState(HANDLE_MPEGH_UI_MANAGER self, char *xmlOut, unsigned int xmlOutSize, unsigned int flagsIn, unsigned int *flagsOut)
Get XML description of audio scene and available user interactivity parameters.
MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_UpdateMHAS(HANDLE_MPEGH_UI_MANAGER self, unsigned char *mhasBuffer, unsigned int mhasBufferLength, unsigned int *mhasLength)
Update MHAS buffer, inserting UI and DRC packets from UI manager. A previous call of mpegh_UI_FeedMHA...
MPEGHDEC_EXPORT HANDLE_MPEGH_UI_MANAGER mpegh_UI_Manager_Open(void)
Open a mpegh UI manager instance.
MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_FeedMHAS(HANDLE_MPEGH_UI_MANAGER self, unsigned char *mhasBuffer, unsigned int mhasLength)
Feed MHAS input into UI manager.
MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_GetPersistenceMemory(HANDLE_MPEGH_UI_MANAGER self, void **persistenceMemoryBlock, unsigned short *persistenceMemorySize)
Get current UI persistency memory block (updates content, call is required before storing persistence...
MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_SetPersistenceMemory(HANDLE_MPEGH_UI_MANAGER self, void *persistenceMemoryBlock, unsigned short persistenceMemorySize)
Set memory block for storing UI persistency data (activates internal persistence handling) ...
MPEGHDEC_EXPORT void mpegh_UI_Manager_Close(HANDLE_MPEGH_UI_MANAGER self)
De-allocate all resources of a mpegh UI manager instance.
MPEGHDEC_EXPORT MPEGH_UI_ERROR mpegh_UI_ApplyXmlAction(HANDLE_MPEGH_UI_MANAGER self, const char *xmlIn, unsigned int xmlInSize, unsigned int *flagsOut)
Send XML description of UI command to the UI manager.