Project

General

Profile

Support Request #454 » exportSink.cpp

hidden, 2017-03-29 13:30

 
1

    
2
#include "stdafx.h"
3
#include "exportSink.hpp"
4

    
5
ExportSink::ExportSink( )
6
	: cObject( 0 )
7
	, cConfiguration( )
8
	, mapTimeRelations( )
9
{ }
10

    
11

    
12
ExportSink::~ExportSink( )
13
{ }
14

    
15

    
16
tResult ExportSink::Accept( adtf::IMediaType * /*pType*/ )
17
{
18

    
19
	return ERR_NOERROR;
20
}
21

    
22
tResult ExportSink::RegisterExtensions( adtf::IDatExtensions * datExt )
23
{
24
	tInt extCount = datExt->GetExtensionCount( );
25

    
26
	adtf_util::IIndexedFile::tFileExtension * fileExt;
27
	adtf::tADTFClockRelation * extClock;
28

    
29
	tResult ret = datExt->FindExtension( "adtf_clock_ext_demo_clock", &fileExt, reinterpret_cast<tVoid **>( &extClock ) );
30

    
31
	if( IS_FAILED( ret ) )
32
	{
33
		LOG_ERROR( "Couldn't find clock extension." );
34
	}
35
	else
36
	{
37
		size_t countRelations = fileExt->ui64DataSize / sizeof( adtf::tADTFClockRelation );
38
		mapTimeRelations.clear( );
39
		adtf::tADTFClockRelation const * curRelation = nullptr;
40

    
41
		for( size_t i = 0u; countRelations > i; ++i )
42
		{
43
			curRelation = ( extClock + i );
44
			mapTimeRelations.insert( std::make_pair( curRelation->nStreamTime, curRelation->nClockTime ) );
45
		}
46
	}
47

    
48
	return ret;
49
}
50

    
51

    
52
tResult ExportSink::Open( adtf::IMediaType* /*pType*/,
53
								  const tChar* /*strSourceFileName*/,
54
								  const tChar* /*strStreamName*/,
55
								  const tChar* /*strTargetFileName*/ )
56
{
57

    
58

    
59
	return ERR_NOERROR;
60
}
61

    
62
tResult ExportSink::Close( )
63
{
64
	return ERR_NOERROR;
65
}
66

    
67
tResult ExportSink::Process( adtf::IMediaSample* pSample, tTimeStamp /*nChunkTime*/ )
68
{
69
	adtf::cScopedSampleReadLock readLock( pSample );
70
	adtf_devicetb::tCANData const * canData = readLock.GetPtr<adtf_devicetb::tCANData>( );
71
	
72
	mapTimeRelations;
73

    
74
	return ERR_NOERROR;
75
}
76

    
77
tResult ExportSink::ProcessMarker( tVoid const * /*pData*/, tUInt /*nSize*/, tTimeStamp /*nTime*/ )
78
{
79
	return ERR_NOERROR;
80
}
(1-1/2)