return (ushort)(GetLength() - 9);
}
+DTCP_Descriptor::DTCP_Descriptor(pByte data, int startIndex)
+ throw(std::invalid_argument):Descriptor(data, startIndex)
+{
+ if (sizeof(data.get()) < 6)
+ throw std::invalid_argument("Invalid DTCP descriptor");
+ if (GetTag() != Constants::DTCP_DESCRIPTOR_TAG)
+ throw std::invalid_argument("Invalid DTCP descriptor tag");
+ if (GetLength() < 4)
+ throw std::invalid_argument("Invalid DTCP descriptor length");
+ if (data[startIndex + 2] != 0x0f || data[startIndex + 3] != 0xff)
+ throw std::invalid_argument("Invalid DTCP descriptor CA system ID");
+}
+
+DtcpCci DTCP_Descriptor::GetCopyStatus(void)
+{
+ return (DtcpCci)(mData[4] & 0x3);
+}
+
+bool DTCP_Descriptor::GetAnalogConstrain(void)
+{
+ return ((mData[5] & 0x4) == 0);
+}
+
+bool DTCP_Descriptor::GetMacrovision(void)
+{
+ return ((mData[5] & 0x3) > 0);
+}
+
// implement class BluRayOutput
-// implement class DTCP_Descriptor : Descriptor
// implement class SitPacket : TsTable
// implement class PmPacket : TsTable
// implement class H264Info : ElementaryParse
pByte GetData(void);
byte GetTag(void);
byte GetLength(void);
- private:
+ protected:
pByte mData;
};
-class DTCP_Descriptor : Descriptor {
+class DTCP_Descriptor : public Descriptor {
public:
- DTCP_Descriptor(pByte data, int startIndex);
+ DTCP_Descriptor(pByte data, int startIndex)
+ throw(std::invalid_argument);
+ DtcpCci GetCopyStatus(void);
+ bool GetAnalogConstrain(void);
+ bool GetMacrovision(void);
};
class Constants {