michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif michael@0: michael@0: #ifndef EBMLWRITER_HPP michael@0: #define EBMLWRITER_HPP michael@0: #include michael@0: #include "vpx/vpx_integer.h" michael@0: #include "EbmlBufferWriter.h" michael@0: michael@0: /* note: you must define write and serialize functions as well as your own michael@0: * EBML_GLOBAL michael@0: * michael@0: * These functions MUST be implemented michael@0: */ michael@0: michael@0: // typedef struct EbmlGlobal EbmlGlobal; michael@0: // void Ebml_Serialize(EbmlGlobal *glob, const void *, int, unsigned long); michael@0: // void Ebml_Write(EbmlGlobal *glob, const void *, unsigned long); michael@0: michael@0: /*****/ michael@0: michael@0: void Ebml_WriteLen(EbmlGlobal *glob, int64_t val); michael@0: void Ebml_WriteString(EbmlGlobal *glob, const char *str); michael@0: void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr); michael@0: void Ebml_WriteID(EbmlGlobal *glob, unsigned long class_id); michael@0: void Ebml_SerializeUnsigned32(EbmlGlobal *glob, unsigned long class_id, uint32_t ui); michael@0: void Ebml_SerializeUnsigned64(EbmlGlobal *glob, unsigned long class_id, uint64_t ui); michael@0: void Ebml_SerializeUnsigned(EbmlGlobal *glob, unsigned long class_id, unsigned long ui); michael@0: void Ebml_SerializeBinary(EbmlGlobal *glob, unsigned long class_id, unsigned long ui); michael@0: void Ebml_SerializeFloat(EbmlGlobal *glob, unsigned long class_id, double d); michael@0: /* TODO make this more generic to signed */ michael@0: void Ebml_WriteSigned16(EbmlGlobal *glob, short val); michael@0: void Ebml_SerializeString(EbmlGlobal *glob, unsigned long class_id, const char *s); michael@0: void Ebml_SerializeUTF8(EbmlGlobal *glob, unsigned long class_id, wchar_t *s); michael@0: void Ebml_SerializeData(EbmlGlobal *glob, unsigned long class_id, unsigned char *data, unsigned long data_length); michael@0: void Ebml_WriteVoid(EbmlGlobal *glob, unsigned long vSize); michael@0: /* TODO need date function */ michael@0: #endif michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif