OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <Library/BaseMemoryLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcMp3Lib.h>
#include "helix/mp3dec.h"
Go to the source code of this file.
Functions | |
STATIC BOOLEAN | BufferResize (IN OUT VOID **Buffer, IN OUT VOID **BufferCurr, IN OUT UINT32 *BufferSize) |
EFI_STATUS | OcDecodeMp3 (IN CONST VOID *InBuffer, IN UINT32 InBufferSize, OUT VOID **OutBuffer, OUT UINT32 *OutBufferSize, OUT EFI_AUDIO_IO_PROTOCOL_FREQ *Frequency, OUT EFI_AUDIO_IO_PROTOCOL_BITS *Bits, OUT UINT8 *Channels) |
Copyright (C) 2021, vit9696. All rights reserved.
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file OcMp3Lib.c.
STATIC BOOLEAN BufferResize | ( | IN OUT VOID ** | Buffer, |
IN OUT VOID ** | BufferCurr, | ||
IN OUT UINT32 * | BufferSize ) |
Ensure that buffer always has enough memory to hold one frame.
[in,out] | Buffer | Pointer to buffer memory. |
[in,out] | BufferCurr | Pointer to buffer current position. |
[in,out] | BufferSize | Pointer to buffer size. |
TRUE | on success. |
FALSE | on allocation falure. |
Definition at line 36 of file OcMp3Lib.c.
EFI_STATUS OcDecodeMp3 | ( | IN CONST VOID * | InBuffer, |
IN UINT32 | InBufferSize, | ||
OUT VOID ** | OutBuffer, | ||
OUT UINT32 * | OutBufferSize, | ||
OUT EFI_AUDIO_IO_PROTOCOL_FREQ * | Frequency, | ||
OUT EFI_AUDIO_IO_PROTOCOL_BITS * | Bits, | ||
OUT UINT8 * | Channels ) |
Decode MP3 audio to PCM audio. WARNING: This method does not take untrusted data.
[in] | InBuffer | Buffer with mp3 audio data. |
[in] | InBufferSize | InBuffer size in bytes. |
[out] | OutBuffer | Decoded PCM data allocated from pool (needs to be freed). |
[out] | OutBufferSize | Decoded PCM data size in bytes. |
[out] | Frequency | Decoded PCM frequency. |
[out] | Bits | Decoded bit count. |
[out] | Channels | Decoded amount of channels. |
EFI_SUCCESS | on success. |
EFI_UNSUPPORTED | on format mismatch. |
EFI_OUT_OF_RESOURCES | on memory allocation failure. |
Definition at line 89 of file OcMp3Lib.c.