mirror of
https://github.com/mpv-player/mpv
synced 2025-03-02 20:28:02 +00:00
mpegpes support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5146 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
cee508226e
commit
d2052443ec
@ -48,9 +48,23 @@ static void uninit(sh_video_t *sh){
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user