Skip to content

Commit

Permalink
Merge pull request #164 from davemevans/AddAdditionalVideoSampleEntries
Browse files Browse the repository at this point in the history
Add handling of other VisualSampleEntrys like avc3, hev1 etc
  • Loading branch information
cconcolato authored Apr 30, 2019
2 parents 1e3b116 + 218ea98 commit 4544c93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/box-codecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ BoxParser.decimalToHex = function(d, padding) {
return hex;
}

BoxParser.avc1SampleEntry.prototype.getCodec = function() {
BoxParser.avc1SampleEntry.prototype.getCodec =
BoxParser.avc2SampleEntry.prototype.getCodec =
BoxParser.avc3SampleEntry.prototype.getCodec =
BoxParser.avc4SampleEntry.prototype.getCodec = function() {
var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this);
if (this.avcC) {
return baseCodec+"."+BoxParser.decimalToHex(this.avcC.AVCProfileIndication)+
Expand All @@ -99,6 +102,7 @@ BoxParser.avc1SampleEntry.prototype.getCodec = function() {
}
}

BoxParser.hev1SampleEntry.prototype.getCodec =
BoxParser.hvc1SampleEntry.prototype.getCodec = function() {
var i;
var baseCodec = BoxParser.SampleEntry.prototype.getCodec.call(this);
Expand Down
3 changes: 3 additions & 0 deletions src/parsing/sampleentries/sampleentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ BoxParser.createMediaSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, function

// Sample entries inheriting from Audio and Video
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc1");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc2");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc3");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "avc4");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "av01");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "hvc1");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_VISUAL, "hev1");
Expand Down

0 comments on commit 4544c93

Please sign in to comment.