You have decided that you want to put a test point.
You know what data is to be saved.
You know where in your source code you want to put it.
You know the type of data you want to save (i.e. you know the TP handler type )
This page answers how you should write and document the new test point created.
The explanations in this page are specific to the conventions used in Vsoft. Other conventions can be used.
The unavoidable checklist:
You must document the test points you create - or else no one can use them.
All test points are docuemented in VideoClick2.1/interface/h/TestPoints/TP
All test points handlers are docuemented in VideoClick2.1/interface/h/TestPoints/handlers
A test point is usualy part of a module - e.g. communication, scheduling etc.
To keep the number of documentation files low ( and make the search for TP easier), it is
recomended to group all related test points in one file, but it is not mandatory.
Each TP has a registry entry and a name ( the name used in you source code to specify
the TP).
These values are defined in a .REG file and an .H file as can be seen in the following
example.
The naming convention for these files is your_module_nameTp.reg and your_module_nameTpParam.h
file VideoClick2.1/interface/h/TestPoints/TP/AlphaTp.reg :
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Vsoft\TestPoints\{4BFEC551-6064-11d3-9DDC-0060089927C2}]
"Name"="input to the Alpha"
"ProgID"="Vsoft.DataSinkHandler"
"File"="c:\\tmp\\AlphaInput.mp3"
"IsActive"=dword:00000000
"UseNewFileAfterReset"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Vsoft\TestPoints\{4BFEC552-6064-11d3-9DDC-0060089927C2}]
"Name"="output of the BetaPicture"
"ProgID"="Vsoft.DataSinkHandler"
"File"="c:\\tmp\\BetaPictureOutput.bin"
"IsActive"=dword:00000000
"UseNewFileAfterReset"=dword:00000000
and the .H file VideoClick2.1/interface/h/TestPoints/TP/AlphaTpParam.h:
/************************************************************
* This is a part of the VideoClick project.
* Copyright (C) 1998 Vsoft Ltd.
* All rights reserved.
* NAME: AlphaTpParam.h
* Description: Define Test Points in Alpha
*
* Author: Noam Cohen
*
* $Archive: /VideoClick2.1/Interface/h/TestPoints/TP/AlphaTpParam.h $
* $Revision: 1 $
* $Author: Noam $
* $JustDate: 1/09/99 $
************************************************************/
#ifndef AlphaTpParam_h
#define AlphaTpParam_h
/*
TestPoint Name: UUID_AlphaInputTP
TestPoint Position: at the input to the MPEG Alpha.
Required Interfaces from handler: IID_IDataSink2
Remarks:
The data dumped is expeced to be MPEG program stream.
*/
// {4BFEC551-6064-11d3-9DDC-0060089927C2}
static const GUID UUID_AlphaInputTP =
{ 0x4bfec551, 0x6064, 0x11d3, { 0x9d, 0xdc, 0x0, 0x60, 0x8, 0x99, 0x27, 0xc2 } };
/*
TestPoint Name: UUID_PictureBetaOutputTp
TestPoint Position: at the output of the BetaPicture .
Required Interfaces from handler: IID_IDataSink2
Remarks:
The data is expected to be MPEG-1 or MPEG-2 VES.
*/
// {4BFEC552-6064-11d3-9DDC-0060089927C2}
static const GUID UUID_PictureBetaOutputTp =
{ 0x4bfec552, 0x6064, 0x11d3, { 0x9d, 0xdc, 0x0, 0x60, 0x8, 0x99, 0x27, 0xc2 } };
#endif
Find the place in your source where the connection between modules is done; sometimes you might want to use a test point within a module.
#include "TestPoints/TP/StreamSinkTpParam.h"
HRESULT StreamSync::Init(IDataSink* pOutSink)
{
...
// 1) init the test points
m_Dumper.Connect(UUID_StreamSinkInputTp); // even if the connection fail, we don't want to know
m_SinkTp.Connect( UUID_StreamSinkOutputTP , pOutSink, &m_pSink,
true);
...
}
HRESULT StreamSync::StartStream(IDataSink*
pOutSink, const PBYTE buffer, const UINT buffLen)
{
// dump the input
buffer - just to make sure what are the changes done.
m_Dumper.Write_(buffer,buffLen);
m_Dumper.Disconnect();
...
}
The class declaration contains:
#include "SourceTestPoint.h"
class StreamSync : public CUnknown, public
IStreamSync
{
public:
....
private:
....
// test points issues
BufferDumper
m_Dumper;
SinkTestPoint m_SinkTp;
};
Last Edited: 9 September 1999. Send mail to Noam Cohen