Add a copy constructor for the buffer descriptor class

This commit is contained in:
Cameron Gutman 2013-10-30 18:21:12 -04:00
parent 8ba9d8cfc8
commit 303ffaa8a3
2 changed files with 8 additions and 1 deletions

View File

@ -11,4 +11,11 @@ public class AvBufferDescriptor {
this.offset = offset; this.offset = offset;
this.length = length; this.length = length;
} }
public AvBufferDescriptor(AvBufferDescriptor desc)
{
this.data = desc.data;
this.offset = desc.offset;
this.length = desc.length;
}
} }

View File

@ -5,7 +5,7 @@ public class AvPacket {
public AvPacket(AvBufferDescriptor rtpPayload) public AvPacket(AvBufferDescriptor rtpPayload)
{ {
buffer = new AvBufferDescriptor(rtpPayload.data, rtpPayload.offset, rtpPayload.length); buffer = new AvBufferDescriptor(rtpPayload);
} }
public AvBufferDescriptor getNewPayloadDescriptor() public AvBufferDescriptor getNewPayloadDescriptor()