From f452c1262fd167a90fd63e13bd2de7bf8c7ca17b Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 15:39:52 +0000 Subject: Add support for decoding 4:2:2 and 4:4:4 Theora files. Patch by Giorgio Vazzana [mywing81 gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30585 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_theora.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vd_theora.c b/libmpcodecs/vd_theora.c index 35e3edfab8..b8be6d747b 100644 --- a/libmpcodecs/vd_theora.c +++ b/libmpcodecs/vd_theora.c @@ -41,11 +41,28 @@ LIBVD_EXTERN(theora) #define THEORA_NUM_HEADER_PACKETS 3 +typedef struct theora_struct_st { + theora_state st; + theora_comment cc; + theora_info inf; +} theora_struct_t; + +/** Convert Theora pixelformat to the corresponding IMGFMT_ */ +static uint32_t theora_pixelformat2imgfmt(theora_pixelformat fmt){ + switch(fmt) { + case OC_PF_420: return IMGFMT_YV12; + case OC_PF_422: return IMGFMT_422P; + case OC_PF_444: return IMGFMT_444P; + } + return 0; +} + // to set/get/query special features/parameters static int control(sh_video_t *sh,int cmd,void* arg,...){ + theora_struct_t *context = sh->context; switch(cmd) { case VDCTRL_QUERY_FORMAT: - if (*(int*)arg == IMGFMT_YV12) + if (*(int*)arg == theora_pixelformat2imgfmt(context->inf.pixelformat)) return CONTROL_TRUE; return CONTROL_FALSE; } @@ -53,12 +70,6 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ return CONTROL_UNKNOWN; } -typedef struct theora_struct_st { - theora_state st; - theora_comment cc; - theora_info inf; -} theora_struct_t; - /* * init driver */ @@ -104,7 +115,7 @@ static int init(sh_video_t *sh){ mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Theora video init ok!\n"); - return mpcodecs_config_vo (sh,context->inf.frame_width,context->inf.frame_height,IMGFMT_YV12); + return mpcodecs_config_vo (sh,context->inf.frame_width,context->inf.frame_height,theora_pixelformat2imgfmt(context->inf.pixelformat)); err_out: free(context); -- cgit v1.2.3 From caa956090a2d7b62790217b08c0a8dd108c71aef Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 13:16:17 +0000 Subject: Add header file for mplayer_audio_read() instead of forward declaring it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30594 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_mp3lib.c | 1 + libmpcodecs/ad_mp3lib.h | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 libmpcodecs/ad_mp3lib.h (limited to 'libmpcodecs') diff --git a/libmpcodecs/ad_mp3lib.c b/libmpcodecs/ad_mp3lib.c index 5b50557c96..f262757526 100644 --- a/libmpcodecs/ad_mp3lib.c +++ b/libmpcodecs/ad_mp3lib.c @@ -23,6 +23,7 @@ #include "config.h" #include "ad_internal.h" +#include "ad_mp3lib.h" static const ad_info_t info = { diff --git a/libmpcodecs/ad_mp3lib.h b/libmpcodecs/ad_mp3lib.h new file mode 100644 index 0000000000..aeb78b4ed8 --- /dev/null +++ b/libmpcodecs/ad_mp3lib.h @@ -0,0 +1,24 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPLAYER_AD_MP3LIB_H +#define MPLAYER_AD_MP3LIB_H + +int mplayer_audio_read(char *buf, int size); + +#endif /* MPLAYER_AD_MP3LIB_H */ -- cgit v1.2.3 From 3c514ea708749679623ae04fc8f7ade87e51aade Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 14:52:59 +0000 Subject: Add header for init_global_rawdv_decoder() instead of forward declaring it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30595 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_libdv.c | 4 +--- libmpcodecs/vd_libdv.c | 1 + libmpcodecs/vd_libdv.h | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 libmpcodecs/vd_libdv.h (limited to 'libmpcodecs') diff --git a/libmpcodecs/ad_libdv.c b/libmpcodecs/ad_libdv.c index e7d0a82a54..8485a8883f 100644 --- a/libmpcodecs/ad_libdv.c +++ b/libmpcodecs/ad_libdv.c @@ -37,6 +37,7 @@ #include "libmpdemux/stheader.h" #include "ad_internal.h" +#include "vd_libdv.h" static const ad_info_t info = { @@ -49,9 +50,6 @@ static const ad_info_t info = LIBAD_EXTERN(libdv) -// defined in vd_libdv.c: -dv_decoder_t* init_global_rawdv_decoder(void); - static int preinit(sh_audio_t *sh_audio) { sh_audio->audio_out_minsize=4*DV_AUDIO_MAX_SAMPLES*2; diff --git a/libmpcodecs/vd_libdv.c b/libmpcodecs/vd_libdv.c index 02d7e2fc54..137fa7bf60 100644 --- a/libmpcodecs/vd_libdv.c +++ b/libmpcodecs/vd_libdv.c @@ -35,6 +35,7 @@ #include "libmpdemux/stheader.h" #include "vd_internal.h" +#include "vd_libdv.h" static const vd_info_t info = { diff --git a/libmpcodecs/vd_libdv.h b/libmpcodecs/vd_libdv.h new file mode 100644 index 0000000000..608d06bf21 --- /dev/null +++ b/libmpcodecs/vd_libdv.h @@ -0,0 +1,26 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPLAYER_VD_LIBDV_H +#define MPLAYER_VD_LIBDV_H + +#include + +dv_decoder_t* init_global_rawdv_decoder(void); + +#endif /* MPLAYER_VD_LIBDV_H */ -- cgit v1.2.3