Restyle
This commit is contained in:
parent
5b79f296d6
commit
fccf66fba2
280 changed files with 56975 additions and 71885 deletions
|
|
@ -1,15 +1,14 @@
|
|||
#include "mp4_encryption.h"
|
||||
#include "defines.h"
|
||||
#include "mp4_encryption.h"
|
||||
|
||||
namespace MP4 {
|
||||
namespace MP4{
|
||||
|
||||
PSSH::PSSH() {
|
||||
memcpy(data + 4, "pssh", 4);
|
||||
}
|
||||
|
||||
std::string PSSH::toPrettyString(uint32_t indent) {
|
||||
PSSH::PSSH(){memcpy(data + 4, "pssh", 4);}
|
||||
|
||||
std::string PSSH::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[pssh] Protection System Specific Header Box (" << boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent, ' ') << "[pssh] Protection System Specific Header Box (" << boxedSize()
|
||||
<< ")" << std::endl;
|
||||
r << fullBox::toPrettyString(indent);
|
||||
r << std::string(indent + 1, ' ') << "SystemID: " << getSystemIDHex() << std::endl;
|
||||
if (getVersion()){
|
||||
|
|
@ -18,7 +17,7 @@ namespace MP4 {
|
|||
r << std::string(indent + 1, ' ') << "DataSize: " << getDataSize() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "Data: ";
|
||||
size_t dataSize = getDataSize();
|
||||
char * data = getData();
|
||||
char *data = getData();
|
||||
for (size_t i = 0; i < dataSize; ++i){
|
||||
r << std::hex << std::setw(2) << std::setfill('0') << (int)data[i] << std::dec << "";
|
||||
}
|
||||
|
|
@ -26,8 +25,8 @@ namespace MP4 {
|
|||
return r.str();
|
||||
}
|
||||
|
||||
std::string PSSH::getSystemIDHex() {
|
||||
char * systemID = getString(4);
|
||||
std::string PSSH::getSystemIDHex(){
|
||||
char *systemID = getString(4);
|
||||
std::stringstream res;
|
||||
for (size_t i = 0; i < 16; ++i){
|
||||
res << std::hex << std::setw(2) << std::setfill('0') << (int)systemID[i] << std::dec;
|
||||
|
|
@ -35,13 +34,9 @@ namespace MP4 {
|
|||
return "0x" + res.str();
|
||||
}
|
||||
|
||||
void PSSH::setSystemIDHex(const std::string & systemID) {
|
||||
setString(systemID, 4);
|
||||
}
|
||||
void PSSH::setSystemIDHex(const std::string &systemID){setString(systemID, 4);}
|
||||
|
||||
size_t PSSH::getKIDCount(){
|
||||
return getVersion() ? getInt32(20) : 0;
|
||||
}
|
||||
size_t PSSH::getKIDCount(){return getVersion() ? getInt32(20) : 0;}
|
||||
|
||||
size_t PSSH::getDataSize(){
|
||||
if (getVersion()){
|
||||
|
|
@ -51,7 +46,7 @@ namespace MP4 {
|
|||
return getInt32(20);
|
||||
}
|
||||
|
||||
char * PSSH::getData(){
|
||||
char *PSSH::getData(){
|
||||
if (getVersion()){
|
||||
size_t kidCount = getInt32(20);
|
||||
return getString(24 + (kidCount * 16) + 4);
|
||||
|
|
@ -59,25 +54,23 @@ namespace MP4 {
|
|||
return getString(24);
|
||||
}
|
||||
|
||||
void PSSH::setData(const std::string & data){
|
||||
void PSSH::setData(const std::string &data){
|
||||
if (getVersion()){
|
||||
WARN_MSG("Not implemented yet!");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < data.size(); i++){
|
||||
setInt8(data[i], 24 + i);
|
||||
}
|
||||
for (int i = 0; i < data.size(); i++){setInt8(data[i], 24 + i);}
|
||||
setInt32(data.size(), 20);
|
||||
}
|
||||
|
||||
std::string TENC::toPrettyString(uint32_t indent) {
|
||||
std::string TENC::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[tenc] Track Encryption Box (" << boxedSize() << ")" << std::endl;
|
||||
r << fullBox::toPrettyString(indent);
|
||||
r << std::string(indent + 1, ' ') << "default_isEncrypted: " << getDefaultIsEncrypted() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "default_IV_size: " << getDefaultIVSize() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "default_KID: ";
|
||||
std::string defaultKID = getDefaultKID();
|
||||
std::string defaultKID = getDefaultKID();
|
||||
for (int i = 0; i < 16; i++){
|
||||
r << std::hex << std::setw(2) << std::setfill('0') << (int)defaultKID[i] << std::dec << " ";
|
||||
}
|
||||
|
|
@ -85,31 +78,21 @@ namespace MP4 {
|
|||
return r.str();
|
||||
}
|
||||
|
||||
TENC::TENC() {
|
||||
TENC::TENC(){
|
||||
memcpy(data + 4, "tenc", 4);
|
||||
setDefaultIsEncrypted(1);
|
||||
setDefaultIVSize(8);
|
||||
}
|
||||
size_t TENC::getDefaultIsEncrypted(){
|
||||
return getInt24(4);
|
||||
}
|
||||
void TENC::setDefaultIsEncrypted(size_t isEncrypted){
|
||||
setInt24(isEncrypted, 4);
|
||||
}
|
||||
size_t TENC::getDefaultIVSize(){
|
||||
return getInt8(7);
|
||||
}
|
||||
void TENC::setDefaultIVSize(uint8_t ivSize){
|
||||
setInt8(ivSize, 7);
|
||||
}
|
||||
size_t TENC::getDefaultIsEncrypted(){return getInt24(4);}
|
||||
void TENC::setDefaultIsEncrypted(size_t isEncrypted){setInt24(isEncrypted, 4);}
|
||||
size_t TENC::getDefaultIVSize(){return getInt8(7);}
|
||||
void TENC::setDefaultIVSize(uint8_t ivSize){setInt8(ivSize, 7);}
|
||||
std::string TENC::getDefaultKID(){
|
||||
std::string result;
|
||||
for (int i = 8; i < 24; i++){
|
||||
result += getInt8(i);
|
||||
}
|
||||
for (int i = 8; i < 24; i++){result += getInt8(i);}
|
||||
return result;
|
||||
}
|
||||
void TENC::setDefaultKID(const std::string & kid){
|
||||
void TENC::setDefaultKID(const std::string &kid){
|
||||
for (int i = 0; i < 16; i++){
|
||||
if (i < kid.size()){
|
||||
setInt8(kid[i], i + 8);
|
||||
|
|
@ -119,80 +102,75 @@ namespace MP4 {
|
|||
}
|
||||
}
|
||||
|
||||
SENC::SENC() {
|
||||
SENC::SENC(){
|
||||
memcpy(data + 4, "senc", 4);
|
||||
setFlags(2);
|
||||
}
|
||||
uint32_t SENC::getSampleCount() const {
|
||||
return getInt32(4);
|
||||
}
|
||||
uint32_t SENC::getSampleCount() const{return getInt32(4);}
|
||||
|
||||
#define IV_SIZE 8
|
||||
void SENC::setSample(UUID_SampleEncryption_Sample newSample, size_t index) {
|
||||
void SENC::setSample(UUID_SampleEncryption_Sample newSample, size_t index){
|
||||
int myOffset = 8;
|
||||
for (unsigned int i = 0; i < std::min(index, (size_t)getSampleCount()); i++) {
|
||||
for (unsigned int i = 0; i < std::min(index, (size_t)getSampleCount()); i++){
|
||||
myOffset += IV_SIZE;
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
int entryCount = getInt16(myOffset);
|
||||
myOffset += 2 + (entryCount * 6);
|
||||
}
|
||||
}
|
||||
if (index > getSampleCount()) {
|
||||
if (index > getSampleCount()){
|
||||
ERROR_MSG("First fill intermediate entries!");
|
||||
return;
|
||||
/*
|
||||
//we are now at the end of currently reserved space, reserve more and adapt offset accordingly.
|
||||
int reserveSize = ((index - getSampleCount())) * (IV_SIZE + (getFlags() & 0x02));
|
||||
//we are now at the end of currently reserved space, reserve more and adapt offset
|
||||
accordingly. int reserveSize = ((index - getSampleCount())) * (IV_SIZE + (getFlags() & 0x02));
|
||||
reserveSize += IV_SIZE;
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
reserveSize += 2 + newSample.Entries.size();
|
||||
}
|
||||
if (!reserve(myOffset, 0, reserveSize)) {
|
||||
if (!reserve(myOffset, 0, reserveSize)){
|
||||
return;//Memory errors...
|
||||
}
|
||||
myOffset += (index - getSampleCount()) * (IV_SIZE + (getFlags() & 0x02));
|
||||
*/
|
||||
}
|
||||
//write box.
|
||||
for (int i = 0; i < IV_SIZE; i++) {
|
||||
setInt8(newSample.InitializationVector[i], myOffset ++);//set and skip
|
||||
// write box.
|
||||
for (int i = 0; i < IV_SIZE; i++){
|
||||
setInt8(newSample.InitializationVector[i], myOffset++); // set and skip
|
||||
}
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
setInt16(newSample.Entries.size(), myOffset);
|
||||
myOffset += 2;
|
||||
for (std::vector<UUID_SampleEncryption_Sample_Entry>::iterator it = newSample.Entries.begin(); it != newSample.Entries.end(); it++) {
|
||||
for (std::vector<UUID_SampleEncryption_Sample_Entry>::iterator it = newSample.Entries.begin();
|
||||
it != newSample.Entries.end(); it++){
|
||||
setInt16(it->BytesClear, myOffset);
|
||||
myOffset += 2;
|
||||
setInt32(it->BytesEncrypted, myOffset);
|
||||
myOffset += 4;
|
||||
}
|
||||
}
|
||||
if (index >= getSampleCount()) {
|
||||
setInt32(index + 1, 4);
|
||||
}
|
||||
if (index >= getSampleCount()){setInt32(index + 1, 4);}
|
||||
}
|
||||
|
||||
UUID_SampleEncryption_Sample SENC::getSample(size_t index) const {
|
||||
if (index >= getSampleCount()) {
|
||||
return UUID_SampleEncryption_Sample();
|
||||
}
|
||||
UUID_SampleEncryption_Sample SENC::getSample(size_t index) const{
|
||||
if (index >= getSampleCount()){return UUID_SampleEncryption_Sample();}
|
||||
int myOffset = 8;
|
||||
for (unsigned int i = 0; i < index; i++) {
|
||||
for (unsigned int i = 0; i < index; i++){
|
||||
myOffset += IV_SIZE;
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
int entryCount = getInt16(myOffset);
|
||||
myOffset += 2;//skip over entrycount
|
||||
myOffset += entryCount * 6;//skip entryCount sample entries
|
||||
myOffset += 2; // skip over entrycount
|
||||
myOffset += entryCount * 6; // skip entryCount sample entries
|
||||
}
|
||||
}
|
||||
UUID_SampleEncryption_Sample result;
|
||||
for (int i = 0; i < IV_SIZE; i++) {
|
||||
result.InitializationVector += (char)getInt8(myOffset++);//read and skip
|
||||
for (int i = 0; i < IV_SIZE; i++){
|
||||
result.InitializationVector += (char)getInt8(myOffset++); // read and skip
|
||||
}
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
result.NumberOfEntries = getInt16(myOffset);
|
||||
myOffset += 2;
|
||||
for (unsigned int i = 0; i < result.NumberOfEntries; i++) {
|
||||
for (unsigned int i = 0; i < result.NumberOfEntries; i++){
|
||||
result.Entries.push_back(UUID_SampleEncryption_Sample_Entry());
|
||||
result.Entries[i].BytesClear = getInt16(myOffset);
|
||||
myOffset += 2;
|
||||
|
|
@ -203,25 +181,27 @@ namespace MP4 {
|
|||
return result;
|
||||
}
|
||||
|
||||
std::string SENC::toPrettyString(uint32_t indent) const {
|
||||
std::string SENC::toPrettyString(uint32_t indent) const{
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[senc] Sample Encryption Box (" << boxedSize() << ")" << std::endl;
|
||||
r << fullBox::toPrettyString(indent);
|
||||
r << std::string(indent + 1, ' ') << "Sample Count: " << getSampleCount() << std::endl;
|
||||
for (unsigned int i = 0; i < getSampleCount(); i++) {
|
||||
for (unsigned int i = 0; i < getSampleCount(); i++){
|
||||
UUID_SampleEncryption_Sample tmpSample = getSample(i);
|
||||
r << std::string(indent + 1, ' ') << "[" << i << "]" << std::endl;
|
||||
r << std::string(indent + 3, ' ') << "Initialization Vector: 0x";
|
||||
for (unsigned int j = 0; j < tmpSample.InitializationVector.size(); j++) {
|
||||
r << std::hex << std::setw(2) << std::setfill('0') << (int)tmpSample.InitializationVector[j] << std::dec;
|
||||
for (unsigned int j = 0; j < tmpSample.InitializationVector.size(); j++){
|
||||
r << std::hex << std::setw(2) << std::setfill('0') << (int)tmpSample.InitializationVector[j]
|
||||
<< std::dec;
|
||||
}
|
||||
r << std::endl;
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
r << std::string(indent + 3, ' ') << "Number of entries: " << tmpSample.NumberOfEntries << std::endl;
|
||||
for (unsigned int j = 0; j < tmpSample.NumberOfEntries; j++) {
|
||||
for (unsigned int j = 0; j < tmpSample.NumberOfEntries; j++){
|
||||
r << std::string(indent + 3, ' ') << "[" << j << "]" << std::endl;
|
||||
r << std::string(indent + 5, ' ') << "Bytes clear: " << tmpSample.Entries[j].BytesClear << std::endl;
|
||||
r << std::string(indent + 5, ' ') << "Bytes encrypted: " << tmpSample.Entries[j].BytesEncrypted << std::endl;
|
||||
r << std::string(indent + 5, ' ')
|
||||
<< "Bytes encrypted: " << tmpSample.Entries[j].BytesEncrypted << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -232,29 +212,26 @@ namespace MP4 {
|
|||
memcpy(data + 4, "saiz", 4);
|
||||
setFlags(0);
|
||||
setVersion(0);
|
||||
setInt24(0, 4); //Default sample size
|
||||
setInt16(entryCount, 7);//EntryCount Samples
|
||||
setInt24(0, 4); // Default sample size
|
||||
setInt16(entryCount, 7); // EntryCount Samples
|
||||
for (int i = 0; i < entryCount; i++){
|
||||
setInt8(16, i+9);//16 bytes IV's
|
||||
setInt8(16, i + 9); // 16 bytes IV's
|
||||
}
|
||||
}
|
||||
|
||||
size_t SAIZ::getDefaultSampleSize(){
|
||||
return getInt24(4);
|
||||
}
|
||||
|
||||
size_t SAIZ::getEntryCount(){
|
||||
return getInt16(7);
|
||||
}
|
||||
size_t SAIZ::getDefaultSampleSize(){return getInt24(4);}
|
||||
|
||||
size_t SAIZ::getEntryCount(){return getInt16(7);}
|
||||
|
||||
size_t SAIZ::getEntrySize(size_t entryNo){
|
||||
if (entryNo >= getEntryCount()){return -1;}
|
||||
return getInt8(9 + entryNo);
|
||||
}
|
||||
|
||||
std::string SAIZ::toPrettyString(uint32_t indent) {
|
||||
std::string SAIZ::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[saiz] Sample Auxiliary Information Size Box (" << boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent, ' ') << "[saiz] Sample Auxiliary Information Size Box (" << boxedSize()
|
||||
<< ")" << std::endl;
|
||||
r << fullBox::toPrettyString(indent);
|
||||
r << std::string(indent + 1, ' ') << "Default Sample Size: " << getDefaultSampleSize() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "Entry Count: " << getEntryCount() << std::endl;
|
||||
|
|
@ -270,18 +247,17 @@ namespace MP4 {
|
|||
setInt32(offset, 8);
|
||||
}
|
||||
|
||||
size_t SAIO::getEntryCount(){
|
||||
return getInt32(4);
|
||||
}
|
||||
size_t SAIO::getEntryCount(){return getInt32(4);}
|
||||
|
||||
size_t SAIO::getEntrySize(size_t entryNo){
|
||||
if (entryNo >= getEntryCount()){return -1;}
|
||||
return getInt32(8 + (entryNo * 4));
|
||||
return getInt32(8 + (entryNo * 4));
|
||||
}
|
||||
|
||||
std::string SAIO::toPrettyString(uint32_t indent) {
|
||||
std::string SAIO::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[saio] Sample Auxiliary Information Offset Box (" << boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent, ' ') << "[saio] Sample Auxiliary Information Offset Box ("
|
||||
<< boxedSize() << ")" << std::endl;
|
||||
r << fullBox::toPrettyString(indent);
|
||||
r << std::string(indent + 1, ' ') << "Entry Count: " << getEntryCount() << std::endl;
|
||||
for (size_t i = 0; i < getEntryCount(); ++i){
|
||||
|
|
@ -290,153 +266,122 @@ namespace MP4 {
|
|||
return r.str();
|
||||
}
|
||||
|
||||
UUID_SampleEncryption::UUID_SampleEncryption() {
|
||||
setUUID((std::string)"a2394f52-5a9b-4f14-a244-6c427c648df4");
|
||||
UUID_SampleEncryption::UUID_SampleEncryption(){
|
||||
setUUID((std::string) "a2394f52-5a9b-4f14-a244-6c427c648df4");
|
||||
}
|
||||
|
||||
UUID_SampleEncryption::UUID_SampleEncryption(const SENC & senc){
|
||||
setUUID((std::string)"a2394f52-5a9b-4f14-a244-6c427c648df4");
|
||||
UUID_SampleEncryption::UUID_SampleEncryption(const SENC &senc){
|
||||
setUUID((std::string) "a2394f52-5a9b-4f14-a244-6c427c648df4");
|
||||
setVersion(0);
|
||||
setFlags(2);
|
||||
size_t sampleCount = senc.getSampleCount();
|
||||
for (size_t i = 0; i < sampleCount; ++i){
|
||||
setSample(senc.getSample(i), i);
|
||||
}
|
||||
for (size_t i = 0; i < sampleCount; ++i){setSample(senc.getSample(i), i);}
|
||||
}
|
||||
|
||||
void UUID_SampleEncryption::setVersion(uint32_t newVersion) {
|
||||
setInt8(newVersion, 16);
|
||||
void UUID_SampleEncryption::setVersion(uint32_t newVersion){setInt8(newVersion, 16);}
|
||||
|
||||
uint32_t UUID_SampleEncryption::getVersion(){return getInt8(16);}
|
||||
|
||||
void UUID_SampleEncryption::setFlags(uint32_t newFlags){setInt24(newFlags, 17);}
|
||||
|
||||
uint32_t UUID_SampleEncryption::getFlags(){return getInt24(17);}
|
||||
|
||||
void UUID_SampleEncryption::setAlgorithmID(uint32_t newAlgorithmID){
|
||||
if (getFlags() & 0x01){setInt24(newAlgorithmID, 20);}
|
||||
}
|
||||
|
||||
uint32_t UUID_SampleEncryption::getVersion() {
|
||||
return getInt8(16);
|
||||
}
|
||||
|
||||
void UUID_SampleEncryption::setFlags(uint32_t newFlags) {
|
||||
setInt24(newFlags, 17);
|
||||
}
|
||||
|
||||
uint32_t UUID_SampleEncryption::getFlags() {
|
||||
return getInt24(17);
|
||||
}
|
||||
|
||||
void UUID_SampleEncryption::setAlgorithmID(uint32_t newAlgorithmID) {
|
||||
if (getFlags() & 0x01) {
|
||||
setInt24(newAlgorithmID, 20);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t UUID_SampleEncryption::getAlgorithmID() {
|
||||
if (getFlags() & 0x01) {
|
||||
return getInt24(20);
|
||||
}
|
||||
uint32_t UUID_SampleEncryption::getAlgorithmID(){
|
||||
if (getFlags() & 0x01){return getInt24(20);}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void UUID_SampleEncryption::setIVSize(uint32_t newIVSize) {
|
||||
if (getFlags() & 0x01) {
|
||||
setInt8(newIVSize, 23);
|
||||
}
|
||||
void UUID_SampleEncryption::setIVSize(uint32_t newIVSize){
|
||||
if (getFlags() & 0x01){setInt8(newIVSize, 23);}
|
||||
}
|
||||
|
||||
uint32_t UUID_SampleEncryption::getIVSize() {
|
||||
if (getFlags() & 0x01) {
|
||||
return getInt8(23);
|
||||
}
|
||||
uint32_t UUID_SampleEncryption::getIVSize(){
|
||||
if (getFlags() & 0x01){return getInt8(23);}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void UUID_SampleEncryption::setKID(std::string newKID) {
|
||||
if (newKID == "") {
|
||||
return;
|
||||
}
|
||||
if (getFlags() & 0x01) {
|
||||
while (newKID.size() < 16) {
|
||||
newKID += (char)0x00;
|
||||
}
|
||||
for (int i = 0; i < 16; i++) {
|
||||
setInt8(newKID[i], 24 + i);
|
||||
}
|
||||
void UUID_SampleEncryption::setKID(std::string newKID){
|
||||
if (newKID == ""){return;}
|
||||
if (getFlags() & 0x01){
|
||||
while (newKID.size() < 16){newKID += (char)0x00;}
|
||||
for (int i = 0; i < 16; i++){setInt8(newKID[i], 24 + i);}
|
||||
}
|
||||
}
|
||||
|
||||
std::string UUID_SampleEncryption::getKID() {
|
||||
if (getFlags() & 0x01) {
|
||||
std::string UUID_SampleEncryption::getKID(){
|
||||
if (getFlags() & 0x01){
|
||||
std::string result;
|
||||
for (int i = 0; i < 16; i++) {
|
||||
result += (char)getInt8(24 + i);
|
||||
}
|
||||
for (int i = 0; i < 16; i++){result += (char)getInt8(24 + i);}
|
||||
return result;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
uint32_t UUID_SampleEncryption::getSampleCount() {
|
||||
uint32_t UUID_SampleEncryption::getSampleCount(){
|
||||
int myOffset = 20;
|
||||
if (getFlags() & 0x01) {
|
||||
myOffset += 20;
|
||||
}
|
||||
if (getFlags() & 0x01){myOffset += 20;}
|
||||
return getInt32(myOffset);
|
||||
}
|
||||
|
||||
#define IV_SIZE 8
|
||||
void UUID_SampleEncryption::setSample(UUID_SampleEncryption_Sample newSample, size_t index) {
|
||||
void UUID_SampleEncryption::setSample(UUID_SampleEncryption_Sample newSample, size_t index){
|
||||
int myOffset = 20;
|
||||
myOffset += 20 * (getFlags() & 0x01);
|
||||
myOffset += 4;//sampleCount is here;
|
||||
for (unsigned int i = 0; i < std::min(index, (size_t)getSampleCount()); i++) {
|
||||
myOffset += 4; // sampleCount is here;
|
||||
for (unsigned int i = 0; i < std::min(index, (size_t)getSampleCount()); i++){
|
||||
myOffset += IV_SIZE;
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
int entryCount = getInt16(myOffset);
|
||||
myOffset += 2 + (entryCount * 6);
|
||||
}
|
||||
}
|
||||
if (index > getSampleCount()) {
|
||||
if (index > getSampleCount()){
|
||||
ERROR_MSG("First fill intermediate entries!");
|
||||
return;
|
||||
}
|
||||
//write box.
|
||||
for (int i = 0; i < IV_SIZE; i++) {
|
||||
setInt8(newSample.InitializationVector[i], myOffset ++);//set and skip
|
||||
// write box.
|
||||
for (int i = 0; i < IV_SIZE; i++){
|
||||
setInt8(newSample.InitializationVector[i], myOffset++); // set and skip
|
||||
}
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
setInt16(newSample.Entries.size(), myOffset);
|
||||
myOffset += 2;
|
||||
for (std::vector<UUID_SampleEncryption_Sample_Entry>::iterator it = newSample.Entries.begin(); it != newSample.Entries.end(); it++) {
|
||||
for (std::vector<UUID_SampleEncryption_Sample_Entry>::iterator it = newSample.Entries.begin();
|
||||
it != newSample.Entries.end(); it++){
|
||||
setInt16(it->BytesClear, myOffset);
|
||||
myOffset += 2;
|
||||
setInt32(it->BytesEncrypted, myOffset);
|
||||
myOffset += 4;
|
||||
}
|
||||
}
|
||||
if (index >= getSampleCount()) {
|
||||
setInt32(index + 1, 20 + (20 * (getFlags() & 0x01)));
|
||||
}
|
||||
if (index >= getSampleCount()){setInt32(index + 1, 20 + (20 * (getFlags() & 0x01)));}
|
||||
}
|
||||
|
||||
UUID_SampleEncryption_Sample UUID_SampleEncryption::getSample(size_t index) {
|
||||
if (index >= getSampleCount()) {
|
||||
return UUID_SampleEncryption_Sample();
|
||||
}
|
||||
UUID_SampleEncryption_Sample UUID_SampleEncryption::getSample(size_t index){
|
||||
if (index >= getSampleCount()){return UUID_SampleEncryption_Sample();}
|
||||
int myOffset = 20;
|
||||
myOffset += 20 * (getFlags() & 0x01);
|
||||
myOffset += 4;//sampleCount is here
|
||||
for (unsigned int i = 0; i < index; i++) {
|
||||
myOffset += 4; // sampleCount is here
|
||||
for (unsigned int i = 0; i < index; i++){
|
||||
myOffset += IV_SIZE;
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
int entryCount = getInt16(myOffset);
|
||||
myOffset += 2;//skip over entrycount
|
||||
myOffset += entryCount * 6;//skip entryCount sample entries
|
||||
myOffset += 2; // skip over entrycount
|
||||
myOffset += entryCount * 6; // skip entryCount sample entries
|
||||
}
|
||||
}
|
||||
UUID_SampleEncryption_Sample result;
|
||||
for (int i = 0; i < IV_SIZE; i++) {
|
||||
result.InitializationVector += getInt8(myOffset++);//read and skip
|
||||
for (int i = 0; i < IV_SIZE; i++){
|
||||
result.InitializationVector += getInt8(myOffset++); // read and skip
|
||||
}
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
result.NumberOfEntries = getInt16(myOffset);
|
||||
myOffset += 2;
|
||||
for (unsigned int i = 0; i < result.NumberOfEntries; i++) {
|
||||
for (unsigned int i = 0; i < result.NumberOfEntries; i++){
|
||||
result.Entries.push_back(UUID_SampleEncryption_Sample_Entry());
|
||||
result.Entries[i].BytesClear = getInt16(myOffset);
|
||||
myOffset += 2;
|
||||
|
|
@ -447,162 +392,136 @@ namespace MP4 {
|
|||
return result;
|
||||
}
|
||||
|
||||
std::string UUID_SampleEncryption::toPrettyString(uint32_t indent) {
|
||||
std::string UUID_SampleEncryption::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[a2394f52-5a9b-4f14-a244-6c427c648df4] Sample Encryption Box (" << boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent, ' ') << "[a2394f52-5a9b-4f14-a244-6c427c648df4] Sample Encryption Box ("
|
||||
<< boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "Version: " << getVersion() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "Flags: " << getFlags() << std::endl;
|
||||
if (getFlags() & 0x01) {
|
||||
if (getFlags() & 0x01){
|
||||
r << std::string(indent + 1, ' ') << "Algorithm ID: " << getAlgorithmID() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "IV Size: " << getIVSize() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "Key ID: " << getKID() << std::endl;
|
||||
}
|
||||
r << std::string(indent + 1, ' ') << "Sample Count: " << getSampleCount() << std::endl;
|
||||
for (unsigned int i = 0; i < getSampleCount(); i++) {
|
||||
for (unsigned int i = 0; i < getSampleCount(); i++){
|
||||
UUID_SampleEncryption_Sample tmpSample = getSample(i);
|
||||
r << std::string(indent + 1, ' ') << "[" << i << "]" << std::endl;
|
||||
r << std::string(indent + 3, ' ') << "Initialization Vector: 0x";
|
||||
for (unsigned int j = 0; j < tmpSample.InitializationVector.size(); j++) {
|
||||
r << std::hex << std::setw(2) << std::setfill('0') << (int)tmpSample.InitializationVector[j] << std::dec;
|
||||
for (unsigned int j = 0; j < tmpSample.InitializationVector.size(); j++){
|
||||
r << std::hex << std::setw(2) << std::setfill('0') << (int)tmpSample.InitializationVector[j]
|
||||
<< std::dec;
|
||||
}
|
||||
r << std::endl;
|
||||
if (getFlags() & 0x02) {
|
||||
if (getFlags() & 0x02){
|
||||
r << std::string(indent + 3, ' ') << "Number of entries: " << tmpSample.NumberOfEntries << std::endl;
|
||||
for (unsigned int j = 0; j < tmpSample.NumberOfEntries; j++) {
|
||||
for (unsigned int j = 0; j < tmpSample.NumberOfEntries; j++){
|
||||
r << std::string(indent + 3, ' ') << "[" << j << "]" << std::endl;
|
||||
r << std::string(indent + 5, ' ') << "Bytes clear: " << tmpSample.Entries[j].BytesClear << std::endl;
|
||||
r << std::string(indent + 5, ' ') << "Bytes encrypted: " << tmpSample.Entries[j].BytesEncrypted << std::endl;
|
||||
r << std::string(indent + 5, ' ')
|
||||
<< "Bytes encrypted: " << tmpSample.Entries[j].BytesEncrypted << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
return r.str();
|
||||
}
|
||||
|
||||
UUID_TrackEncryption::UUID_TrackEncryption() {
|
||||
setUUID((std::string)"8974dbce-7be7-4c51-84f9-7148f9882554");
|
||||
UUID_TrackEncryption::UUID_TrackEncryption(){
|
||||
setUUID((std::string) "8974dbce-7be7-4c51-84f9-7148f9882554");
|
||||
}
|
||||
|
||||
void UUID_TrackEncryption::setVersion(uint32_t newVersion) {
|
||||
setInt8(newVersion, 16);
|
||||
}
|
||||
void UUID_TrackEncryption::setVersion(uint32_t newVersion){setInt8(newVersion, 16);}
|
||||
|
||||
uint32_t UUID_TrackEncryption::getVersion() {
|
||||
return getInt8(16);
|
||||
}
|
||||
uint32_t UUID_TrackEncryption::getVersion(){return getInt8(16);}
|
||||
|
||||
void UUID_TrackEncryption::setFlags(uint32_t newFlags) {
|
||||
setInt24(newFlags, 17);
|
||||
}
|
||||
void UUID_TrackEncryption::setFlags(uint32_t newFlags){setInt24(newFlags, 17);}
|
||||
|
||||
uint32_t UUID_TrackEncryption::getFlags() {
|
||||
return getInt24(17);
|
||||
}
|
||||
uint32_t UUID_TrackEncryption::getFlags(){return getInt24(17);}
|
||||
|
||||
void UUID_TrackEncryption::setDefaultAlgorithmID(uint32_t newID) {
|
||||
setInt24(newID, 20);
|
||||
}
|
||||
void UUID_TrackEncryption::setDefaultAlgorithmID(uint32_t newID){setInt24(newID, 20);}
|
||||
|
||||
uint32_t UUID_TrackEncryption::getDefaultAlgorithmID() {
|
||||
return getInt24(20);
|
||||
}
|
||||
uint32_t UUID_TrackEncryption::getDefaultAlgorithmID(){return getInt24(20);}
|
||||
|
||||
void UUID_TrackEncryption::setDefaultIVSize(uint8_t newIVSize) {
|
||||
setInt8(newIVSize, 23);
|
||||
}
|
||||
void UUID_TrackEncryption::setDefaultIVSize(uint8_t newIVSize){setInt8(newIVSize, 23);}
|
||||
|
||||
uint8_t UUID_TrackEncryption::getDefaultIVSize() {
|
||||
return getInt8(23);
|
||||
}
|
||||
uint8_t UUID_TrackEncryption::getDefaultIVSize(){return getInt8(23);}
|
||||
|
||||
void UUID_TrackEncryption::setDefaultKID(std::string newKID) {
|
||||
for (unsigned int i = 0; i < 16; i++) {
|
||||
if (i < newKID.size()) {
|
||||
void UUID_TrackEncryption::setDefaultKID(std::string newKID){
|
||||
for (unsigned int i = 0; i < 16; i++){
|
||||
if (i < newKID.size()){
|
||||
setInt8(newKID[i], 24 + i);
|
||||
} else {
|
||||
}else{
|
||||
setInt8(0x00, 24 + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string UUID_TrackEncryption::getDefaultKID() {
|
||||
std::string UUID_TrackEncryption::getDefaultKID(){
|
||||
std::string result;
|
||||
for (int i = 0; i < 16; i++) {
|
||||
result += getInt8(24 + i);
|
||||
}
|
||||
for (int i = 0; i < 16; i++){result += getInt8(24 + i);}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string UUID_TrackEncryption::toPrettyString(uint32_t indent) {
|
||||
std::string UUID_TrackEncryption::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[8974dbce-7be7-4c51-84f9-7148f9882554] Track Encryption Box (" << boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent, ' ') << "[8974dbce-7be7-4c51-84f9-7148f9882554] Track Encryption Box ("
|
||||
<< boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Version: " << getVersion() << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Flags: " << getFlags() << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Default Algorithm ID: " << std::hex << getDefaultAlgorithmID() << std::dec << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Default Algorithm ID: " << std::hex
|
||||
<< getDefaultAlgorithmID() << std::dec << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Default IV Size: " << (int)getDefaultIVSize() << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Default KID: 16 bytes of binary data." << std::endl;
|
||||
return r.str();
|
||||
}
|
||||
|
||||
UUID_ProtectionSystemSpecificHeader::UUID_ProtectionSystemSpecificHeader() {
|
||||
setUUID((std::string)"d08a4f18-10f3-4a82-b6c8-32d8aba183d3");
|
||||
UUID_ProtectionSystemSpecificHeader::UUID_ProtectionSystemSpecificHeader(){
|
||||
setUUID((std::string) "d08a4f18-10f3-4a82-b6c8-32d8aba183d3");
|
||||
}
|
||||
|
||||
void UUID_ProtectionSystemSpecificHeader::setVersion(uint32_t newVersion) {
|
||||
void UUID_ProtectionSystemSpecificHeader::setVersion(uint32_t newVersion){
|
||||
setInt8(newVersion, 16);
|
||||
}
|
||||
|
||||
uint32_t UUID_ProtectionSystemSpecificHeader::getVersion() {
|
||||
return getInt8(16);
|
||||
}
|
||||
uint32_t UUID_ProtectionSystemSpecificHeader::getVersion(){return getInt8(16);}
|
||||
|
||||
void UUID_ProtectionSystemSpecificHeader::setFlags(uint32_t newFlags) {
|
||||
setInt24(newFlags, 17);
|
||||
}
|
||||
void UUID_ProtectionSystemSpecificHeader::setFlags(uint32_t newFlags){setInt24(newFlags, 17);}
|
||||
|
||||
uint32_t UUID_ProtectionSystemSpecificHeader::getFlags() {
|
||||
return getInt24(17);
|
||||
}
|
||||
uint32_t UUID_ProtectionSystemSpecificHeader::getFlags(){return getInt24(17);}
|
||||
|
||||
void UUID_ProtectionSystemSpecificHeader::setSystemID(std::string newID) {
|
||||
for (unsigned int i = 0; i < 16; i++) {
|
||||
if (i < newID.size()) {
|
||||
void UUID_ProtectionSystemSpecificHeader::setSystemID(std::string newID){
|
||||
for (unsigned int i = 0; i < 16; i++){
|
||||
if (i < newID.size()){
|
||||
setInt8(newID[i], 20 + i);
|
||||
} else {
|
||||
}else{
|
||||
setInt8(0x00, 20 + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string UUID_ProtectionSystemSpecificHeader::getSystemID() {
|
||||
std::string UUID_ProtectionSystemSpecificHeader::getSystemID(){
|
||||
std::string result;
|
||||
for (int i = 0; i < 16; i++) {
|
||||
result += getInt8(20 + i);
|
||||
}
|
||||
for (int i = 0; i < 16; i++){result += getInt8(20 + i);}
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t UUID_ProtectionSystemSpecificHeader::getDataSize() {
|
||||
return getInt32(36);
|
||||
}
|
||||
uint32_t UUID_ProtectionSystemSpecificHeader::getDataSize(){return getInt32(36);}
|
||||
|
||||
void UUID_ProtectionSystemSpecificHeader::setData(std::string newData) {
|
||||
void UUID_ProtectionSystemSpecificHeader::setData(std::string newData){
|
||||
setInt32(newData.size(), 36);
|
||||
for (unsigned int i = 0; i < newData.size(); i++) {
|
||||
setInt8(newData[i], 40 + i);
|
||||
}
|
||||
for (unsigned int i = 0; i < newData.size(); i++){setInt8(newData[i], 40 + i);}
|
||||
}
|
||||
|
||||
std::string UUID_ProtectionSystemSpecificHeader::getData() {
|
||||
std::string UUID_ProtectionSystemSpecificHeader::getData(){
|
||||
std::string result;
|
||||
for (unsigned int i = 0; i < getDataSize(); i++) {
|
||||
result += getInt8(40 + i);
|
||||
}
|
||||
for (unsigned int i = 0; i < getDataSize(); i++){result += getInt8(40 + i);}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string UUID_ProtectionSystemSpecificHeader::toPrettyString(uint32_t indent) {
|
||||
std::string UUID_ProtectionSystemSpecificHeader::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[d08a4f18-10f3-4a82-b6c8-32d8aba183d3] Protection System Specific Header Box (" << boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent, ' ') << "[d08a4f18-10f3-4a82-b6c8-32d8aba183d3] Protection System Specific Header Box ("
|
||||
<< boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Version: " << getVersion() << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Flags: " << getFlags() << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "System ID: " << getSystemID() << std::endl;
|
||||
|
|
@ -611,66 +530,54 @@ namespace MP4 {
|
|||
return r.str();
|
||||
}
|
||||
|
||||
SINF::SINF() {
|
||||
memcpy(data + 4, "sinf", 4);
|
||||
}
|
||||
SINF::SINF(){memcpy(data + 4, "sinf", 4);}
|
||||
|
||||
void SINF::setEntry(Box & newEntry, uint32_t no) {
|
||||
if (no > 4) {
|
||||
return;
|
||||
}
|
||||
void SINF::setEntry(Box &newEntry, uint32_t no){
|
||||
if (no > 4){return;}
|
||||
int tempLoc = 0;
|
||||
for (unsigned int i = 0; i < no; i++) {
|
||||
for (unsigned int i = 0; i < no; i++){
|
||||
tempLoc += Box(getBox(tempLoc).asBox(), false).boxedSize();
|
||||
}
|
||||
setBox(newEntry, tempLoc);
|
||||
}
|
||||
|
||||
Box & SINF::getEntry(uint32_t no) {
|
||||
Box &SINF::getEntry(uint32_t no){
|
||||
static Box ret = Box((char *)"\000\000\000\010erro", false);
|
||||
if (no > 4) {
|
||||
return ret;
|
||||
}
|
||||
if (no > 4){return ret;}
|
||||
int tempLoc = 0;
|
||||
for (unsigned int i = 0; i < no; i++) {
|
||||
tempLoc += getBoxLen(tempLoc);
|
||||
}
|
||||
for (unsigned int i = 0; i < no; i++){tempLoc += getBoxLen(tempLoc);}
|
||||
return getBox(tempLoc);
|
||||
}
|
||||
|
||||
std::string SINF::toPrettyString(uint32_t indent) {
|
||||
std::string SINF::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
std::cerr << payloadOffset << std::endl;
|
||||
r << std::string(indent, ' ') << "[sinf] Protection Scheme Info Box (" << boxedSize() << ")" << std::endl;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (!getEntry(i).isType("erro")) {
|
||||
r << getEntry(i).toPrettyString(indent + 2);
|
||||
}
|
||||
for (int i = 0; i < 4; i++){
|
||||
if (!getEntry(i).isType("erro")){r << getEntry(i).toPrettyString(indent + 2);}
|
||||
}
|
||||
r << std::endl;
|
||||
return r.str();
|
||||
}
|
||||
|
||||
FRMA::FRMA(const std::string & originalFormat) {
|
||||
FRMA::FRMA(const std::string &originalFormat){
|
||||
memcpy(data + 4, "frma", 4);
|
||||
setOriginalFormat(originalFormat);
|
||||
}
|
||||
|
||||
void FRMA::setOriginalFormat(const std::string & newFormat) {
|
||||
for (unsigned int i = 0; i < 4; i++) {
|
||||
if (i < newFormat.size()) {
|
||||
void FRMA::setOriginalFormat(const std::string &newFormat){
|
||||
for (unsigned int i = 0; i < 4; i++){
|
||||
if (i < newFormat.size()){
|
||||
setInt8(newFormat[i], i);
|
||||
} else {
|
||||
}else{
|
||||
setInt8(0x00, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string FRMA::getOriginalFormat() {
|
||||
return std::string(payload(), 4);
|
||||
}
|
||||
std::string FRMA::getOriginalFormat(){return std::string(payload(), 4);}
|
||||
|
||||
std::string FRMA::toPrettyString(uint32_t indent) {
|
||||
std::string FRMA::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[frma] Original Format Box (" << boxedSize() << ")" << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "Original Format: " << getOriginalFormat() << std::endl;
|
||||
|
|
@ -683,65 +590,50 @@ namespace MP4 {
|
|||
setSchemeVersion(schemeVersion);
|
||||
}
|
||||
|
||||
void SCHM::setSchemeType(uint32_t newType) {
|
||||
setInt32(htonl(newType), 4);
|
||||
}
|
||||
void SCHM::setSchemeType(uint32_t newType){setInt32(htonl(newType), 4);}
|
||||
|
||||
uint32_t SCHM::getSchemeType() {
|
||||
return ntohl(getInt32(4));
|
||||
}
|
||||
uint32_t SCHM::getSchemeType(){return ntohl(getInt32(4));}
|
||||
|
||||
void SCHM::setSchemeVersion(uint32_t newVersion) {
|
||||
setInt32(htonl(newVersion), 8);
|
||||
}
|
||||
void SCHM::setSchemeVersion(uint32_t newVersion){setInt32(htonl(newVersion), 8);}
|
||||
|
||||
uint32_t SCHM::getSchemeVersion() {
|
||||
return ntohl(getInt32(8));
|
||||
}
|
||||
uint32_t SCHM::getSchemeVersion(){return ntohl(getInt32(8));}
|
||||
|
||||
void SCHM::setSchemeURI(std::string newURI) {
|
||||
void SCHM::setSchemeURI(std::string newURI){
|
||||
setFlags(getFlags() | 0x01);
|
||||
setString(newURI, 12);
|
||||
}
|
||||
|
||||
std::string SCHM::getSchemeURI() {
|
||||
if (getFlags() & 0x01) {
|
||||
return getString(12);
|
||||
}
|
||||
std::string SCHM::getSchemeURI(){
|
||||
if (getFlags() & 0x01){return getString(12);}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string SCHM::toPrettyString(uint32_t indent) {
|
||||
std::string SCHM::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[schm] Scheme Type Box (" << boxedSize() << ")" << std::endl;
|
||||
char tmpStr[10];
|
||||
int tmpInt = getSchemeType();
|
||||
sprintf(tmpStr, "%.4s", (char *)&tmpInt);
|
||||
r << std::string(indent + 2, ' ') << "SchemeType: " << std::string(tmpStr, 4) << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "SchemeVersion: 0x" << std::hex << std::setw(8) << std::setfill('0') << getSchemeVersion() << std::dec << std::endl;
|
||||
if (getFlags() & 0x01) {
|
||||
r << std::string(indent + 2, ' ') << "SchemeVersion: 0x" << std::hex << std::setw(8)
|
||||
<< std::setfill('0') << getSchemeVersion() << std::dec << std::endl;
|
||||
if (getFlags() & 0x01){
|
||||
r << std::string(indent + 2, ' ') << "SchemeURI: " << getSchemeURI() << std::endl;
|
||||
}
|
||||
return r.str();
|
||||
}
|
||||
|
||||
SCHI::SCHI() {
|
||||
memcpy(data + 4, "schi", 4);
|
||||
}
|
||||
SCHI::SCHI(){memcpy(data + 4, "schi", 4);}
|
||||
|
||||
void SCHI::setContent(Box & newContent) {
|
||||
setBox(newContent, 0);
|
||||
}
|
||||
void SCHI::setContent(Box &newContent){setBox(newContent, 0);}
|
||||
|
||||
Box & SCHI::getContent() {
|
||||
return getBox(0);
|
||||
}
|
||||
Box &SCHI::getContent(){return getBox(0);}
|
||||
|
||||
std::string SCHI::toPrettyString(uint32_t indent) {
|
||||
std::string SCHI::toPrettyString(uint32_t indent){
|
||||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[schi] Scheme Information Box (" << boxedSize() << ")" << std::endl;
|
||||
r << getContent().toPrettyString(indent + 2);
|
||||
return r.str();
|
||||
}
|
||||
|
||||
}
|
||||
}// namespace MP4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue