Skip to content

Commit 4518bfc

Browse files
authored
test: Add additional tests to ffprobe (#341)
1 parent 221637f commit 4518bfc

File tree

7 files changed

+469
-41
lines changed

7 files changed

+469
-41
lines changed

src/main/java/net/bramp/ffmpeg/probe/FFmpegFrame.java

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,72 @@ public class FFmpegFrame implements FFmpegFrameOrPacket {
2424
public int nb_samples;
2525
public int channels;
2626
public String channel_layout;
27+
28+
public CodecType getMediaType() {
29+
return media_type;
30+
}
31+
32+
public int getStreamIndex() {
33+
return stream_index;
34+
}
35+
36+
public int getKeyFrame() {
37+
return key_frame;
38+
}
39+
40+
public long getPktPts() {
41+
return pkt_pts;
42+
}
43+
44+
public double getPktPtsTime() {
45+
return pkt_pts_time;
46+
}
47+
48+
public long getPktDts() {
49+
return pkt_dts;
50+
}
51+
52+
public double getPktDtsTime() {
53+
return pkt_dts_time;
54+
}
55+
56+
public long getBestEffortTimestamp() {
57+
return best_effort_timestamp;
58+
}
59+
60+
public float getBestEffortTimestampTime() {
61+
return best_effort_timestamp_time;
62+
}
63+
64+
public long getPktDuration() {
65+
return pkt_duration;
66+
}
67+
68+
public float getPktDurationTime() {
69+
return pkt_duration_time;
70+
}
71+
72+
public long getPktPos() {
73+
return pkt_pos;
74+
}
75+
76+
public long getPktSize() {
77+
return pkt_size;
78+
}
79+
80+
public String getSampleFmt() {
81+
return sample_fmt;
82+
}
83+
84+
public int getNbSamples() {
85+
return nb_samples;
86+
}
87+
88+
public int getChannels() {
89+
return channels;
90+
}
91+
92+
public String getChannelLayout() {
93+
return channel_layout;
94+
}
2795
}

src/main/java/net/bramp/ffmpeg/probe/FFmpegPacket.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,48 @@ public class FFmpegPacket implements FFmpegFrameOrPacket {
1818
public String size;
1919
public String pos;
2020
public String flags;
21+
22+
public CodecType getCodecType() {
23+
return codec_type;
24+
}
25+
26+
public int getStreamIndex() {
27+
return stream_index;
28+
}
29+
30+
public long getPts() {
31+
return pts;
32+
}
33+
34+
public double getPtsTime() {
35+
return pts_time;
36+
}
37+
38+
public long getDts() {
39+
return dts;
40+
}
41+
42+
public double getDtsTime() {
43+
return dts_time;
44+
}
45+
46+
public long getDuration() {
47+
return duration;
48+
}
49+
50+
public float getDurationTime() {
51+
return duration_time;
52+
}
53+
54+
public String getSize() {
55+
return size;
56+
}
57+
58+
public String getPos() {
59+
return pos;
60+
}
61+
62+
public String getFlags() {
63+
return flags;
64+
}
2165
}

src/main/java/net/bramp/ffmpeg/probe/FFmpegStream.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.google.common.collect.ImmutableMap;
55
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
66

7+
import java.util.Collections;
78
import java.util.List;
89
import java.util.Map;
910

@@ -217,6 +218,10 @@ public Map<String, String> getTags() {
217218
}
218219

219220
public List<SideData> getSideDataList() {
221+
if (side_data_list == null) {
222+
return Collections.emptyList();
223+
}
224+
220225
return ImmutableList.copyOf(side_data_list);
221226
}
222227

0 commit comments

Comments
 (0)