Commit 0796641e authored by Simon Morlat's avatar Simon Morlat
Browse files

fix compilation errors and incorrect indentation

parent 62417844
......@@ -39,7 +39,7 @@ typedef struct _DecData{
uint8_t *bitstream;
int bitstream_size;
uint64_t last_error_reported_time;
bool_t first_image_decoded;
bool_t first_image_decoded;
}DecData;
static void ffmpeg_init(){
......@@ -82,8 +82,8 @@ static void dec_init(MSFilter *f){
}
static void dec_preprocess(MSFilter* f) {
DecData *s=(DecData*)f->data;
s->first_image_decoded = FALSE;
DecData *s=(DecData*)f->data;
s->first_image_decoded = FALSE;
}
static void dec_reinit(DecData *d){
......@@ -280,10 +280,10 @@ static void dec_process(MSFilter *f){
}
if (got_picture) {
ms_queue_put(f->outputs[0],get_as_yuvmsg(f,d,&orig));
if (!d->first_image_decoded) {
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_FIRST_IMAGE_DECODED);
d->first_image_decoded = TRUE;
}
if (!d->first_image_decoded) {
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_FIRST_IMAGE_DECODED);
d->first_image_decoded = TRUE;
}
}
p+=len;
}
......@@ -312,14 +312,15 @@ static int dec_add_fmtp(MSFilter *f, void *arg){
return 0;
}
static void reset_first_image(MSFilter* f) {
DecData *d=(DecData*)f->data;
d->first_image_decoded = FALSE;
static int reset_first_image(MSFilter* f, void *data) {
DecData *d=(DecData*)f->data;
d->first_image_decoded = FALSE;
return 0;
}
static MSFilterMethod h264_dec_methods[]={
{ MS_FILTER_ADD_FMTP , dec_add_fmtp },
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ 0 , NULL }
};
......@@ -334,7 +335,7 @@ MSFilterDesc ms_h264_dec_desc={
.ninputs=1,
.noutputs=1,
.init=dec_init,
.preprocess=dec_preprocess,
.preprocess=dec_preprocess,
.process=dec_process,
.uninit=dec_uninit,
.methods=h264_dec_methods
......
......@@ -45,7 +45,7 @@ typedef struct DecState{
int dci_size;
uint64_t last_error_reported_time;
bool_t snow_initialized;
bool_t first_image_decoded;
bool_t first_image_decoded;
}DecState;
......@@ -130,8 +130,8 @@ static int dec_add_fmtp(MSFilter *f, void *data){
static void dec_preprocess(MSFilter *f){
DecState *s=(DecState*)f->data;
int error;
s->first_image_decoded = FALSE;
s->first_image_decoded = FALSE;
if (s->av_context.codec==NULL){
/* we must know picture size before initializing snow decoder*/
if (s->codec!=CODEC_ID_SNOW){
......@@ -685,11 +685,11 @@ static void dec_process_frame(MSFilter *f, mblk_t *inm){
mblk_t *om = get_as_yuvmsg(f,s,&orig);
if (om!=NULL)
ms_queue_put(f->outputs[0],om);
if (!s->first_image_decoded) {
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_FIRST_IMAGE_DECODED);
s->first_image_decoded = TRUE;
}
if (!s->first_image_decoded) {
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_FIRST_IMAGE_DECODED);
s->first_image_decoded = TRUE;
}
}
frame->b_rptr+=len;
}
......@@ -705,16 +705,17 @@ static void dec_process(MSFilter *f){
}
}
static void reset_first_image(MSFilter* f) {
DecState *s=(DecState*)f->data;
s->first_image_decoded = FALSE;
static int reset_first_image(MSFilter* f, void *data) {
DecState *s=(DecState*)f->data;
s->first_image_decoded = FALSE;
return 0;
}
static MSFilterMethod methods[]={
{ MS_FILTER_ADD_FMTP , dec_add_fmtp },
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ 0 , NULL }
};
......
......@@ -146,7 +146,7 @@ static void enc_preprocess(MSFilter *f) {
if (res) {
ms_error("vpx_codec_enc_init failed: %s (%s)n", vpx_codec_err_to_string(res), vpx_codec_error_detail(&s->codec));
}
/*cpu/quality tradeoff: positive values decrease CPU usage at the expense of quality*/
/*cpu/quality tradeoff: positive values decrease CPU usage at the expense of quality*/
vpx_codec_control(&s->codec, VP8E_SET_CPUUSED, (s->cfg.g_threads > 1) ? 10 : 10);
vpx_codec_control(&s->codec, VP8E_SET_STATIC_THRESHOLD, 0);
vpx_codec_control(&s->codec, VP8E_SET_ENABLEAUTOALTREF, 1);
......@@ -466,7 +466,7 @@ typedef struct DecState {
MSPicture outbuf;
int yuv_width, yuv_height;
MSQueue q;
bool_t first_image_decoded;
bool_t first_image_decoded;
} DecState;
......@@ -485,13 +485,13 @@ static void dec_init(MSFilter *f) {
s->yuv_height = 0;
s->yuv_msg = 0;
ms_queue_init(&s->q);
s->first_image_decoded = FALSE;
s->first_image_decoded = FALSE;
f->data = s;
}
static void dec_preprocess(MSFilter* f) {
DecState *s=(DecState*)f->data;
s->first_image_decoded = FALSE;
DecState *s=(DecState*)f->data;
s->first_image_decoded = FALSE;
}
static void dec_uninit(MSFilter *f) {
......@@ -563,7 +563,7 @@ static void dec_process(MSFilter *f) {
while((m=ms_queue_get(&s->q))!=NULL){
vpx_codec_err_t err;
vpx_codec_iter_t iter = NULL;
vpx_image_t *img;
vpx_image_t *img;
err = vpx_codec_decode(&s->codec, m->b_rptr, m->b_wptr - m->b_rptr, NULL, 0);
if (err) {
......@@ -603,24 +603,25 @@ static void dec_process(MSFilter *f) {
}
ms_queue_put(f->outputs[0], dupmsg(s->yuv_msg));
if (!s->first_image_decoded) {
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_FIRST_IMAGE_DECODED);
s->first_image_decoded = TRUE;
}
if (!s->first_image_decoded) {
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_FIRST_IMAGE_DECODED);
s->first_image_decoded = TRUE;
}
}
freemsg(m);
}
}
}
static void reset_first_image(MSFilter* f) {
static int reset_first_image(MSFilter* f, void *data) {
DecState *s=(DecState*)f->data;
s->first_image_decoded = FALSE;
return 0;
}
static MSFilterMethod dec_methods[]={
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ 0 , NULL }
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ 0 , NULL }
};
#ifdef _MSC_VER
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment