From: Ilkka Ollakka Date: Thu, 26 Jun 2008 07:38:53 +0000 (+0300) Subject: Merge branch 'master' of git@git.videolan.org:vlc X-Git-Tag: 0.9.0-test1~121 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e2a614c82b502ea6c3cdee7d0fc39cbb9627041e;hp=51f898a0eb6029c1922b2b4311f074245c99e963;p=vlc Merge branch 'master' of git@git.videolan.org:vlc --- diff --git a/NEWS b/NEWS index 2413e0db2d..be10395dc0 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ Changes between 0.8.6 and 0.9.0-git (not released yet): Important notes: ---------------- + * This release will not work with Windows 98/ME and Mac OS X 10.3.9 (Panther) * The HTTP interface is now only available on the local machine by default. If you want to make it available from other machines, you will have to edit the ".hosts" file. @@ -15,9 +16,9 @@ Important notes: C:\Program Files\VideoLAN\VLC\http\old\.hosts - On Mac OS X, you can find it in VLC.app/Contents/MacOS/share/http/.hosts and respectively in VLC.app/Contents/MacOS/share/http/old/.hosts - * This version of VLC contains a new interface for Windows and Linux. This - interface lacks the "Streaming Wizard" that used to be present in VLC 0.8.6. - It will be replaced by a better alternative in the next version. + * This version of VLC contains a new interface for Windows and Linux. + This interface has a fullscreen controller. This interface lacks the + "Streaming Wizard" that used to be present in VLC 0.8.6. If you absolutely need it, we advise you to keep VLC 0.8.6. * The behavior of --sout-keep was changed. It's now activated by default. * The marq, mosaic and logo commands in the rc interface changed. They @@ -33,14 +34,15 @@ Important notes: EXTVLCOPT options parsing in m3u playlists. Note that only a limited set of options is available to m3u playlists (CVE-2007-6683). * The old access:url syntax is no longer supported. Use access://url instead. - E.g.: vlc:quit -> vlc://quit ; - udp:@239.255.12.12 -> udp://@239.255.12.12 + E.g.: vlc:quit -> vlc://quit ; + udp:@239.255.12.12 -> udp://@239.255.12.12 * The ffmpeg module has been removed and replaced by avcodec, avformat, swscale (or imgresample if you use a swscale-less ffmpeg build) and postproc modules. - * The web plugins ActiveX (IE)/Firefox/Mozilla/Safari now recognize the following - states: IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4, STOPPING=5, - FORWARD=6, BACKWARD=7, ENDED=8, ERROR=9. With FORWARD and BACKWARD being - reserved for future implementations and are thus not functional atm. + * The web plugins ActiveX (IE)/Firefox/Mozilla/Safari now recognize the + following states: IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4, + STOPPING=5, FORWARD=6, BACKWARD=7, ENDED=8, ERROR=9. With FORWARD and + BACKWARD being reserved for future implementations and are thus not + functional atm. * Croping and padding in transcode are now done using the croppadd video filter. For example: transcode{vcodec=mp2v,vfilter=croppadd{cropttop=20,cropbottom=30,paddleft=100}} @@ -56,7 +58,7 @@ Security updates: Playlist: * Vastly improved playlist support: - * Media library support + * Media library creation to save all your playlist items * "Live search" * Shoutcast TV listings * Audioscrobbler/Last.FM support @@ -74,15 +76,15 @@ Inputs: * JACK audio input support * Input run time option (improved live stream recording) * BDA devices access module for DVB-C/S/T capture cards on Microsoft Windows - * Re-written Screen access module for Mac OS X + * Re-written Screen access module for Mac OS X using OpenGL instead of QuickDraw * Screen module now supports partial screen capture and mouse following on X11. - * Experimental EyeTV access module (Mac OS X only) + * Experimental EyeTV access module This requires the user to install a plugin to EyeTV.app (available as a separate download). * RTMP input support * QTKit-based Input module for Mac OS X allowing display and streaming of video - taken from all QuickTime-compatible video devices (no audio yet) + taken from all iSight-labelled video cameras (no audio support) * HTTP access now supports gzip compressed data and Digest Access Authentication. * New options to reduce latency between arrival of raw data and display of @@ -102,6 +104,7 @@ Demuxers: * TiVo Series 2 support * CD+G karaoke Files support * MXF files support + * OMA support Decoders: * VP60/VP61/VP6F/VP62 support @@ -113,15 +116,15 @@ Decoders: * Fluidsynth MIDI software synthesis (with external sound fonts) * New codec FOURCCs to support more specific files: Avid, FCP, Sony, Samsung, ... - * Closed Caption Decoder (DVD, ReplayTV, TiVo, DVB/ATSC) * H.264 PAFF support * DNxHD / VC-3 support * NellyMoser ASAO support * APE (Monkey audio) support - * VBI & EBU (Teletext) support * RealVideo support (with the RealVideo run-time) Subtitles: + * Closed Caption Decoder (DVD, ReplayTV, TiVo, DVB/ATSC) + * VBI & EBU (Teletext) support (*nix, Mac OS) * Ogg/Kate subtitles support * AQTitle subtitles support * MKV USF subtitles support @@ -141,7 +144,7 @@ Encoders: * Improved H.264 encoding speed Video outputs and filters: - * New CoreAnimation output module (Mac OS X 10.5 only) + * New CoreAnimation-based output module (VLCKit framework on OS X only) * Adjust, Invert and Distort (now split into Wave, Ripple, Gradient and Psychedelic) video filters can now be streamed * New puzzle video output filter @@ -180,8 +183,6 @@ Stream output: * RTMP output Interfaces: - * Windows/Linux - * Brand new interface for Linux and Windows, based on the Qt toolkit * All * New Simple Preferences dialogs showing the most important settings in an end-user suitable way. @@ -189,12 +190,16 @@ Interfaces: * Improved mouse gestures * Vastly improved Update checker * Full support for meta data editing (ID3v2, Ogg/Vorbis, AAC, APEv1/2) + * Windows/Linux + * Brand new interface for Linux and Windows, based on the Qt toolkit + * Fullscreen controller (transparency on Linux+Composite) * Mac OS X * Improved video output features * Online access to VideoLAN's Help Wiki within VLC * New setting to disable the "Recent Items" service * When playing Radio (live) streams, the current track is shown correctly * Correct appearance on Macs using Aqua's graphite theme + * Simplified Extended Controls panel * Ncurses: * Correctly displays wide characters when using an UTF-8 locale, if libncursesw is available. @@ -216,12 +221,12 @@ Linux Port: (which means that VLC doesn't use the $HOME/.vlc directory anymore) Mac OS X Port: - * Mac OS X Framework that can be used to embed VLC in third party + * Mac OS X Framework "VLCKit" that can be used to embed VLC in third party applications (Google Summer of Code Student project, Mac OS X 10.5 only) * New text renderer based on Quartz replacing the existing Freetype solution * Complete compatibility with Mac OS X 10.5 Leopard * It is now required to compile a fully featured build - * The support of Mac OS X 10.3.9 was discontinued. + * The support of Mac OS X 10.3.9 and QuickTime 6.x was discontinued. LibVLC: * Event management and various improvements in libvlc @@ -947,12 +952,12 @@ Video Output: * Experimental generic OpenGL video output (X11, Win32, MacOS X) with support for effects. * Improved filter and subpictures support : - - New filters can be streamed. - - "Subpicture filters" to overlay subpictures on video - - Centralized scaling and blending + - New filters can be streamed. + - "Subpicture filters" to overlay subpictures on video + - Centralized scaling and blending * New filters : - - "time", to display current time - - "marq", to display a marquee + - "time", to display current time + - "marq", to display a marquee Interfaces: * OSD sliders for volume and postition information diff --git a/THANKS b/THANKS index 807fb81cc1..a63b6e1e38 100644 --- a/THANKS +++ b/THANKS @@ -147,7 +147,7 @@ Laurent Mutricy - HTTP interface Leo Spalteholz - Qt interface design Loox Thefuture - Media key in X11 vout Lorena Gomes - Catalan translation -Lukas Durfina - qt4: full screen controller. teletext button fix. +Lukas Durfina - Qt4: full screen controller. Teletext button fix. Various fixes. Mahrazi Mohd Kamal - Malay Translation Marc Nolette - PVR support in DirectShow input Marco Munderloh - HTTP fix for Win32 to URL filenames diff --git a/configure.ac b/configure.ac index 0ee5d8535e..214e400704 100644 --- a/configure.ac +++ b/configure.ac @@ -5589,16 +5589,6 @@ then VLC_ADD_PLUGIN([test4]) fi -dnl -dnl Microsoft Layer for Unicode for WIN9x/ME -dnl -if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin" -then - AC_CHECK_LIB(unicows, LoadUnicowsSymbol, [ - VLC_ADD_LDFLAGS([vlc libvlc],[-Wl,--exclude-libs,libunicows.a -lunicows]) - ]) -fi - dnl dnl gtk_main plugin dnl diff --git a/extras/contrib/src/Distributions/win32.mak b/extras/contrib/src/Distributions/win32.mak index 08eba4802e..0495905d7c 100644 --- a/extras/contrib/src/Distributions/win32.mak +++ b/extras/contrib/src/Distributions/win32.mak @@ -5,7 +5,7 @@ all: .iconv .intl .freetype .fribidi .zlib \ .live .goom2k4 .caca .mod .x264 .xml .twolame \ .png .gpg-error .gcrypt .opencdk .gnutls .mpcdec \ .dvdnav .dvbpsi .wxwidgets .qt4_win32 .dirac .SDL_image \ - .dx_headers .dshow_headers .gecko-win32 .unicows .dca \ + .dx_headers .dshow_headers .gecko-win32 .dca \ .lua .tag .fontconfig .portaudio \ .aclocal # .daap .cddb .cdio .vcdimager diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile index 18b6f4e760..166292945e 100644 --- a/extras/contrib/src/Makefile +++ b/extras/contrib/src/Makefile @@ -2311,25 +2311,6 @@ DISTCLEAN_PKG += yasm-$(YASM_VERSION).tar.bz2 CLEAN_FILE += .aclocal -# *************************************************************************** -# UNICOWS (Unicode support for WINME/98/95) -# *************************************************************************** - -libunicows-$(UNICOWS_VERSION).tar.gz: - $(WGET) $(UNICOWS_URL) - mv libunicows-$(UNICOWS_VERSION)-src.tar.gz $@ || true - -libunicows: libunicows-$(UNICOWS_VERSION).tar.gz - $(EXTRACT_GZ) - -.unicows: libunicows - (cd $hide(); @@ -721,11 +730,8 @@ void ControlsWidget::next() void ControlsWidget::setNavigation( int navigation ) { -#define HELP_MENU N_( "Menu" ) #define HELP_PCH N_( "Previous chapter" ) #define HELP_NCH N_( "Next chapter" ) -#define HELP_PTR N_( "Previous track" ) -#define HELP_NTR N_( "Next track" ) // 1 = chapter, 2 = title, 0 = no if( navigation == 0 ) @@ -872,7 +878,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, MainInterface *_p_mi, bool b_advControls, bool b_shiny ) : ControlsWidget( _p_i, _p_mi, b_advControls, b_shiny, true ), i_lastPosX( -1 ), i_lastPosY( -1 ), i_hideTimeout( 1 ), - b_mouseIsOver( false ) + b_mouseIsOver( false ), b_isFullscreen( false ) { setWindowFlags( Qt::ToolTip ); @@ -970,7 +976,11 @@ void FullscreenControllerWidget::slowHideFSC() } else { +#ifdef WIN32TRICK + if ( windowOpacity() > 0.0 && !fscHidden ) +#else if ( windowOpacity() > 0.0 ) +#endif { /* we should use 0.01 because of 100 pieces ^^^ but than it cannt be done in time */ @@ -1007,7 +1017,7 @@ void FullscreenControllerWidget::customEvent( QEvent *event ) { int type = event->type(); - if ( type == FullscreenControlShow_Type ) + if ( type == FullscreenControlShow_Type && b_isFullscreen ) { #ifdef WIN32TRICK // after quiting and going to fs, we need to call show() @@ -1144,7 +1154,8 @@ static int regMouseMoveCallback( vlc_object_t *vlc_object, const char *variable, if ( var_GetBool( p_vout, "fullscreen" ) && !b_registered ) { - p_fs->SetHideTimeout( var_GetInteger( p_vout, "mouse-hide-timeout" ) ); + p_fs->setHideTimeout( var_GetInteger( p_vout, "mouse-hide-timeout" ) ); + p_fs->setIsFullscreen( true ); var_AddCallback( p_vout, "mouse-moved", showFullscreenControllCallback, (void *) p_fs ); b_registered = true; @@ -1152,14 +1163,13 @@ static int regMouseMoveCallback( vlc_object_t *vlc_object, const char *variable, if ( !var_GetBool( p_vout, "fullscreen" ) && b_registered ) { + p_fs->setIsFullscreen( false ); + p_fs->hide(); var_DelCallback( p_vout, "mouse-moved", showFullscreenControllCallback, (void *) p_fs ); b_registered = false; } - if ( !var_GetBool( p_vout, "fullscreen" ) ) - p_fs->hide(); - return VLC_SUCCESS; } diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp index 35e3c9adfa..c1071d6aa1 100644 --- a/modules/gui/qt4/components/interface_widgets.hpp +++ b/modules/gui/qt4/components/interface_widgets.hpp @@ -91,8 +91,7 @@ private: QSize videoSize; signals: - void askVideoWidgetToShow(); - //void askResize(); + void askVideoWidgetToShow( unsigned int, unsigned int ); public slots: void SetSizing( unsigned int, unsigned int ); @@ -251,7 +250,8 @@ public: FullscreenControllerWidget( intf_thread_t *, MainInterface*, bool, bool ); virtual ~FullscreenControllerWidget(); - void SetHideTimeout( int hideTimeout ) { i_hideTimeout = hideTimeout; } + void setHideTimeout( int hideTimeout ) { i_hideTimeout = hideTimeout; } + void setIsFullscreen( bool isFS ) { b_isFullscreen = isFS; } void regFullscreenCallback( vout_thread_t *p_vout ); bool isFSCHidden(); @@ -284,6 +284,7 @@ private: int i_lastPosY; int i_hideTimeout; /* FSC hiding timeout, same as mouse hiding timeout */ bool b_mouseIsOver; + bool b_isFullscreen; #ifdef WIN32TRICK bool fscHidden; diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp index bcb6457a3e..547b926f6e 100644 --- a/modules/gui/qt4/components/open_panels.cpp +++ b/modules/gui/qt4/components/open_panels.cpp @@ -410,13 +410,14 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ui.setupUi( this ); /* CONNECTs */ - CONNECT( ui.protocolCombo, currentIndexChanged( int ), + CONNECT( ui.protocolCombo, activated( int ), this, updateProtocol( int ) ); CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() ); CONNECT( ui.addressText, textChanged( QString ), this, updateMRL()); CONNECT( ui.timeShift, clicked(), this, updateMRL()); CONNECT( ui.ipv6, clicked(), this, updateMRL()); + ui.protocolCombo->addItem( "" ); ui.protocolCombo->addItem("HTTP", QVariant("http")); ui.protocolCombo->addItem("HTTPS", QVariant("https")); ui.protocolCombo->addItem("FTP", QVariant("ftp")); @@ -424,6 +425,7 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ui.protocolCombo->addItem("RTSP", QVariant("rtsp")); ui.protocolCombo->addItem("UDP/RTP (unicast)", QVariant("udp")); ui.protocolCombo->addItem("UDP/RTP (multicast)", QVariant("udp")); + ui.protocolCombo->addItem("RTMP", QVariant("rtmp")); } NetOpenPanel::~NetOpenPanel() @@ -433,19 +435,26 @@ void NetOpenPanel::clear() {} /* update the widgets according the type of protocol */ -void NetOpenPanel::updateProtocol( int idx ) { +void NetOpenPanel::updateProtocol( int idx_proto ) { QString addr = ui.addressText->text(); - QString proto = ui.protocolCombo->itemData( idx ).toString(); + QString proto = ui.protocolCombo->itemData( idx_proto ).toString(); - ui.timeShift->setEnabled( idx >= 5 ); - ui.ipv6->setEnabled( idx == 5 ); - ui.addressText->setEnabled( idx != 5 ); - ui.portSpin->setEnabled( idx >= 5 ); + ui.timeShift->setEnabled( idx_proto == UDP_PROTO || + idx_proto == UDPM_PROTO ); + ui.ipv6->setEnabled( idx_proto == UDP_PROTO ); + ui.addressText->setEnabled( idx_proto != UDP_PROTO ); + ui.portSpin->setEnabled( idx_proto == UDP_PROTO || + idx_proto == UDPM_PROTO ); + + if( idx_proto == NO_PROTO ) return; /* If we already have a protocol in the address, replace it */ - if( addr.contains( "://")) { - msg_Err( p_intf, "replace"); - addr.replace( QRegExp("^.*://"), proto + "://"); + if( addr.contains( "://")) + { + if( idx_proto != UDPM_PROTO ) + addr.replace( QRegExp("^.*://@*"), proto + "://"); + else + addr.replace( QRegExp("^.*://"), proto + "://@"); ui.addressText->setText( addr ); } updateMRL(); @@ -455,36 +464,41 @@ void NetOpenPanel::updateMRL() { QString mrl = ""; QString addr = ui.addressText->text(); addr = QUrl::toPercentEncoding( addr, ":/?#@!$&'()*+,;=" ); - int proto = ui.protocolCombo->currentIndex(); + int idx_proto = ui.protocolCombo->currentIndex(); - if( addr.contains( "://") && ( proto != 5 || proto != 6 ) ) + if( addr.contains( "://")) { - mrl = addr; + /* Match the correct item in the comboBox */ + ui.protocolCombo->setCurrentIndex( + ui.protocolCombo->findData( addr.section( ':', 0, 0 ) ) ); + + if( idx_proto != UDP_PROTO || idx_proto != UDPM_PROTO ) + mrl = addr; } else { - switch( proto ) { - case 0: + switch( idx_proto ) { + case HTTP_PROTO: mrl = "http://" + addr; emit methodChanged("http-caching"); break; - case 1: + case HTTPS_PROTO: mrl = "https://" + addr; emit methodChanged("http-caching"); break; - case 3: + case MMS_PROTO: mrl = "mms://" + addr; emit methodChanged("mms-caching"); break; - case 2: + case FTP_PROTO: mrl = "ftp://" + addr; emit methodChanged("ftp-caching"); break; - case 4: /* RTSP */ + case RTSP_PROTO: mrl = "rtsp://" + addr; emit methodChanged("rtsp-caching"); break; - case 5: + case UDP_PROTO: mrl = "udp://@"; if( ui.ipv6->isEnabled() && ui.ipv6->isChecked() ) { @@ -493,7 +507,7 @@ void NetOpenPanel::updateMRL() { mrl += QString(":%1").arg( ui.portSpin->value() ); emit methodChanged("udp-caching"); break; - case 6: /* UDP multicast */ + case UDPM_PROTO: /* UDP multicast */ mrl = "udp://@"; /* Add [] to IPv6 */ if ( addr.contains(':') && !addr.contains('[') ) @@ -503,6 +517,11 @@ void NetOpenPanel::updateMRL() { else mrl += addr; mrl += QString(":%1").arg( ui.portSpin->value() ); emit methodChanged("udp-caching"); + case RTMP_PROTO: + mrl = "rtmp://" + addr; + emit methodChanged("rtmp-caching"); + break; + } } @@ -907,10 +926,10 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : screenDevLayout->addWidget( screenLabel, 0, 0 ); /* General connects */ - connect( ui.deviceCombo, SIGNAL( activated( int ) ), - stackedDevLayout, SLOT( setCurrentIndex( int ) ) ); - connect( ui.deviceCombo, SIGNAL( activated( int ) ), - stackedPropLayout, SLOT( setCurrentIndex( int ) ) ); + CONNECT( ui.deviceCombo, activated( int ) , + stackedDevLayout, setCurrentIndex( int ) ); + CONNECT( ui.deviceCombo, activated( int ), + stackedPropLayout, setCurrentIndex( int ) ); CONNECT( ui.deviceCombo, activated( int ), this, updateMRL() ); CONNECT( ui.deviceCombo, activated( int ), this, updateButtons() ); @@ -1114,7 +1133,7 @@ void CaptureOpenPanel::advancedDialog() advButtonBox->addButton( closeButton, QDialogButtonBox::AcceptRole ); advButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole ); - gLayout->addWidget( advButtonBox, i_confsize + 1, 0, 1, -1 ); + mainLayout->addWidget( advButtonBox ); /* Creation of the MRL */ if( adv->exec() ) diff --git a/modules/gui/qt4/components/open_panels.hpp b/modules/gui/qt4/components/open_panels.hpp index d21a6429c1..e8348ca62f 100644 --- a/modules/gui/qt4/components/open_panels.hpp +++ b/modules/gui/qt4/components/open_panels.hpp @@ -48,6 +48,20 @@ #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \ spinbox->setAccelerated( true ); } +enum +{ + NO_PROTO, + HTTP_PROTO, + HTTPS_PROTO, + MMS_PROTO, + FTP_PROTO, + RTSP_PROTO, + UDP_PROTO, + UDPM_PROTO, + RTMP_PROTO +}; + + enum { V4L_DEVICE, diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp index df020a4a94..24b28208ce 100644 --- a/modules/gui/qt4/dialogs/help.cpp +++ b/modules/gui/qt4/dialogs/help.cpp @@ -292,6 +292,9 @@ void UpdateDialog::updateNotify( bool b_result ) updateButton->setText( "Download" ); updateLabel->setText( qtr( "There is a new version of VLC :\n" ) + qfu( p_release->psz_desc ) ); + + /* Force the dialog to be shown */ + this->show(); } else updateLabel->setText( qtr( "You have the latest version of VLC" ) ); diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index 6a5fec61cc..d21cca070c 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -436,12 +436,7 @@ void MainInterface::handleMainUi( QSettings *settings ) if( videoEmbeddedFlag ) { videoWidget = new VideoWidget( p_intf ); - mainLayout->insertWidget( 0, videoWidget ); - - var_Create( p_intf, "window_widget", VLC_VAR_ADDRESS ); - vlc_value_t val; - val.p_address = this; - var_Set( p_intf, "window_widget", val ); + mainLayout->insertWidget( 0, videoWidget, 10 ); } /* Finish the sizing */ @@ -659,8 +654,6 @@ private: * Thou shall not call/resize/hide widgets from on another thread. * This is wrong, and this is TEH reason to emit signals on those Video Functions **/ -/* function called from ::DoRequest in order to show a nice VideoWidget - at the good size */ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, int *pi_y, unsigned int *pi_width, unsigned int *pi_height ) @@ -692,7 +685,7 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, #endif videoIsActive = true; - emit askVideoToResize( *pi_width, *pi_height ); +// emit askVideoToResize( *pi_width, *pi_height ); emit askUpdate(); fullscreenControls->regFullscreenCallback( p_nvout ); @@ -700,8 +693,6 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, return ret; } -/* function called from ::DoRequest in order to show a nice VideoWidget - at the good size */ void MainInterface::requestNotEmbeddedVideo( vout_thread_t *p_nvout ) { fullscreenControls->regFullscreenCallback( p_nvout ); diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp index f4db67a285..d07002487c 100644 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -29,6 +29,10 @@ #include #include #include +#include +#include +#include +#include #include "qt4.hpp" #include "dialogs_provider.hpp" @@ -91,7 +95,7 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); #define OPACITY_TEXT N_( "Windows opacity between 0.1 and 1." ) #define OPACITY_LONGTEXT N_( "Sets the windows opacity between 0.1 and 1 " \ - "for main interface, playlist and extended panel." \ + "for main interface, playlist and extended panel."\ " This option only works with Windows and " \ "X11 with composite extensions." ) @@ -228,6 +232,7 @@ static int Open( vlc_object_t *p_this ) XCloseDisplay( p_display ); #endif + /* Allocations */ p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) ); if( !p_intf->p_sys ) return VLC_ENOMEM; @@ -235,9 +240,12 @@ static int Open( vlc_object_t *p_this ) p_intf->pf_run = Run; + /* Access to the playlist */ p_intf->p_sys->p_playlist = pl_Yield( p_intf ); + /* Listen to the messages */ p_intf->p_sys->p_sub = msg_Subscribe( p_intf ); + var_Create( p_this, "window_widget", VLC_VAR_ADDRESS ); return VLC_SUCCESS; } @@ -288,8 +296,12 @@ static void Run( intf_thread_t *p_intf ) Init( p_intf ); } +static QMutex windowLock; +static QWaitCondition windowWait; + static void Init( intf_thread_t *p_intf ) { + vlc_value_t val; char dummy[] = ""; char *argv[] = { dummy }; int argc = 1; @@ -309,23 +321,33 @@ static void Init( intf_thread_t *p_intf ) /* Start the QApplication here */ QApplication *app = new QApplication( argc, argv , true ); + p_intf->p_sys->p_app = app; + + /* Icon setting + FIXME: use a bigger icon ? */ if( QDate::currentDate().dayOfYear() >= 354 ) app->setWindowIcon( QIcon( QPixmap(vlc_christmas_xpm) ) ); else app->setWindowIcon( QIcon( QPixmap(vlc_xpm) ) ); - p_intf->p_sys->p_app = app; - // Initialize timers and the Dialog Provider + /* Initialize timers and the Dialog Provider */ DialogsProvider::getInstance( p_intf ); - // Create the normal interface + QPointer *miP = NULL; + + /* Create the normal interface in non-DP mode */ if( !p_intf->pf_show_dialog ) { - MainInterface *p_mi = new MainInterface( p_intf ); - p_intf->p_sys->p_mi = p_mi; + p_intf->p_sys->p_mi = new MainInterface( p_intf ); /* We don't show it because it is done in the MainInterface constructor p_mi->show(); */ p_intf->p_sys->b_isDialogProvider = false; + + miP = new QPointer (p_intf->p_sys->p_mi); + val.p_address = miP; + QMutexLocker locker (&windowLock); + var_Set (p_intf, "window_widget", val); + windowWait.wakeAll (); } else { @@ -333,6 +355,8 @@ static void Init( intf_thread_t *p_intf ) p_intf->p_sys->b_isDialogProvider = true; } + /* Explain to the core how to show a dialog :D */ + p_intf->pf_show_dialog = ShowDialog; #ifdef ENABLE_NLS // Translation - get locale @@ -353,16 +377,13 @@ static void Init( intf_thread_t *p_intf ) app->installTranslator( &qtTranslator ); #endif //ENABLE_NLS - /* Explain to the core how to show a dialog :D */ - p_intf->pf_show_dialog = ShowDialog; - /* Last settings */ app->setQuitOnLastWindowClosed( false ); - /* retrieve last known path used in file browsing */ + /* Retrieve last known path used in file browsing */ char *psz_path = config_GetPsz( p_intf, "qt-filedialog-path" ); p_intf->p_sys->psz_filepath = EMPTY_STR( psz_path ) ? psz_path - : config_GetHomeDir(); + : config_GetHomeDir(); #ifdef UPDATE_CHECK /* Checking for VLC updates */ @@ -385,6 +406,14 @@ static void Init( intf_thread_t *p_intf ) /* And quit */ + if (miP) + { + QMutexLocker locker (&windowLock); + val.p_address = NULL; + var_Set (p_intf, "window_widget", val); + delete miP; + } + /* Destroy first the main interface because it is connected to some slots in the MainInputManager */ delete p_intf->p_sys->p_mi; @@ -396,8 +425,10 @@ static void Init( intf_thread_t *p_intf ) /* Destroy the MainInputManager */ MainInputManager::killInstance(); + /* Delete the application */ delete app; + /* Save the path */ config_PutPsz( p_intf, "qt-filedialog-path", p_intf->p_sys->psz_filepath ); free( psz_path ); } @@ -436,53 +467,65 @@ static int OpenWindow (vlc_object_t *obj) { vout_window_t *wnd = (vout_window_t *)obj; - /* TODO: should probably be in the libvlc core instead: */ - if (!config_GetInt (obj, "embedded-video")) - return VLC_EGENERIC; - intf_thread_t *intf = (intf_thread_t *) vlc_object_find_name (obj, "qt4", FIND_ANYWHERE); if (intf == NULL) return VLC_EGENERIC; /* Qt4 not in use */ assert (intf->i_object_type == VLC_OBJECT_INTF); - var_Create (intf, "window_mutex", VLC_VAR_MUTEX); var_Create (intf, "window_widget", VLC_VAR_ADDRESS); - vlc_value_t lockval, ptrval; - var_Get (intf, "window_mutex", &lockval); + vlc_value_t ptrval; - vlc_mutex_lock ((vlc_mutex_t *)lockval.p_address); + windowLock.lock (); msg_Dbg (obj, "waiting for interface..."); - do + for (;;) { var_Get (intf, "window_widget", &ptrval); - /* FIXME A condition variable would be way more appropriate. */ - msleep (INTF_IDLE_SLEEP); - } while (ptrval.p_address == NULL); + if (ptrval.p_address != NULL) + break; + windowWait.wait (&windowLock); + } - msg_Dbg (obj, "requestiong window..."); - MainInterface *mi = (MainInterface *)ptrval.p_address; + msg_Dbg (obj, "requesting window..."); + QPointer *miP = (QPointer *)ptrval.p_address; + miP = new QPointer (*miP); /* create our own copy */ + vlc_object_release (intf); - wnd->handle = mi->requestVideo (wnd->vout, &wnd->pos_x, &wnd->pos_y, - &wnd->width, &wnd->height); - vlc_mutex_unlock ((vlc_mutex_t *)lockval.p_address); + if (miP->isNull ()) + return VLC_EGENERIC; + + if (config_GetInt (obj, "embedded-video") <= 0) + { + (*miP)->requestNotEmbeddedVideo (wnd->vout); + return VLC_EGENERIC; + } + + wnd->handle = (*miP)->requestVideo (wnd->vout, &wnd->pos_x, &wnd->pos_y, + &wnd->width, &wnd->height); + windowLock.unlock (); wnd->control = ControlWindow; - wnd->p_private = intf; + wnd->p_private = miP; return VLC_SUCCESS; } static int ControlWindow (vout_window_t *wnd, int query, va_list args) { - intf_thread_t *intf = (intf_thread_t *)wnd->p_private; - intf->p_sys->p_mi->controlVideo (wnd->handle, query, args); + QPointer *miP = (QPointer *)wnd->p_private; + QMutexLocker locker (&windowLock); + + if (miP->isNull ()) + return VLC_EGENERIC; + return (*miP)->controlVideo (wnd->handle, query, args); } static void CloseWindow (vlc_object_t *obj) { vout_window_t *wnd = (vout_window_t *)obj; - intf_thread_t *intf = (intf_thread_t *)obj->p_private; + QPointer *miP = (QPointer *)wnd->p_private; + QMutexLocker locker (&windowLock); - intf->p_sys->p_mi->releaseVideo (wnd->handle); - vlc_object_release (intf); + if (!miP->isNull ()) + (*miP)->releaseVideo (wnd->handle); + delete miP; } diff --git a/modules/gui/qt4/ui/open_capture.ui b/modules/gui/qt4/ui/open_capture.ui index 5f9e0712a2..94af00bbeb 100644 --- a/modules/gui/qt4/ui/open_capture.ui +++ b/modules/gui/qt4/ui/open_capture.ui @@ -7,7 +7,7 @@ 0 0 358 - 163 + 177 @@ -52,16 +52,6 @@ - - - - _("Access advanced options to tweak the device") - - - _("Advanced options...") - - - @@ -70,7 +60,7 @@ QSizePolicy::MinimumExpanding - + 20 30 @@ -78,6 +68,16 @@ + + + + _("Access advanced options to tweak the device") + + + _("Advanced options...") + + + diff --git a/modules/gui/qt4/ui/open_net.ui b/modules/gui/qt4/ui/open_net.ui index 40cecc5b0f..424d89d6ca 100644 --- a/modules/gui/qt4/ui/open_net.ui +++ b/modules/gui/qt4/ui/open_net.ui @@ -79,7 +79,8 @@ - _("Enter the URL of the network stream here,\nwith or without the protocol.") + _("Enter the URL of the network stream here, +with or without the protocol.") diff --git a/modules/video_filter/rss.c b/modules/video_filter/rss.c index 28e0713d67..cd75d9280c 100644 --- a/modules/video_filter/rss.c +++ b/modules/video_filter/rss.c @@ -291,7 +291,7 @@ static int CreateFilter( vlc_object_t *p_this ) if( p_sys->b_images == true && p_sys->p_style->i_font_size == -1 ) { - msg_Warn( p_filter, "rrs-size wasn't specified. Feed images will thus be displayed without being resized" ); + msg_Warn( p_filter, "rss-size wasn't specified. Feed images will thus be displayed without being resized" ); } if( FetchRSS( p_filter ) ) diff --git a/src/input/stream.c b/src/input/stream.c index 8c669d0dde..567c11593e 100644 --- a/src/input/stream.c +++ b/src/input/stream.c @@ -535,7 +535,6 @@ static void UStreamDestroy( stream_t *s ) { access_t *p_access = (access_t *)s->p_parent; AStreamDestroy( s ); - vlc_object_release( p_access ); access_Delete( p_access ); } diff --git a/src/libvlc-module.c b/src/libvlc-module.c index 3eaacbd07c..3f5f458135 100644 --- a/src/libvlc-module.c +++ b/src/libvlc-module.c @@ -1477,13 +1477,8 @@ vlc_module_begin(); add_bool( "fullscreen", 0, NULL, FULLSCREEN_TEXT, FULLSCREEN_LONGTEXT, false ); change_short('f'); -#ifndef __APPLE__ - add_bool( "embedded-video", false, NULL, EMBEDDED_TEXT, EMBEDDED_LONGTEXT, - true ); -#else - add_bool( "embedded-video", true, NULL, EMBEDDED_TEXT, EMBEDDED_LONGTEXT, + add_bool( "embedded-video", 1, NULL, EMBEDDED_TEXT, EMBEDDED_LONGTEXT, true ); -#endif #ifdef __APPLE__ add_deprecated_alias( "macosx-embedded" ); /*deprecated since 0.9.0 */ #endif diff --git a/src/misc/update.c b/src/misc/update.c index 6d25a22aa1..51d6ecb0f8 100644 --- a/src/misc/update.c +++ b/src/misc/update.c @@ -1049,6 +1049,9 @@ update_t *__update_New( vlc_object_t *p_this ) p_update->release.psz_url = NULL; p_update->release.psz_desc = NULL; + p_update->p_download = NULL; + p_update->p_check = NULL; + p_update->p_pkey = NULL; vlc_gcrypt_init(); @@ -1065,6 +1068,21 @@ void update_Delete( update_t *p_update ) { assert( p_update ); + vlc_mutex_lock( &p_update->lock ); + + if( p_update->p_check ) + { + assert( !p_update->p_download ); + vlc_object_kill( p_update->p_check ); + vlc_thread_join( p_update->p_check ); + } + else if( p_update->p_download ) + { + vlc_object_kill( p_update->p_download ); + vlc_thread_join( p_update->p_download ); + } + + vlc_mutex_unlock( &p_update->lock ); vlc_mutex_destroy( &p_update->lock ); free( p_update->release.psz_url ); @@ -1336,19 +1354,7 @@ error: return false; } - -/** - * Struct to launch the check in an other thread - */ -typedef struct -{ - VLC_COMMON_MEMBERS - update_t *p_update; - void (*pf_callback)( void *, bool ); - void *p_data; -} update_check_thread_t; - -void update_CheckReal( update_check_thread_t *p_uct ); +static void update_CheckReal( update_check_thread_t *p_uct ); /** * Check for updates @@ -1367,6 +1373,7 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void if( !p_uct ) return; p_uct->p_update = p_update; + p_update->p_check = p_uct; p_uct->pf_callback = pf_callback; p_uct->p_data = p_data; @@ -1385,6 +1392,10 @@ void update_CheckReal( update_check_thread_t *p_uct ) if( p_uct->pf_callback ) (p_uct->pf_callback)( p_uct->p_data, b_ret ); + + p_uct->p_update->p_check = NULL; + + vlc_object_release( p_uct ); } /** @@ -1425,18 +1436,7 @@ static char *size_str( long int l_size ) return i_retval == -1 ? NULL : psz_tmp; } - -/** - * Struct to launch the download in a thread - */ -typedef struct -{ - VLC_COMMON_MEMBERS - update_t *p_update; - char *psz_destdir; -} update_download_thread_t; - -void update_DownloadReal( update_download_thread_t *p_udt ); +static void update_DownloadReal( update_download_thread_t *p_udt ); /** * Download the file given in the update_t @@ -1455,13 +1455,14 @@ void update_Download( update_t *p_update, const char *psz_destdir ) return; p_udt->p_update = p_update; + p_update->p_download = p_udt; p_udt->psz_destdir = psz_destdir ? strdup( psz_destdir ) : NULL; vlc_thread_create( p_udt, "download update", update_DownloadReal, VLC_THREAD_PRIORITY_LOW, false ); } -void update_DownloadReal( update_download_thread_t *p_udt ) +static void update_DownloadReal( update_download_thread_t *p_udt ) { int i_progress = 0; long int l_size; @@ -1523,9 +1524,12 @@ void update_DownloadReal( update_download_thread_t *p_udt ) free( psz_status ); } - while( ( i_read = stream_Read( p_stream, p_buffer, 1 << 10 ) ) && - !intf_ProgressIsCancelled( p_udt, i_progress ) ) + vlc_object_lock( p_udt ); + while( vlc_object_alive( p_udt ) && + ( i_read = stream_Read( p_stream, p_buffer, 1 << 10 ) ) && + !intf_ProgressIsCancelled( p_udt, i_progress ) ) { + vlc_object_unlock( p_udt ); if( fwrite( p_buffer, i_read, 1, p_file ) < 1 ) { msg_Err( p_udt, "Failed to write into %s", psz_destfile ); @@ -1544,14 +1548,17 @@ void update_DownloadReal( update_download_thread_t *p_udt ) free( psz_status ); } free( psz_downloaded ); + vlc_object_lock( p_udt ); } /* Finish the progress bar or delete the file if the user had canceled */ fclose( p_file ); p_file = NULL; - if( !intf_ProgressIsCancelled( p_udt, i_progress ) ) + if( vlc_object_alive( p_udt ) && + !intf_ProgressIsCancelled( p_udt, i_progress ) ) { + vlc_object_unlock( p_udt ); if( asprintf( &psz_status, "%s\nDone %s (100.0%%)", p_update->release.psz_url, psz_size ) != -1 ) { @@ -1561,6 +1568,7 @@ void update_DownloadReal( update_download_thread_t *p_udt ) } else { + vlc_object_unlock( p_udt ); utf8_unlink( psz_destfile ); goto end; } @@ -1652,6 +1660,10 @@ end: free( psz_destfile ); free( p_buffer ); free( psz_size ); + + p_udt->p_update->p_download = NULL; + + vlc_object_release( p_udt ); } update_release_t *update_GetRelease( update_t *p_update ) diff --git a/src/misc/update.h b/src/misc/update.h index b0ebf458ba..c092cf5e54 100644 --- a/src/misc/update.h +++ b/src/misc/update.h @@ -142,6 +142,26 @@ struct public_key_t typedef struct public_key_t public_key_t; +/** + * Non blocking binary download + */ +typedef struct +{ + VLC_COMMON_MEMBERS + update_t *p_update; + char *psz_destdir; +} update_download_thread_t; + +/** + * Non blocking update availability verification + */ +typedef struct +{ + VLC_COMMON_MEMBERS + update_t *p_update; + void (*pf_callback)( void *, bool ); + void *p_data; +} update_check_thread_t; /** * The update object. Stores (and caches) all information relative to updates */ @@ -151,5 +171,7 @@ struct update_t vlc_mutex_t lock; struct update_release_t release; ///< Release (version) public_key_t *p_pkey; + update_download_thread_t *p_download; + update_check_thread_t *p_check; };