changeset 5145:109377795585

mpegpes support
author arpi
date Sat, 16 Mar 2002 20:36:24 +0000
parents 9651a7bb874d
children 1941807a2188
files libmpcodecs/vd_libmpeg2.c
diffstat 1 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_libmpeg2.c	Sat Mar 16 20:35:59 2002 +0000
+++ b/libmpcodecs/vd_libmpeg2.c	Sat Mar 16 20:36:24 2002 +0000
@@ -48,9 +48,23 @@
 
 // decode a frame
 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
-    mp_image_t* mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_DRAW_CALLBACK,
-	sh->disp_w, sh->disp_h);
-    mpeg2_decode_data(sh->video_out, data, data+len,flags&3); // decode
+    mp_image_t* mpi;
+    if(sh->codec->outfmt[sh->outfmtidx]==IMGFMT_MPEGPES){
+	static vo_mpegpes_t packet;
+	mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0,
+	    sh->disp_w, sh->disp_h);
+	// hardware decoding:
+//	mpeg2_decode_data(video_out, start, start+in_size,3); // parse headers
+	packet.data=data;
+	packet.size=len-4;
+	packet.timestamp=sh->timer*90000.0;
+	packet.id=0x1E0; //+sh_video->ds->id;
+	mpi->planes[0]=(uint8_t*)(&packet);
+    } else {
+	mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_DRAW_CALLBACK,
+	    sh->disp_w, sh->disp_h);
+	mpeg2_decode_data(sh->video_out, data, data+len,flags&3); // decode
+    }
     return mpi;
 }