diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-11-23 01:56:21 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-11-23 01:56:21 +0200 |
commit | 5995bc175aea0417ce7ff7285c1c8fc84ebb5704 (patch) | |
tree | 7fa0b90e03fc5b3a6447b79754b654bc279f5237 /libmpcodecs | |
parent | 4c552b2e420ba4cb6d888b12360c7bf63e7cd03a (diff) | |
parent | af2988cbcef1b057772d44b9f9752be3f15960b0 (diff) | |
download | mpv-5995bc175aea0417ce7ff7285c1c8fc84ebb5704.tar.bz2 mpv-5995bc175aea0417ce7ff7285c1c8fc84ebb5704.tar.xz |
Merge svn changes up to r29962
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_ffmpeg.c | 6 | ||||
-rw-r--r-- | libmpcodecs/img_format.h | 2 | ||||
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 7 | ||||
-rw-r--r-- | libmpcodecs/vf_crop.c | 13 | ||||
-rw-r--r-- | libmpcodecs/vf_delogo.c | 16 | ||||
-rw-r--r-- | libmpcodecs/vf_eq.c | 6 | ||||
-rw-r--r-- | libmpcodecs/vf_expand.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vf_format.c | 39 | ||||
-rw-r--r-- | libmpcodecs/vf_hue.c | 5 | ||||
-rw-r--r-- | libmpcodecs/vf_noformat.c | 39 | ||||
-rw-r--r-- | libmpcodecs/vf_scale.c | 21 |
11 files changed, 13 insertions, 143 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 769425d9a4..79601f9b63 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -163,15 +163,19 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m unsigned char *start=NULL; int y,len=-1; while(len<minlen){ + AVPacket pkt; int len2=maxlen; double pts; int x=ds_get_packet_pts(sh_audio->ds,&start, &pts); if(x<=0) break; // error + av_init_packet(&pkt); + pkt.data = start; + pkt.size = x; if (pts != MP_NOPTS_VALUE) { sh_audio->pts = pts; sh_audio->pts_bytes = 0; } - y=avcodec_decode_audio2(sh_audio->context,(int16_t*)buf,&len2,start,x); + y=avcodec_decode_audio3(sh_audio->context,(int16_t*)buf,&len2,&pkt); //printf("return:%d samples_out:%d bitstream_in:%d sample_sum:%d\n", y, len2, x, len); fflush(stdout); if(y<0){ mp_msg(MSGT_DECAUDIO,MSGL_V,"lavc_audio: error\n");break; } if(y<x) sh_audio->ds->buffer_pos+=y-x; // put back data (HACK!) diff --git a/libmpcodecs/img_format.h b/libmpcodecs/img_format.h index 94ab281262..4c917b01e4 100644 --- a/libmpcodecs/img_format.h +++ b/libmpcodecs/img_format.h @@ -34,11 +34,13 @@ #define IMGFMT_BGRA (IMGFMT_RGB32|64) #define IMGFMT_ARGB IMGFMT_BGR32 #define IMGFMT_RGBA (IMGFMT_BGR32|64) +#define IMGFMT_RGB48NE IMGFMT_RGB48BE #else #define IMGFMT_ABGR (IMGFMT_BGR32|64) #define IMGFMT_BGRA IMGFMT_BGR32 #define IMGFMT_ARGB (IMGFMT_RGB32|64) #define IMGFMT_RGBA IMGFMT_RGB32 +#define IMGFMT_RGB48NE IMGFMT_RGB48LE #endif /* old names for compatibility */ diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index eb53c6e830..52e11623db 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -476,10 +476,8 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ int type= MP_IMGTYPE_IPB; int width= avctx->width; int height= avctx->height; - int align=15; + avcodec_align_dimensions(avctx, &width, &height); //printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count); - if(avctx->pix_fmt == PIX_FMT_YUV410P) - align=63; //yes seriously, its really needed (16x16 chroma blocks in SVQ1 -> 64x64) if (pic->buffer_hints) { mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Buffer hints: %u\n", pic->buffer_hints); @@ -535,8 +533,7 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type== MP_IMGTYPE_IPB ? "using IPB\n" : "using IP\n"); } - mpi= mpcodecs_get_image(sh, type, flags, - (width+align)&(~align), (height+align)&(~align)); + mpi= mpcodecs_get_image(sh, type, flags, width, height); if (!mpi) return -1; // ok, let's see what did we get: diff --git a/libmpcodecs/vf_crop.c b/libmpcodecs/vf_crop.c index 14bbcd9d7c..877c01d3b3 100644 --- a/libmpcodecs/vf_crop.c +++ b/libmpcodecs/vf_crop.c @@ -143,19 +143,6 @@ static int open(vf_instance_t *vf, char* args){ vf->start_slice=start_slice; vf->draw_slice=draw_slice; vf->default_reqs=VFCAP_ACCEPT_STRIDE; - if(!vf->priv) { - vf->priv=malloc(sizeof(struct vf_priv_s)); - // TODO: parse args -> - vf->priv->crop_x= - vf->priv->crop_y= - vf->priv->crop_w= - vf->priv->crop_h=-1; - } //if(!vf->priv) - if(args) sscanf(args, "%d:%d:%d:%d", - &vf->priv->crop_w, - &vf->priv->crop_h, - &vf->priv->crop_x, - &vf->priv->crop_y); mp_msg(MSGT_VFILTER, MSGL_INFO, "Crop: %d x %d, %d ; %d\n", vf->priv->crop_w, vf->priv->crop_h, diff --git a/libmpcodecs/vf_delogo.c b/libmpcodecs/vf_delogo.c index d9234b6eab..2dd971fab9 100644 --- a/libmpcodecs/vf_delogo.c +++ b/libmpcodecs/vf_delogo.c @@ -197,27 +197,11 @@ static const unsigned int fmt_list[]={ }; static int open(vf_instance_t *vf, char* args){ - int res; - vf->config=config; vf->put_image=put_image; vf->get_image=get_image; vf->query_format=query_format; vf->uninit=uninit; - if (!vf->priv) - { - vf->priv=malloc(sizeof(struct vf_priv_s)); - memset(vf->priv, 0, sizeof(struct vf_priv_s)); - } - - if (args) res = sscanf(args, "%d:%d:%d:%d:%d", - &vf->priv->xoff, &vf->priv->yoff, - &vf->priv->lw, &vf->priv->lh, - &vf->priv->band); - if (args && (res != 5)) { - uninit(vf); - return 0; // bad syntax - } mp_msg(MSGT_VFILTER, MSGL_V, "delogo: %d x %d, %d x %d, band = %d\n", vf->priv->xoff, vf->priv->yoff, diff --git a/libmpcodecs/vf_eq.c b/libmpcodecs/vf_eq.c index c038355f52..14c47a77dc 100644 --- a/libmpcodecs/vf_eq.c +++ b/libmpcodecs/vf_eq.c @@ -208,12 +208,6 @@ static int open(vf_instance_t *vf, char* args) vf->put_image=put_image; vf->uninit=uninit; - if(!vf->priv) { - vf->priv = malloc(sizeof(struct vf_priv_s)); - memset(vf->priv, 0, sizeof(struct vf_priv_s)); - } - if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast); - process = process_C; #if HAVE_MMX if(gCpuCaps.hasMMX) process = process_MMX; diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c index b6a2822745..5d2bf06f96 100644 --- a/libmpcodecs/vf_expand.c +++ b/libmpcodecs/vf_expand.c @@ -45,6 +45,8 @@ static struct vf_priv_s { } const vf_priv_dflt = { -1,-1, -1,-1, + -1,-1, + -1,-1, 0, 0., 1, diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c index deb0e8fb02..4dc90a26fc 100644 --- a/libmpcodecs/vf_format.c +++ b/libmpcodecs/vf_format.c @@ -31,45 +31,6 @@ static int query_format(struct vf_instance* vf, unsigned int fmt){ static int open(vf_instance_t *vf, char* args){ vf->query_format=query_format; vf->default_caps=0; - if(!vf->priv) { - vf->priv=malloc(sizeof(struct vf_priv_s)); - vf->priv->fmt=IMGFMT_YUY2; - } - if(args){ - if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else - if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else - if(!strcasecmp(args,"411p")) vf->priv->fmt=IMGFMT_411P; else - if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else - if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else - if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else - if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else - if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else - if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else - if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else - if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else - if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else - if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else - if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else - if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else - if(!strcasecmp(args,"bgr4")) vf->priv->fmt=IMGFMT_BGR4; else - if(!strcasecmp(args,"bg4b")) vf->priv->fmt=IMGFMT_BG4B; else - if(!strcasecmp(args,"bgr1")) vf->priv->fmt=IMGFMT_BGR1; else - if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else - if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else - if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else - if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else - if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else - if(!strcasecmp(args,"rgb4")) vf->priv->fmt=IMGFMT_RGB4; else - if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else - if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else - if(!strcasecmp(args,"rgba")) vf->priv->fmt=IMGFMT_RGBA; else - if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else - if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else - if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else - { mp_tmsg(MSGT_VFILTER, MSGL_WARN, "[VF_FORMAT] Unknown format name: '%s'.\n", args);return 0;} - } - - return 1; } diff --git a/libmpcodecs/vf_hue.c b/libmpcodecs/vf_hue.c index a289543c48..44cdd67bd7 100644 --- a/libmpcodecs/vf_hue.c +++ b/libmpcodecs/vf_hue.c @@ -152,11 +152,6 @@ static int open(vf_instance_t *vf, char* args) vf->put_image=put_image; vf->uninit=uninit; - if(!vf->priv) { - vf->priv = malloc(sizeof(struct vf_priv_s)); - memset(vf->priv, 0, sizeof(struct vf_priv_s)); - } - if (args) sscanf(args, "%f:%f", &vf->priv->hue, &vf->priv->saturation); vf->priv->hue *= M_PI / 180.0; process = process_C; diff --git a/libmpcodecs/vf_noformat.c b/libmpcodecs/vf_noformat.c index 4d6a9b106b..7017c5a89e 100644 --- a/libmpcodecs/vf_noformat.c +++ b/libmpcodecs/vf_noformat.c @@ -31,45 +31,6 @@ static int query_format(struct vf_instance* vf, unsigned int fmt){ static int open(vf_instance_t *vf, char* args){ vf->query_format=query_format; vf->default_caps=0; - if(!vf->priv) { - vf->priv=malloc(sizeof(struct vf_priv_s)); - vf->priv->fmt=IMGFMT_YV12; - } - if(args){ - if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else - if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else - if(!strcasecmp(args,"411p")) vf->priv->fmt=IMGFMT_411P; else - if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else - if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else - if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else - if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else - if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else - if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else - if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else - if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else - if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else - if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else - if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else - if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else - if(!strcasecmp(args,"bgr4")) vf->priv->fmt=IMGFMT_BGR4; else - if(!strcasecmp(args,"bg4b")) vf->priv->fmt=IMGFMT_BG4B; else - if(!strcasecmp(args,"bgr1")) vf->priv->fmt=IMGFMT_BGR1; else - if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else - if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else - if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else - if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else - if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else - if(!strcasecmp(args,"rgb4")) vf->priv->fmt=IMGFMT_RGB4; else - if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else - if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else - if(!strcasecmp(args,"rgba")) vf->priv->fmt=IMGFMT_RGBA; else - if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else - if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else - if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else - { mp_tmsg(MSGT_VFILTER, MSGL_WARN, "[VF_FORMAT] Unknown format name: '%s'.\n", args);return 0;} - } - - return 1; } diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index ab931c8080..3a1bae77c8 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -65,6 +65,8 @@ static const unsigned int outfmt_list[]={ IMGFMT_RGB32, IMGFMT_BGR24, IMGFMT_RGB24, + IMGFMT_RGB48LE, + IMGFMT_RGB48BE, IMGFMT_BGR16, IMGFMT_RGB16, IMGFMT_BGR15, @@ -505,25 +507,6 @@ static int open(vf_instance_t *vf, char* args){ vf->query_format=query_format; vf->control= control; vf->uninit=uninit; - if(!vf->priv) { - vf->priv=malloc(sizeof(struct vf_priv_s)); - // TODO: parse args -> - vf->priv->ctx=NULL; - vf->priv->ctx2=NULL; - vf->priv->w= - vf->priv->h=-1; - vf->priv->v_chr_drop=0; - vf->priv->accurate_rnd=0; - vf->priv->param[0]= - vf->priv->param[1]=SWS_PARAM_DEFAULT; - vf->priv->palette=NULL; - } // if(!vf->priv) - if(args) sscanf(args, "%d:%d:%d:%lf:%lf", - &vf->priv->w, - &vf->priv->h, - &vf->priv->v_chr_drop, - &vf->priv->param[0], - &vf->priv->param[1]); mp_msg(MSGT_VFILTER,MSGL_V,"SwScale params: %d x %d (-1=no scaling)\n", vf->priv->w, vf->priv->h); |