MPlayer: bump to release (#3781)

This commit is contained in:
miqlas
2019-04-25 17:44:35 +02:00
committed by Jérôme Duval
parent 1a1e04b0bf
commit 96c6579a11
3 changed files with 276 additions and 286 deletions

View File

@@ -1,5 +1,5 @@
resource app_flags B_ARGV_ONLY; resource app_flags B_MULTIPLE_LAUNCH | B_ARGV_ONLY;
resource app_version { resource app_version {
major = @MAJOR@, major = @MAJOR@,

View File

@@ -20,14 +20,12 @@ fonts are supported along with 12 subtitle formats (MicroDVD, SubRip, OGM, \
SubViewer, Sami, VPlayer, RT, SSA, AQTitle, JACOsub, PJS and our own: MPsub). \ SubViewer, Sami, VPlayer, RT, SSA, AQTitle, JACOsub, PJS and our own: MPsub). \
DVD subtitles (SPU streams, VOBsub and Closed Captions) are supported as well." DVD subtitles (SPU streams, VOBsub and Closed Captions) are supported as well."
HOMEPAGE="http://www.mplayerhq.hu/" HOMEPAGE="http://www.mplayerhq.hu/"
COPYRIGHT="2001-2016 The MPlayer Team" COPYRIGHT="2001-2019 The MPlayer Team"
LICENSE="GNU LGPL v2.1" LICENSE="GNU LGPL v2.1"
REVISION="1" REVISION="1"
srcGitRev="c4eb74cb8d8d7b8ccd9936cb18742d086492fb9f" SOURCE_URI="http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.4.tar.xz"
SOURCE_URI="https://github.com/extrowerk/mplayer/archive/$srcGitRev.zip" CHECKSUM_SHA256="82596ed558478d28248c7bc3828eb09e6948c099bbd76bb7ee745a0e3275b548"
CHECKSUM_SHA256="ae9508e6504da751b3dc91b85aae141d6164c1da65fc270b666c0509518e45ee" SOURCE_DIR="MPlayer-1.4"
SOURCE_DIR="mplayer-$srcGitRev"
SOURCE_FILENAME="mplayer-$srcGitRev.zip"
PATCHES="mplayer_x86-$portVersion.patchset" PATCHES="mplayer_x86-$portVersion.patchset"
ADDITIONAL_FILES="mplayer.rdef.in" ADDITIONAL_FILES="mplayer.rdef.in"
@@ -56,7 +54,7 @@ REQUIRES="
lib:liba52$secondaryArchSuffix lib:liba52$secondaryArchSuffix
lib:libbz2$secondaryArchSuffix lib:libbz2$secondaryArchSuffix
lib:libcaca$secondaryArchSuffix lib:libcaca$secondaryArchSuffix
# lib:libcdio$secondaryArchSuffix lib:libcdio$secondaryArchSuffix
lib:libdca$secondaryArchSuffix lib:libdca$secondaryArchSuffix
lib:libdv$secondaryArchSuffix lib:libdv$secondaryArchSuffix
lib:libdvdcss$secondaryArchSuffix lib:libdvdcss$secondaryArchSuffix
@@ -113,7 +111,7 @@ BUILD_REQUIRES="
devel:libbz2$secondaryArchSuffix devel:libbz2$secondaryArchSuffix
devel:libcaca$secondaryArchSuffix devel:libcaca$secondaryArchSuffix
devel:libcddb$secondaryArchSuffix devel:libcddb$secondaryArchSuffix
# devel:libcdio$secondaryArchSuffix devel:libcdio$secondaryArchSuffix
devel:libdca$secondaryArchSuffix devel:libdca$secondaryArchSuffix
devel:libdv$secondaryArchSuffix devel:libdv$secondaryArchSuffix
devel:libdvdcss$secondaryArchSuffix devel:libdvdcss$secondaryArchSuffix

View File

@@ -1,22 +1,23 @@
From 683eb6964591da827fe9f7c7827507d999a12696 Mon Sep 17 00:00:00 2001 From fa11c15302e76a470d9ae76c6983e74cceafb61f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com> From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Mon, 26 Dec 2016 17:18:13 +0100 Date: Mon, 22 Apr 2019 11:38:50 +0200
Subject: [PATCH] Haiku supporting code from Sergei Reznikov Subject: [PATCH] Haiku
--- ---
Makefile | 3 + Makefile | 3 +
configure | 42 ++++++- configure | 42 +++++-
libao2/ao_haiku.cpp | 195 +++++++++++++++++++++++++++++++ libao2/ao_haiku.cpp | 195 ++++++++++++++++++++++++++
libao2/audio_out.c | 7 ++ libao2/audio_out.c | 7 +
libvo/haiku_common.cpp | 304 +++++++++++++++++++++++++++++++++++++++++++++++++ libvo/haiku_common.cpp | 304 +++++++++++++++++++++++++++++++++++++++++
libvo/haiku_common.h | 69 +++++++++++ libvo/haiku_common.h | 69 ++++++++++
libvo/haiku_view.cpp | 171 ++++++++++++++++++++++++++++ libvo/haiku_view.cpp | 171 +++++++++++++++++++++++
libvo/haiku_view.h | 36 ++++++ libvo/haiku_view.h | 36 +++++
libvo/haiku_window.cpp | 125 ++++++++++++++++++++ libvo/haiku_window.cpp | 125 +++++++++++++++++
libvo/haiku_window.h | 31 +++++ libvo/haiku_window.h | 31 +++++
libvo/video_out.c | 4 + libvo/video_out.c | 4 +
libvo/vo_haiku.cpp | 201 ++++++++++++++++++++++++++++++++ libvo/vo_haiku.cpp | 201 +++++++++++++++++++++++++++
12 files changed, 1185 insertions(+), 3 deletions(-) path.c | 18 +++
13 files changed, 1203 insertions(+), 3 deletions(-)
create mode 100644 libao2/ao_haiku.cpp create mode 100644 libao2/ao_haiku.cpp
create mode 100644 libvo/haiku_common.cpp create mode 100644 libvo/haiku_common.cpp
create mode 100644 libvo/haiku_common.h create mode 100644 libvo/haiku_common.h
@@ -27,7 +28,7 @@ Subject: [PATCH] Haiku supporting code from Sergei Reznikov
create mode 100644 libvo/vo_haiku.cpp create mode 100644 libvo/vo_haiku.cpp
diff --git a/Makefile b/Makefile diff --git a/Makefile b/Makefile
index f59f635..3d422c3 100644 index efa871d..aec5a2f 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -544,6 +544,9 @@ SRCS_MPLAYER-$(S3FB) += libvo/vo_s3fb.c @@ -544,6 +544,9 @@ SRCS_MPLAYER-$(S3FB) += libvo/vo_s3fb.c
@@ -41,7 +42,7 @@ index f59f635..3d422c3 100644
SRCS_MPLAYER-$(SNDIO) += libao2/ao_sndio.c SRCS_MPLAYER-$(SNDIO) += libao2/ao_sndio.c
SRCS_MPLAYER-$(SUNAUDIO) += libao2/ao_sun.c SRCS_MPLAYER-$(SUNAUDIO) += libao2/ao_sun.c
diff --git a/configure b/configure diff --git a/configure b/configure
index d18543d..02f2004 100755 index d1aa8cd..52aa9b5 100755
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -228,6 +228,7 @@ qnx() { issystem "QNX"; } @@ -228,6 +228,7 @@ qnx() { issystem "QNX"; }
@@ -60,7 +61,7 @@ index d18543d..02f2004 100755
--enable-kva enable KVA video output [autodetect] --enable-kva enable KVA video output [autodetect]
--enable-aa enable AAlib video output [autodetect] --enable-aa enable AAlib video output [autodetect]
--enable-caca enable CACA video output [autodetect] --enable-caca enable CACA video output [autodetect]
@@ -678,6 +680,7 @@ _xvmc=no #auto when complete @@ -682,6 +684,7 @@ _xvmc=no #auto when complete
_vda=auto _vda=auto
_vdpau=auto _vdpau=auto
_sdl=auto _sdl=auto
@@ -68,7 +69,7 @@ index d18543d..02f2004 100755
_kva=auto _kva=auto
_direct3d=auto _direct3d=auto
_directx=auto _directx=auto
@@ -1028,6 +1031,8 @@ for ac_option do @@ -1033,6 +1036,8 @@ for ac_option do
--disable-vdpau) _vdpau=no ;; --disable-vdpau) _vdpau=no ;;
--enable-sdl) _sdl=yes ;; --enable-sdl) _sdl=yes ;;
--disable-sdl) _sdl=no ;; --disable-sdl) _sdl=no ;;
@@ -77,7 +78,7 @@ index d18543d..02f2004 100755
--enable-kva) _kva=yes ;; --enable-kva) _kva=yes ;;
--disable-kva) _kva=no ;; --disable-kva) _kva=no ;;
--enable-direct3d) _direct3d=yes ;; --enable-direct3d) _direct3d=yes ;;
@@ -1640,7 +1645,7 @@ else @@ -1676,7 +1681,7 @@ else
cc_name=$cc_name_tmp cc_name=$cc_name_tmp
echocheck "$_cc version" echocheck "$_cc version"
cc_vendor=gnu cc_vendor=gnu
@@ -86,7 +87,7 @@ index d18543d..02f2004 100755
case $cc_version in case $cc_version in
2.96*) 2.96*)
cc_fail=yes cc_fail=yes
@@ -1710,7 +1715,7 @@ if test -z "$_target" ; then @@ -1746,7 +1751,7 @@ if test -z "$_target" ; then
# host's CPU/instruction set # host's CPU/instruction set
set_host_arch() { set_host_arch() {
case "$1" in case "$1" in
@@ -95,7 +96,7 @@ index d18543d..02f2004 100755
ia64) host_arch=ia64 ;; ia64) host_arch=ia64 ;;
macppc|ppc*|Power*) host_arch=ppc ;; macppc|ppc*|Power*) host_arch=ppc ;;
alpha) host_arch=alpha ;; alpha) host_arch=alpha ;;
@@ -1749,6 +1754,7 @@ else # if test -z "$_target" @@ -1785,6 +1790,7 @@ else # if test -z "$_target"
amigaos) system_name=AmigaOS ;; amigaos) system_name=AmigaOS ;;
mingw32*) system_name=MINGW32 ;; mingw32*) system_name=MINGW32 ;;
wine) system_name=Wine ;; wine) system_name=Wine ;;
@@ -103,7 +104,7 @@ index d18543d..02f2004 100755
esac esac
done done
# We need to convert underscores so that values like k6-2 and pentium-mmx can be passed # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
@@ -1825,6 +1831,11 @@ if wine ; then @@ -1863,6 +1869,11 @@ if wine ; then
extra_cflags="-fno-pic -UWIN32 -U_WIN32 -U__WIN32 -U__WIN32__ -DWINE_NOWINSOCK $extra_cflags" extra_cflags="-fno-pic -UWIN32 -U_WIN32 -U__WIN32 -U__WIN32__ -DWINE_NOWINSOCK $extra_cflags"
fi fi
@@ -115,7 +116,7 @@ index d18543d..02f2004 100755
if darwin && test "$cc_vendor" != "clang" ; then if darwin && test "$cc_vendor" != "clang" ; then
extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags" extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
fi fi
@@ -5766,6 +5777,29 @@ fi @@ -5894,6 +5905,29 @@ fi
echores "$_v4l2" echores "$_v4l2"
@@ -145,7 +146,7 @@ index d18543d..02f2004 100755
######### #########
# AUDIO # # AUDIO #
@@ -8005,7 +8039,7 @@ fi @@ -8059,7 +8093,7 @@ fi
# (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly) # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
ld_dl_dynamic='' ld_dl_dynamic=''
freebsd || netbsd || openbsd || dragonfly || bsdos && ld_dl_dynamic='-rdynamic' freebsd || netbsd || openbsd || dragonfly || bsdos && ld_dl_dynamic='-rdynamic'
@@ -154,7 +155,7 @@ index d18543d..02f2004 100755
ld_dl_dynamic='-rdynamic' ld_dl_dynamic='-rdynamic'
fi fi
@@ -8498,6 +8532,7 @@ RADIO_CAPTURE=$_radio_capture @@ -8552,6 +8586,7 @@ RADIO_CAPTURE=$_radio_capture
REAL_CODECS = $_real REAL_CODECS = $_real
S3FB = $_s3fb S3FB = $_s3fb
SDL = $_sdl SDL = $_sdl
@@ -162,7 +163,7 @@ index d18543d..02f2004 100755
SDL_IMAGE = $sdl_image SDL_IMAGE = $sdl_image
SPEEX = $_speex SPEEX = $_speex
STREAM_CACHE = $_stream_cache STREAM_CACHE = $_stream_cache
@@ -9080,6 +9115,7 @@ $def_quartz @@ -9153,6 +9188,7 @@ $def_quartz
$def_s3fb $def_s3fb
$def_sdl $def_sdl
$def_sdl_sdl_h $def_sdl_sdl_h
@@ -172,7 +173,7 @@ index d18543d..02f2004 100755
$def_tdfxvid $def_tdfxvid
diff --git a/libao2/ao_haiku.cpp b/libao2/ao_haiku.cpp diff --git a/libao2/ao_haiku.cpp b/libao2/ao_haiku.cpp
new file mode 100644 new file mode 100644
index 0000000..e201f17 index 0000000..e50f1dc
--- /dev/null --- /dev/null
+++ b/libao2/ao_haiku.cpp +++ b/libao2/ao_haiku.cpp
@@ -0,0 +1,195 @@ @@ -0,0 +1,195 @@
@@ -216,7 +217,7 @@ index 0000000..e201f17
+ &info, + &info,
+ control, + control,
+ init, + init,
+ uninit, + uninit,
+ reset, + reset,
+ get_space, + get_space,
+ play, + play,
@@ -239,17 +240,17 @@ index 0000000..e201f17
+static BSoundPlayer *player = NULL; +static BSoundPlayer *player = NULL;
+ +
+static int write_buffer(unsigned char* data,int len){ +static int write_buffer(unsigned char* data,int len){
+ int free = av_fifo_space(buffer); + int free = av_fifo_space(buffer);
+ if (len > free) len = free; + if (len > free) len = free;
+ return av_fifo_generic_write(buffer, data, len, NULL); + return av_fifo_generic_write(buffer, data, len, NULL);
+} +}
+ +
+ +
+static int read_buffer(unsigned char* data,int len){ +static int read_buffer(unsigned char* data,int len){
+ int buffered = av_fifo_size(buffer); + int buffered = av_fifo_size(buffer);
+ if (len > buffered) len = buffered; + if (len > buffered) len = buffered;
+ av_fifo_generic_read(buffer, data, len, NULL); + av_fifo_generic_read(buffer, data, len, NULL);
+ return len; + return len;
+} +}
+ +
+//BSoundPlayer proc func +//BSoundPlayer proc func
@@ -272,7 +273,7 @@ index 0000000..e201f17
+ ao_data.samplerate = rate; + ao_data.samplerate = rate;
+ ao_data.buffersize = CHUNK_SIZE; + ao_data.buffersize = CHUNK_SIZE;
+ ao_data.outburst = CHUNK_SIZE; + ao_data.outburst = CHUNK_SIZE;
+ ao_data.format = format; + ao_data.format = format;
+ +
+ media_raw_audio_format hspec = { + media_raw_audio_format hspec = {
+ rate, + rate,
@@ -283,32 +284,32 @@ index 0000000..e201f17
+ }; + };
+ +
+ switch(format) { + switch(format) {
+ case AF_FORMAT_U8: + case AF_FORMAT_U8:
+ hspec.format = media_raw_audio_format::B_AUDIO_UCHAR; + hspec.format = media_raw_audio_format::B_AUDIO_UCHAR;
+ break; + break;
+ case AF_FORMAT_S8: + case AF_FORMAT_S8:
+ hspec.format = media_raw_audio_format::B_AUDIO_CHAR;; + hspec.format = media_raw_audio_format::B_AUDIO_CHAR;;
+ break; + break;
+ case AF_FORMAT_S16_LE: + case AF_FORMAT_S16_LE:
+ hspec.format = media_raw_audio_format::B_AUDIO_SHORT; + hspec.format = media_raw_audio_format::B_AUDIO_SHORT;
+ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; + hspec.byte_order = B_MEDIA_LITTLE_ENDIAN;
+ break; + break;
+ case AF_FORMAT_S16_BE: + case AF_FORMAT_S16_BE:
+ hspec.format = media_raw_audio_format::B_AUDIO_SHORT; + hspec.format = media_raw_audio_format::B_AUDIO_SHORT;
+ hspec.byte_order = B_MEDIA_BIG_ENDIAN; + hspec.byte_order = B_MEDIA_BIG_ENDIAN;
+ break; + break;
+ case AF_FORMAT_FLOAT_LE: + case AF_FORMAT_FLOAT_LE:
+ hspec.format = media_raw_audio_format::B_AUDIO_FLOAT; + hspec.format = media_raw_audio_format::B_AUDIO_FLOAT;
+ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; + hspec.byte_order = B_MEDIA_LITTLE_ENDIAN;
+ break; + break;
+ case AF_FORMAT_FLOAT_BE: + case AF_FORMAT_FLOAT_BE:
+ hspec.format = media_raw_audio_format::B_AUDIO_FLOAT; + hspec.format = media_raw_audio_format::B_AUDIO_FLOAT;
+ hspec.byte_order = B_MEDIA_BIG_ENDIAN; + hspec.byte_order = B_MEDIA_BIG_ENDIAN;
+ break; + break;
+ default: + default:
+ hspec.format = media_raw_audio_format::B_AUDIO_SHORT; + hspec.format = media_raw_audio_format::B_AUDIO_SHORT;
+ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; + hspec.byte_order = B_MEDIA_LITTLE_ENDIAN;
+ ao_data.format = AF_FORMAT_S16_LE; + ao_data.format = AF_FORMAT_S16_LE;
+ break; + break;
+ } + }
+ +
@@ -333,7 +334,7 @@ index 0000000..e201f17
+static void uninit(int immed){ +static void uninit(int immed){
+ +
+ if (!immed) + if (!immed)
+ usec_sleep(get_delay() * 1000 * 1000); + usec_sleep(get_delay() * 1000 * 1000);
+ +
+ player->SetHasData(false); + player->SetHasData(false);
+ delete player; + delete player;
@@ -358,7 +359,7 @@ index 0000000..e201f17
+} +}
+ +
+static int get_space(void){ +static int get_space(void){
+ return av_fifo_space(buffer); + return av_fifo_space(buffer);
+} +}
+ +
+static int play(void* data,int len,int flags){ +static int play(void* data,int len,int flags){
@@ -368,8 +369,8 @@ index 0000000..e201f17
+} +}
+ +
+static float get_delay(void){ +static float get_delay(void){
+ int buffered = av_fifo_size(buffer); // could be less + int buffered = av_fifo_size(buffer); // could be less
+ return (float)(buffered + ao_data.buffersize)/(float)ao_data.bps; + return (float)(buffered + ao_data.buffersize)/(float)ao_data.bps;
+} +}
diff --git a/libao2/audio_out.c b/libao2/audio_out.c diff --git a/libao2/audio_out.c b/libao2/audio_out.c
index 197a63b..7f7baff 100644 index 197a63b..7f7baff 100644
@@ -481,8 +482,8 @@ index 0000000..1ea5f96
+ if (msg->FindFloat("be:wheel_delta_y", &dy) == B_OK) { + if (msg->FindFloat("be:wheel_delta_y", &dy) == B_OK) {
+ if(dy<0) + if(dy<0)
+ mplayer_put_key(MOUSE_BTN3); + mplayer_put_key(MOUSE_BTN3);
+ else + else
+ mplayer_put_key(MOUSE_BTN4); + mplayer_put_key(MOUSE_BTN4);
+ } + }
+} +}
+ +
@@ -490,15 +491,15 @@ index 0000000..1ea5f96
+FBView::MouseMoved(BPoint point, uint32 transit,const BMessage *message) +FBView::MouseMoved(BPoint point, uint32 transit,const BMessage *message)
+{ +{
+ switch(transit) + switch(transit)
+ { + {
+ case B_INSIDE_VIEW: + case B_INSIDE_VIEW:
+ case B_ENTERED_VIEW: + case B_ENTERED_VIEW:
+ { + {
+ BPoint p = point; + BPoint p = point;
+ vo_mouse_movement(p.x, p.y); + vo_mouse_movement(p.x, p.y);
+ break; + break;
+ } + }
+ } + }
+} +}
+ +
+void +void
@@ -532,9 +533,9 @@ index 0000000..1ea5f96
+void +void
+FBView::Paint() +FBView::Paint()
+{ +{
+ if(LockLooper()) { + if(LockLooper()) {
+ bufferView->LockLooper(); + bufferView->LockLooper();
+ SetDrawingMode(B_OP_COPY); + SetDrawingMode(B_OP_COPY);
+ DrawBitmap(bufferBitmap,bufferView->Bounds(),Bounds()); + DrawBitmap(bufferBitmap,bufferView->Bounds(),Bounds());
+ bufferView->UnlockLooper(); + bufferView->UnlockLooper();
+ UnlockLooper(); + UnlockLooper();
@@ -623,19 +624,19 @@ index 0000000..1ea5f96
+void +void
+MWindow::FrameResized(float width, float height) +MWindow::FrameResized(float width, float height)
+{ +{
+ int d_width=width; + int d_width=width;
+ int d_height=height; + int d_height=height;
+ +
+ float winaspect = width/height; + float winaspect = width/height;
+ float videoaspect = image_width/image_height; + float videoaspect = image_width/image_height;
+ +
+ d_width = width; + d_width = width;
+ d_height = width/videoaspect; + d_height = width/videoaspect;
+ +
+ if(d_height>height) { + if(d_height>height) {
+ d_height = height; + d_height = height;
+ d_width = height*videoaspect; + d_width = height*videoaspect;
+ } + }
+ +
+ renderRect.left = (width - d_width) / 2; + renderRect.left = (width - d_width) / 2;
+ renderRect.top = (height - d_height) / 2; + renderRect.top = (height - d_height) / 2;
@@ -647,8 +648,8 @@ index 0000000..1ea5f96
+void +void
+MWindow::Zoom(BPoint origin, float width,float height) +MWindow::Zoom(BPoint origin, float width,float height)
+{ +{
+ vo_fs = !vo_fs; + vo_fs = !vo_fs;
+ SetFullscreen(vo_fs); + SetFullscreen(vo_fs);
+} +}
+ +
+void +void
@@ -664,9 +665,9 @@ index 0000000..1ea5f96
+ case B_ESCAPE: + case B_ESCAPE:
+ if(vo_fs==1) { + if(vo_fs==1) {
+ vo_fs = !vo_fs; + vo_fs = !vo_fs;
+ SetFullscreen(vo_fs); + SetFullscreen(vo_fs);
+ } else { + } else {
+ mplayer_put_key(KEY_ESC); + mplayer_put_key(KEY_ESC);
+ } + }
+ break; + break;
+ case B_LEFT_ARROW: + case B_LEFT_ARROW:
@@ -752,8 +753,8 @@ index 0000000..53e21ef
+ int Width(); + int Width();
+ int Height(); + int Height();
+ private: + private:
+ int buffer_width; + int buffer_width;
+ int buffer_height; + int buffer_height;
+ BView *bufferView; + BView *bufferView;
+ BBitmap *bufferBitmap; + BBitmap *bufferBitmap;
+ BRect renderRect; + BRect renderRect;
@@ -841,15 +842,15 @@ index 0000000..e491de4
+FBView::MouseDown(BPoint point) +FBView::MouseDown(BPoint point)
+{ +{
+ uint32 buttons = Window()->CurrentMessage()->FindInt32("buttons"); + uint32 buttons = Window()->CurrentMessage()->FindInt32("buttons");
+ int32 clicks = Window()->CurrentMessage()->FindInt32("clicks"); + int32 clicks = Window()->CurrentMessage()->FindInt32("clicks");
+ +
+ if( buttons & B_PRIMARY_MOUSE_BUTTON ) { + if( buttons & B_PRIMARY_MOUSE_BUTTON ) {
+ if(clicks==1) + if(clicks==1)
+ mplayer_put_key(MOUSE_BTN0); + mplayer_put_key(MOUSE_BTN0);
+ else { + else {
+ vo_fs = !vo_fs; + vo_fs = !vo_fs;
+ haiku_fullscreen(); + haiku_fullscreen();
+ mplayer_put_key(MOUSE_BTN0); + mplayer_put_key(MOUSE_BTN0);
+ } + }
+ } + }
+ if( buttons & B_SECONDARY_MOUSE_BUTTON ) { + if( buttons & B_SECONDARY_MOUSE_BUTTON ) {
@@ -867,24 +868,24 @@ index 0000000..e491de4
+ if (msg->FindFloat("be:wheel_delta_y", &dy) == B_OK) { + if (msg->FindFloat("be:wheel_delta_y", &dy) == B_OK) {
+ if(dy>0) + if(dy>0)
+ mplayer_put_key(MOUSE_BTN3); + mplayer_put_key(MOUSE_BTN3);
+ else + else
+ mplayer_put_key(MOUSE_BTN4); + mplayer_put_key(MOUSE_BTN4);
+ } + }
+} +}
+ +
+void +void
+FBView::MouseMoved(BPoint point, uint32 transit,const BMessage *message) +FBView::MouseMoved(BPoint point, uint32 transit,const BMessage *message)
+{ +{
+ switch(transit) + switch(transit)
+ { + {
+ case B_INSIDE_VIEW: + case B_INSIDE_VIEW:
+ case B_ENTERED_VIEW: + case B_ENTERED_VIEW:
+ { + {
+ BPoint p = point; + BPoint p = point;
+ vo_mouse_movement(p.x, p.y); + vo_mouse_movement(p.x, p.y);
+ break; + break;
+ } + }
+ } + }
+} +}
+ +
+void +void
@@ -918,12 +919,12 @@ index 0000000..e491de4
+void +void
+FBView::Paint() +FBView::Paint()
+{ +{
+ if(LockLooper()) { + if(LockLooper()) {
+ bufferView->LockLooper(); + bufferView->LockLooper();
+ SetDrawingMode(B_OP_COPY); + SetDrawingMode(B_OP_COPY);
+ DrawBitmap(bufferBitmap,bufferView->Bounds(),B_FILTER_BITMAP_BILINEAR,Bounds()); + DrawBitmap(bufferBitmap,bufferView->Bounds(),B_FILTER_BITMAP_BILINEAR,Bounds());
+ bufferView->UnlockLooper(); + bufferView->UnlockLooper();
+ UnlockLooper(); + UnlockLooper();
+ } + }
+} +}
+ +
@@ -1048,19 +1049,19 @@ index 0000000..2f4c8bf
+void +void
+TestWindow::FrameResized(float width, float height) +TestWindow::FrameResized(float width, float height)
+{ +{
+ int d_width=width; + int d_width=width;
+ int d_height=height; + int d_height=height;
+ +
+ float winaspect = width/height; + float winaspect = width/height;
+ float videoaspect = image_width/image_height; + float videoaspect = image_width/image_height;
+ +
+ d_width = width; + d_width = width;
+ d_height = width/videoaspect; + d_height = width/videoaspect;
+ +
+ if(d_height>height) { + if(d_height>height) {
+ d_height = height; + d_height = height;
+ d_width = height*videoaspect; + d_width = height*videoaspect;
+ } + }
+ +
+ renderRect.left = (width - d_width) / 2; + renderRect.left = (width - d_width) / 2;
+ renderRect.top = (height - d_height) / 2; + renderRect.top = (height - d_height) / 2;
@@ -1088,9 +1089,9 @@ index 0000000..2f4c8bf
+ case B_ESCAPE: + case B_ESCAPE:
+ if(vo_fs==1) { + if(vo_fs==1) {
+ vo_fs = !vo_fs; + vo_fs = !vo_fs;
+ haiku_fullscreen(); + haiku_fullscreen();
+ } else { + } else {
+ mplayer_put_key(KEY_ESC); + mplayer_put_key(KEY_ESC);
+ } + }
+ break; + break;
+ case B_LEFT_ARROW: + case B_LEFT_ARROW:
@@ -1244,7 +1245,7 @@ index 0000000..614c8ff
+ control, + control,
+ draw_frame, + draw_frame,
+ draw_slice, + draw_slice,
+ draw_osd, + draw_osd,
+ flip_page, + flip_page,
+ check_events, + check_events,
+ uninit + uninit
@@ -1266,12 +1267,12 @@ index 0000000..614c8ff
+ +
+static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) +static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride)
+{ +{
+ switch (image_format) + switch (image_format)
+ { + {
+ case IMGFMT_BGR32: + case IMGFMT_BGR32:
+ vo_draw_alpha_rgb32(w,h,src,srca,stride, image_data+4*(y0*image_width+x0),4*image_width); + vo_draw_alpha_rgb32(w,h,src,srca,stride, image_data+4*(y0*image_width+x0),4*image_width);
+ break; + break;
+ } + }
+} +}
+ +
+static void draw_osd(void) +static void draw_osd(void)
@@ -1292,17 +1293,17 @@ index 0000000..614c8ff
+ unsigned char *pbuffer = (unsigned char *)image_data; + unsigned char *pbuffer = (unsigned char *)image_data;
+ +
+ int n = sizeBuf/BLOCK; + int n = sizeBuf/BLOCK;
+ int ln = sizeBuf%BLOCK; + int ln = sizeBuf%BLOCK;
+ unsigned char* ptr=pbuffer; + unsigned char* ptr=pbuffer;
+ +
+ write_port(port,'BITS',(void*)&cmd, sizeof(int)); + write_port(port,'BITS',(void*)&cmd, sizeof(int));
+ +
+ write_port(port,msg_code,(void*)&w, sizeof(int)); + write_port(port,msg_code,(void*)&w, sizeof(int));
+ write_port(port,msg_code,(void*)&h, sizeof(int)); + write_port(port,msg_code,(void*)&h, sizeof(int));
+ +
+ for(int i=0;i<n;i++,ptr+=BLOCK) + for(int i=0;i<n;i++,ptr+=BLOCK)
+ write_port(port,msg_code,(void*)ptr, BLOCK); + write_port(port,msg_code,(void*)ptr, BLOCK);
+ write_port(port,msg_code,(void*)ptr, ln); + write_port(port,msg_code,(void*)ptr, ln);
+ } + }
+} +}
+ +
@@ -1317,11 +1318,11 @@ index 0000000..614c8ff
+query_format(uint32_t format) +query_format(uint32_t format)
+{ +{
+ image_format = format; + image_format = format;
+ switch(format){ + switch(format){
+ case IMGFMT_BGR32: + case IMGFMT_BGR32:
+ return VFCAP_CSP_SUPPORTED|VFCAP_OSD|VFCAP_SWSCALE; + return VFCAP_CSP_SUPPORTED|VFCAP_OSD|VFCAP_SWSCALE;
+ } + }
+ return 0; + return 0;
+} +}
+ +
+static int +static int
@@ -1333,7 +1334,7 @@ index 0000000..614c8ff
+ image_size = (image_width * image_height * image_depth + 7) / 8; + image_size = (image_width * image_height * image_depth + 7) / 8;
+ +
+ aspect_save_orig(width,height); + aspect_save_orig(width,height);
+ aspect_save_prescale(d_width,d_height); + aspect_save_prescale(d_width,d_height);
+ +
+ //printf("WinID=%d\n",WinID); + //printf("WinID=%d\n",WinID);
+ port=find_port("WID:12345"); + port=find_port("WID:12345");
@@ -1344,8 +1345,8 @@ index 0000000..614c8ff
+ haiku_wnd->Show(); + haiku_wnd->Show();
+ if(flags&VOFLAG_FULLSCREEN) { + if(flags&VOFLAG_FULLSCREEN) {
+ vo_fs=1; + vo_fs=1;
+ if(haiku_wnd) + if(haiku_wnd)
+ haiku_wnd->SetFullscreen(vo_fs); + haiku_wnd->SetFullscreen(vo_fs);
+ } + }
+ } else { + } else {
+ image_data=(unsigned char *)malloc(image_size); + image_data=(unsigned char *)malloc(image_size);
@@ -1368,46 +1369,37 @@ index 0000000..614c8ff
+ +
+static int preinit(const char *arg) +static int preinit(const char *arg)
+{ +{
+// if(be_app==NULL) +// if(be_app==NULL)
+// be_app = new BApplication("application/x-vnd.mplayer"); +// be_app = new BApplication("application/x-vnd.mplayer");
+ if(arg) + if(arg)
+ { + {
+ mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_NULL_UnknownSubdevice,arg); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_NULL_UnknownSubdevice,arg);
+ return ENOSYS; + return ENOSYS;
+ } + }
+ return 0; + return 0;
+} +}
+ +
+static int control(uint32_t request, void *data) +static int control(uint32_t request, void *data)
+{ +{
+ switch (request) { + switch (request) {
+ case VOCTRL_QUERY_FORMAT: + case VOCTRL_QUERY_FORMAT:
+ { + {
+ return query_format(*((uint32_t*)data)); + return query_format(*((uint32_t*)data));
+ } + }
+ case VOCTRL_FULLSCREEN: + case VOCTRL_FULLSCREEN:
+ { + {
+ vo_fs = !vo_fs; + vo_fs = !vo_fs;
+ if(haiku_wnd) + if(haiku_wnd)
+ haiku_wnd->SetFullscreen(vo_fs); + haiku_wnd->SetFullscreen(vo_fs);
+ return VO_TRUE; + return VO_TRUE;
+ } + }
+ } + }
+ return VO_NOTIMPL; + return VO_NOTIMPL;
+} +}
+ +
+ +
--
2.10.2
From 38ddddaa2dd35b98fdbdaf063163cf28e288dea6 Mon Sep 17 00:00:00 2001
From: Damillora <duniapengetahuan.12345@gmail.com>
Date: Sun, 24 Dec 2017 13:13:40 +0700
Subject: Put settings to user settings folder
diff --git a/path.c b/path.c diff --git a/path.c b/path.c
index b8d9335..a98f43b 100644 index e6287d2..e5c4cd9 100644
--- a/path.c --- a/path.c
+++ b/path.c +++ b/path.c
@@ -42,6 +42,11 @@ @@ -42,6 +42,11 @@
@@ -1450,5 +1442,5 @@ index b8d9335..a98f43b 100644
if (filename == NULL) { if (filename == NULL) {
if ((buff = malloc(len)) == NULL) if ((buff = malloc(len)) == NULL)
-- --
2.14.2 2.21.0