Mercurial > mplayer.hg
annotate libmpcodecs/vd_mpegpes.c @ 34025:e7f393cb9d0f
Get rid of X11_FULLSCREEN.
It seems likely the code does not compile when it is not defined anyway,
it is unclear what its purpose is, and lastly vos changing there
behaviour depending on whether some otherwise completely unrelated
vo (e.g. vo_gl) is enabled seems like really bad idea.
author | reimar |
---|---|
date | Mon, 19 Sep 2011 22:11:12 +0000 |
parents | cc27da5d7286 |
children | d32f75f79517 |
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 |
5476 | 19 #include <stdio.h> |
20 #include <stdlib.h> | |
21 | |
22 #include "config.h" | |
23 #include "mp_msg.h" | |
20115
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
24 #include "libmpdemux/mpeg_hdr.h" |
5476 | 25 |
26 #include "vd_internal.h" | |
27 | |
30504
cc27da5d7286
Mark all ad_info_t/vd_info_t structure declarations as const.
diego
parents:
30421
diff
changeset
|
28 static const vd_info_t info = |
5476 | 29 { |
30 "MPEG 1/2 Video passthrough", | |
31 "mpegpes", | |
32 "A'rpi", | |
33 "A'rpi", | |
34 "for hw decoders" | |
35 }; | |
36 | |
37 LIBVD_EXTERN(mpegpes) | |
38 | |
39 //#include "libmpdemux/parse_es.h" | |
40 | |
41 #include "libvo/video_out.h" | |
42 | |
43 // to set/get/query special features/parameters | |
44 static int control(sh_video_t *sh,int cmd,void* arg,...){ | |
45 return CONTROL_UNKNOWN; | |
46 } | |
47 | |
48 // init driver | |
49 static int init(sh_video_t *sh){ | |
50 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_MPEGPES); | |
51 } | |
52 | |
53 // uninit driver | |
54 static void uninit(sh_video_t *sh){ | |
55 } | |
56 | |
57 // decode a frame | |
58 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ | |
59 mp_image_t* mpi; | |
60 static vo_mpegpes_t packet; | |
20115
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
61 mp_mpeg_header_t picture; |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
62 const unsigned char *d = data; |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
63 |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
64 if(len>10 && !d[0] && !d[1] && d[2]==1 && d[3]==0xB3) { |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
65 float old_aspect = sh->aspect; |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
66 int oldw = sh->disp_w, oldh = sh->disp_h; |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
67 mp_header_process_sequence_header(&picture, &d[4]); |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
68 sh->aspect = mpeg12_aspect_info(&picture); |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
69 sh->disp_w = picture.display_picture_width; |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
70 sh->disp_h = picture.display_picture_height; |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
71 if(sh->aspect != old_aspect || sh->disp_w != oldw || sh->disp_h != oldh) { |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
72 if(!mpcodecs_config_vo(sh, sh->disp_w,sh->disp_h,IMGFMT_MPEGPES)) |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
73 return 0; |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
74 } |
9dbe188e65ad
reinit codec chain when aspect ratio and/or resolution change
nicodvb
parents:
7464
diff
changeset
|
75 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
20115
diff
changeset
|
76 |
5476 | 77 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, sh->disp_w, sh->disp_h); |
78 packet.data=data; | |
7464 | 79 packet.size=len; |
5476 | 80 packet.timestamp=sh->timer*90000.0; |
81 packet.id=0x1E0; //+sh_video->ds->id; | |
82 mpi->planes[0]=(uint8_t*)(&packet); | |
83 return mpi; | |
84 } |