Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Commit

Permalink
added constructor to audio / video to enable outside packet creation
Browse files Browse the repository at this point in the history
git-svn-id: https://flazr.svn.sourceforge.net/svnroot/flazr/trunk/flazr@61 5dee199b-8608-4927-992f-dc734163a847
  • Loading branch information
ptrthomas committed Dec 1, 2009
1 parent a7080b6 commit 93c25eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/flazr/rtmp/message/Audio.java
Expand Up @@ -81,6 +81,10 @@ public Audio(final int time, final byte[] prefix, final byte[] audioData) {
data = ChannelBuffers.wrappedBuffer(prefix, audioData);
header.setSize(data.readableBytes());
}

public Audio(final int time, final ChannelBuffer in) {
super(time, in);
}

public static Audio empty() {
Audio empty = new Audio();
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/flazr/rtmp/message/DataMessage.java
Expand Up @@ -36,6 +36,12 @@ public DataMessage(final RtmpHeader header, final ChannelBuffer in) {
super(header, in);
}

public DataMessage(final int time, final ChannelBuffer in) {
header.setTime(time);
header.setSize(in.readableBytes());
data = in;
}

@Override
public ChannelBuffer encode() {
if(encoded) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/flazr/rtmp/message/Video.java
Expand Up @@ -75,6 +75,10 @@ public Video(final int time, final byte[] prefix, final int compositionOffset, f
header.setSize(data.readableBytes());
}

public Video(final int time, final ChannelBuffer in) {
super(time, in);
}

public static Video empty() {
Video empty = new Video();
empty.data = ChannelBuffers.wrappedBuffer(new byte[2]);
Expand Down

0 comments on commit 93c25eb

Please sign in to comment.