54 lines
1.7 KiB
C
54 lines
1.7 KiB
C
//
|
|
// MP42FormatUtilites.h
|
|
// MP42Foundation
|
|
//
|
|
// Created by Damiano Galassi on 10/11/15.
|
|
// Copyright © 2015 Damiano Galassi. All rights reserved.
|
|
//
|
|
|
|
#ifndef MP42FormatUtilites_h
|
|
#define MP42FormatUtilites_h
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
uint8_t *CreateEsdsFromSetupData(uint8_t *codecPrivate, size_t vosLen, size_t *esdsLen, int trackID, bool audio, bool write_version);
|
|
ComponentResult ReadESDSDescExt(void* descExt, UInt8 **buffer, int *size, int versionFlags);
|
|
|
|
UInt32 getDefaultChannelLayout(UInt32 channelsCount);
|
|
|
|
int readAC3Config(uint64_t acmod, uint64_t lfeon, UInt32 *channelsCount, UInt32 *channelLayoutTag);
|
|
int readEAC3Config(const uint8_t *cookie, uint32_t cookieLen, UInt32 *channelsCount, UInt32 *channelLayoutTag);
|
|
|
|
int analyze_EAC3(void **context ,uint8_t *frame, uint32_t size);
|
|
CFDataRef createCookie_EAC3(void *context);
|
|
void free_EAC3_context(void *context);
|
|
|
|
typedef struct MPEG4AudioConfig {
|
|
int object_type;
|
|
int sampling_index;
|
|
int sample_rate;
|
|
int chan_config;
|
|
int sbr; ///< -1 implicit, 1 presence
|
|
int ext_object_type;
|
|
int ext_sampling_index;
|
|
int ext_sample_rate;
|
|
int ext_chan_config;
|
|
int channels;
|
|
int ps; ///< -1 implicit, 1 presence
|
|
int frame_length_short;
|
|
} MPEG4AudioConfig;
|
|
|
|
int analyze_ESDS(MPEG4AudioConfig *c, const uint8_t *cookie, uint32_t cookieLen);
|
|
|
|
int analyze_AVC(const uint8_t *cookie, uint32_t cookieLen);
|
|
|
|
int analyze_HEVC(const uint8_t *frame, uint32_t cookieLen, bool *completeness);
|
|
void force_HEVC_completeness(const uint8_t *cookie, uint32_t cookieLen);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* MP42FormatUtilites_h */
|