[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libamf/amf.h libamf/element.h l...
From: |
Bastiaan Jacques |
Subject: |
[Gnash-commit] gnash ChangeLog libamf/amf.h libamf/element.h l... |
Date: |
Thu, 06 Mar 2008 05:22:53 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Bastiaan Jacques <bjacques> 08/03/06 05:22:53
Modified files:
. : ChangeLog
libamf : amf.h element.h lcshm.h sol.h
libbase : GC.h WallClockTimer.h shm.h string_table.h
utility.cpp utility.h
libmedia : AudioDecoder.h AudioDecoderSimple.cpp
Makefile.am
libmedia/gst : GstUtil.h VideoDecoderGst.h
server : PropertyList.h SystemClock.h as_environment.h
as_function.h character.h shape.h timers.h
Added files:
libmedia : Util.cpp Util.h
Log message:
* libamf/{amf.h, element.h, lcshm.h, sol.h},
libbase/{GC.h, WallClockTimer.h, libbase/shm.h, string_table.h}
libmedia/gst/{VideoDecoderGst.h, GstUtil.h},
server/{PropertyList.h, SystemClock.h, as_environment.h,
as_function.h, character.h, shape.h, timers.h}: Add DSOEXPORT
where a symbol is used outside of the DSO where it's
implemented.
Allows compilation with -fvisibility=hidden.
* libbase/utility.{cpp h}, libmedia/{AudioDecoder.h,
AudioDecoderSimple.cpp, Makefile.am}: Move convert_raw_data to
libmedia.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5813&r2=1.5814
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/amf.h?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/element.h?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/lcshm.h?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/sol.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/GC.h?cvsroot=gnash&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/WallClockTimer.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/shm.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/string_table.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/utility.cpp?cvsroot=gnash&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/utility.h?cvsroot=gnash&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/AudioDecoder.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/AudioDecoderSimple.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/Makefile.am?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/Util.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/Util.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/GstUtil.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/VideoDecoderGst.h?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/PropertyList.h?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/server/SystemClock.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.72&r2=1.73
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_function.h?cvsroot=gnash&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.131&r2=1.132
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.h?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/timers.h?cvsroot=gnash&r1=1.35&r2=1.36
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5813
retrieving revision 1.5814
diff -u -b -r1.5813 -r1.5814
--- ChangeLog 5 Mar 2008 18:20:49 -0000 1.5813
+++ ChangeLog 6 Mar 2008 05:22:49 -0000 1.5814
@@ -1,3 +1,16 @@
+2008-03-04 Bastiaan Jacques <address@hidden>
+
+ * libamf/{amf.h, element.h, lcshm.h, sol.h},
+ libbase/{GC.h, WallClockTimer.h, libbase/shm.h, string_table.h}
+ libmedia/gst/{VideoDecoderGst.h, GstUtil.h},
+ server/{PropertyList.h, SystemClock.h, as_environment.h,
+ as_function.h, character.h, shape.h, timers.h}: Add DSOEXPORT
+ where a symbol is used outside of the DSO where it's implemented.
+ Allows compilation with -fvisibility=hidden.
+ * libbase/utility.{cpp h}, libmedia/{AudioDecoder.h,
+ AudioDecoderSimple.cpp, Makefile.am}: Move convert_raw_data to
+ libmedia.
+
2008-03-04 Benjamin Wolsey <address@hidden>
* libbase/log.cpp: remove silly assertion.
Index: libamf/amf.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/amf.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- libamf/amf.h 1 Feb 2008 01:42:41 -0000 1.31
+++ libamf/amf.h 6 Mar 2008 05:22:50 -0000 1.32
@@ -83,7 +83,7 @@
onDebugEvents
} amfresponse_e;
-class AMF {
+class DSOEXPORT AMF {
public:
typedef enum {
HEADER_12 = 0x0,
Index: libamf/element.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/element.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- libamf/element.h 1 Feb 2008 01:42:41 -0000 1.8
+++ libamf/element.h 6 Mar 2008 05:22:50 -0000 1.9
@@ -30,11 +30,12 @@
#include <boost/cstdint.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include "amf.h"
+#include "tu_config.h"
namespace amf
{
-class Element {
+class DSOEXPORT Element {
public:
// The following elements are defined within AMF:
typedef enum {
@@ -78,7 +79,7 @@
Element &init(std::vector<double> &data);
Element &init(const std::string &name, const std::string &data);
Element &init(const std::string &data);
- Element &init(const std::string &name, bool data);
+ Element & init(const std::string &name, bool data);
Element &init(bool data);
// Create a function block for AMF
Element &init(bool, double, double, const std::string &str);
Index: libamf/lcshm.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/lcshm.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- libamf/lcshm.h 1 Feb 2008 01:42:41 -0000 1.7
+++ libamf/lcshm.h 6 Mar 2008 05:22:50 -0000 1.8
@@ -52,7 +52,7 @@
// std::vector<std::string> _listeners;
};
-class LcShm : public Listener, public Shm {
+class DSOEXPORT LcShm : public Listener, public Shm {
public:
typedef struct {
uint32_t unknown1;
Index: libamf/sol.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/sol.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libamf/sol.h 31 Jan 2008 11:25:57 -0000 1.9
+++ libamf/sol.h 6 Mar 2008 05:22:50 -0000 1.10
@@ -27,6 +27,7 @@
#include <vector>
#include "element.h"
#include "amf.h"
+#include "tu_config.h"
// It comprises of a magic number, followed by the file length, a
// filetype, which appears to always be "TCSO", and what appears to be
@@ -41,7 +42,7 @@
// After this is a series of AMF objects
namespace amf
{
-class SOL {
+class DSOEXPORT SOL {
public:
SOL();
~SOL();
Index: libbase/GC.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/GC.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- libbase/GC.h 5 Mar 2008 11:42:36 -0000 1.19
+++ libbase/GC.h 6 Mar 2008 05:22:50 -0000 1.20
@@ -32,6 +32,8 @@
# include <boost/thread.hpp>
#endif
+#include "tu_config.h"
+
// Define the following macro to enable GC verbosity
// Verbosity levels:
// 1 - print stats about how many resources are registered and how many
@@ -183,7 +185,7 @@
/// itself.
///
///
-class GC
+class DSOEXPORT GC
{
public:
Index: libbase/WallClockTimer.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/WallClockTimer.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libbase/WallClockTimer.h 21 Jan 2008 20:55:44 -0000 1.3
+++ libbase/WallClockTimer.h 6 Mar 2008 05:22:50 -0000 1.4
@@ -27,7 +27,7 @@
namespace gnash {
/// General-purpose wall-clock timer.
-class WallClockTimer
+class DSOEXPORT WallClockTimer
{
public:
@@ -38,10 +38,10 @@
/// \brief
/// Return time elapsed in milliseconds since construction
/// or last call to ::restart()
- DSOEXPORT boost::uint32_t elapsed() const;
+ boost::uint32_t elapsed() const;
/// Restart the timer
- DSOEXPORT void restart();
+ void restart();
private:
Index: libbase/shm.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/shm.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libbase/shm.h 25 Jan 2008 18:07:59 -0000 1.3
+++ libbase/shm.h 6 Mar 2008 05:22:50 -0000 1.4
@@ -62,8 +62,8 @@
// Initialize the shared memory segment
bool attach();
- bool attach(char const *filespec, bool nuke);
- bool attach(key_t key, bool nuke);
+ bool DSOEXPORT attach(char const *filespec, bool nuke);
+ bool DSOEXPORT attach(key_t key, bool nuke);
// Resize the allocated memory segment
bool resize(int bytes);
@@ -73,7 +73,7 @@
void *brk(int bytes);
// Close the memory segment. This removes it from the system.
- bool closeMem();
+ bool DSOEXPORT closeMem();
Shm *cloneSelf(void);
Index: libbase/string_table.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/string_table.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libbase/string_table.h 29 Jan 2008 07:13:23 -0000 1.9
+++ libbase/string_table.h 6 Mar 2008 05:22:51 -0000 1.10
@@ -30,6 +30,7 @@
#include <boost/multi_index/member.hpp>
#include <boost/thread.hpp>
#include <string>
+#include "tu_config.h"
namespace gnash
{
@@ -39,7 +40,7 @@
// So many strings are duplicated (such as standard property names)
// that a string table could give significant memory savings.
/// A general use string table.
-class string_table
+class DSOEXPORT string_table
{
public:
/// A little helper for indexing.
Index: libbase/utility.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/utility.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- libbase/utility.cpp 21 Jan 2008 20:55:45 -0000 1.19
+++ libbase/utility.cpp 6 Mar 2008 05:22:51 -0000 1.20
@@ -32,6 +32,7 @@
#include "utility.h"
#include "dlmalloc.h"
+#include "tu_config.h"
// Overrides of new/delete that use Doug Lea's malloc. Very helpful
// on certain lame platforms.
@@ -101,138 +102,6 @@
}
#endif // CAN_DUMP_MEMORY_STATS
-namespace gnash {
-
-// VERY crude sample-rate conversion.
-// Converts input data to output format.
-// sample_size
-void convert_raw_data(
- boost::int16_t** adjusted_data,
- int* adjusted_size,
- void* data,
- int sample_count, // A stereo pair counts as one
- int /*sample_size*/, // Should now always == 2
- // sample_rate and stereo are those of the incoming sample
- int sample_rate,
- bool stereo,
- // m_sample_rate, m_stereo are the format we must convert to.
- int m_sample_rate,
- bool m_stereo)
-{
- // simple hack to handle dup'ing mono to stereo
- if ( !stereo && m_stereo)
- {
- sample_rate >>= 1;
- }
-
- // simple hack to lose half the samples to get mono from stereo
- if ( stereo && !m_stereo)
- {
- sample_rate <<= 1;
- }
-
- // Brain-dead sample-rate conversion: duplicate or
- // skip input samples an integral number of times.
- int inc = 1; // increment
- int dup = 1; // duplicate
- if (sample_rate > m_sample_rate)
- {
- inc = sample_rate / m_sample_rate;
- }
- else if (sample_rate < m_sample_rate)
- {
- dup = m_sample_rate / sample_rate;
- }
-
- int output_sample_count = (sample_count * dup * (stereo ? 2 : 1)) /
inc;
- boost::int16_t* out_data = new boost::int16_t[output_sample_count];
- *adjusted_data = out_data;
- *adjusted_size = output_sample_count * sizeof(boost::int16_t); // in bytes
-
- // Either inc > 1 (decimate the audio)
- // or dup > 1 (repeat samples)
- // or both == 1 (no transformation required)
- if (inc == 1 && dup == 1)
- {
- // No tranformation required
- memcpy(out_data, data, output_sample_count *
sizeof(boost::int16_t));
- }
- else if (inc > 1)
- {
- // Downsample by skipping samples from the input
- boost::int16_t* in = (boost::int16_t*) data;
- for (int i = output_sample_count; i > 0; i--)
- {
- *out_data++ = *in;
- in += inc;
- }
- }
- else if (dup > 1)
- {
- // Upsample by duplicating input samples in the output.
-
- // The straight sample-replication code handles mono-to-stereo (sort of)
- // and upsampling of mono but would make a botch of stereo-to-stereo
- // upsampling, giving the left sample in both channels
- // then the right sample in both channels alternately.
- // So for stereo-stereo transforms we have a stereo routine.
-
- boost::int16_t* in = (boost::int16_t*) data;
-
- if (stereo && m_stereo) {
- // Stereo-to-stereo upsampling: Replicate pairs of samples
- for (int i = output_sample_count / dup / 2; i > 0; i--)
- {
- for (int j = dup; j > 0; j--)
- {
- out_data[0] = in[0];
- out_data[1] = in[1];
- out_data += 2;
- }
- in += 2;
- }
- } else {
-
- // Linear upsampling, either to increase a sample rate
- // or to convert a mono file to stereo or both:
- // replicate each sample several times.
- switch (dup)
- {
- case 2:
- for (int i = output_sample_count / dup; i > 0; i--)
- {
- *out_data++ = *in;
- *out_data++ = *in;
- in++;
- }
- break;
- case 4:
- for (int i = output_sample_count / dup; i > 0; i--)
- {
- *out_data++ = *in;
- *out_data++ = *in;
- *out_data++ = *in;
- *out_data++ = *in;
- in++;
- }
- break;
- default:
- for (int i = output_sample_count / dup; i > 0; i--)
- {
- for (int j = dup; j > 0; j--)
- {
- *out_data++ = *in;
- }
- in++;
- }
- break;
- }
- }
- }
-}
-
-} // namespace gnash
-
// Local Variables:
// mode: C++
// indent-tabs-mode: t
Index: libbase/utility.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/utility.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- libbase/utility.h 21 Jan 2008 20:55:46 -0000 1.40
+++ libbase/utility.h 6 Mar 2008 05:22:51 -0000 1.41
@@ -220,44 +220,6 @@
return typeName;
}
-namespace gnash {
-
-/// VERY crude sample-rate and steroe conversion. Converts input data to
-/// output format.
-//
-/// @param adjusted_data
-/// Where the converted data is placed.
-///
-/// @param adjusted_size
-/// The size of the converted data.
-///
-/// @param data
-/// Data that needs to be converted.
-///
-/// @param sample_count
-/// The datas current sample count.
-///
-/// @param sample_size
-/// The datas current sample size.
-///
-/// @param sample_rate
-/// The datas current sample rate.
-///
-/// @param stereo
-/// Whether the current data is in stereo
-///
-/// @param m_sample_rate
-/// The samplerate we which to convert to.
-///
-/// @param m_stereo
-/// Do we want the output data to be in stereo?
-///
-void convert_raw_data(boost::int16_t** adjusted_data,
- int* adjusted_size, void* data, int sample_count,
- int sample_size, int sample_rate, bool stereo,
- int m_sample_rate, bool m_stereo);
-} // namespace gnash
-
#endif // UTILITY_H
Index: libmedia/AudioDecoder.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/AudioDecoder.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libmedia/AudioDecoder.h 5 Mar 2008 03:55:53 -0000 1.9
+++ libmedia/AudioDecoder.h 6 Mar 2008 05:22:51 -0000 1.10
@@ -22,6 +22,7 @@
#include "MediaParser.h"
#include "SoundInfo.h"
+#include "Util.h"
namespace gnash {
namespace media {
Index: libmedia/AudioDecoderSimple.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/AudioDecoderSimple.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libmedia/AudioDecoderSimple.cpp 5 Mar 2008 03:55:53 -0000 1.14
+++ libmedia/AudioDecoderSimple.cpp 6 Mar 2008 05:22:51 -0000 1.15
@@ -406,7 +406,7 @@
int sample_count = outsize / (_stereo ? 4 : 2); // samples are
of size 2
// Convert to needed samplerate - this converter only support
standard flash samplerates
- convert_raw_data(&adjusted_data, &adjusted_size,
tmp_raw_buffer, sample_count, 0,
+ Util::convert_raw_data(&adjusted_data, &adjusted_size,
tmp_raw_buffer, sample_count, 0,
_sampleRate, _stereo,
44100, true /* stereo */);
Index: libmedia/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/libmedia/Makefile.am,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- libmedia/Makefile.am 23 Feb 2008 18:12:51 -0000 1.16
+++ libmedia/Makefile.am 6 Mar 2008 05:22:51 -0000 1.17
@@ -77,6 +77,7 @@
FLVParser.cpp \
AudioDecoderNellymoser.cpp \
AudioDecoderSimple.cpp \
+ Util.cpp \
$(NULL)
noinst_HEADERS = \
@@ -89,6 +90,7 @@
AudioDecoderSimple.h \
sound_handler.h \
SoundInfo.h \
+ Util.h \
$(NULL)
Index: libmedia/gst/GstUtil.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/gst/GstUtil.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- libmedia/gst/GstUtil.h 5 Mar 2008 03:55:55 -0000 1.2
+++ libmedia/gst/GstUtil.h 6 Mar 2008 05:22:52 -0000 1.3
@@ -29,13 +29,14 @@
#include <gst/gst.h>
#include "image.h"
+#include "tu_config.h"
namespace gnash {
namespace media {
/// \brief Generalized Gstreamer utilities for pipeline configuration.
/// WARNING: This class is not guaranteed to be thread-safe.
-class GstUtil {
+class DSOEXPORT GstUtil {
public:
Index: libmedia/gst/VideoDecoderGst.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/gst/VideoDecoderGst.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- libmedia/gst/VideoDecoderGst.h 5 Mar 2008 03:55:55 -0000 1.15
+++ libmedia/gst/VideoDecoderGst.h 6 Mar 2008 05:22:52 -0000 1.16
@@ -30,6 +30,7 @@
#include "log.h"
#include "MediaParser.h"
#include "VideoDecoder.h"
+#include "tu_config.h"
namespace gnash {
@@ -64,7 +65,7 @@
};
-class VideoDecoderGst : public VideoDecoder
+class DSOEXPORT VideoDecoderGst : public VideoDecoder
{
public:
VideoDecoderGst(videoCodecType codec_type, int width, int height);
Index: server/PropertyList.h
===================================================================
RCS file: /sources/gnash/gnash/server/PropertyList.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/PropertyList.h 19 Feb 2008 19:20:52 -0000 1.23
+++ server/PropertyList.h 6 Mar 2008 05:22:52 -0000 1.24
@@ -440,7 +440,7 @@
/// Mark all simple properties, getters and setters
/// as being reachable (for the GC)
- void setReachable() const;
+ void DSOEXPORT setReachable() const;
private:
container _props;
Index: server/SystemClock.h
===================================================================
RCS file: /sources/gnash/gnash/server/SystemClock.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/SystemClock.h 21 Jan 2008 20:55:48 -0000 1.3
+++ server/SystemClock.h 6 Mar 2008 05:22:52 -0000 1.4
@@ -27,6 +27,7 @@
#include "VirtualClock.h" // for inheritance
#include <boost/cstdint.hpp> // for boost::uint64_t typedef
+#include "tu_config.h"
namespace gnash
{
@@ -36,7 +37,7 @@
/// This class uses the system clock for computing elapsed time.
/// See http://en.wikipedia.org/wiki/System_time for capacity
///
-class SystemClock: public VirtualClock
+class DSOEXPORT SystemClock: public VirtualClock
{
public:
Index: server/as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- server/as_environment.h 27 Feb 2008 12:52:57 -0000 1.72
+++ server/as_environment.h 6 Mar 2008 05:22:52 -0000 1.73
@@ -30,6 +30,7 @@
#include <string> // for frame_slot name
#include <vector>
#include <iostream> // for dump_stack inline
+#include "tu_config.h"
namespace gnash {
@@ -509,13 +510,13 @@
/// @param func
/// The function being called
///
- static void pushCallFrame(as_function* func);
+ static DSOEXPORT void pushCallFrame(as_function* func);
/// Remove current call frame from the stack
//
/// This should happen when an ActionScript function returns.
///
- static void popCallFrame();
+ static DSOEXPORT void popCallFrame();
/// Return the (possibly UNDEFINED) value of the named variable.
//
Index: server/as_function.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_function.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- server/as_function.h 21 Jan 2008 20:55:48 -0000 1.20
+++ server/as_function.h 6 Mar 2008 05:22:52 -0000 1.21
@@ -62,7 +62,7 @@
///
///
///
-class as_function : public as_object
+class DSOEXPORT as_function : public as_object
{
public:
Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -b -r1.131 -r1.132
--- server/character.h 5 Mar 2008 03:55:58 -0000 1.131
+++ server/character.h 6 Mar 2008 05:22:53 -0000 1.132
@@ -1130,7 +1130,7 @@
//
/// e.g. "_level0.sprite1.sprite2.ourSprite"
///
- std::string getTarget() const;
+ std::string DSOEXPORT getTarget() const;
#ifdef NEW_KEY_LISTENER_LIST_DESIGN
boost::intrusive_ptr<as_function> getUserDefinedEventHandler(const
std::string& name) const;
Index: server/shape.h
===================================================================
RCS file: /sources/gnash/gnash/server/shape.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/shape.h 5 Mar 2008 03:55:59 -0000 1.37
+++ server/shape.h 6 Mar 2008 05:22:53 -0000 1.38
@@ -99,7 +99,7 @@
/// \brief
/// A subset of a shape -- a series of edges sharing a single set
/// of styles.
- class path
+ class DSOEXPORT path
{
public:
/// Default constructor
Index: server/timers.h
===================================================================
RCS file: /sources/gnash/gnash/server/timers.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- server/timers.h 21 Jan 2008 20:55:53 -0000 1.35
+++ server/timers.h 6 Mar 2008 05:22:53 -0000 1.36
@@ -58,7 +58,7 @@
/// with properly set-up context.
///
///
-class Timer
+class DSOEXPORT Timer
{
public:
Index: libmedia/Util.cpp
===================================================================
RCS file: libmedia/Util.cpp
diff -N libmedia/Util.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libmedia/Util.cpp 6 Mar 2008 05:22:51 -0000 1.1
@@ -0,0 +1,166 @@
+// utility.cpp -- Various little utility functions, macros & typedefs.
+//
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// 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 3 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 St, Fifth Floor, Boston, MA 02110-1301 USA
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "Util.h"
+
+#include <cstring>
+
+namespace gnash {
+
+namespace media {
+
+// VERY crude sample-rate conversion.
+// Converts input data to output format.
+// sample_size
+void
+Util::convert_raw_data(
+ boost::int16_t** adjusted_data,
+ int* adjusted_size,
+ void* data,
+ int sample_count, // A stereo pair counts as one
+ int /*sample_size*/, // Should now always == 2
+ // sample_rate and stereo are those of the incoming sample
+ int sample_rate,
+ bool stereo,
+ // m_sample_rate, m_stereo are the format we must convert to.
+ int m_sample_rate,
+ bool m_stereo)
+{
+ // simple hack to handle dup'ing mono to stereo
+ if ( !stereo && m_stereo)
+ {
+ sample_rate >>= 1;
+ }
+
+ // simple hack to lose half the samples to get mono from stereo
+ if ( stereo && !m_stereo)
+ {
+ sample_rate <<= 1;
+ }
+
+ // Brain-dead sample-rate conversion: duplicate or
+ // skip input samples an integral number of times.
+ int inc = 1; // increment
+ int dup = 1; // duplicate
+ if (sample_rate > m_sample_rate)
+ {
+ inc = sample_rate / m_sample_rate;
+ }
+ else if (sample_rate < m_sample_rate)
+ {
+ dup = m_sample_rate / sample_rate;
+ }
+
+ int output_sample_count = (sample_count * dup * (stereo ? 2 : 1)) /
inc;
+ boost::int16_t* out_data = new boost::int16_t[output_sample_count];
+ *adjusted_data = out_data;
+ *adjusted_size = output_sample_count * sizeof(boost::int16_t); // in bytes
+
+ // Either inc > 1 (decimate the audio)
+ // or dup > 1 (repeat samples)
+ // or both == 1 (no transformation required)
+ if (inc == 1 && dup == 1)
+ {
+ // No tranformation required
+ memcpy(out_data, data, output_sample_count *
sizeof(boost::int16_t));
+ }
+ else if (inc > 1)
+ {
+ // Downsample by skipping samples from the input
+ boost::int16_t* in = (boost::int16_t*) data;
+ for (int i = output_sample_count; i > 0; i--)
+ {
+ *out_data++ = *in;
+ in += inc;
+ }
+ }
+ else if (dup > 1)
+ {
+ // Upsample by duplicating input samples in the output.
+
+ // The straight sample-replication code handles mono-to-stereo (sort of)
+ // and upsampling of mono but would make a botch of stereo-to-stereo
+ // upsampling, giving the left sample in both channels
+ // then the right sample in both channels alternately.
+ // So for stereo-stereo transforms we have a stereo routine.
+
+ boost::int16_t* in = (boost::int16_t*) data;
+
+ if (stereo && m_stereo) {
+ // Stereo-to-stereo upsampling: Replicate pairs of samples
+ for (int i = output_sample_count / dup / 2; i > 0; i--)
+ {
+ for (int j = dup; j > 0; j--)
+ {
+ out_data[0] = in[0];
+ out_data[1] = in[1];
+ out_data += 2;
+ }
+ in += 2;
+ }
+ } else {
+
+ // Linear upsampling, either to increase a sample rate
+ // or to convert a mono file to stereo or both:
+ // replicate each sample several times.
+ switch (dup)
+ {
+ case 2:
+ for (int i = output_sample_count / dup; i > 0; i--)
+ {
+ *out_data++ = *in;
+ *out_data++ = *in;
+ in++;
+ }
+ break;
+ case 4:
+ for (int i = output_sample_count / dup; i > 0; i--)
+ {
+ *out_data++ = *in;
+ *out_data++ = *in;
+ *out_data++ = *in;
+ *out_data++ = *in;
+ in++;
+ }
+ break;
+ default:
+ for (int i = output_sample_count / dup; i > 0; i--)
+ {
+ for (int j = dup; j > 0; j--)
+ {
+ *out_data++ = *in;
+ }
+ in++;
+ }
+ break;
+ }
+ }
+ }
+}
+
+} // namespace media
+} // namespace gnash
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
Index: libmedia/Util.h
===================================================================
RCS file: libmedia/Util.h
diff -N libmedia/Util.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libmedia/Util.h 6 Mar 2008 05:22:51 -0000 1.1
@@ -0,0 +1,77 @@
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// 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 3 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 St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+#ifndef __GNASH_UTIL_H
+#define __GNASH_UTIL_H
+
+#include <boost/cstdint.hpp> // for boost::int16_t
+
+namespace gnash {
+namespace media {
+
+
+class Util {
+
+public:
+/// VERY crude sample-rate and steroe conversion. Converts input data to
+/// output format.
+//
+/// @param adjusted_data
+/// Where the converted data is placed.
+///
+/// @param adjusted_size
+/// The size of the converted data.
+///
+/// @param data
+/// Data that needs to be converted.
+///
+/// @param sample_count
+/// The datas current sample count.
+///
+/// @param sample_size
+/// The datas current sample size.
+///
+/// @param sample_rate
+/// The datas current sample rate.
+///
+/// @param stereo
+/// Whether the current data is in stereo
+///
+/// @param m_sample_rate
+/// The samplerate we which to convert to.
+///
+/// @param m_stereo
+/// Do we want the output data to be in stereo?
+///
+ static void convert_raw_data(boost::int16_t** adjusted_data,
+ int* adjusted_size, void* data, int sample_count,
+ int sample_size, int sample_rate, bool stereo,
+ int m_sample_rate, bool m_stereo);
+};
+
+} // namespace media
+} // namespace gnash
+
+#endif // __GNASH_UTIL_H
+
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 8
+// tab-width: 8
+// indent-tabs-mode: t
+// End:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog libamf/amf.h libamf/element.h l...,
Bastiaan Jacques <=