Allow disabling VP8 rtp extension(X)
This commit is contained in:
parent
e36cf37f0a
commit
46d7c1c69f
|
@ -45,15 +45,23 @@
|
|||
#include "tsk_time.h"
|
||||
#include "tsk_debug.h"
|
||||
|
||||
#define TDAV_VP8_PAY_DESC_SIZE 4
|
||||
#if !defined(TDAV_VP8_DISABLE_EXTENSION)
|
||||
# define TDAV_VP8_DISABLE_EXTENSION 0 /* Set X fied value to zero */
|
||||
#endif
|
||||
|
||||
#if TDAV_VP8_DISABLE_EXTENSION
|
||||
# define TDAV_VP8_PAY_DESC_SIZE 1
|
||||
#else
|
||||
# define TDAV_VP8_PAY_DESC_SIZE 4
|
||||
#endif
|
||||
#define TDAV_SYSTEM_CORES_COUNT 0
|
||||
#define TDAV_VP8_GOP_SIZE_IN_SECONDS 25
|
||||
#define TDAV_VP8_RTP_PAYLOAD_MAX_SIZE 1050
|
||||
#if !defined(TDAV_VP8_MAX_BANDWIDTH_KB)
|
||||
# define TDAV_VP8_MAX_BANDWIDTH_KB 6000
|
||||
# define TDAV_VP8_MAX_BANDWIDTH_KB 6000
|
||||
#endif
|
||||
#if !defined(TDAV_VP8_MIN_BANDWIDTH_KB)
|
||||
# define TDAV_VP8_MIN_BANDWIDTH_KB 100
|
||||
# define TDAV_VP8_MIN_BANDWIDTH_KB 100
|
||||
#endif
|
||||
|
||||
/* VP8 codec */
|
||||
|
@ -163,12 +171,12 @@ static int tdav_codec_vp8_set(tmedia_codec_t* self, const tmedia_param_t* param)
|
|||
return -1;
|
||||
}
|
||||
#else
|
||||
int ret;
|
||||
if((ret = tdav_codec_vp8_close_encoder(vp8))){
|
||||
return ret;
|
||||
}
|
||||
if((ret = tdav_codec_vp8_open_encoder(vp8))){
|
||||
return ret;
|
||||
int ret;
|
||||
if((ret = tdav_codec_vp8_close_encoder(vp8))){
|
||||
return ret;
|
||||
}
|
||||
if((ret = tdav_codec_vp8_open_encoder(vp8))){
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -836,13 +844,20 @@ static void tdav_codec_vp8_rtp_callback(tdav_codec_vp8_t *self, const void *data
|
|||
| ((part_start << 4) & 0x10)// S
|
||||
| ((non_ref << 5) & 0x20) // N
|
||||
// R = 0
|
||||
#if TDAV_VP8_DISABLE_EXTENSION
|
||||
| (0x00) // X=0
|
||||
#else
|
||||
| (0x80) // X=1
|
||||
#endif
|
||||
;
|
||||
|
||||
#if !TDAV_VP8_DISABLE_EXTENSION
|
||||
// X: |I|L|T|K| RSV |
|
||||
self->encoder.rtp.ptr[1] = 0x80; // I = 1, L = 0, T = 0, K = 0, RSV = 0
|
||||
// I: |M| PictureID |
|
||||
self->encoder.rtp.ptr[2] = (0x80 | (self->encoder.pic_id >> 9)); // M = 1 (PictureID on 15 bits)
|
||||
self->encoder.rtp.ptr[3] = (self->encoder.pic_id & 0xFF);
|
||||
#endif
|
||||
|
||||
/* 4.2. VP8 Payload Header */
|
||||
if(has_hdr){
|
||||
|
|
Loading…
Reference in New Issue