/* * Copyright (c) 2010 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/ #include"EbmlWriter.h" #include <stdlib.h> #include <wchar.h> #include <string.h> #include <limits.h> #include"EbmlBufferWriter.h" #ifdefined(_MSC_VER) #define LITERALU64(n) n #else #define LITERALU64(n) n##LLU #endif
void Ebml_WriteLen(EbmlGlobal *glob, int64_t val) { /* TODO check and make sure we are not > than 0x0100000000000000LLU */ unsignedchar size = 8; /* size in bytes to output */
/* mask to compare for byte size */
int64_t minVal = 0xff;
for (size = 1; size < 8; size ++) { if (val < minVal) break;
void Ebml_WriteString(EbmlGlobal *glob, constchar *str) { const size_t size_ = strlen(str); const uint64_t size = size_;
Ebml_WriteLen(glob, size); /* TODO: it's not clear from the spec whether the nul terminator * should be serialized too. For now we omit the null terminator.
*/
Ebml_Write(glob, str, (unsignedlong)size);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.