[MPlayer-cvslog] r37799 - in trunk: etc/codecs.conf libmpcodecs/vd.c libmpdemux/aviheader.c libmpdemux/demux_lavf.c libmpdemux/stheader.h
reimar
subversion at mplayerhq.hu
Thu Feb 25 19:10:01 CET 2016
Author: reimar
Date: Thu Feb 25 19:10:01 2016
New Revision: 37799
Log:
Fix flip behaviour for RAW formats.
For non-AVI raw they should not be treated
as flipped by default.
Also respect the flip decision by the FFmpeg
demuxer even when used with our rawdec.
Modified:
trunk/etc/codecs.conf
trunk/libmpcodecs/vd.c
trunk/libmpdemux/aviheader.c
trunk/libmpdemux/demux_lavf.c
trunk/libmpdemux/stheader.h
Modified: trunk/etc/codecs.conf
==============================================================================
--- trunk/etc/codecs.conf Thu Feb 25 18:09:25 2016 (r37798)
+++ trunk/etc/codecs.conf Thu Feb 25 19:10:01 2016 (r37799)
@@ -4258,13 +4258,6 @@ videocodec rawbgr15
format 0x4247520F
out BGR15
-videocodec rawbgr8flip
- info "RAW BGR8"
- status working
- driver raw
- format 0x0
- out BGR8 flip
-
videocodec rawbgr8
info "RAW BGR8"
status working
@@ -4281,7 +4274,7 @@ videocodec rawbgr1
format 0x0
format 0x20776172 0x42475201
format 0x42475201
- out BGR1 flip
+ out BGR1
videocodec ffrawpal
info "RAW PAL8"
@@ -4293,7 +4286,7 @@ videocodec ffrawpal
format 0x20776172 0x42475204
format 0x42475204
format 0x42475202
- out BGR8 flip
+ out BGR8
videocodec rawyuy2
info "RAW YUY2"
Modified: trunk/libmpcodecs/vd.c
==============================================================================
--- trunk/libmpcodecs/vd.c Thu Feb 25 18:09:25 2016 (r37798)
+++ trunk/libmpcodecs/vd.c Thu Feb 25 19:10:01 2016 (r37799)
@@ -289,6 +289,7 @@ int mpcodecs_config_vo(sh_video_t *sh, i
}
if (vo_flags & VFCAP_FLIPPED)
flip ^= 1;
+ flip ^= sh->flipped_input;
if (flip && !(vo_flags & VFCAP_FLIP)) {
// we need to flip, but no flipping filter avail.
vf_add_before_vo(&vf, "flip", NULL);
Modified: trunk/libmpdemux/aviheader.c
==============================================================================
--- trunk/libmpdemux/aviheader.c Thu Feb 25 18:09:25 2016 (r37798)
+++ trunk/libmpdemux/aviheader.c Thu Feb 25 19:10:01 2016 (r37799)
@@ -284,6 +284,9 @@ while(1){
sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
sh_video->format = sh_video->bih->biCompression;
+ if (sh_video->bih->biCompression == 0 && sh_video->bih->biHeight > 0)
+ sh_video->flipped_input ^= 1;
+ sh_video->bih->biHeight = FFABS(sh_video->bih->biHeight);
// if(demuxer->video->id==-1) demuxer->video->id=stream_id;
// IdxFix:
idxfix_videostream=stream_id;
Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c Thu Feb 25 18:09:25 2016 (r37798)
+++ trunk/libmpdemux/demux_lavf.c Thu Feb 25 19:10:01 2016 (r37799)
@@ -367,6 +367,12 @@ static void handle_stream(demuxer_t *dem
if(!sh_video) break;
stream_type = "video";
priv->vstreams[priv->video_streams] = i;
+ if (codec->extradata_size >= 9 &&
+ !memcmp(codec->extradata + codec->extradata_size - 9, "BottomUp", 9))
+ {
+ codec->extradata_size -= 9;
+ sh_video->flipped_input ^= 1;
+ }
// always reserve space for palette
sh_video->bih_size = sizeof(*bih) + codec->extradata_size + 1024;
bih=calloc(sh_video->bih_size,1);
Modified: trunk/libmpdemux/stheader.h
==============================================================================
--- trunk/libmpdemux/stheader.h Thu Feb 25 18:09:25 2016 (r37798)
+++ trunk/libmpdemux/stheader.h Thu Feb 25 19:10:01 2016 (r37799)
@@ -111,6 +111,7 @@ typedef struct sh_video {
float stream_aspect; // aspect ratio stored in the media headers (e.g. in DVD IFO files)
int i_bps; // == bitrate (compressed bytes/sec)
int disp_w,disp_h; // display size (filled by fileformat parser)
+ int flipped_input;
// output driver/filters: (set by libmpcodecs core)
unsigned int outfmtidx;
struct vf_instance *vfilter; // the video filter chain, used for this video stream
More information about the MPlayer-cvslog
mailing list