Commit af691d06 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

BeOS interface: remove

This has been broken for sure since 1.0, most probably nuch earlier.
parent e4347611
......@@ -380,7 +380,6 @@ case "${host_os}" in
CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar"; CXXFLAGS="${CXXFLAGS_save}"
VLC_ADD_CXXFLAGS([beos],[])
VLC_ADD_LIBS([vlc libvlccore logger],[-lbe])
VLC_ADD_LIBS([beos],[-lbe -lmedia -ltranslation -ltracker -lgame])
VLC_ADD_LIBS([dvdnav dvdread],[-ldl])
VLC_ADD_LIBS([filesystem],[-lpoll])
LDFLAGS_save="${LDFLAGS_save} -lintl"; LDFLAGS="${LDFLAGS_save}"
......@@ -390,11 +389,6 @@ case "${host_os}" in
else
VLC_ADD_LIBS([filesystem access_ftp access_mms access_output_udp oldtelnet netsync sap libvlccore growl_udp],[-lnet])
fi
dnl Ugly check for Zeta
if test -f /boot/beos/system/lib/libzeta.so; then
VLC_ADD_LIBS([beos],[-lzeta])
fi
;;
*)
SYS="${host_os}"
......@@ -4101,12 +4095,6 @@ dnl
AC_ARG_WITH(,[Interface plugins:])
dnl special case for BeOS
if test "${SYS}" = "beos"
then
VLC_ADD_PLUGIN([beos])
fi
dnl
dnl Skins2 module
dnl
......@@ -5039,7 +5027,6 @@ AC_CONFIG_FILES([
modules/demux/mpeg/Makefile
modules/demux/playlist/Makefile
modules/gui/Makefile
modules/gui/beos/Makefile
modules/gui/macosx/Makefile
modules/gui/hildon/Makefile
modules/gui/minimal_macosx/Makefile
......
......@@ -60,7 +60,6 @@ $Id$
* ball: Augmented reality ball video filter module
* bandlimited_resampler: Bandlimited interpolation audio resampler
* bda: DVB support for Windows BDA drivers
* beos: Audio output, video output and interface module for BeOS
* blend: a picture filter that blends two pictures
* blendbench: a picture filter that test performance of blending routines
* bluescreen: Bluescreen (weather channel like) video filter
......
DIST_SUBDIRS = beos macosx hildon minimal_macosx qt4 skins2 macosx_dialog_provider
DIST_SUBDIRS = macosx hildon minimal_macosx qt4 skins2 macosx_dialog_provider
SUBDIRS =
if HAVE_BEOS
SUBDIRS += beos
endif
if HAVE_DARWIN
SUBDIRS += macosx minimal_macosx macosx_dialog_provider
endif
......
/*****************************************************************************
* AudioOutput.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Eric Petit <titer@videolan.org>
*
* 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 <malloc.h>
#include <SoundPlayer.h>
#include <media/MediaDefs.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_aout.h>
extern "C"
{
#include <aout_internal.h>
}
/*****************************************************************************
* aout_sys_t: BeOS audio output method descriptor
*****************************************************************************/
typedef struct aout_sys_t
{
BSoundPlayer * p_player;
mtime_t latency;
} aout_sys_t;
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static void Play ( void * p_aout, void * p_buffer, size_t size,
const media_raw_audio_format & format );
static void DoNothing ( aout_instance_t * p_aout );
/*****************************************************************************
* OpenAudio
*****************************************************************************/
int OpenAudio ( vlc_object_t * p_this )
{
aout_instance_t * p_aout = (aout_instance_t*) p_this;
p_aout->output.p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
if( p_aout->output.p_sys == NULL )
return -1;
aout_sys_t * p_sys = p_aout->output.p_sys;
aout_VolumeSoftInit( p_aout );
int i_nb_channels = aout_FormatNbChannels( &p_aout->output.output );
/* BSoundPlayer does not support more than 2 channels AFAIK */
if( i_nb_channels > 2 )
{
i_nb_channels = 2;
p_aout->output.output.i_physical_channels
= AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
}
media_raw_audio_format * p_format;
p_format = (media_raw_audio_format*)
malloc( sizeof( media_raw_audio_format ) );
p_format->channel_count = i_nb_channels;
p_format->frame_rate = p_aout->output.output.i_rate;
p_format->format = media_raw_audio_format::B_AUDIO_FLOAT;
#ifdef WORDS_BIGENDIAN
p_format->byte_order = B_MEDIA_BIG_ENDIAN;
#else
p_format->byte_order = B_MEDIA_LITTLE_ENDIAN;
#endif
p_format->buffer_size = 8192;
p_aout->output.output.i_format = VLC_CODEC_FL32;
p_aout->output.i_nb_samples = 2048 / i_nb_channels;
p_aout->output.pf_play = DoNothing;
p_sys->p_player = new BSoundPlayer( p_format, "player", Play, NULL, p_aout );
if( p_sys->p_player->InitCheck() != B_OK )
{
msg_Err( p_aout, "BSoundPlayer InitCheck failed" );
delete p_sys->p_player;
free( p_sys );
return -1;
}
/* Start playing */
p_sys->latency = p_sys->p_player->Latency();
p_sys->p_player->Start();
p_sys->p_player->SetHasData( true );
return 0;
}
/*****************************************************************************
* CloseAudio
*****************************************************************************/
void CloseAudio ( vlc_object_t * p_this )
{
aout_instance_t * p_aout = (aout_instance_t *) p_this;
aout_sys_t * p_sys = (aout_sys_t *) p_aout->output.p_sys;
/* Clean up */
p_sys->p_player->Stop();
delete p_sys->p_player;
free( p_sys );
}
/*****************************************************************************
* Play
*****************************************************************************/
static void Play( void * _p_aout, void * _p_buffer, size_t i_size,
const media_raw_audio_format &format )
{
aout_instance_t * p_aout = (aout_instance_t*) _p_aout;
float * p_buffer = (float*) _p_buffer;
aout_sys_t * p_sys = (aout_sys_t*) p_aout->output.p_sys;
aout_buffer_t * p_aout_buffer;
p_aout_buffer = aout_OutputNextBuffer( p_aout,
mdate() + p_sys->latency,
false );
if( p_aout_buffer != NULL )
{
vlc_memcpy( p_buffer, p_aout_buffer->p_buffer,
MIN( i_size, p_aout_buffer->i_buffer ) );
if( p_aout_buffer->i_buffer < i_size )
{
vlc_memset( p_buffer + p_aout_buffer->i_buffer,
0, i_size - p_aout_buffer->i_buffer );
}
aout_BufferFree( p_aout_buffer );
}
else
{
vlc_memset( p_buffer, 0, i_size );
}
}
/*****************************************************************************
* DoNothing
*****************************************************************************/
static void DoNothing( aout_instance_t *p_aout )
{
return;
}
/*****************************************************************************
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Stephan Aßmus <stippi@yellowbites.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
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
/*****************************************************************************
* External prototypes
*****************************************************************************/
int OpenIntf ( vlc_object_t * );
void CloseIntf ( vlc_object_t * );
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_category( CAT_INTERFACE )
set_subcategory( SUBCAT_INTERFACE_MAIN )
add_bool( "beos-dvdmenus", false, NULL, _("Use DVD Menus"), "", true )
set_shortname( "BeOS" )
set_description( N_("BeOS standard API interface") )
set_capability( "interface", 100 )
set_callbacks( OpenIntf, CloseIntf )
add_submodule ()
set_capability( "video output", 100 )
set_callbacks( OpenVideo, CloseVideo )
add_submodule ()
set_capability( "audio output", 100 )
set_callbacks( OpenAudio, CloseAudio )
vlc_module_end ()
This diff is collapsed.
/*****************************************************************************
* DrawingTidbits.cpp
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* $Id$
*
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
* Stephan Aßmus <stippi@yellowbites.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.
*****************************************************************************/
#include <math.h>
#include <Bitmap.h>
#include <Debug.h>
#include <Screen.h>
#include "DrawingTidbits.h"
// ShiftComponent
inline uchar
ShiftComponent(uchar component, float percent)
{
// change the color by <percent>, make sure we aren't rounding
// off significant bits
if (percent >= 1)
return (uchar)(component * (2 - percent));
else
return (uchar)(255 - percent * (255 - component));
}
// ShiftColor
rgb_color
ShiftColor(rgb_color color, float percent)
{
rgb_color result = {
ShiftComponent(color.red, percent),
ShiftComponent(color.green, percent),
ShiftComponent(color.blue, percent),
0
};
return result;
}
// CompareColors
static bool
CompareColors(const rgb_color a, const rgb_color b)
{
return a.red == b.red
&& a.green == b.green
&& a.blue == b.blue
&& a.alpha == b.alpha;
}
// ==
bool
operator==(const rgb_color &a, const rgb_color &b)
{
return CompareColors(a, b);
}
// !=
bool
operator!=(const rgb_color &a, const rgb_color &b)
{
return !CompareColors(a, b);
}
// ReplaceColor
void
ReplaceColor(BBitmap *bitmap, rgb_color from, rgb_color to)
{
ASSERT(bitmap->ColorSpace() == B_COLOR_8_BIT); // other color spaces not implemented yet
BScreen screen(B_MAIN_SCREEN_ID);
uint32 fromIndex = screen.IndexForColor(from);
uint32 toIndex = screen.IndexForColor(to);
uchar *bits = (uchar *)bitmap->Bits();
int32 bitsLength = bitmap->BitsLength();
for (int32 index = 0; index < bitsLength; index++)
if (bits[index] == fromIndex)
bits[index] = toIndex;
}
// ReplaceTransparentColor
void
ReplaceTransparentColor(BBitmap *bitmap, rgb_color with)
{
ASSERT(bitmap->ColorSpace() == B_COLOR_8_BIT); // other color spaces not implemented yet
BScreen screen(B_MAIN_SCREEN_ID);
uint32 withIndex = screen.IndexForColor(with);
uchar *bits = (uchar *)bitmap->Bits();
int32 bitsLength = bitmap->BitsLength();
for (int32 index = 0; index < bitsLength; index++)
if (bits[index] == B_TRANSPARENT_8_BIT)
bits[index] = withIndex;
}
// ycrcb_to_rgb
inline void
ycbcr_to_rgb( uint8 y, uint8 cb, uint8 cr,
uint8& r, uint8& g, uint8& b)
{
r = (uint8)max_c( 0, min_c( 255, 1.164 * ( y - 16 ) + 1.596 * ( cr - 128 ) ) );
g = (uint8)max_c( 0, min_c( 255, 1.164 * ( y - 16 ) - 0.813 * ( cr - 128 )
- 0.391 * ( cb - 128 ) ) );
b = (uint8)max_c( 0, min_c( 255, 1.164 * ( y - 16 ) + 2.018 * ( cb - 128 ) ) );
}
// this function will not produce visually pleasing results!
// we'd have to convert to Lab colorspace, do the mixing
// and convert back to RGB - in an ideal world...
//
// mix_colors
inline void
mix_colors( uint8 ra, uint8 ga, uint8 ba,
uint8 rb, uint8 gb, uint8 bb,
uint8& r, uint8& g, uint8& b, float mixLevel )
{
float mixA = ( 1.0 - mixLevel );
float mixB = mixLevel;
r = (uint8)(mixA * ra + mixB * rb);
g = (uint8)(mixA * ga + mixB * gb);
b = (uint8)(mixA * ba + mixB * bb);
}
// the algorithm used is probably pretty slow, but it should be easy
// to understand what's going on...
//
// scale_bitmap
status_t
scale_bitmap( BBitmap* bitmap, uint32 fromWidth, uint32 fromHeight )
{
status_t status = B_BAD_VALUE;
if ( bitmap && bitmap->IsValid()
&& ( bitmap->ColorSpace() == B_RGB32 || bitmap->ColorSpace() == B_RGBA32 ) )
{
status = B_MISMATCHED_VALUES;
// we only support upscaling as of now
uint32 destWidth = bitmap->Bounds().IntegerWidth() + 1;
uint32 destHeight = bitmap->Bounds().IntegerHeight() + 1;
if ( fromWidth <= destWidth && fromHeight <= destHeight )
{
status = B_OK;
uint32 bpr = bitmap->BytesPerRow();
if ( fromWidth < destWidth )
{
// scale horizontally
uint8* src = (uint8*)bitmap->Bits();
uint8* p = new uint8[fromWidth * 4]; // temp buffer
for ( uint32 y = 0; y < fromHeight; y++ )
{
// copy valid pixels into temp buffer
memcpy( p, src, fromWidth * 4 );
for ( uint32 x = 0; x < destWidth; x++ )
{
// mix colors of left and right pixels and write it back
// into the bitmap
float xPos = ( (float)x / (float)destWidth ) * (float)fromWidth;
uint32 leftIndex = (uint32)floorf( xPos ) * 4;
uint32 rightIndex = (uint32)ceilf( xPos ) * 4;
rgb_color left;
left.red = p[leftIndex + 2];
left.green = p[leftIndex + 1];
left.blue = p[leftIndex + 0];
rgb_color right;
right.red = p[rightIndex + 2];
right.green = p[rightIndex + 1];
right.blue = p[rightIndex + 0];
rgb_color mix;
mix_colors( left.red, left.green, left.blue,
right.red, right.green, right.blue,
mix.red, mix.green, mix.blue, xPos - floorf( xPos ) );
uint32 destIndex = x * 4;
src[destIndex + 2] = mix.red;
src[destIndex + 1] = mix.green;
src[destIndex + 0] = mix.blue;
}
src += bpr;
}
delete[] p;
}
if ( fromHeight < destHeight )
{
// scale vertically
uint8* src = (uint8*)bitmap->Bits();
uint8* p = new uint8[fromHeight * 3]; // temp buffer
for ( uint32 x = 0; x < destWidth; x++ )
{
// copy valid pixels into temp buffer
for ( uint32 y = 0; y < fromHeight; y++ )
{
uint32 destIndex = y * 3;
uint32 srcIndex = x * 4 + y * bpr;
p[destIndex + 0] = src[srcIndex + 0];
p[destIndex + 1] = src[srcIndex + 1];
p[destIndex + 2] = src[srcIndex + 2];
}
// do the scaling
for ( uint32 y = 0; y < destHeight; y++ )
{
// mix colors of upper and lower pixels and write it back
// into the bitmap
float yPos = ( (float)y / (float)destHeight ) * (float)fromHeight;
uint32 upperIndex = (uint32)floorf( yPos ) * 3;
uint32 lowerIndex = (uint32)ceilf( yPos ) * 3;
rgb_color upper;
upper.red = p[upperIndex + 2];
upper.green = p[upperIndex + 1];
upper.blue = p[upperIndex + 0];
rgb_color lower;
lower.red = p[lowerIndex + 2];
lower.green = p[lowerIndex + 1];
lower.blue = p[lowerIndex + 0];
rgb_color mix;
mix_colors( upper.red, upper.green, upper.blue,
lower.red, lower.green, lower.blue,
mix.red, mix.green, mix.blue, yPos - floorf( yPos ) );
uint32 destIndex = x * 4 + y * bpr;
src[destIndex + 2] = mix.red;
src[destIndex + 1] = mix.green;
src[destIndex + 0] = mix.blue;
}
}
delete[] p;
}
}
}
return status;
}
// convert_bitmap
status_t
convert_bitmap( BBitmap* inBitmap, BBitmap* outBitmap )
{
status_t status = B_BAD_VALUE;
// see that we got valid bitmaps
if ( inBitmap && inBitmap->IsValid()
&& outBitmap && outBitmap->IsValid() )
{
status = B_MISMATCHED_VALUES;
// see that bitmaps are compatible and that we support the conversion
if ( inBitmap->Bounds().Width() <= outBitmap->Bounds().Width()
&& inBitmap->Bounds().Height() <= outBitmap->Bounds().Height()
&& ( outBitmap->ColorSpace() == B_RGB32
|| outBitmap->ColorSpace() == B_RGBA32) )
{
int32 width = inBitmap->Bounds().IntegerWidth() + 1;
int32 height = inBitmap->Bounds().IntegerHeight() + 1;
int32 srcBpr = inBitmap->BytesPerRow();
int32 dstBpr = outBitmap->BytesPerRow();
uint8* srcBits = (uint8*)inBitmap->Bits();
uint8* dstBits = (uint8*)outBitmap->Bits();
switch (inBitmap->ColorSpace())
{
case B_YCbCr422:
// Y0[7:0] Cb0[7:0] Y1[7:0] Cr0[7:0]
// Y2[7:0] Cb2[7:0] Y3[7:0] Cr2[7:0]
for ( int32 y = 0; y < height; y++ )
{
for ( int32 x = 0; x < width; x += 2 )
{
int32 srcOffset = x * 2;
int32 dstOffset = x * 4;
ycbcr_to_rgb( srcBits[srcOffset + 0],
srcBits[srcOffset + 1],
srcBits[srcOffset + 3],
dstBits[dstOffset + 2],
dstBits[dstOffset + 1],
dstBits[dstOffset + 0] );
ycbcr_to_rgb( srcBits[srcOffset + 2],
srcBits[srcOffset + 1],
srcBits[srcOffset + 3],
dstBits[dstOffset + 6],
dstBits[dstOffset + 5],
dstBits[dstOffset + 4] );
// take care of alpha
dstBits[x * 4 + 3] = 255;
dstBits[x * 4 + 7] = 255;
}
srcBits += srcBpr;
dstBits += dstBpr;