annotate libmpcodecs/vd_mpegpes.c @ 6740:913736867009

10l y422p -> y420p use uvstride in draw_slices dr2 support (disabled as mplayer doesnt like slices with width!=picture width sometimes)
author michael
date Tue, 16 Jul 2002 12:04:30 +0000
parents ac09ea252466
children 28677d779205
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5476
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
1 #include <stdio.h>
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
2 #include <stdlib.h>
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
3
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
4 #include "config.h"
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
5 #include "mp_msg.h"
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
6
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
7 #include "vd_internal.h"
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
8
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
9 static vd_info_t info =
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
10 {
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
11 "MPEG 1/2 Video passthrough",
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
12 "mpegpes",
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
13 VFM_MPEGPES,
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
14 "A'rpi",
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
15 "A'rpi",
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
16 "for hw decoders"
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
17 };
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
18
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
19 LIBVD_EXTERN(mpegpes)
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
20
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
21 //#include "libmpdemux/parse_es.h"
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
22
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
23 #include "libvo/video_out.h"
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
24
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
25 // to set/get/query special features/parameters
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
26 static int control(sh_video_t *sh,int cmd,void* arg,...){
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
27 return CONTROL_UNKNOWN;
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
28 }
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
29
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
30 // init driver
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
31 static int init(sh_video_t *sh){
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
32 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_MPEGPES);
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
33 }
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
34
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
35 // uninit driver
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
36 static void uninit(sh_video_t *sh){
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
37 }
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
38
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
39 // decode a frame
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
40 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
41 mp_image_t* mpi;
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
42 static vo_mpegpes_t packet;
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
43 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, sh->disp_w, sh->disp_h);
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
44 packet.data=data;
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
45 packet.size=len-4;
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
46 packet.timestamp=sh->timer*90000.0;
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
47 packet.id=0x1E0; //+sh_video->ds->id;
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
48 mpi->planes[0]=(uint8_t*)(&packet);
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
49 return mpi;
ac09ea252466 vd_mpegpes added
arpi
parents:
diff changeset
50 }