Skip to content

Commit

Permalink
use possibilties of latest isoparser
Browse files Browse the repository at this point in the history
  • Loading branch information
sannies committed May 20, 2015
1 parent 6fc8a4b commit 43e6490
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 38 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>de.sannies.isoviewer</groupId>
<packaging>jar</packaging>
<name>ISO Viewer</name>
<version>1.0.7-SNAPSHOT</version>
<version>1.0.7</version>
<description>The ISO Viewer is a UI Tool for viewing ISO Box files (see ISO/IEC 14496-12). Useful for looking into
Apple Quicktime Movies, DCF files, PDCF files, MP4 files and other ISO Box files.
</description>
Expand Down Expand Up @@ -152,7 +152,7 @@
<scm>
<connection>scm:git:git@github.com:sannies/isoviewer.git</connection>
<developerConnection>scm:git:git@github.com:sannies/isoviewer.git</developerConnection>
<tag>HEAD</tag>
<tag>isoviewer-1.0.7</tag>
</scm>

</project>
46 changes: 12 additions & 34 deletions src/main/java/com/github/sannies/isoviewer/AvcNalWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package com.github.sannies.isoviewer;

import com.googlecode.mp4parser.authoring.tracks.h264.H264NalUnitTypes;

import java.lang.reflect.Field;
import java.nio.ByteBuffer;

/**
Expand All @@ -36,41 +39,16 @@ public AvcNalWrapper(ByteBuffer data) {
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
switch (nal_unit_type) {
case 1:
sb.append("NonIDR");
break;
case 2:
sb.append("Part.A");
break;
case 3:
sb.append("Part.B");
break;
case 4:
sb.append("Part.C");
break;
case 5:
sb.append("IDR");
break;
case 6:
sb.append("SEI");
break;
case 7:
sb.append("SPS");
break;
case 8:
sb.append("PPS");
break;
case 9:
sb.append("AUD");
return sb.toString();
case 10:
sb.append("EndOfSeq");
break;
case 11:
sb.append("EndOfStr");
break;
for (Field f : H264NalUnitTypes.class.getFields()) {
try {
if (nal_unit_type == f.getInt(null)) {
sb.append(f.getName());
}
} catch (IllegalAccessException e) {
throw new RuntimeException();
}
}

sb.append("{").append("type:").append(nal_unit_type).append(",idc:").append(nal_ref_idc).append(",size:").append(data.limit());
sb.append('}');
// sb.append("{data=").append(data);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/github/sannies/isoviewer/HvcNalWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.github.sannies.isoviewer;

import com.googlecode.mp4parser.authoring.tracks.h265.NalUnitTypes;
import com.googlecode.mp4parser.authoring.tracks.h265.H265NalUnitTypes;

import java.lang.reflect.Field;
import java.nio.ByteBuffer;
Expand All @@ -39,7 +39,7 @@ public HvcNalWrapper(ByteBuffer data) {
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
for (Field f : NalUnitTypes.class.getFields()) {
for (Field f : H265NalUnitTypes.class.getFields()) {
try {
if (nal_unit_type == f.getInt(null)) {
sb.append(f.getName());
Expand Down

0 comments on commit 43e6490

Please sign in to comment.