[sip-comm-dev] Question about Payload size


#1

Hi, and thanks to let me participate in this project. Im trying to learn
as far as I can.

I want to know how do you set the size of the Payload on a RTP PAcket.
Im studying the ALAW codification, and I see all packets send
by SIP-COMMUNICATOR have a payload of 160 bytes. I could see
in neomedia.alaw.JavaEncoder class, how do you code the inputBuffer
(320 bytes), in an ouputBuffer of 160 bytes, but Im triying to make my own
class to see easily the behavior, and always get a 800 bytes inputBuffer, so
my Payload is always with a size of 400.

How do you set, or what variables are involved, in the size of this buffer?

Thanks for your help, and I will try to help you as far as I can.

Antonio MG.


#2

The first thing I can think of is that you don't have to process the
whole inputBuffer in one call of Codec#process i.e. you can process as
much as you want and then you can tell JMF that (BUFFER_PROCESSED_OK |
INPUT_BUFFER_NOT_CONSUMED). Please refer to the
impl.neomedia.codec.audio.speex Codec for an example.

···

2010/5/30 Antonio Martínez García <tonio.mg@gmail.com>:

Hi, and thanks to let me participate in this project. Im trying to learn
as far as I can.

I want to know how do you set the size of the Payload on a RTP PAcket.
Im studying the ALAW codification, and I see all packets send
by SIP-COMMUNICATOR have a payload of 160 bytes. I could see
in neomedia.alaw.JavaEncoder class, how do you code the inputBuffer
(320 bytes), in an ouputBuffer of 160 bytes, but Im triying to make my own
class to see easily the behavior, and always get a 800 bytes inputBuffer, so
my Payload is always with a size of 400.

How do you set, or what variables are involved, in the size of this buffer?

Thanks for your help, and I will try to help you as far as I can.

Antonio MG.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Yes, but, I guess all the 800 bytes of InputBuffer are captured sound, how
can I process only 320 of them?? What about the 480 bytes that I ignore? Im
ignoring part of the audio, dont I?

Un Saludo.

Antonio MG.

···

2010/5/31 Lubomir Marinov <lubo@sip-communicator.org>

The first thing I can think of is that you don't have to process the
whole inputBuffer in one call of Codec#process i.e. you can process as
much as you want and then you can tell JMF that (BUFFER_PROCESSED_OK |
INPUT_BUFFER_NOT_CONSUMED). Please refer to the
impl.neomedia.codec.audio.speex Codec for an example.

2010/5/30 Antonio Martínez García <tonio.mg@gmail.com>:
> Hi, and thanks to let me participate in this project. Im trying to learn
> as far as I can.
>
> I want to know how do you set the size of the Payload on a RTP PAcket.
> Im studying the ALAW codification, and I see all packets send
> by SIP-COMMUNICATOR have a payload of 160 bytes. I could see
> in neomedia.alaw.JavaEncoder class, how do you code the inputBuffer
> (320 bytes), in an ouputBuffer of 160 bytes, but Im triying to make my
own
> class to see easily the behavior, and always get a 800 bytes inputBuffer,
so
> my Payload is always with a size of 400.
>
> How do you set, or what variables are involved, in the size of this
buffer?
>
> Thanks for your help, and I will try to help you as far as I can.
>
> Antonio MG.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

When you tell JMF that INPUT_BUFFER_NOT_CONSUMED, JMF will call
Codec#process with the same inputBuffer again. When 320 bytes are
processed, the Codec increments the offset of the inputBuffer with 320
bytes and decrements the length of the inputBuffer with 320 bytes so
the next time #process gets called with the same inputBuffer it will
have the remaining bytes for processing.

···

2010/5/31 Antonio Martínez García <tonio.mg@gmail.com>:

Yes, but, I guess all the 800 bytes of InputBuffer are captured sound, how
can I process only 320 of them?? What about the 480 bytes that I ignore? Im
ignoring part of the audio, dont I?

Un Saludo.

Antonio MG.

2010/5/31 Lubomir Marinov <lubo@sip-communicator.org>

The first thing I can think of is that you don't have to process the
whole inputBuffer in one call of Codec#process i.e. you can process as
much as you want and then you can tell JMF that (BUFFER_PROCESSED_OK |
INPUT_BUFFER_NOT_CONSUMED). Please refer to the
impl.neomedia.codec.audio.speex Codec for an example.

2010/5/30 Antonio Martínez García <tonio.mg@gmail.com>:
> Hi, and thanks to let me participate in this project. Im trying to learn
> as far as I can.
>
> I want to know how do you set the size of the Payload on a RTP PAcket.
> Im studying the ALAW codification, and I see all packets send
> by SIP-COMMUNICATOR have a payload of 160 bytes. I could see
> in neomedia.alaw.JavaEncoder class, how do you code the inputBuffer
> (320 bytes), in an ouputBuffer of 160 bytes, but Im triying to make my
> own
> class to see easily the behavior, and always get a 800 bytes
> inputBuffer, so
> my Payload is always with a size of 400.
>
> How do you set, or what variables are involved, in the size of this
> buffer?
>
> Thanks for your help, and I will try to help you as far as I can.
>
> Antonio MG.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net