Commit 7c8b9f86 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Remove qnx modules.

Unmaintained and no maintainer showed up
parent f5aed5af
......@@ -99,7 +99,7 @@ Removed modules:
* gtk_main, gtk_main2, gnome_main, gnome_main2 and pda interfaces
* linear_resampler and trivial_resampler are removed. Use the ugly one.
* XvMC accelerated modules
* WinCE interface
* WinCE and qnx interfaces
* opie, qte and qte_main
* opengllayer
* cddax. Use cdda instead
......
......@@ -2639,7 +2639,7 @@ if test "${enable_screen}" != "no"; then
fi
dnl
dnl ipv6 plugin - not for QNX yet
dnl ipv6 plugin
dnl
have_ipv6=no
AC_CHECK_FUNCS(inet_pton,[have_ipv6=yes],[
......@@ -4396,19 +4396,6 @@ AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
(test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
dnl
dnl QNX RTOS module
dnl
AC_ARG_ENABLE(qnx,
[ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
if test "${enable_qnx}" != "no"
then
AC_CHECK_HEADERS(Ph.h, [
VLC_ADD_PLUGIN([qnx])
VLC_ADD_LIBS([qnx],[-lasound -lph])
])
fi
dnl
dnl ncurses module
dnl
......@@ -5168,7 +5155,6 @@ AC_CONFIG_FILES([
modules/gui/hildon/Makefile
modules/gui/minimal_macosx/Makefile
modules/gui/macosx_dialog_provider/Makefile
modules/gui/qnx/Makefile
modules/gui/qt4/Makefile
modules/gui/skins2/Makefile
modules/meta_engine/Makefile
......
......@@ -258,7 +258,6 @@ $Id$
* puzzle: puzzle video filter
* pva: PVA demuxer
* pvr: input module to read from a PVR card
* qnx: QNX RTOS plugin
* qt4: interface module using the cross-platform Qt4 library
* qtcapture: Quicktime Capture
* quartztext: Text renderer using native Mac OS X API
......
DIST_SUBDIRS = beos macosx hildon minimal_macosx qnx qt4 skins2 macosx_dialog_provider
DIST_SUBDIRS = beos macosx hildon minimal_macosx qt4 skins2 macosx_dialog_provider
SUBDIRS =
if HAVE_BEOS
......@@ -10,7 +10,6 @@ endif
if BUILD_HILDON
SUBDIRS += hildon
endif
SUBDIRS += qnx
if ENABLE_QT4
SUBDIRS += qt4
endif
......
SOURCES_qnx = \
qnx.c \
aout.c \
vout.c
/*****************************************************************************
* aout.c : QNX audio output
*****************************************************************************
* Copyright (C) 2000, 2001 the VideoLAN team
*
* Authors: Henri Fallon <henri@videolan.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Pascal Levesque <pascal.levesque@mindready.com>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_aout.h>
#include <sys/asoundlib.h>
struct aout_sys_t
{
snd_pcm_t * p_pcm_handle;
int i_card;
int i_device;
uint8_t * p_silent_buffer;
};
#define DEFAULT_FRAME_SIZE 2048
/*****************************************************************************
* Local prototypes
*****************************************************************************/
int OpenAudio ( vlc_object_t *p_this );
void CloseAudio ( vlc_object_t *p_this );
static int GetBufInfo ( aout_instance_t * );
static void Play ( aout_instance_t * );
static void* QNXaoutThread ( vlc_object_t * );
/*****************************************************************************
* Open : creates a handle and opens an alsa device
*****************************************************************************
* This function opens an alsa device, through the alsa API
*****************************************************************************/
int OpenAudio( vlc_object_t *p_this )
{
aout_instance_t *p_aout = (aout_instance_t *)p_this;
int i_ret;
int i_bytes_per_sample;
int i_nb_channels;
snd_pcm_channel_info_t pi;
snd_pcm_channel_params_t pp;
aout_instance_t *p_aout = (aout_instance_t *)p_this;
/* allocate structure */
p_aout->output.p_sys = malloc( sizeof( aout_sys_t ) );
if( p_aout->output.p_sys == NULL )
return -1;
/* open audio device */
if( ( i_ret = snd_pcm_open_preferred( &p_aout->output.p_sys->p_pcm_handle,
&p_aout->output.p_sys->i_card,
&p_aout->output.p_sys->i_device,
SND_PCM_OPEN_PLAYBACK ) ) < 0 )
{
msg_Err( p_aout, "unable to open audio device (%s)",
snd_strerror( i_ret ) );
free( p_aout->output.p_sys );
return -1;
}
/* disable mmap */
if( ( i_ret = snd_pcm_plugin_set_disable( p_aout->output.p_sys->p_pcm_handle,
PLUGIN_DISABLE_MMAP ) ) < 0 )
{
msg_Err( p_aout, "unable to disable mmap (%s)", snd_strerror(i_ret) );
CloseAudio( p_this );
free( p_aout->output.p_sys );
return -1;
}
p_aout->output.p_sys->p_silent_buffer = malloc( DEFAULT_FRAME_SIZE * 4 );
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
memset( &pi, 0, sizeof(pi) );
memset( &pp, 0, sizeof(pp) );
pi.channel = SND_PCM_CHANNEL_PLAYBACK;
if( ( i_ret = snd_pcm_plugin_info( p_aout->output.p_sys->p_pcm_handle,
&pi ) ) < 0 )
{
msg_Err( p_aout, "unable to get plugin info (%s)",
snd_strerror( i_ret ) );
CloseAudio( p_this );
free( p_aout->output.p_sys );
return -1;
}
pp.mode = SND_PCM_MODE_BLOCK;
pp.channel = SND_PCM_CHANNEL_PLAYBACK;
pp.start_mode = SND_PCM_START_FULL;
pp.stop_mode = SND_PCM_STOP_STOP;
pp.buf.block.frags_max = 3;
pp.buf.block.frags_min = 1;
pp.format.interleave = 1;
pp.format.rate = p_aout->output.output.i_rate;
i_nb_channels = aout_FormatNbChannels( &p_aout->output.output );
if ( i_nb_channels > 2 )
{
/* I don't know if QNX supports more than two channels. */
i_nb_channels = 2;
p_aout->output.output.i_channels = AOUT_CHAN_STEREO;
}
pp.format.voices = i_nb_channels;
p_aout->output.output.i_format = VLC_CODEC_S16N;
p_aout->output.i_nb_samples = DEFAULT_FRAME_SIZE;
pp.format.format = SND_PCM_SFMT_S16;
i_bytes_per_sample = 2;
pp.buf.block.frag_size = p_aout->output.i_nb_samples *
p_aout->output.output.i_channels *
i_bytes_per_sample;
/* set parameters */
if( ( i_ret = snd_pcm_plugin_params( p_aout->output.p_sys->p_pcm_handle,
&pp ) ) < 0 )
{
msg_Err( p_aout, "unable to set parameters (%s)", snd_strerror(i_ret) );
CloseAudio( p_this );
free( p_aout->output.p_sys );
return -1;
}
/* prepare channel */
if( ( i_ret = snd_pcm_plugin_prepare( p_aout->output.p_sys->p_pcm_handle,
SND_PCM_CHANNEL_PLAYBACK ) ) < 0 )
{
msg_Err( p_aout, "unable to prepare channel (%s)",
snd_strerror( i_ret ) );
CloseAudio( p_this );
free( p_aout->output.p_sys );
return -1;
}
/* Create audio thread and wait for its readiness. */
if( vlc_thread_create( p_aout, "aout", QNXaoutThread,
VLC_THREAD_PRIORITY_OUTPUT ) )
{
msg_Err( p_aout, "cannot create QNX audio thread (%m)" );
CloseAudio( p_this );
free( p_aout->output.p_sys );
return -1;
}
return( 0 );
}
/*****************************************************************************
* GetBufInfo: buffer status query
*****************************************************************************
* This function returns the number of used byte in the queue.
* It also deals with errors : indeed if the device comes to run out
* of data to play, it switches to the "underrun" status. It has to
* be flushed and re-prepared
*****************************************************************************/
static int GetBufInfo( aout_instance_t *p_aout )
{
int i_ret;
snd_pcm_channel_status_t status;
/* get current pcm status */
memset( &status, 0, sizeof(status) );
if( ( i_ret = snd_pcm_plugin_status( p_aout->output.p_sys->p_pcm_handle,
&status ) ) < 0 )
{
msg_Err( p_aout, "unable to get device status (%s)",
snd_strerror( i_ret ) );
return( -1 );
}
/* check for underrun */
switch( status.status )
{
case SND_PCM_STATUS_READY:
case SND_PCM_STATUS_UNDERRUN:
if( ( i_ret = snd_pcm_plugin_prepare( p_aout->output.p_sys->p_pcm_handle,
SND_PCM_CHANNEL_PLAYBACK ) ) < 0 )
{
msg_Err( p_aout, "unable to prepare channel (%s)",
snd_strerror( i_ret ) );
}
break;
}
return( status.count );
}
/*****************************************************************************
* Play : plays a sample
*****************************************************************************
* Plays a sample using the snd_pcm_write function from the alsa API
*****************************************************************************/
static void Play( aout_instance_t *p_aout )
{
}
/*****************************************************************************
* CloseAudio: close the audio device
*****************************************************************************/
void CloseAudio ( vlc_object_t *p_this )
{
aout_instance_t *p_aout = (aout_instance_t *)p_this;
int i_ret;
vlc_object_kill( p_aout );
vlc_thread_join( p_aout );
if( ( i_ret = snd_pcm_close( p_aout->output.p_sys->p_pcm_handle ) ) < 0 )
{
msg_Err( p_aout, "unable to close audio device (%s)",
snd_strerror( i_ret ) );
}
free( p_aout->output.p_sys->p_silent_buffer );
free( p_aout->output.p_sys );
}
/*****************************************************************************
* QNXaoutThread: asynchronous thread used to DMA the data to the device
*****************************************************************************/
static void* QNXaoutThread( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t*)p_this;
struct aout_sys_t * p_sys = p_aout->output.p_sys;
int canc = vlc_savecancel ();
while ( vlc_object_alive (p_aout) )
{
aout_buffer_t * p_buffer;
int i_tmp, i_size;
uint8_t * p_bytes;
if ( p_aout->output.output.i_format != VLC_CODEC_SPDIFL )
{
mtime_t next_date = 0;
/* Get the presentation date of the next write() operation. It
* is equal to the current date + duration of buffered samples.
* Order is important here, since GetBufInfo is believed to take
* more time than mdate(). */
next_date = (mtime_t)GetBufInfo( p_aout ) * 1000000
/ p_aout->output.output.i_bytes_per_frame
/ p_aout->output.output.i_rate
* p_aout->output.output.i_frame_length;
next_date += mdate();
p_buffer = aout_OutputNextBuffer( p_aout, next_date, false );
}
else
{
p_buffer = aout_OutputNextBuffer( p_aout, 0, true );
}
if ( p_buffer != NULL )
{
p_bytes = p_buffer->p_buffer;
i_size = p_buffer->i_buffer;
}
else
{
i_size = DEFAULT_FRAME_SIZE / p_aout->output.output.i_frame_length
* p_aout->output.output.i_bytes_per_frame;
p_bytes = p_aout->output.p_sys->p_silent_buffer;
memset( p_bytes, 0, i_size );
}
i_tmp = snd_pcm_plugin_write( p_aout->output.p_sys->p_pcm_handle,
(void *) p_bytes,
(size_t) i_size );
if( i_tmp < 0 )
{
msg_Err( p_aout, "write failed (%m)" );
}
if ( p_buffer != NULL )
{
aout_BufferFree( p_buffer );
}
}
vlc_restorecancel (canc);
return NULL;
}
/*****************************************************************************
* qnx.c : QNX RTOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 the VideoLAN team
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
/*****************************************************************************
* External prototypes
******************************************************************************/
int OpenAudio ( vlc_object_t * );
void CloseAudio ( vlc_object_t * );
int OpenVideo ( vlc_object_t * );
void CloseVideo ( vlc_object_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin ()
set_description( N_("QNX RTOS video and audio output") )
set_capability( "video output", 100 )
set_callbacks( OpenVideo, CloseVideo )
set_category( CAT_INTERFACE )
set_subcategory( SUBCAT_INTERFACE_MAIN )
add_submodule ()
set_capability( "audio output", 100 )
set_callbacks( OpenAudio, CloseAudio )
vlc_module_end ()
/*****************************************************************************
* vout.c: QNX RTOS video output display method
*****************************************************************************
* Copyright (C) 2001, 2002 the VideoLAN team
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Pascal Levesque <Pascal.Levesque@mindready.com>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
#include <photon/PtWidget.h>
#include <photon/PtWindow.h>
#include <photon/PtLabel.h>
#include <photon/PdDirect.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_interface.h>
#include <vlc_vout.h>
#include <vlc_memory.h>
/*****************************************************************************
* vout_sys_t: video output QNX method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the QNX specific properties of an output thread. QNX video
* output is performed through regular resizable windows. Windows can be
* dynamically resized to adapt to the size of the streams.
*****************************************************************************/
#define MAX_DIRECTBUFFERS 2
#define MODE_NORMAL_MEM 0
#define MODE_SHARED_MEM 1
#define MODE_VIDEO_MEM 2
#define MODE_VIDEO_OVERLAY 3
struct vout_sys_t
{
/* video mode */
int i_mode;
/* internal stuff */
PtWidget_t * p_window;
/* Color palette for 8bpp */
PgColor_t p_colors[255];
/* [shared] memory blit */
int i_img_type;
/* video memory blit */
/* video overlay */
PgVideoChannel_t * p_channel;
int i_vc_flags;
int i_vc_format;
int i_screen_depth;
int i_bytes_per_pixel;
int i_bytes_per_line;
/* position & dimensions */
PhPoint_t pos;
PhDim_t dim;
PhPoint_t old_pos;
PhDim_t old_dim;
PhDim_t screen_dim;
PhRect_t frame;
};
/*****************************************************************************
* picture_sys_t: direct buffer method descriptor
*****************************************************************************
* This structure is part of the picture descriptor, it describes the
* XVideo specific properties of a direct buffer.
*****************************************************************************/
struct picture_sys_t
{
/* [shared] memory blit */
PhImage_t * p_image;
/* video memory blit and video overlay */
PdOffscreenContext_t * p_ctx[3]; /* 0: y, 1: u, 2: v */
char * p_buf[3];
};
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int QNXInit ( vout_thread_t * );
static void QNXEnd ( vout_thread_t * );
static int QNXManage ( vout_thread_t * );
static void QNXDisplay ( vout_thread_t *, picture_t * );
static int QNXInitDisplay ( vout_thread_t * );
static int QNXCreateWnd ( vout_thread_t * );
static int QNXDestroyWnd ( vout_thread_t * );
static int NewPicture ( vout_thread_t *, picture_t *, int );
static void FreePicture ( vout_thread_t *, picture_t * );
static int ResizeOverlayOutput ( vout_thread_t * );
static void SetPalette ( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * );
/*****************************************************************************
* OpenVideo: allocate QNX video thread output method
*****************************************************************************
* This function allocate and initialize a QNX vout method. It uses some of the
* vout properties to choose the window size, and change them according to the
* actual properties of the display.
*****************************************************************************/
int OpenVideo ( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
/* init connection to photon */
if( PtInit( "/dev/photon" ) != 0 )
{
msg_Err( p_vout, "unable to connect to photon" );
return( 1 );
}
/* allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return( 1 );
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
p_vout->b_fullscreen = config_GetInt( p_vout, "fullscreen" );
p_vout->p_sys->i_mode = config_GetInt( p_vout, "overlay" ) ?
MODE_VIDEO_OVERLAY : MODE_VIDEO_MEM;
p_vout->p_sys->dim.w = p_vout->i_window_width;
p_vout->p_sys->dim.h = p_vout->i_window_height;
/* init display and create window */
if( QNXInitDisplay( p_vout ) || QNXCreateWnd( p_vout ) )
{
free( p_vout->p_sys );
return( 1 );
}
p_vout->pf_init = QNXInit;
p_vout->pf_end = QNXEnd;
p_vout->pf_manage = QNXManage;
p_vout->pf_render = NULL;
p_vout->pf_display = QNXDisplay;
return( 0 );
}
/*****************************************************************************
* QNXInit: initialize QNX video thread output method
*****************************************************************************
* This function create the buffers needed by the output thread. It is called
* at the beginning of the thread, but also each time the window is resized.
*****************************************************************************/
static int QNXInit( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
I_OUTPUTPICTURES = 0;
switch( p_vout->p_sys->i_mode )
{
case MODE_NORMAL_MEM:
case MODE_SHARED_MEM:
p_vout->output.i_width = p_vout->p_sys->dim.w;
p_vout->output.i_height = p_vout->p_sys->dim.h;
/* Assume we have square pixels */
p_vout->output.i_aspect = p_vout->p_sys->dim.w
* VOUT_ASPECT_FACTOR / p_vout->p_sys->dim.h;
break;
case MODE_VIDEO_MEM:
p_vout->output.i_width = p_vout->p_sys->dim.w;
p_vout->output.i_height = p_vout->p_sys->dim.h;
/* Assume we have square pixels */
p_vout->output.i_aspect = p_vout->p_sys->dim.w
* VOUT_ASPECT_FACTOR / p_vout->p_sys->dim.h;