Commit 79b605b4 authored by Serrière Guillaume's avatar Serrière Guillaume

Add ebml header when generate a new file with generic stream writer.

Signed-off-by: default avatarSerrière Guillaume <guillaume.serriere@inria.fr>
parent 26e7a330
......@@ -21,9 +21,9 @@ INCLUDE("FindOpenViBECommon")
# Test applications
# ---------------------------------
OPTION(BUILD_OPENVIBE_MODULE_EBML_EXAMPLES "Build OpenViBE module EBML examples" OFF)
IF(BUILD_OPENVIBE_MODULE_EBML_EXAMPLES)
SUBDIRS(test)
ENDIF(BUILD_OPENVIBE_MODULE_EBML_EXAMPLES)
IF(OV_COMPILE_TESTS)
ADD_SUBDIRECTORY(test)
ENDIF(OV_COMPILE_TESTS)
# ---------------------------------
# Target macros
......
project(test_ebml)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
INCLUDE_DIRECTORIES(../src)
ADD_EXECUTABLE(${PROJECT_NAME} test_ebml_write.cpp)
INCLUDE("FindOpenViBEModuleEBML")
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ADD_EXECUTABLE(test_ebml_write-dynamic test_ebml_write.cpp)
OV_INSTALL_LAUNCH_SCRIPT(${PROJECT_NAME})
INSTALL(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
#ADD_EXECUTABLE(test_ebml_write-dynamic test_ebml_write.cpp)
#ADD_EXECUTABLE(test_ebml_write-static test_ebml_write.cpp)
ADD_EXECUTABLE(test_ebml_read-dynamic test_ebml_read.cpp)
#ADD_EXECUTABLE(test_ebml_read-dynamic test_ebml_read.cpp)
#ADD_EXECUTABLE(test_ebml_read-static test_ebml_read.cpp)
ADD_EXECUTABLE(test_ebml_tree-dynamic test_ebml_tree.cpp)
#ADD_EXECUTABLE(test_ebml_tree-dynamic test_ebml_tree.cpp)
#ADD_EXECUTABLE(test_ebml_tree-static test_ebml_tree.cpp)
TARGET_LINK_LIBRARIES(test_ebml_write-dynamic ${PROJECT_NAME})
#TARGET_LINK_LIBRARIES(test_ebml_write-dynamic ${PROJECT_NAME})
#TARGET_LINK_LIBRARIES(test_ebml_write-static ${PROJECT_NAME}-static)
TARGET_LINK_LIBRARIES(test_ebml_read-dynamic ${PROJECT_NAME})
#TARGET_LINK_LIBRARIES(test_ebml_read-dynamic ${PROJECT_NAME})
#TARGET_LINK_LIBRARIES(test_ebml_read-static ${PROJECT_NAME}-static)
TARGET_LINK_LIBRARIES(test_ebml_tree-dynamic ${PROJECT_NAME})
#TARGET_LINK_LIBRARIES(test_ebml_tree-dynamic ${PROJECT_NAME})
#TARGET_LINK_LIBRARIES(test_ebml_tree-static ${PROJECT_NAME}-static)
......@@ -7,6 +7,15 @@
#include "ebml/IWriterHelper.h"
#include "ebml/CWriterHelper.h"
#define OVP_NodeId_OpenViBEStream_Header EBML::CIdentifier(0xF59505AB, 0x3684C8D8)
#define OVP_NodeId_OpenViBEStream_Header_Compression EBML::CIdentifier(0x40358769, 0x166380D1)
#define OVP_NodeId_OpenViBEStream_Header_ChannelType EBML::CIdentifier(0x732EC1D1, 0xFE904087)
#define OVP_NodeId_OpenViBEStream_Buffer EBML::CIdentifier(0x2E60AD18, 0x87A29BDF)
#define OVP_NodeId_OpenViBEStream_Buffer_ChannelIndex EBML::CIdentifier(0x30A56D8A, 0xB9C12238)
#define OVP_NodeId_OpenViBEStream_Buffer_StartTime EBML::CIdentifier(0x093E6A0A, 0xC5A9467B)
#define OVP_NodeId_OpenViBEStream_Buffer_EndTime EBML::CIdentifier(0x8B5CCCD9, 0xC5024F29)
#define OVP_NodeId_OpenViBEStream_Buffer_Content EBML::CIdentifier(0x8D4B0BE8, 0x7051265C)
class CWriterCallBack : public EBML::IWriterCallBack
{
public:
......
......@@ -34,6 +34,21 @@ boolean CBoxAlgorithmGenericStreamWriter::initialize(void)
m_oSwap.setSize(0, true);
m_oWriterHelper.connect(&m_oWriter);
m_oWriterHelper.openChild(EBML_Identifier_Header);
m_oWriterHelper.openChild(EBML_Identifier_DocType);
m_oWriterHelper.setASCIIStringAsChildData("OpenViBE_Stream_File");
m_oWriterHelper.closeChild();
m_oWriterHelper.openChild(EBML_Identifier_EBMLVersion);
m_oWriterHelper.setUIntegerAsChildData(1);
m_oWriterHelper.closeChild();
m_oWriterHelper.openChild(EBML_Identifier_EBMLIdLength);
m_oWriterHelper.setUIntegerAsChildData(10);
m_oWriterHelper.closeChild();
m_oWriterHelper.closeChild();
m_oWriterHelper.openChild(OVP_NodeId_OpenViBEStream_Header);
m_oWriterHelper.openChild(OVP_NodeId_OpenViBEStream_Header_Compression);
m_oWriterHelper.setUIntegerAsChildData(0 /* m_bUseCompression?1:0 */);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment