Mercurial > mplayer.hg
annotate libmpcodecs/vd_dmo.c @ 30431:5fef3206196f
Document that -af-adv force=0 currently does the same as =1
author | reimar |
---|---|
date | Sun, 31 Jan 2010 01:42:11 +0000 |
parents | bbb6ebec87a0 |
children | cc27da5d7286 |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
18 |
8295 | 19 #include <stdio.h> |
20 #include <stdlib.h> | |
21 #include <stdarg.h> | |
22 | |
23 #include "config.h" | |
24 | |
25 #include "mp_msg.h" | |
26 #include "help_mp.h" | |
27 | |
28 #include "vd_internal.h" | |
29 | |
30 #include "loader/dmo/DMO_VideoDecoder.h" | |
31 | |
32 static vd_info_t info = { | |
33 "DMO video codecs", | |
34 "dmo", | |
35 "A'rpi", | |
36 "based on http://avifile.sf.net", | |
37 "win32 codecs" | |
38 }; | |
39 | |
40 LIBVD_EXTERN(dmo) | |
41 | |
42 // to set/get/query special features/parameters | |
43 static int control(sh_video_t *sh,int cmd,void* arg,...){ | |
44 return CONTROL_UNKNOWN; | |
45 } | |
46 | |
47 // init driver | |
48 static int init(sh_video_t *sh){ | |
49 unsigned int out_fmt; | |
50 if(!(sh->context=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){ | |
51 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll); | |
12763
f34a7cf4265a
Console message corrected and moved to help_mp-en.h.
diego
parents:
8504
diff
changeset
|
52 mp_msg(MSGT_DECVIDEO,MSGL_HINT,MSGTR_DownloadCodecPackage); |
8295 | 53 return 0; |
54 } | |
55 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0; | |
56 out_fmt=sh->codec->outfmt[sh->outfmtidx]; | |
57 switch(out_fmt){ | |
58 case IMGFMT_YUY2: | |
59 case IMGFMT_UYVY: | |
60 DMO_VideoDecoder_SetDestFmt(sh->context,16,out_fmt);break; // packed YUV | |
61 case IMGFMT_YV12: | |
62 case IMGFMT_I420: | |
63 case IMGFMT_IYUV: | |
64 DMO_VideoDecoder_SetDestFmt(sh->context,12,out_fmt);break; // planar YUV | |
65 case IMGFMT_YVU9: | |
66 DMO_VideoDecoder_SetDestFmt(sh->context,9,out_fmt);break; | |
67 default: | |
68 DMO_VideoDecoder_SetDestFmt(sh->context,out_fmt&255,0); // RGB/BGR | |
69 } | |
70 DMO_VideoDecoder_StartInternal(sh->context); | |
12763
f34a7cf4265a
Console message corrected and moved to help_mp-en.h.
diego
parents:
8504
diff
changeset
|
71 mp_msg(MSGT_DECVIDEO,MSGL_V,MSGTR_DMOInitOK); |
8295 | 72 return 1; |
73 } | |
74 | |
75 // uninit driver | |
76 static void uninit(sh_video_t *sh){ | |
77 DMO_VideoDecoder_Destroy(sh->context); | |
78 } | |
79 | |
80 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); | |
81 | |
82 // decode a frame | |
83 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ | |
84 mp_image_t* mpi; | |
85 if(len<=0) return NULL; // skipped frame | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
18765
diff
changeset
|
86 |
8295 | 87 if(flags&3){ |
88 // framedrop: | |
89 DMO_VideoDecoder_DecodeInternal(sh->context, data, len, 0, 0); | |
90 return NULL; | |
91 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
18765
diff
changeset
|
92 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
18765
diff
changeset
|
93 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, 0 /*MP_IMGFLAG_ACCEPT_STRIDE*/, |
8295 | 94 sh->disp_w, sh->disp_h); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
18765
diff
changeset
|
95 |
8295 | 96 if(!mpi){ // temporary! |
18004
bcd805923554
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents:
12763
diff
changeset
|
97 mp_msg(MSGT_DECVIDEO,MSGL_WARN,MSGTR_MPCODECS_CouldntAllocateImageForCinepakCodec); |
8295 | 98 return NULL; |
99 } | |
100 | |
101 DMO_VideoDecoder_DecodeInternal(sh->context, data, len, 1, mpi->planes[0]); | |
102 | |
103 return mpi; | |
104 } |