Skip to content

Commit

Permalink
Add handling of other VideoSampleEntrys like avc3, hev1 etc
Browse files Browse the repository at this point in the history
  • Loading branch information
davemevans committed Jan 31, 2019
1 parent 6417ccd commit 218ea98
Show file tree
Hide file tree
Showing 2 changed files with 9 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
4 changes: 4 additions & 0 deletions src/parsing/sampleentries/sampleentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ 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");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "mp4a");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "ac-3");
BoxParser.createSampleEntryCtor(BoxParser.SAMPLE_ENTRY_TYPE_AUDIO, "ec-3");
Expand Down

0 comments on commit 218ea98

Please sign in to comment.