2 Copyright (c) 2004-2013, John Hurst
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
8 1. Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13 3. The name of the author may not be used to endorse or promote products
14 derived from this software without specific prior written permission.
16 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 /*! \file AS_DCP_DCData_internal.h
28 \version $Id: AS_DCP_DCData_internal.h,v 1.3 2014/01/02 23:29:22 jhurst Exp $
29 \brief AS-DCP library, non-public common DCData reader and writer implementation
32 #ifndef _AS_DCP_DCDATA_INTERNAL_H_
33 #define _AS_DCP_DCDATA_INTERNAL_H_
37 #include "AS_DCP_internal.h"
44 class InterchangeObject;
49 typedef std::list<MXF::InterchangeObject*> SubDescriptorList_t;
51 class h__Reader : public ASDCP::h__ASDCPReader
53 MXF::DCDataDescriptor* m_EssenceDescriptor;
54 ASDCP_NO_COPY_CONSTRUCT(h__Reader);
58 DCDataDescriptor m_DDesc;
60 h__Reader(const Dictionary& d) : ASDCP::h__ASDCPReader(d), m_EssenceDescriptor(0),
63 Result_t OpenRead(const std::string&);
64 Result_t ReadFrame(ui32_t, FrameBuffer&, AESDecContext*, HMACContext*);
65 Result_t MD_to_DCData_DDesc(DCData::DCDataDescriptor& DDesc);
68 class h__Writer : public ASDCP::h__ASDCPWriter
70 ASDCP_NO_COPY_CONSTRUCT(h__Writer);
74 DCDataDescriptor m_DDesc;
75 byte_t m_EssenceUL[SMPTE_UL_LENGTH];
77 h__Writer(const Dictionary& d) : ASDCP::h__ASDCPWriter(d) {
78 memset(m_EssenceUL, 0, SMPTE_UL_LENGTH);
83 Result_t OpenWrite(const std::string&, ui32_t HeaderSize, const SubDescriptorList_t& subDescriptors);
84 Result_t SetSourceStream(const DCDataDescriptor&, const byte_t*, const std::string&, const std::string&);
85 Result_t WriteFrame(const FrameBuffer&, AESEncContext* = 0, HMACContext* = 0);
87 Result_t DCData_DDesc_to_MD(DCData::DCDataDescriptor& DDesc);
94 #endif // _AS_DCP_DCDATA_INTERNAL_H_