mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 07:33:46 +01:00
add mfi support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4552 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e53e5c4694
commit
a4396200f1
17
cfg-common.h
17
cfg-common.h
@ -57,6 +57,8 @@
|
||||
|
||||
// ------------------------- codec/pp options --------------------
|
||||
|
||||
{"mf", mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
|
||||
|
||||
#ifdef USE_FAKE_MONO
|
||||
{"stereo", &fakemono, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
|
||||
#endif
|
||||
@ -153,4 +155,19 @@ struct config vivoopts_conf[]={
|
||||
{NULL, NULL, 0, 0, 0, 0, NULL}
|
||||
};
|
||||
|
||||
extern int mf_support;
|
||||
extern int mf_w;
|
||||
extern int mf_h;
|
||||
extern int mf_fps;
|
||||
extern char * mf_type;
|
||||
|
||||
struct config mfopts_conf[]={
|
||||
{"on", &mf_support, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||
{"w", &mf_w, CONF_TYPE_INT, 0, 0, 0, NULL},
|
||||
{"h", &mf_h, CONF_TYPE_INT, 0, 0, 0, NULL},
|
||||
{"fps", &mf_fps, CONF_TYPE_INT, 0, 0, 0, NULL},
|
||||
{"type", &mf_type, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
{NULL, NULL, 0, 0, 0, 0, NULL}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -3,7 +3,7 @@ LIBNAME = libmpdemux.a
|
||||
|
||||
include ../config.mak
|
||||
|
||||
SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c aviwrite.c demux_asf.c demux_avi.c demux_mov.c demux_mpg.c demux_viv.c demuxer.c dvdauth.c open.c parse_es.c stream.c tv.c tvi_dummy.c tvi_v4l.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c
|
||||
SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c aviwrite.c demux_asf.c demux_avi.c demux_mov.c demux_mpg.c demux_viv.c demuxer.c dvdauth.c open.c parse_es.c stream.c tv.c tvi_dummy.c tvi_v4l.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c
|
||||
ifeq ($(STREAMING),yes)
|
||||
SRCS += asf_streaming.c url.c http.c network.c rtp.c
|
||||
endif
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "stream.h"
|
||||
#include "demuxer.h"
|
||||
#include "stheader.h"
|
||||
#include "mf.h"
|
||||
|
||||
void free_demuxer_stream(demux_stream_t *ds){
|
||||
ds_free_packs(ds);
|
||||
@ -150,6 +151,7 @@ void ds_read_packet(demux_stream_t *ds,stream_t *stream,int len,float pts,off_t
|
||||
// return value:
|
||||
// 0 = EOF or no stream found or invalid type
|
||||
// 1 = successfully read a packet
|
||||
int demux_mf_fill_buffer( demuxer_t *demux);
|
||||
int demux_roq_fill_buffer(demuxer_t *demux);
|
||||
int demux_film_fill_buffer(demuxer_t *demux);
|
||||
int demux_fli_fill_buffer(demuxer_t *demux);
|
||||
@ -177,6 +179,7 @@ int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){
|
||||
// Note: parameter 'ds' can be NULL!
|
||||
// printf("demux->type=%d\n",demux->type);
|
||||
switch(demux->type){
|
||||
case DEMUXER_TYPE_MF: return demux_mf_fill_buffer(demux);
|
||||
case DEMUXER_TYPE_ROQ: return demux_roq_fill_buffer(demux);
|
||||
case DEMUXER_TYPE_FILM: return demux_film_fill_buffer(demux);
|
||||
case DEMUXER_TYPE_FLI: return demux_fli_fill_buffer(demux);
|
||||
@ -368,6 +371,7 @@ demuxer_t* demux_open_avi(demuxer_t* demuxer);
|
||||
int mov_check_file(demuxer_t* demuxer);
|
||||
int mov_read_header(demuxer_t* demuxer);
|
||||
int demux_open_fli(demuxer_t* demuxer);
|
||||
int demux_open_mf(demuxer_t* demuxer);
|
||||
int demux_open_film(demuxer_t* demuxer);
|
||||
int demux_open_roq(demuxer_t* demuxer);
|
||||
|
||||
@ -397,6 +401,12 @@ sh_video_t *sh_video=NULL;
|
||||
|
||||
//printf("demux_open(%p,%d,%d,%d,%d) \n",stream,file_format,audio_id,video_id,dvdsub_id);
|
||||
|
||||
if ( mf_support )
|
||||
{
|
||||
mp_msg(MSGT_DEMUXER,MSGL_INFO,"forced mf.\n");
|
||||
file_format=DEMUXER_TYPE_MF;
|
||||
}
|
||||
|
||||
#ifdef USE_TV
|
||||
//=============== Try to open as TV-input: =================
|
||||
if((tv_param_on == 1) &&
|
||||
@ -564,6 +574,17 @@ if(file_format==DEMUXER_TYPE_MPEG_ES){ // little hack, see above!
|
||||
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGESfile);
|
||||
}
|
||||
}
|
||||
//=============== Try to open as multi file: =================
|
||||
if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MF){
|
||||
demuxer=new_demuxer(stream,DEMUXER_TYPE_MF,audio_id,video_id,dvdsub_id);
|
||||
{
|
||||
if ( mf_support )
|
||||
{
|
||||
file_format=DEMUXER_TYPE_MF;
|
||||
mp_msg( MSGT_DEMUXER,MSGL_INFO,"[demuxer] mf support.\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
//=============== Unknown, exiting... ===========================
|
||||
if(file_format==DEMUXER_TYPE_UNKNOWN){
|
||||
mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized);
|
||||
@ -578,6 +599,10 @@ d_video=demuxer->video;
|
||||
demuxer->file_format=file_format;
|
||||
|
||||
switch(file_format){
|
||||
case DEMUXER_TYPE_MF: {
|
||||
if (!demux_open_mf(demuxer)) return NULL;
|
||||
break;
|
||||
}
|
||||
case DEMUXER_TYPE_FLI: {
|
||||
if (!demux_open_fli(demuxer)) return NULL;
|
||||
break;
|
||||
@ -696,6 +721,7 @@ int demux_seek_asf(demuxer_t *demuxer,float rel_seek_secs,int flags);
|
||||
int demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,int flags);
|
||||
int demux_seek_y4m(demuxer_t *demuxer,float rel_seek_secs,int flags);
|
||||
int demux_seek_fli(demuxer_t *demuxer,float rel_seek_secs,int flags);
|
||||
int demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,int flags);
|
||||
int demux_seek_nuv(demuxer_t *demuxer,float rel_seek_secs,int flags);
|
||||
void demux_seek_mov(demuxer_t *demuxer,float pts,int flags);
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#define DEMUXER_TYPE_NUV 13
|
||||
#define DEMUXER_TYPE_FILM 14
|
||||
#define DEMUXER_TYPE_ROQ 15
|
||||
#define DEMUXER_TYPE_MF 16
|
||||
|
||||
#define DEMUXER_TIME_NONE 0
|
||||
#define DEMUXER_TIME_PTS 1
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "../cfgparser.h"
|
||||
#include "stream.h"
|
||||
#include "demuxer.h"
|
||||
#include "mf.h"
|
||||
|
||||
#ifdef STREAMING
|
||||
#include "url.h"
|
||||
@ -382,6 +383,20 @@ tv_err:
|
||||
}
|
||||
#endif
|
||||
|
||||
//============ Check for multi file-input ====
|
||||
if (mf_support == 1)
|
||||
{
|
||||
/* create stream */
|
||||
stream = new_stream(-1, STREAMTYPE_MF);
|
||||
if (!stream)
|
||||
return(NULL);
|
||||
|
||||
if (!stream_open_mf(filename, stream))
|
||||
return(NULL);
|
||||
|
||||
return(stream);
|
||||
}
|
||||
|
||||
//============ Open STDIN ============
|
||||
if(!strcmp(filename,"-")){
|
||||
// read from stdin
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define STREAMTYPE_MEMORY 4
|
||||
#define STREAMTYPE_TV 5
|
||||
#define STREAMTYPE_PLAYLIST 6
|
||||
#define STREAMTYPE_MF 7
|
||||
|
||||
#define VCD_SECTOR_SIZE 2352
|
||||
#define VCD_SECTOR_OFFS 24
|
||||
|
Loading…
Reference in New Issue
Block a user